From 5610813230d1d58c2dbb75316a7431542117e386 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 3 Aug 2023 00:54:05 +0000 Subject: [PATCH] CodeGen from PR 25132 in Azure/azure-rest-api-specs Merge 84df535099876e5c01ec0fccaec936973d654f7c into 08e237fe5388817906a4fa2bdb2301b7042a3241 --- .../network/armnetwork/CHANGELOG.md | 14 +- .../armnetwork/adminrulecollections_client.go | 18 +- ...dminrulecollections_client_example_test.go | 184 -- .../network/armnetwork/adminrules_client.go | 18 +- .../adminrules_client_example_test.go | 373 --- ...atewayprivateendpointconnections_client.go | 20 +- ...endpointconnections_client_example_test.go | 169 - ...ationgatewayprivatelinkresources_client.go | 4 +- ...rivatelinkresources_client_example_test.go | 58 - .../armnetwork/applicationgateways_client.go | 80 +- ...applicationgateways_client_example_test.go | 2346 ------------- ...cationgatewaywafdynamicmanifests_client.go | 4 +- ...wafdynamicmanifests_client_example_test.go | 92 - ...atewaywafdynamicmanifestsdefault_client.go | 4 +- ...micmanifestsdefault_client_example_test.go | 84 - .../applicationsecuritygroups_client.go | 28 +- ...ationsecuritygroups_client_example_test.go | 242 -- .../network/armnetwork/autorest.md | 7 +- .../armnetwork/availabledelegations_client.go | 4 +- ...vailabledelegations_client_example_test.go | 54 - .../availableendpointservices_client.go | 4 +- ...bleendpointservices_client_example_test.go | 61 - .../availableprivateendpointtypes_client.go | 8 +- ...rivateendpointtypes_client_example_test.go | 84 - ...vailableresourcegroupdelegations_client.go | 4 +- ...rcegroupdelegations_client_example_test.go | 54 - .../availableservicealiases_client.go | 8 +- ...lableservicealiases_client_example_test.go | 98 - .../azurefirewallfqdntags_client.go | 4 +- ...urefirewallfqdntags_client_example_test.go | 60 - .../armnetwork/azurefirewalls_client.go | 42 +- .../azurefirewalls_client_example_test.go | 2934 ----------------- .../network/armnetwork/bastionhosts_client.go | 30 +- .../bastionhosts_client_example_test.go | 376 --- .../bgpservicecommunities_client.go | 4 +- ...pservicecommunities_client_example_test.go | 84 - .../configurationpolicygroups_client.go | 20 +- ...urationpolicygroups_client_example_test.go | 226 -- .../armnetwork/connectionmonitors_client.go | 42 +- .../connectionmonitors_client_example_test.go | 579 ---- .../connectivityconfigurations_client.go | 18 +- ...ivityconfigurations_client_example_test.go | 228 -- .../network/armnetwork/constants.go | 22 +- .../armnetwork/customipprefixes_client.go | 28 +- .../customipprefixes_client_example_test.go | 627 ---- .../armnetwork/ddoscustompolicies_client.go | 20 +- .../ddoscustompolicies_client_example_test.go | 145 - .../armnetwork/ddosprotectionplans_client.go | 28 +- ...ddosprotectionplans_client_example_test.go | 296 -- .../armnetwork/defaultsecurityrules_client.go | 8 +- ...efaultsecurityrules_client_example_test.go | 234 -- .../armnetwork/dscpconfiguration_client.go | 24 +- .../dscpconfiguration_client_example_test.go | 592 ---- ...xpressroutecircuitauthorizations_client.go | 20 +- ...rcuitauthorizations_client_example_test.go | 143 - .../expressroutecircuitconnections_client.go | 20 +- ...ecircuitconnections_client_example_test.go | 206 -- .../expressroutecircuitpeerings_client.go | 20 +- ...outecircuitpeerings_client_example_test.go | 266 -- .../armnetwork/expressroutecircuits_client.go | 54 +- ...xpressroutecircuits_client_example_test.go | 642 ---- .../expressrouteconnections_client.go | 20 +- ...essrouteconnections_client_example_test.go | 266 -- ...ressroutecrossconnectionpeerings_client.go | 20 +- ...sconnectionpeerings_client_example_test.go | 195 -- .../expressroutecrossconnections_client.go | 40 +- ...utecrossconnections_client_example_test.go | 366 -- .../armnetwork/expressroutegateways_client.go | 30 +- ...xpressroutegateways_client_example_test.go | 337 -- .../armnetwork/expressroutelinks_client.go | 8 +- .../expressroutelinks_client_example_test.go | 108 - .../expressrouteportauthorizations_client.go | 20 +- ...eportauthorizations_client_example_test.go | 148 - .../armnetwork/expressrouteports_client.go | 32 +- .../expressrouteports_client_example_test.go | 519 --- .../expressrouteportslocations_client.go | 8 +- ...routeportslocations_client_example_test.go | 95 - ...xpressrouteproviderportslocation_client.go | 4 +- ...oviderportslocation_client_example_test.go | 73 - .../expressrouteserviceproviders_client.go | 4 +- ...uteserviceproviders_client_example_test.go | 90 - .../armnetwork/fake/loadbalancers_server.go | 50 + .../armnetwork/firewallpolicies_client.go | 28 +- .../firewallpolicies_client_example_test.go | 597 ---- .../firewallpolicyidpssignatures_client.go | 4 +- ...olicyidpssignatures_client_example_test.go | 87 - ...policyidpssignaturesfiltervalues_client.go | 4 +- ...naturesfiltervalues_client_example_test.go | 47 - ...allpolicyidpssignaturesoverrides_client.go | 16 +- ...signaturesoverrides_client_example_test.go | 166 - ...rewallpolicyrulecollectiongroups_client.go | 20 +- ...ulecollectiongroups_client_example_test.go | 859 ----- .../network/armnetwork/flowlogs_client.go | 24 +- .../flowlogs_client_example_test.go | 284 -- .../network/armnetwork/groups_client.go | 18 +- .../armnetwork/groups_client_example_test.go | 168 - .../armnetwork/hubroutetables_client.go | 20 +- .../hubroutetables_client_example_test.go | 186 -- .../hubvirtualnetworkconnections_client.go | 20 +- ...lnetworkconnections_client_example_test.go | 278 -- .../armnetwork/inboundnatrules_client.go | 20 +- .../inboundnatrules_client_example_test.go | 200 -- .../armnetwork/inboundsecurityrule_client.go | 6 +- ...inboundsecurityrule_client_example_test.go | 66 - .../interfaceipconfigurations_client.go | 8 +- ...aceipconfigurations_client_example_test.go | 110 - .../interfaceloadbalancers_client.go | 4 +- ...erfaceloadbalancers_client_example_test.go | 162 - .../network/armnetwork/interfaces_client.go | 52 +- .../interfaces_client_example_test.go | 1352 -------- .../interfacetapconfigurations_client.go | 20 +- ...cetapconfigurations_client_example_test.go | 154 - .../armnetwork/ipallocations_client.go | 28 +- .../ipallocations_client_example_test.go | 276 -- .../network/armnetwork/ipgroups_client.go | 28 +- .../ipgroups_client_example_test.go | 320 -- .../loadbalancerbackendaddresspools_client.go | 20 +- ...backendaddresspools_client_example_test.go | 312 -- ...balancerfrontendipconfigurations_client.go | 8 +- ...endipconfigurations_client_example_test.go | 112 - .../loadbalancerloadbalancingrules_client.go | 8 +- ...rloadbalancingrules_client_example_test.go | 116 - .../loadbalancernetworkinterfaces_client.go | 4 +- ...ernetworkinterfaces_client_example_test.go | 210 -- .../loadbalanceroutboundrules_client.go | 8 +- ...lanceroutboundrules_client_example_test.go | 106 - .../armnetwork/loadbalancerprobes_client.go | 8 +- .../loadbalancerprobes_client_example_test.go | 104 - .../armnetwork/loadbalancers_client.go | 111 +- .../loadbalancers_client_example_test.go | 2765 ---------------- .../armnetwork/localnetworkgateways_client.go | 24 +- ...ocalnetworkgateways_client_example_test.go | 230 -- .../network/armnetwork/management_client.go | 60 +- .../management_client_example_test.go | 629 ---- ...ntgroupnetworkmanagerconnections_client.go | 16 +- ...kmanagerconnections_client_example_test.go | 164 - .../armnetwork/managercommits_client.go | 6 +- .../managercommits_client_example_test.go | 57 - .../managerdeploymentstatus_client.go | 4 +- ...gerdeploymentstatus_client_example_test.go | 71 - .../network/armnetwork/managers_client.go | 26 +- .../managers_client_example_test.go | 316 -- .../network/armnetwork/models.go | 33 +- .../network/armnetwork/models_serde.go | 120 + .../network/armnetwork/natgateways_client.go | 28 +- .../natgateways_client_example_test.go | 359 -- .../network/armnetwork/natrules_client.go | 20 +- .../natrules_client_example_test.go | 172 - .../network/armnetwork/operations_client.go | 4 +- .../operations_client_example_test.go | 166 - .../network/armnetwork/options.go | 7 + .../armnetwork/p2svpngateways_client.go | 60 +- .../p2svpngateways_client_example_test.go | 1079 ------ .../armnetwork/packetcaptures_client.go | 32 +- .../packetcaptures_client_example_test.go | 246 -- ...erexpressroutecircuitconnections_client.go | 8 +- ...ecircuitconnections_client_example_test.go | 120 - .../armnetwork/privatednszonegroups_client.go | 20 +- ...rivatednszonegroups_client_example_test.go | 253 -- .../armnetwork/privateendpoints_client.go | 24 +- .../privateendpoints_client_example_test.go | 930 ------ .../armnetwork/privatelinkservices_client.go | 62 +- ...privatelinkservices_client_example_test.go | 783 ----- .../network/armnetwork/profiles_client.go | 26 +- .../profiles_client_example_test.go | 684 ---- .../armnetwork/publicipaddresses_client.go | 46 +- .../publicipaddresses_client_example_test.go | 863 ----- .../armnetwork/publicipprefixes_client.go | 28 +- .../publicipprefixes_client_example_test.go | 399 --- .../resourcenavigationlinks_client.go | 4 +- ...urcenavigationlinks_client_example_test.go | 52 - .../network/armnetwork/response_types.go | 6 + .../armnetwork/routefilterrules_client.go | 20 +- .../routefilterrules_client_example_test.go | 159 - .../network/armnetwork/routefilters_client.go | 28 +- .../routefilters_client_example_test.go | 326 -- .../network/armnetwork/routemaps_client.go | 20 +- .../routemaps_client_example_test.go | 265 -- .../network/armnetwork/routes_client.go | 20 +- .../armnetwork/routes_client_example_test.go | 153 - .../network/armnetwork/routetables_client.go | 28 +- .../routetables_client_example_test.go | 333 -- .../armnetwork/routingintent_client.go | 20 +- .../routingintent_client_example_test.go | 194 -- .../armnetwork/scopeconnections_client.go | 16 +- .../scopeconnections_client_example_test.go | 169 - .../securityadminconfigurations_client.go | 18 +- ...adminconfigurations_client_example_test.go | 176 - .../armnetwork/securitygroups_client.go | 28 +- .../securitygroups_client_example_test.go | 1106 ------- .../securitypartnerproviders_client.go | 28 +- ...itypartnerproviders_client_example_test.go | 261 -- .../armnetwork/securityrules_client.go | 20 +- .../securityrules_client_example_test.go | 168 - .../serviceassociationlinks_client.go | 4 +- ...iceassociationlinks_client_example_test.go | 54 - .../serviceendpointpolicies_client.go | 28 +- ...iceendpointpolicies_client_example_test.go | 391 --- ...serviceendpointpolicydefinitions_client.go | 20 +- ...ntpolicydefinitions_client_example_test.go | 157 - .../servicetaginformation_client.go | 4 +- ...rvicetaginformation_client_example_test.go | 169 - .../network/armnetwork/servicetags_client.go | 4 +- .../servicetags_client_example_test.go | 109 - .../armnetwork/staticmembers_client.go | 16 +- .../staticmembers_client_example_test.go | 162 - .../network/armnetwork/subnets_client.go | 32 +- .../armnetwork/subnets_client_example_test.go | 330 -- ...riptionnetworkmanagerconnections_client.go | 16 +- ...kmanagerconnections_client_example_test.go | 164 - .../network/armnetwork/usages_client.go | 4 +- .../armnetwork/usages_client_example_test.go | 644 ---- .../network/armnetwork/vipswap_client.go | 14 +- .../armnetwork/vipswap_client_example_test.go | 103 - .../virtualapplianceconnections_client.go | 20 +- ...pplianceconnections_client_example_test.go | 237 -- .../armnetwork/virtualappliances_client.go | 28 +- .../virtualappliances_client_example_test.go | 543 --- .../virtualappliancesites_client.go | 20 +- ...rtualappliancesites_client_example_test.go | 171 - .../armnetwork/virtualapplianceskus_client.go | 8 +- ...irtualapplianceskus_client_example_test.go | 106 - .../virtualhubbgpconnection_client.go | 16 +- ...ualhubbgpconnection_client_example_test.go | 120 - .../virtualhubbgpconnections_client.go | 16 +- ...alhubbgpconnections_client_example_test.go | 206 -- .../virtualhubipconfiguration_client.go | 20 +- ...lhubipconfiguration_client_example_test.go | 154 - .../virtualhubroutetablev2s_client.go | 20 +- ...ualhubroutetablev2s_client_example_test.go | 190 -- .../network/armnetwork/virtualhubs_client.go | 46 +- .../virtualhubs_client_example_test.go | 627 ---- ...virtualnetworkgatewayconnections_client.go | 66 +- ...kgatewayconnections_client_example_test.go | 689 ---- .../virtualnetworkgatewaynatrules_client.go | 20 +- ...workgatewaynatrules_client_example_test.go | 169 - .../virtualnetworkgateways_client.go | 122 +- ...tualnetworkgateways_client_example_test.go | 1305 -------- .../virtualnetworkpeerings_client.go | 20 +- ...tualnetworkpeerings_client_example_test.go | 486 --- .../armnetwork/virtualnetworks_client.go | 42 +- .../virtualnetworks_client_example_test.go | 1116 ------- .../armnetwork/virtualnetworktaps_client.go | 28 +- .../virtualnetworktaps_client_example_test.go | 307 -- .../virtualrouterpeerings_client.go | 20 +- ...rtualrouterpeerings_client_example_test.go | 147 - .../armnetwork/virtualrouters_client.go | 24 +- .../virtualrouters_client_example_test.go | 246 -- .../network/armnetwork/virtualwans_client.go | 28 +- .../virtualwans_client_example_test.go | 350 -- .../armnetwork/vpnconnections_client.go | 32 +- .../vpnconnections_client_example_test.go | 411 --- .../network/armnetwork/vpngateways_client.go | 48 +- .../vpngateways_client_example_test.go | 1334 -------- .../armnetwork/vpnlinkconnections_client.go | 16 +- .../vpnlinkconnections_client_example_test.go | 91 - .../vpnserverconfigurations_client.go | 28 +- ...erverconfigurations_client_example_test.go | 855 ----- ...urationsassociatedwithvirtualwan_client.go | 6 +- ...iatedwithvirtualwan_client_example_test.go | 47 - .../vpnsitelinkconnections_client.go | 4 +- ...sitelinkconnections_client_example_test.go | 71 - .../network/armnetwork/vpnsitelinks_client.go | 8 +- .../vpnsitelinks_client_example_test.go | 117 - .../network/armnetwork/vpnsites_client.go | 28 +- .../vpnsites_client_example_test.go | 462 --- .../vpnsitesconfiguration_client.go | 6 +- ...nsitesconfiguration_client_example_test.go | 44 - .../network/armnetwork/watchers_client.go | 96 +- .../watchers_client_example_test.go | 909 ----- .../webapplicationfirewallpolicies_client.go | 22 +- ...ionfirewallpolicies_client_example_test.go | 945 ------ .../armnetwork/webcategories_client.go | 8 +- .../webcategories_client_example_test.go | 84 - 274 files changed, 1790 insertions(+), 49956 deletions(-) delete mode 100644 sdk/resourcemanager/network/armnetwork/adminrulecollections_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/adminrules_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/applicationgatewayprivateendpointconnections_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/applicationgatewayprivatelinkresources_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/applicationgateways_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/applicationgatewaywafdynamicmanifests_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/applicationgatewaywafdynamicmanifestsdefault_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/applicationsecuritygroups_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/availabledelegations_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/availableendpointservices_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/availableprivateendpointtypes_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/availableresourcegroupdelegations_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/availableservicealiases_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/azurefirewallfqdntags_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/azurefirewalls_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/bastionhosts_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/bgpservicecommunities_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/configurationpolicygroups_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/connectionmonitors_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/connectivityconfigurations_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/customipprefixes_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/ddoscustompolicies_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/ddosprotectionplans_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/defaultsecurityrules_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/dscpconfiguration_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/expressroutecircuitauthorizations_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/expressroutecircuitconnections_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/expressroutecircuitpeerings_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/expressroutecircuits_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/expressrouteconnections_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/expressroutecrossconnectionpeerings_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/expressroutecrossconnections_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/expressroutegateways_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/expressroutelinks_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/expressrouteportauthorizations_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/expressrouteports_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/expressrouteportslocations_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/expressrouteproviderportslocation_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/expressrouteserviceproviders_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/firewallpolicies_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignatures_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignaturesfiltervalues_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignaturesoverrides_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/firewallpolicyrulecollectiongroups_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/flowlogs_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/groups_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/hubroutetables_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/hubvirtualnetworkconnections_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/inboundnatrules_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/inboundsecurityrule_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/interfaceipconfigurations_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/interfaceloadbalancers_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/interfaces_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/interfacetapconfigurations_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/ipallocations_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/ipgroups_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/loadbalancerbackendaddresspools_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/loadbalancerfrontendipconfigurations_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/loadbalancerloadbalancingrules_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/loadbalancernetworkinterfaces_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/loadbalanceroutboundrules_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/loadbalancerprobes_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/loadbalancers_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/localnetworkgateways_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/management_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/managementgroupnetworkmanagerconnections_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/managercommits_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/managerdeploymentstatus_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/managers_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/natgateways_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/natrules_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/operations_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/p2svpngateways_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/packetcaptures_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/peerexpressroutecircuitconnections_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/privatednszonegroups_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/privateendpoints_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/privatelinkservices_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/profiles_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/publicipaddresses_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/publicipprefixes_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/resourcenavigationlinks_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/routefilterrules_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/routefilters_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/routemaps_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/routes_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/routetables_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/routingintent_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/scopeconnections_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/securityadminconfigurations_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/securitygroups_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/securitypartnerproviders_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/securityrules_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/serviceassociationlinks_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/serviceendpointpolicies_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/serviceendpointpolicydefinitions_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/servicetaginformation_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/servicetags_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/staticmembers_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/subnets_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/subscriptionnetworkmanagerconnections_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/usages_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/vipswap_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/virtualapplianceconnections_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/virtualappliances_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/virtualappliancesites_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/virtualapplianceskus_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/virtualhubbgpconnection_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/virtualhubbgpconnections_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/virtualhubipconfiguration_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/virtualhubroutetablev2s_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/virtualhubs_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/virtualnetworkgatewayconnections_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/virtualnetworkgatewaynatrules_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/virtualnetworkgateways_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/virtualnetworkpeerings_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/virtualnetworks_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/virtualnetworktaps_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/virtualrouterpeerings_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/virtualrouters_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/virtualwans_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/vpnconnections_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/vpngateways_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/vpnlinkconnections_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/vpnserverconfigurations_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/vpnserverconfigurationsassociatedwithvirtualwan_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/vpnsitelinkconnections_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/vpnsitelinks_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/vpnsites_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/vpnsitesconfiguration_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/watchers_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/webapplicationfirewallpolicies_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/webcategories_client_example_test.go diff --git a/sdk/resourcemanager/network/armnetwork/CHANGELOG.md b/sdk/resourcemanager/network/armnetwork/CHANGELOG.md index 3c63296d0af7..4859858f74ad 100644 --- a/sdk/resourcemanager/network/armnetwork/CHANGELOG.md +++ b/sdk/resourcemanager/network/armnetwork/CHANGELOG.md @@ -1,10 +1,18 @@ # Release History -## 4.1.0-beta.1 (2023-07-28) - +## 4.1.0 (2023-08-03) ### Features Added -- Support for test fakes and OpenTelemetry trace spans. +- New value `ApplicationGatewaySKUNameBasic` added to enum type `ApplicationGatewaySKUName` +- New value `ApplicationGatewayTierBasic` added to enum type `ApplicationGatewayTier` +- New enum type `SyncMode` with values `SyncModeAutomatic`, `SyncModeManual` +- New function `*LoadBalancersClient.MigrateToIPBased(context.Context, string, string, *LoadBalancersClientMigrateToIPBasedOptions) (LoadBalancersClientMigrateToIPBasedResponse, error)` +- New struct `BastionHostPropertiesFormatNetworkACLs` +- New struct `IPRule` +- New struct `MigrateLoadBalancerToIPBasedRequest` +- New struct `MigratedPools` +- New field `SyncMode` in struct `BackendAddressPoolPropertiesFormat` +- New field `NetworkACLs`, `VirtualNetwork` in struct `BastionHostPropertiesFormat` ## 4.0.0 (2023-07-11) diff --git a/sdk/resourcemanager/network/armnetwork/adminrulecollections_client.go b/sdk/resourcemanager/network/armnetwork/adminrulecollections_client.go index 4ef828dde4f4..d7a1db9f9b50 100644 --- a/sdk/resourcemanager/network/armnetwork/adminrulecollections_client.go +++ b/sdk/resourcemanager/network/armnetwork/adminrulecollections_client.go @@ -48,7 +48,7 @@ func NewAdminRuleCollectionsClient(subscriptionID string, credential azcore.Toke // CreateOrUpdate - Creates or updates an admin rule collection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Security Configuration. @@ -106,7 +106,7 @@ func (client *AdminRuleCollectionsClient) createOrUpdateCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, ruleCollection); err != nil { @@ -127,7 +127,7 @@ func (client *AdminRuleCollectionsClient) createOrUpdateHandleResponse(resp *htt // BeginDelete - Deletes an admin rule collection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Security Configuration. @@ -152,7 +152,7 @@ func (client *AdminRuleCollectionsClient) BeginDelete(ctx context.Context, resou // Delete - Deletes an admin rule collection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *AdminRuleCollectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, options *AdminRuleCollectionsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "AdminRuleCollectionsClient.BeginDelete" @@ -202,7 +202,7 @@ func (client *AdminRuleCollectionsClient) deleteCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } @@ -214,7 +214,7 @@ func (client *AdminRuleCollectionsClient) deleteCreateRequest(ctx context.Contex // Get - Gets a network manager security admin configuration rule collection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Security Configuration. @@ -271,7 +271,7 @@ func (client *AdminRuleCollectionsClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -288,7 +288,7 @@ func (client *AdminRuleCollectionsClient) getHandleResponse(resp *http.Response) // NewListPager - Lists all the rule collections in a security admin configuration, in a paginated format. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Security Configuration. @@ -348,7 +348,7 @@ func (client *AdminRuleCollectionsClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } diff --git a/sdk/resourcemanager/network/armnetwork/adminrulecollections_client_example_test.go b/sdk/resourcemanager/network/armnetwork/adminrulecollections_client_example_test.go deleted file mode 100644 index 4aa442d77b8d..000000000000 --- a/sdk/resourcemanager/network/armnetwork/adminrulecollections_client_example_test.go +++ /dev/null @@ -1,184 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkManagerAdminRuleCollectionList.json -func ExampleAdminRuleCollectionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAdminRuleCollectionsClient().NewListPager("rg1", "testNetworkManager", "myTestSecurityConfig", &armnetwork.AdminRuleCollectionsClientListOptions{Top: nil, - SkipToken: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AdminRuleCollectionListResult = armnetwork.AdminRuleCollectionListResult{ - // Value: []*armnetwork.AdminRuleCollection{ - // { - // Name: to.Ptr("testRuleCollection"), - // Type: to.Ptr("Microsoft.Network/networkManagers/securityAdminConfigurations/ruleCollections"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/securityAdminConfigurations/myTestSecurityConfig/ruleCollections/testRuleCollection"), - // Properties: &armnetwork.AdminRuleCollectionPropertiesFormat{ - // Description: to.Ptr("A sample rule collection"), - // AppliesToGroups: []*armnetwork.ManagerSecurityGroupItem{ - // { - // NetworkGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/testGroup"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkManagerAdminRuleCollectionGet.json -func ExampleAdminRuleCollectionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAdminRuleCollectionsClient().Get(ctx, "rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AdminRuleCollection = armnetwork.AdminRuleCollection{ - // Name: to.Ptr("testRuleCollection"), - // Type: to.Ptr("Microsoft.Network/networkManagers/securityAdminConfigurations/ruleCollections"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/securityAdminConfigurations/myTestSecurityConfig/ruleCollections/testRuleCollection"), - // Properties: &armnetwork.AdminRuleCollectionPropertiesFormat{ - // Description: to.Ptr("A sample rule collection"), - // AppliesToGroups: []*armnetwork.ManagerSecurityGroupItem{ - // { - // NetworkGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/testGroup"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkManagerAdminRuleCollectionPut.json -func ExampleAdminRuleCollectionsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAdminRuleCollectionsClient().CreateOrUpdate(ctx, "rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", armnetwork.AdminRuleCollection{ - Properties: &armnetwork.AdminRuleCollectionPropertiesFormat{ - Description: to.Ptr("A sample policy"), - AppliesToGroups: []*armnetwork.ManagerSecurityGroupItem{ - { - NetworkGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/testGroup"), - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AdminRuleCollection = armnetwork.AdminRuleCollection{ - // Name: to.Ptr("myTestSecurityConfig"), - // Type: to.Ptr("Microsoft.Network/networkManagers/securityAdminConfigurations/ruleCollections"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManager/testNetworkManager/securityAdminConfigurations/myTestSecurityConfig/ruleCollections/testRuleCollection"), - // Properties: &armnetwork.AdminRuleCollectionPropertiesFormat{ - // Description: to.Ptr("A sample policy"), - // AppliesToGroups: []*armnetwork.ManagerSecurityGroupItem{ - // { - // NetworkGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/testGroup"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkManagerAdminRuleCollectionDelete.json -func ExampleAdminRuleCollectionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAdminRuleCollectionsClient().BeginDelete(ctx, "rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", &armnetwork.AdminRuleCollectionsClientBeginDeleteOptions{Force: to.Ptr(false)}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/network/armnetwork/adminrules_client.go b/sdk/resourcemanager/network/armnetwork/adminrules_client.go index 24bee44e3e12..893152c15b9e 100644 --- a/sdk/resourcemanager/network/armnetwork/adminrules_client.go +++ b/sdk/resourcemanager/network/armnetwork/adminrules_client.go @@ -48,7 +48,7 @@ func NewAdminRulesClient(subscriptionID string, credential azcore.TokenCredentia // CreateOrUpdate - Creates or updates an admin rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Security Configuration. @@ -111,7 +111,7 @@ func (client *AdminRulesClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, adminRule); err != nil { @@ -132,7 +132,7 @@ func (client *AdminRulesClient) createOrUpdateHandleResponse(resp *http.Response // BeginDelete - Deletes an admin rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Security Configuration. @@ -157,7 +157,7 @@ func (client *AdminRulesClient) BeginDelete(ctx context.Context, resourceGroupNa // Delete - Deletes an admin rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *AdminRulesClient) deleteOperation(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, ruleName string, options *AdminRulesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "AdminRulesClient.BeginDelete" @@ -211,7 +211,7 @@ func (client *AdminRulesClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } @@ -223,7 +223,7 @@ func (client *AdminRulesClient) deleteCreateRequest(ctx context.Context, resourc // Get - Gets a network manager security configuration admin rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Security Configuration. @@ -284,7 +284,7 @@ func (client *AdminRulesClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -301,7 +301,7 @@ func (client *AdminRulesClient) getHandleResponse(resp *http.Response) (AdminRul // NewListPager - List all network manager security configuration admin rules. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Security Configuration. @@ -365,7 +365,7 @@ func (client *AdminRulesClient) listCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } diff --git a/sdk/resourcemanager/network/armnetwork/adminrules_client_example_test.go b/sdk/resourcemanager/network/armnetwork/adminrules_client_example_test.go deleted file mode 100644 index 25e76324f2db..000000000000 --- a/sdk/resourcemanager/network/armnetwork/adminrules_client_example_test.go +++ /dev/null @@ -1,373 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkManagerAdminRuleList.json -func ExampleAdminRulesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAdminRulesClient().NewListPager("rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", &armnetwork.AdminRulesClientListOptions{Top: nil, - SkipToken: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AdminRuleListResult = armnetwork.AdminRuleListResult{ - // Value: []armnetwork.BaseAdminRuleClassification{ - // &armnetwork.AdminRule{ - // Name: to.Ptr("SampleAdminRule"), - // Type: to.Ptr("Microsoft.Network/networkManagers/securityAdminConfigurations/ruleCollections/rules"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkmanagers/testNetworkManager/securityAdminConfigurations/myTestSecurityConfig/ruleCollections/testRuleCollection/rules/SampleAdminRule"), - // Kind: to.Ptr(armnetwork.AdminRuleKindCustom), - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // Properties: &armnetwork.AdminPropertiesFormat{ - // Description: to.Ptr("This is Sample Admin Rule"), - // Access: to.Ptr(armnetwork.SecurityConfigurationRuleAccessDeny), - // DestinationPortRanges: []*string{ - // to.Ptr("22")}, - // Destinations: []*armnetwork.AddressPrefixItem{ - // { - // AddressPrefix: to.Ptr("*"), - // AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeIPPrefix), - // }}, - // Direction: to.Ptr(armnetwork.SecurityConfigurationRuleDirectionInbound), - // Priority: to.Ptr[int32](1), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // SourcePortRanges: []*string{ - // to.Ptr("0-65535")}, - // Sources: []*armnetwork.AddressPrefixItem{ - // { - // AddressPrefix: to.Ptr("*"), - // AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeIPPrefix), - // }}, - // Protocol: to.Ptr(armnetwork.SecurityConfigurationRuleProtocolTCP), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkManagerAdminRuleGet.json -func ExampleAdminRulesClient_Get_getsSecurityAdminRule() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAdminRulesClient().Get(ctx, "rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", "SampleAdminRule", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armnetwork.AdminRulesClientGetResponse{ - // BaseAdminRuleClassification: &armnetwork.AdminRule{ - // Name: to.Ptr("SampleAdminRule"), - // Type: to.Ptr("Microsoft.Network/networkManagers/securityAdminConfigurations/ruleCollections/rules"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/securityAdminConfigurations/myTestSecurityConfig/ruleCollections/testRuleCollection/rules/SampleAdminRule"), - // Kind: to.Ptr(armnetwork.AdminRuleKindCustom), - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // Properties: &armnetwork.AdminPropertiesFormat{ - // Description: to.Ptr("This is Sample Admin Rule"), - // Access: to.Ptr(armnetwork.SecurityConfigurationRuleAccessDeny), - // DestinationPortRanges: []*string{ - // to.Ptr("22")}, - // Destinations: []*armnetwork.AddressPrefixItem{ - // { - // AddressPrefix: to.Ptr("*"), - // AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeIPPrefix), - // }}, - // Direction: to.Ptr(armnetwork.SecurityConfigurationRuleDirectionInbound), - // Priority: to.Ptr[int32](1), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // SourcePortRanges: []*string{ - // to.Ptr("0-65535")}, - // Sources: []*armnetwork.AddressPrefixItem{ - // { - // AddressPrefix: to.Ptr("*"), - // AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeIPPrefix), - // }}, - // Protocol: to.Ptr(armnetwork.SecurityConfigurationRuleProtocolTCP), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkManagerDefaultAdminRuleGet.json -func ExampleAdminRulesClient_Get_getsSecurityDefaultAdminRule() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAdminRulesClient().Get(ctx, "rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", "SampleDefaultAdminRule", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armnetwork.AdminRulesClientGetResponse{ - // BaseAdminRuleClassification: &armnetwork.DefaultAdminRule{ - // Name: to.Ptr("SampleDefaultAdminRule"), - // Type: to.Ptr("Microsoft.Network/networkManagers/securityAdminConfigurations/ruleCollections/rules"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/securityAdminConfigurations/myTestSecurityConfig/ruleCollections/testRuleCollection/rules/SampleDefaultAdminRule"), - // Kind: to.Ptr(armnetwork.AdminRuleKindDefault), - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // Properties: &armnetwork.DefaultAdminPropertiesFormat{ - // Description: to.Ptr("This is Sample Default Admin Rule"), - // Access: to.Ptr(armnetwork.SecurityConfigurationRuleAccessDeny), - // DestinationPortRanges: []*string{ - // to.Ptr("22")}, - // Destinations: []*armnetwork.AddressPrefixItem{ - // { - // AddressPrefix: to.Ptr("*"), - // AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeIPPrefix), - // }}, - // Direction: to.Ptr(armnetwork.SecurityConfigurationRuleDirectionInbound), - // Flag: to.Ptr("AllowVnetInbound"), - // Priority: to.Ptr[int32](1), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // SourcePortRanges: []*string{ - // to.Ptr("0-65535")}, - // Sources: []*armnetwork.AddressPrefixItem{ - // { - // AddressPrefix: to.Ptr("*"), - // AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeIPPrefix), - // }}, - // Protocol: to.Ptr(armnetwork.SecurityConfigurationRuleProtocolTCP), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkManagerDefaultAdminRulePut.json -func ExampleAdminRulesClient_CreateOrUpdate_createADefaultAdminRule() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAdminRulesClient().CreateOrUpdate(ctx, "rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", "SampleDefaultAdminRule", &armnetwork.DefaultAdminRule{ - Kind: to.Ptr(armnetwork.AdminRuleKindDefault), - Properties: &armnetwork.DefaultAdminPropertiesFormat{ - Flag: to.Ptr("AllowVnetInbound"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armnetwork.AdminRulesClientCreateOrUpdateResponse{ - // BaseAdminRuleClassification: &armnetwork.DefaultAdminRule{ - // Name: to.Ptr("SampleDefaultAdminRule"), - // Type: to.Ptr("Microsoft.Network/networkManagers/securityAdminConfigurations/ruleCollections/rules"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/securityAdminConfigurations/myTestSecurityConfig/ruleCollections/testRuleCollection/rules/SampleDefaultAdminRule"), - // Kind: to.Ptr(armnetwork.AdminRuleKindDefault), - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // Properties: &armnetwork.DefaultAdminPropertiesFormat{ - // Description: to.Ptr("This is Sample Default Admin Rule"), - // Access: to.Ptr(armnetwork.SecurityConfigurationRuleAccessDeny), - // DestinationPortRanges: []*string{ - // to.Ptr("22")}, - // Destinations: []*armnetwork.AddressPrefixItem{ - // { - // AddressPrefix: to.Ptr("*"), - // AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeIPPrefix), - // }}, - // Direction: to.Ptr(armnetwork.SecurityConfigurationRuleDirectionInbound), - // Flag: to.Ptr("AllowVnetInbound"), - // Priority: to.Ptr[int32](1), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // SourcePortRanges: []*string{ - // to.Ptr("0-65535")}, - // Sources: []*armnetwork.AddressPrefixItem{ - // { - // AddressPrefix: to.Ptr("Internet"), - // AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeServiceTag), - // }}, - // Protocol: to.Ptr(armnetwork.SecurityConfigurationRuleProtocolTCP), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkManagerAdminRulePut.json -func ExampleAdminRulesClient_CreateOrUpdate_createAnAdminRule() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAdminRulesClient().CreateOrUpdate(ctx, "rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", "SampleAdminRule", &armnetwork.AdminRule{ - Kind: to.Ptr(armnetwork.AdminRuleKindCustom), - Properties: &armnetwork.AdminPropertiesFormat{ - Description: to.Ptr("This is Sample Admin Rule"), - Access: to.Ptr(armnetwork.SecurityConfigurationRuleAccessDeny), - DestinationPortRanges: []*string{ - to.Ptr("22")}, - Destinations: []*armnetwork.AddressPrefixItem{ - { - AddressPrefix: to.Ptr("*"), - AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeIPPrefix), - }}, - Direction: to.Ptr(armnetwork.SecurityConfigurationRuleDirectionInbound), - Priority: to.Ptr[int32](1), - SourcePortRanges: []*string{ - to.Ptr("0-65535")}, - Sources: []*armnetwork.AddressPrefixItem{ - { - AddressPrefix: to.Ptr("Internet"), - AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeServiceTag), - }}, - Protocol: to.Ptr(armnetwork.SecurityConfigurationRuleProtocolTCP), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armnetwork.AdminRulesClientCreateOrUpdateResponse{ - // BaseAdminRuleClassification: &armnetwork.AdminRule{ - // Name: to.Ptr("SampleAdminRule"), - // Type: to.Ptr("Microsoft.Network/networkManagers/securityAdminConfigurations/ruleCollections/rules"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/securityAdminConfigurations/myTestSecurityConfig/ruleCollections/testRuleCollection/rules/SampleAdminRule"), - // Kind: to.Ptr(armnetwork.AdminRuleKindCustom), - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // Properties: &armnetwork.AdminPropertiesFormat{ - // Description: to.Ptr("This is Sample Admin Rule"), - // Access: to.Ptr(armnetwork.SecurityConfigurationRuleAccessDeny), - // DestinationPortRanges: []*string{ - // to.Ptr("22")}, - // Destinations: []*armnetwork.AddressPrefixItem{ - // { - // AddressPrefix: to.Ptr("*"), - // AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeIPPrefix), - // }}, - // Direction: to.Ptr(armnetwork.SecurityConfigurationRuleDirectionInbound), - // Priority: to.Ptr[int32](1), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // SourcePortRanges: []*string{ - // to.Ptr("0-65535")}, - // Sources: []*armnetwork.AddressPrefixItem{ - // { - // AddressPrefix: to.Ptr("Internet"), - // AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeServiceTag), - // }}, - // Protocol: to.Ptr(armnetwork.SecurityConfigurationRuleProtocolTCP), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkManagerAdminRuleDelete.json -func ExampleAdminRulesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAdminRulesClient().BeginDelete(ctx, "rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", "SampleAdminRule", &armnetwork.AdminRulesClientBeginDeleteOptions{Force: to.Ptr(false)}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/network/armnetwork/applicationgatewayprivateendpointconnections_client.go b/sdk/resourcemanager/network/armnetwork/applicationgatewayprivateendpointconnections_client.go index 8ef639ecaf21..c22dfb3f825c 100644 --- a/sdk/resourcemanager/network/armnetwork/applicationgatewayprivateendpointconnections_client.go +++ b/sdk/resourcemanager/network/armnetwork/applicationgatewayprivateendpointconnections_client.go @@ -47,7 +47,7 @@ func NewApplicationGatewayPrivateEndpointConnectionsClient(subscriptionID string // BeginDelete - Deletes the specified private endpoint connection on application gateway. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - applicationGatewayName - The name of the application gateway. // - connectionName - The name of the application gateway private endpoint connection. @@ -71,7 +71,7 @@ func (client *ApplicationGatewayPrivateEndpointConnectionsClient) BeginDelete(ct // Delete - Deletes the specified private endpoint connection on application gateway. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *ApplicationGatewayPrivateEndpointConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, applicationGatewayName string, connectionName string, options *ApplicationGatewayPrivateEndpointConnectionsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ApplicationGatewayPrivateEndpointConnectionsClient.BeginDelete" @@ -117,7 +117,7 @@ func (client *ApplicationGatewayPrivateEndpointConnectionsClient) deleteCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -126,7 +126,7 @@ func (client *ApplicationGatewayPrivateEndpointConnectionsClient) deleteCreateRe // Get - Gets the specified private endpoint connection on application gateway. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - applicationGatewayName - The name of the application gateway. // - connectionName - The name of the application gateway private endpoint connection. @@ -178,7 +178,7 @@ func (client *ApplicationGatewayPrivateEndpointConnectionsClient) getCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -195,7 +195,7 @@ func (client *ApplicationGatewayPrivateEndpointConnectionsClient) getHandleRespo // NewListPager - Lists all private endpoint connections on an application gateway. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - applicationGatewayName - The name of the application gateway. // - options - ApplicationGatewayPrivateEndpointConnectionsClientListOptions contains the optional parameters for the ApplicationGatewayPrivateEndpointConnectionsClient.NewListPager @@ -250,7 +250,7 @@ func (client *ApplicationGatewayPrivateEndpointConnectionsClient) listCreateRequ return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -268,7 +268,7 @@ func (client *ApplicationGatewayPrivateEndpointConnectionsClient) listHandleResp // BeginUpdate - Updates the specified private endpoint connection on application gateway. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - applicationGatewayName - The name of the application gateway. // - connectionName - The name of the application gateway private endpoint connection. @@ -293,7 +293,7 @@ func (client *ApplicationGatewayPrivateEndpointConnectionsClient) BeginUpdate(ct // Update - Updates the specified private endpoint connection on application gateway. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *ApplicationGatewayPrivateEndpointConnectionsClient) update(ctx context.Context, resourceGroupName string, applicationGatewayName string, connectionName string, parameters ApplicationGatewayPrivateEndpointConnection, options *ApplicationGatewayPrivateEndpointConnectionsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "ApplicationGatewayPrivateEndpointConnectionsClient.BeginUpdate" @@ -339,7 +339,7 @@ func (client *ApplicationGatewayPrivateEndpointConnectionsClient) updateCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/applicationgatewayprivateendpointconnections_client_example_test.go b/sdk/resourcemanager/network/armnetwork/applicationgatewayprivateendpointconnections_client_example_test.go deleted file mode 100644 index abb1e5c1a4dd..000000000000 --- a/sdk/resourcemanager/network/armnetwork/applicationgatewayprivateendpointconnections_client_example_test.go +++ /dev/null @@ -1,169 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ApplicationGatewayPrivateEndpointConnectionDelete.json -func ExampleApplicationGatewayPrivateEndpointConnectionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewApplicationGatewayPrivateEndpointConnectionsClient().BeginDelete(ctx, "rg1", "appgw", "connection1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ApplicationGatewayPrivateEndpointConnectionUpdate.json -func ExampleApplicationGatewayPrivateEndpointConnectionsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewApplicationGatewayPrivateEndpointConnectionsClient().BeginUpdate(ctx, "rg1", "appgw", "connection1", armnetwork.ApplicationGatewayPrivateEndpointConnection{ - Name: to.Ptr("connection1"), - Properties: &armnetwork.ApplicationGatewayPrivateEndpointConnectionProperties{ - PrivateEndpoint: &armnetwork.PrivateEndpoint{ - ID: to.Ptr("/subscriptions/subId2/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe"), - }, - PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ - Description: to.Ptr("approved it for some reason."), - Status: to.Ptr("Approved"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ApplicationGatewayPrivateEndpointConnection = armnetwork.ApplicationGatewayPrivateEndpointConnection{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/privateLinkResources/testPlePeConnection"), - // Name: to.Ptr("testPlePeConnection"), - // Properties: &armnetwork.ApplicationGatewayPrivateEndpointConnectionProperties{ - // LinkIdentifier: to.Ptr("linkId"), - // PrivateEndpoint: &armnetwork.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe"), - // }, - // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("approved it for some reason."), - // Status: to.Ptr("Approved"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ApplicationGatewayPrivateEndpointConnectionGet.json -func ExampleApplicationGatewayPrivateEndpointConnectionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApplicationGatewayPrivateEndpointConnectionsClient().Get(ctx, "rg1", "appgw", "connection1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ApplicationGatewayPrivateEndpointConnection = armnetwork.ApplicationGatewayPrivateEndpointConnection{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/privateLinkResources/connection1"), - // Name: to.Ptr("coonection1"), - // Type: to.Ptr("Microsoft.Network/applicationGateways/privateEndpointConnections"), - // Properties: &armnetwork.ApplicationGatewayPrivateEndpointConnectionProperties{ - // LinkIdentifier: to.Ptr("805319460"), - // PrivateEndpoint: &armnetwork.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/subid2/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/pe1"), - // }, - // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Approval Done"), - // Status: to.Ptr("Approved"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ApplicationGatewayPrivateEndpointConnectionList.json -func ExampleApplicationGatewayPrivateEndpointConnectionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewApplicationGatewayPrivateEndpointConnectionsClient().NewListPager("rg1", "appgw", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ApplicationGatewayPrivateEndpointConnectionListResult = armnetwork.ApplicationGatewayPrivateEndpointConnectionListResult{ - // Value: []*armnetwork.ApplicationGatewayPrivateEndpointConnection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/privateLinkResources/connection1"), - // Name: to.Ptr("coonection1"), - // Type: to.Ptr("Microsoft.Network/applicationGateways/privateEndpointConnections"), - // Properties: &armnetwork.ApplicationGatewayPrivateEndpointConnectionProperties{ - // LinkIdentifier: to.Ptr("805319460"), - // PrivateEndpoint: &armnetwork.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/subid2/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/pe1"), - // }, - // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Approval Done"), - // Status: to.Ptr("Approved"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/applicationgatewayprivatelinkresources_client.go b/sdk/resourcemanager/network/armnetwork/applicationgatewayprivatelinkresources_client.go index c35f6df80759..1ac8a74454d4 100644 --- a/sdk/resourcemanager/network/armnetwork/applicationgatewayprivatelinkresources_client.go +++ b/sdk/resourcemanager/network/armnetwork/applicationgatewayprivatelinkresources_client.go @@ -46,7 +46,7 @@ func NewApplicationGatewayPrivateLinkResourcesClient(subscriptionID string, cred // NewListPager - Lists all private link resources on an application gateway. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - applicationGatewayName - The name of the application gateway. // - options - ApplicationGatewayPrivateLinkResourcesClientListOptions contains the optional parameters for the ApplicationGatewayPrivateLinkResourcesClient.NewListPager @@ -101,7 +101,7 @@ func (client *ApplicationGatewayPrivateLinkResourcesClient) listCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/applicationgatewayprivatelinkresources_client_example_test.go b/sdk/resourcemanager/network/armnetwork/applicationgatewayprivatelinkresources_client_example_test.go deleted file mode 100644 index 6886dc9be13f..000000000000 --- a/sdk/resourcemanager/network/armnetwork/applicationgatewayprivatelinkresources_client_example_test.go +++ /dev/null @@ -1,58 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ApplicationGatewayPrivateLinkResourceList.json -func ExampleApplicationGatewayPrivateLinkResourcesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewApplicationGatewayPrivateLinkResourcesClient().NewListPager("rg1", "appgw", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ApplicationGatewayPrivateLinkResourceListResult = armnetwork.ApplicationGatewayPrivateLinkResourceListResult{ - // Value: []*armnetwork.ApplicationGatewayPrivateLinkResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/privateLinkResources/privateLink1"), - // Name: to.Ptr("privateLink1"), - // Type: to.Ptr("Microsoft.Network/applicationGateways/privateLinkResources"), - // Properties: &armnetwork.ApplicationGatewayPrivateLinkResourceProperties{ - // GroupID: to.Ptr("privateLink1"), - // RequiredMembers: []*string{ - // to.Ptr("privateLink1")}, - // RequiredZoneNames: []*string{ - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/applicationgateways_client.go b/sdk/resourcemanager/network/armnetwork/applicationgateways_client.go index d2f92e1b530f..7780949ec2e6 100644 --- a/sdk/resourcemanager/network/armnetwork/applicationgateways_client.go +++ b/sdk/resourcemanager/network/armnetwork/applicationgateways_client.go @@ -47,7 +47,7 @@ func NewApplicationGatewaysClient(subscriptionID string, credential azcore.Token // BeginBackendHealth - Gets the backend health of the specified application gateway in a resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - applicationGatewayName - The name of the application gateway. // - options - ApplicationGatewaysClientBeginBackendHealthOptions contains the optional parameters for the ApplicationGatewaysClient.BeginBackendHealth @@ -70,7 +70,7 @@ func (client *ApplicationGatewaysClient) BeginBackendHealth(ctx context.Context, // BackendHealth - Gets the backend health of the specified application gateway in a resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *ApplicationGatewaysClient) backendHealth(ctx context.Context, resourceGroupName string, applicationGatewayName string, options *ApplicationGatewaysClientBeginBackendHealthOptions) (*http.Response, error) { var err error const operationName = "ApplicationGatewaysClient.BeginBackendHealth" @@ -112,7 +112,7 @@ func (client *ApplicationGatewaysClient) backendHealthCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } @@ -125,7 +125,7 @@ func (client *ApplicationGatewaysClient) backendHealthCreateRequest(ctx context. // application gateway in a resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - applicationGatewayName - The name of the application gateway. // - probeRequest - Request body for on-demand test probe operation. @@ -150,7 +150,7 @@ func (client *ApplicationGatewaysClient) BeginBackendHealthOnDemand(ctx context. // application gateway in a resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *ApplicationGatewaysClient) backendHealthOnDemand(ctx context.Context, resourceGroupName string, applicationGatewayName string, probeRequest ApplicationGatewayOnDemandProbe, options *ApplicationGatewaysClientBeginBackendHealthOnDemandOptions) (*http.Response, error) { var err error const operationName = "ApplicationGatewaysClient.BeginBackendHealthOnDemand" @@ -192,7 +192,7 @@ func (client *ApplicationGatewaysClient) backendHealthOnDemandCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } @@ -207,7 +207,7 @@ func (client *ApplicationGatewaysClient) backendHealthOnDemandCreateRequest(ctx // BeginCreateOrUpdate - Creates or updates the specified application gateway. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - applicationGatewayName - The name of the application gateway. // - parameters - Parameters supplied to the create or update application gateway operation. @@ -231,7 +231,7 @@ func (client *ApplicationGatewaysClient) BeginCreateOrUpdate(ctx context.Context // CreateOrUpdate - Creates or updates the specified application gateway. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *ApplicationGatewaysClient) createOrUpdate(ctx context.Context, resourceGroupName string, applicationGatewayName string, parameters ApplicationGateway, options *ApplicationGatewaysClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ApplicationGatewaysClient.BeginCreateOrUpdate" @@ -273,7 +273,7 @@ func (client *ApplicationGatewaysClient) createOrUpdateCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -285,7 +285,7 @@ func (client *ApplicationGatewaysClient) createOrUpdateCreateRequest(ctx context // BeginDelete - Deletes the specified application gateway. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - applicationGatewayName - The name of the application gateway. // - options - ApplicationGatewaysClientBeginDeleteOptions contains the optional parameters for the ApplicationGatewaysClient.BeginDelete @@ -308,7 +308,7 @@ func (client *ApplicationGatewaysClient) BeginDelete(ctx context.Context, resour // Delete - Deletes the specified application gateway. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *ApplicationGatewaysClient) deleteOperation(ctx context.Context, resourceGroupName string, applicationGatewayName string, options *ApplicationGatewaysClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ApplicationGatewaysClient.BeginDelete" @@ -350,7 +350,7 @@ func (client *ApplicationGatewaysClient) deleteCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -359,7 +359,7 @@ func (client *ApplicationGatewaysClient) deleteCreateRequest(ctx context.Context // Get - Gets the specified application gateway. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - applicationGatewayName - The name of the application gateway. // - options - ApplicationGatewaysClientGetOptions contains the optional parameters for the ApplicationGatewaysClient.Get method. @@ -405,7 +405,7 @@ func (client *ApplicationGatewaysClient) getCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -423,7 +423,7 @@ func (client *ApplicationGatewaysClient) getHandleResponse(resp *http.Response) // GetSSLPredefinedPolicy - Gets Ssl predefined policy with the specified policy name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - predefinedPolicyName - Name of Ssl predefined policy. // - options - ApplicationGatewaysClientGetSSLPredefinedPolicyOptions contains the optional parameters for the ApplicationGatewaysClient.GetSSLPredefinedPolicy // method. @@ -465,7 +465,7 @@ func (client *ApplicationGatewaysClient) getSSLPredefinedPolicyCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -482,7 +482,7 @@ func (client *ApplicationGatewaysClient) getSSLPredefinedPolicyHandleResponse(re // NewListPager - Lists all application gateways in a resource group. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - options - ApplicationGatewaysClientListOptions contains the optional parameters for the ApplicationGatewaysClient.NewListPager // method. @@ -532,7 +532,7 @@ func (client *ApplicationGatewaysClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -549,7 +549,7 @@ func (client *ApplicationGatewaysClient) listHandleResponse(resp *http.Response) // NewListAllPager - Gets all the application gateways in a subscription. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - options - ApplicationGatewaysClientListAllOptions contains the optional parameters for the ApplicationGatewaysClient.NewListAllPager // method. func (client *ApplicationGatewaysClient) NewListAllPager(options *ApplicationGatewaysClientListAllOptions) *runtime.Pager[ApplicationGatewaysClientListAllResponse] { @@ -594,7 +594,7 @@ func (client *ApplicationGatewaysClient) listAllCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -612,7 +612,7 @@ func (client *ApplicationGatewaysClient) listAllHandleResponse(resp *http.Respon // ListAvailableRequestHeaders - Lists all available request headers. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - options - ApplicationGatewaysClientListAvailableRequestHeadersOptions contains the optional parameters for the ApplicationGatewaysClient.ListAvailableRequestHeaders // method. func (client *ApplicationGatewaysClient) ListAvailableRequestHeaders(ctx context.Context, options *ApplicationGatewaysClientListAvailableRequestHeadersOptions) (ApplicationGatewaysClientListAvailableRequestHeadersResponse, error) { @@ -649,7 +649,7 @@ func (client *ApplicationGatewaysClient) listAvailableRequestHeadersCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -667,7 +667,7 @@ func (client *ApplicationGatewaysClient) listAvailableRequestHeadersHandleRespon // ListAvailableResponseHeaders - Lists all available response headers. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - options - ApplicationGatewaysClientListAvailableResponseHeadersOptions contains the optional parameters for the ApplicationGatewaysClient.ListAvailableResponseHeaders // method. func (client *ApplicationGatewaysClient) ListAvailableResponseHeaders(ctx context.Context, options *ApplicationGatewaysClientListAvailableResponseHeadersOptions) (ApplicationGatewaysClientListAvailableResponseHeadersResponse, error) { @@ -704,7 +704,7 @@ func (client *ApplicationGatewaysClient) listAvailableResponseHeadersCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -722,7 +722,7 @@ func (client *ApplicationGatewaysClient) listAvailableResponseHeadersHandleRespo // ListAvailableSSLOptions - Lists available Ssl options for configuring Ssl policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - options - ApplicationGatewaysClientListAvailableSSLOptionsOptions contains the optional parameters for the ApplicationGatewaysClient.ListAvailableSSLOptions // method. func (client *ApplicationGatewaysClient) ListAvailableSSLOptions(ctx context.Context, options *ApplicationGatewaysClientListAvailableSSLOptionsOptions) (ApplicationGatewaysClientListAvailableSSLOptionsResponse, error) { @@ -759,7 +759,7 @@ func (client *ApplicationGatewaysClient) listAvailableSSLOptionsCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -776,7 +776,7 @@ func (client *ApplicationGatewaysClient) listAvailableSSLOptionsHandleResponse(r // NewListAvailableSSLPredefinedPoliciesPager - Lists all SSL predefined policies for configuring Ssl policy. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - options - ApplicationGatewaysClientListAvailableSSLPredefinedPoliciesOptions contains the optional parameters for the ApplicationGatewaysClient.NewListAvailableSSLPredefinedPoliciesPager // method. func (client *ApplicationGatewaysClient) NewListAvailableSSLPredefinedPoliciesPager(options *ApplicationGatewaysClientListAvailableSSLPredefinedPoliciesOptions) *runtime.Pager[ApplicationGatewaysClientListAvailableSSLPredefinedPoliciesResponse] { @@ -821,7 +821,7 @@ func (client *ApplicationGatewaysClient) listAvailableSSLPredefinedPoliciesCreat return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -839,7 +839,7 @@ func (client *ApplicationGatewaysClient) listAvailableSSLPredefinedPoliciesHandl // ListAvailableServerVariables - Lists all available server variables. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - options - ApplicationGatewaysClientListAvailableServerVariablesOptions contains the optional parameters for the ApplicationGatewaysClient.ListAvailableServerVariables // method. func (client *ApplicationGatewaysClient) ListAvailableServerVariables(ctx context.Context, options *ApplicationGatewaysClientListAvailableServerVariablesOptions) (ApplicationGatewaysClientListAvailableServerVariablesResponse, error) { @@ -876,7 +876,7 @@ func (client *ApplicationGatewaysClient) listAvailableServerVariablesCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -894,7 +894,7 @@ func (client *ApplicationGatewaysClient) listAvailableServerVariablesHandleRespo // ListAvailableWafRuleSets - Lists all available web application firewall rule sets. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - options - ApplicationGatewaysClientListAvailableWafRuleSetsOptions contains the optional parameters for the ApplicationGatewaysClient.ListAvailableWafRuleSets // method. func (client *ApplicationGatewaysClient) ListAvailableWafRuleSets(ctx context.Context, options *ApplicationGatewaysClientListAvailableWafRuleSetsOptions) (ApplicationGatewaysClientListAvailableWafRuleSetsResponse, error) { @@ -931,7 +931,7 @@ func (client *ApplicationGatewaysClient) listAvailableWafRuleSetsCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -949,7 +949,7 @@ func (client *ApplicationGatewaysClient) listAvailableWafRuleSetsHandleResponse( // BeginStart - Starts the specified application gateway. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - applicationGatewayName - The name of the application gateway. // - options - ApplicationGatewaysClientBeginStartOptions contains the optional parameters for the ApplicationGatewaysClient.BeginStart @@ -972,7 +972,7 @@ func (client *ApplicationGatewaysClient) BeginStart(ctx context.Context, resourc // Start - Starts the specified application gateway. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *ApplicationGatewaysClient) start(ctx context.Context, resourceGroupName string, applicationGatewayName string, options *ApplicationGatewaysClientBeginStartOptions) (*http.Response, error) { var err error const operationName = "ApplicationGatewaysClient.BeginStart" @@ -1014,7 +1014,7 @@ func (client *ApplicationGatewaysClient) startCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1023,7 +1023,7 @@ func (client *ApplicationGatewaysClient) startCreateRequest(ctx context.Context, // BeginStop - Stops the specified application gateway in a resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - applicationGatewayName - The name of the application gateway. // - options - ApplicationGatewaysClientBeginStopOptions contains the optional parameters for the ApplicationGatewaysClient.BeginStop @@ -1046,7 +1046,7 @@ func (client *ApplicationGatewaysClient) BeginStop(ctx context.Context, resource // Stop - Stops the specified application gateway in a resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *ApplicationGatewaysClient) stop(ctx context.Context, resourceGroupName string, applicationGatewayName string, options *ApplicationGatewaysClientBeginStopOptions) (*http.Response, error) { var err error const operationName = "ApplicationGatewaysClient.BeginStop" @@ -1088,7 +1088,7 @@ func (client *ApplicationGatewaysClient) stopCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1097,7 +1097,7 @@ func (client *ApplicationGatewaysClient) stopCreateRequest(ctx context.Context, // UpdateTags - Updates the specified application gateway tags. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - applicationGatewayName - The name of the application gateway. // - parameters - Parameters supplied to update application gateway tags. @@ -1145,7 +1145,7 @@ func (client *ApplicationGatewaysClient) updateTagsCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/applicationgateways_client_example_test.go b/sdk/resourcemanager/network/armnetwork/applicationgateways_client_example_test.go deleted file mode 100644 index 0a2315dc9027..000000000000 --- a/sdk/resourcemanager/network/armnetwork/applicationgateways_client_example_test.go +++ /dev/null @@ -1,2346 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ApplicationGatewayDelete.json -func ExampleApplicationGatewaysClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewApplicationGatewaysClient().BeginDelete(ctx, "rg1", "appgw", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ApplicationGatewayGet.json -func ExampleApplicationGatewaysClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApplicationGatewaysClient().Get(ctx, "rg1", "appgw", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ApplicationGateway = armnetwork.ApplicationGateway{ - // Name: to.Ptr("appgw"), - // Type: to.Ptr("Microsoft.Network/applicationGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw"), - // Location: to.Ptr("southcentralus"), - // Properties: &armnetwork.ApplicationGatewayPropertiesFormat{ - // AuthenticationCertificates: []*armnetwork.ApplicationGatewayAuthenticationCertificate{ - // }, - // BackendAddressPools: []*armnetwork.ApplicationGatewayBackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool"), - // Name: to.Ptr("appgwpool"), - // Properties: &armnetwork.ApplicationGatewayBackendAddressPoolPropertiesFormat{ - // BackendAddresses: []*armnetwork.ApplicationGatewayBackendAddress{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool1"), - // Name: to.Ptr("appgwpool1"), - // Properties: &armnetwork.ApplicationGatewayBackendAddressPoolPropertiesFormat{ - // BackendAddresses: []*armnetwork.ApplicationGatewayBackendAddress{ - // { - // }, - // { - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // BackendHTTPSettingsCollection: []*armnetwork.ApplicationGatewayBackendHTTPSettings{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/appgwbhs"), - // Name: to.Ptr("appgwbhs"), - // Properties: &armnetwork.ApplicationGatewayBackendHTTPSettingsPropertiesFormat{ - // CookieBasedAffinity: to.Ptr(armnetwork.ApplicationGatewayCookieBasedAffinityDisabled), - // Port: to.Ptr[int32](80), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RequestTimeout: to.Ptr[int32](30), - // Protocol: to.Ptr(armnetwork.ApplicationGatewayProtocolHTTP), - // }, - // }}, - // FrontendIPConfigurations: []*armnetwork.ApplicationGatewayFrontendIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendIPConfigurations/appgwfip"), - // Name: to.Ptr("appgwfip"), - // Properties: &armnetwork.ApplicationGatewayFrontendIPConfigurationPropertiesFormat{ - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/appgwpip"), - // }, - // }, - // }}, - // FrontendPorts: []*armnetwork.ApplicationGatewayFrontendPort{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendPorts/appgwfp"), - // Name: to.Ptr("appgwfp"), - // Properties: &armnetwork.ApplicationGatewayFrontendPortPropertiesFormat{ - // Port: to.Ptr[int32](443), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendPorts/appgwfp80"), - // Name: to.Ptr("appgwfp80"), - // Properties: &armnetwork.ApplicationGatewayFrontendPortPropertiesFormat{ - // Port: to.Ptr[int32](80), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // GatewayIPConfigurations: []*armnetwork.ApplicationGatewayIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/gatewayIPConfigurations/appgwipc"), - // Name: to.Ptr("appgwipc"), - // Properties: &armnetwork.ApplicationGatewayIPConfigurationPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/virtualNetwork1/subnets/appgwsubnet"), - // }, - // }, - // }}, - // GlobalConfiguration: &armnetwork.ApplicationGatewayGlobalConfiguration{ - // EnableRequestBuffering: to.Ptr(true), - // EnableResponseBuffering: to.Ptr(true), - // }, - // HTTPListeners: []*armnetwork.ApplicationGatewayHTTPListener{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/httpListeners/appgwhl"), - // Name: to.Ptr("appgwhl"), - // Properties: &armnetwork.ApplicationGatewayHTTPListenerPropertiesFormat{ - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendIPConfigurations/appgwfip"), - // }, - // FrontendPort: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendPorts/appgwfp"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RequireServerNameIndication: to.Ptr(false), - // SSLCertificate: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/sslCertificates/sslcert"), - // }, - // SSLProfile: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/sslProfiles/sslProfile1"), - // }, - // Protocol: to.Ptr(armnetwork.ApplicationGatewayProtocolHTTPS), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/httpListeners/appgwhttplistener"), - // Name: to.Ptr("appgwhttplistener"), - // Properties: &armnetwork.ApplicationGatewayHTTPListenerPropertiesFormat{ - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendIPConfigurations/appgwfip"), - // }, - // FrontendPort: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendPorts/appgwfp80"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.ApplicationGatewayProtocolHTTP), - // }, - // }}, - // LoadDistributionPolicies: []*armnetwork.ApplicationGatewayLoadDistributionPolicy{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1"), - // Name: to.Ptr("ldp1"), - // Properties: &armnetwork.ApplicationGatewayLoadDistributionPolicyPropertiesFormat{ - // LoadDistributionAlgorithm: to.Ptr(armnetwork.ApplicationGatewayLoadDistributionAlgorithmRoundRobin), - // LoadDistributionTargets: []*armnetwork.ApplicationGatewayLoadDistributionTarget{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1/loadDistributionTargets/ldt1"), - // Name: to.Ptr("ld11"), - // Properties: &armnetwork.ApplicationGatewayLoadDistributionTargetPropertiesFormat{ - // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool"), - // }, - // WeightPerServer: to.Ptr[int32](40), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1/loadDistributionTargets/ldt1"), - // Name: to.Ptr("ld11"), - // Properties: &armnetwork.ApplicationGatewayLoadDistributionTargetPropertiesFormat{ - // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool1"), - // }, - // WeightPerServer: to.Ptr[int32](60), - // }, - // }}, - // }, - // }}, - // OperationalState: to.Ptr(armnetwork.ApplicationGatewayOperationalStateRunning), - // PrivateEndpointConnections: []*armnetwork.ApplicationGatewayPrivateEndpointConnection{ - // }, - // PrivateLinkConfigurations: []*armnetwork.ApplicationGatewayPrivateLinkConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/privateLinkConfigurations/privateLink1"), - // Name: to.Ptr("privateLink1"), - // Properties: &armnetwork.ApplicationGatewayPrivateLinkConfigurationProperties{ - // IPConfigurations: []*armnetwork.ApplicationGatewayPrivateLinkIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/privateLinkConfigurations/privateLink1/privateLinkConfigurations/privateLink1/ipConfigurations/natNicIpconfig1"), - // Name: to.Ptr("natNicIpconfig1"), - // Properties: &armnetwork.ApplicationGatewayPrivateLinkIPConfigurationProperties{ - // Primary: to.Ptr(true), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/virtualNetwork1/subnets/appgwsubnet"), - // }, - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/privateLinkConfigurations/privateLink1/privateLinkConfigurations/privateLink1/ipConfigurations/natNicIpconfig2"), - // Name: to.Ptr("natNicIpconfig2"), - // Properties: &armnetwork.ApplicationGatewayPrivateLinkIPConfigurationProperties{ - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/virtualNetwork1/subnets/appgwsubnet"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // Probes: []*armnetwork.ApplicationGatewayProbe{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RequestRoutingRules: []*armnetwork.ApplicationGatewayRequestRoutingRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/requestRoutingRules/appgwrule"), - // Name: to.Ptr("appgwrule"), - // Properties: &armnetwork.ApplicationGatewayRequestRoutingRulePropertiesFormat{ - // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool"), - // }, - // BackendHTTPSettings: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/appgwbhs"), - // }, - // HTTPListener: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/httpListeners/appgwhl"), - // }, - // LoadDistributionPolicy: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1"), - // }, - // Priority: to.Ptr[int32](10), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RewriteRuleSet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/rewriteRuleSets/rewriteRuleSet1"), - // }, - // RuleType: to.Ptr(armnetwork.ApplicationGatewayRequestRoutingRuleTypeBasic), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/requestRoutingRules/appgwPathBasedRule"), - // Name: to.Ptr("appgwPathBasedRule"), - // Properties: &armnetwork.ApplicationGatewayRequestRoutingRulePropertiesFormat{ - // HTTPListener: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/httpListeners/appgwhttplistener"), - // }, - // Priority: to.Ptr[int32](20), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RuleType: to.Ptr(armnetwork.ApplicationGatewayRequestRoutingRuleTypePathBasedRouting), - // URLPathMap: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/urlPathMaps/pathMap1"), - // }, - // }, - // }}, - // RewriteRuleSets: []*armnetwork.ApplicationGatewayRewriteRuleSet{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/rewriteRuleSets/rewriteRuleSet1"), - // Name: to.Ptr("rewriteRuleSet1"), - // Properties: &armnetwork.ApplicationGatewayRewriteRuleSetPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RewriteRules: []*armnetwork.ApplicationGatewayRewriteRule{ - // { - // Name: to.Ptr("Set X-Forwarded-For"), - // ActionSet: &armnetwork.ApplicationGatewayRewriteRuleActionSet{ - // RequestHeaderConfigurations: []*armnetwork.ApplicationGatewayHeaderConfiguration{ - // { - // HeaderName: to.Ptr("X-Forwarded-For"), - // HeaderValue: to.Ptr("{var_remote-addr}"), - // }}, - // ResponseHeaderConfigurations: []*armnetwork.ApplicationGatewayHeaderConfiguration{ - // { - // HeaderName: to.Ptr("Strict-Transport-Security"), - // HeaderValue: to.Ptr("max-age=31536000"), - // }}, - // URLConfiguration: &armnetwork.ApplicationGatewayURLConfiguration{ - // ModifiedPath: to.Ptr("/abc"), - // ModifiedQueryString: to.Ptr("x=y&a=b"), - // Reroute: to.Ptr(false), - // }, - // }, - // Conditions: []*armnetwork.ApplicationGatewayRewriteRuleCondition{ - // { - // IgnoreCase: to.Ptr(true), - // Negate: to.Ptr(false), - // Pattern: to.Ptr("^Bearer"), - // Variable: to.Ptr("http_req_Authorization"), - // }}, - // RuleSequence: to.Ptr[int32](102), - // }}, - // }, - // }}, - // SKU: &armnetwork.ApplicationGatewaySKU{ - // Name: to.Ptr(armnetwork.ApplicationGatewaySKUNameStandardMedium), - // Capacity: to.Ptr[int32](3), - // Tier: to.Ptr(armnetwork.ApplicationGatewayTierStandard), - // }, - // SSLCertificates: []*armnetwork.ApplicationGatewaySSLCertificate{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/sslCertificates/sslcert"), - // Name: to.Ptr("sslcert"), - // Properties: &armnetwork.ApplicationGatewaySSLCertificatePropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicCertData: to.Ptr("*****"), - // }, - // }}, - // SSLProfiles: []*armnetwork.ApplicationGatewaySSLProfile{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/sslProfiles/sslProfile1"), - // Name: to.Ptr("sslProfile1"), - // Properties: &armnetwork.ApplicationGatewaySSLProfilePropertiesFormat{ - // ClientAuthConfiguration: &armnetwork.ApplicationGatewayClientAuthConfiguration{ - // VerifyClientCertIssuerDN: to.Ptr(true), - // VerifyClientRevocation: to.Ptr(armnetwork.ApplicationGatewayClientRevocationOptionsOCSP), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SSLPolicy: &armnetwork.ApplicationGatewaySSLPolicy{ - // CipherSuites: []*armnetwork.ApplicationGatewaySSLCipherSuite{ - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128CBCSHA256)}, - // MinProtocolVersion: to.Ptr(armnetwork.ApplicationGatewaySSLProtocolTLSv11), - // PolicyType: to.Ptr(armnetwork.ApplicationGatewaySSLPolicyTypeCustom), - // }, - // TrustedClientCertificates: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/trustedClientCertificates/clientcert"), - // }}, - // }, - // }}, - // TrustedClientCertificates: []*armnetwork.ApplicationGatewayTrustedClientCertificate{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/trustedClientCertificates/clientcert"), - // Name: to.Ptr("clientcert"), - // Properties: &armnetwork.ApplicationGatewayTrustedClientCertificatePropertiesFormat{ - // ClientCertIssuerDN: to.Ptr("CN=User1, OU=Eng, O=Company Ltd, L=D4, S=Arizona, C=US"), - // Data: to.Ptr("****"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ValidatedCertData: to.Ptr("****"), - // }, - // }}, - // URLPathMaps: []*armnetwork.ApplicationGatewayURLPathMap{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/urlPathMaps/pathMap1"), - // Name: to.Ptr("pathMap1"), - // Properties: &armnetwork.ApplicationGatewayURLPathMapPropertiesFormat{ - // DefaultBackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool"), - // }, - // DefaultBackendHTTPSettings: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/appgwbhs"), - // }, - // DefaultLoadDistributionPolicy: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1"), - // }, - // DefaultRewriteRuleSet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/rewriteRuleSets/rewriteRuleSet1"), - // }, - // PathRules: []*armnetwork.ApplicationGatewayPathRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/urlPathMaps/pathMap1/pathRules/apiPaths"), - // Name: to.Ptr("apiPaths"), - // Properties: &armnetwork.ApplicationGatewayPathRulePropertiesFormat{ - // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool"), - // }, - // BackendHTTPSettings: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/appgwbhs"), - // }, - // LoadDistributionPolicy: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1"), - // }, - // Paths: []*string{ - // to.Ptr("/api"), - // to.Ptr("/v1/api")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RewriteRuleSet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/rewriteRuleSets/rewriteRuleSet1"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ApplicationGatewayCreate.json -func ExampleApplicationGatewaysClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewApplicationGatewaysClient().BeginCreateOrUpdate(ctx, "rg1", "appgw", armnetwork.ApplicationGateway{ - Location: to.Ptr("eastus"), - Identity: &armnetwork.ManagedServiceIdentity{ - Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), - UserAssignedIdentities: map[string]*armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {}, - }, - }, - Properties: &armnetwork.ApplicationGatewayPropertiesFormat{ - BackendAddressPools: []*armnetwork.ApplicationGatewayBackendAddressPool{ - { - Name: to.Ptr("appgwpool"), - Properties: &armnetwork.ApplicationGatewayBackendAddressPoolPropertiesFormat{ - BackendAddresses: []*armnetwork.ApplicationGatewayBackendAddress{ - { - IPAddress: to.Ptr("10.0.1.1"), - }, - { - IPAddress: to.Ptr("10.0.1.2"), - }}, - }, - }, - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool1"), - Name: to.Ptr("appgwpool1"), - Properties: &armnetwork.ApplicationGatewayBackendAddressPoolPropertiesFormat{ - BackendAddresses: []*armnetwork.ApplicationGatewayBackendAddress{ - { - IPAddress: to.Ptr("10.0.0.1"), - }, - { - IPAddress: to.Ptr("10.0.0.2"), - }}, - }, - }}, - BackendHTTPSettingsCollection: []*armnetwork.ApplicationGatewayBackendHTTPSettings{ - { - Name: to.Ptr("appgwbhs"), - Properties: &armnetwork.ApplicationGatewayBackendHTTPSettingsPropertiesFormat{ - CookieBasedAffinity: to.Ptr(armnetwork.ApplicationGatewayCookieBasedAffinityDisabled), - Port: to.Ptr[int32](80), - RequestTimeout: to.Ptr[int32](30), - Protocol: to.Ptr(armnetwork.ApplicationGatewayProtocolHTTP), - }, - }}, - FrontendIPConfigurations: []*armnetwork.ApplicationGatewayFrontendIPConfiguration{ - { - Name: to.Ptr("appgwfip"), - Properties: &armnetwork.ApplicationGatewayFrontendIPConfigurationPropertiesFormat{ - PublicIPAddress: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/appgwpip"), - }, - }, - }}, - FrontendPorts: []*armnetwork.ApplicationGatewayFrontendPort{ - { - Name: to.Ptr("appgwfp"), - Properties: &armnetwork.ApplicationGatewayFrontendPortPropertiesFormat{ - Port: to.Ptr[int32](443), - }, - }, - { - Name: to.Ptr("appgwfp80"), - Properties: &armnetwork.ApplicationGatewayFrontendPortPropertiesFormat{ - Port: to.Ptr[int32](80), - }, - }}, - GatewayIPConfigurations: []*armnetwork.ApplicationGatewayIPConfiguration{ - { - Name: to.Ptr("appgwipc"), - Properties: &armnetwork.ApplicationGatewayIPConfigurationPropertiesFormat{ - Subnet: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet/subnets/appgwsubnet"), - }, - }, - }}, - GlobalConfiguration: &armnetwork.ApplicationGatewayGlobalConfiguration{ - EnableRequestBuffering: to.Ptr(true), - EnableResponseBuffering: to.Ptr(true), - }, - HTTPListeners: []*armnetwork.ApplicationGatewayHTTPListener{ - { - Name: to.Ptr("appgwhl"), - Properties: &armnetwork.ApplicationGatewayHTTPListenerPropertiesFormat{ - FrontendIPConfiguration: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendIPConfigurations/appgwfip"), - }, - FrontendPort: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendPorts/appgwfp"), - }, - RequireServerNameIndication: to.Ptr(false), - SSLCertificate: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/sslCertificates/sslcert"), - }, - SSLProfile: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/sslProfiles/sslProfile1"), - }, - Protocol: to.Ptr(armnetwork.ApplicationGatewayProtocolHTTPS), - }, - }, - { - Name: to.Ptr("appgwhttplistener"), - Properties: &armnetwork.ApplicationGatewayHTTPListenerPropertiesFormat{ - FrontendIPConfiguration: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendIPConfigurations/appgwfip"), - }, - FrontendPort: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendPorts/appgwfp80"), - }, - Protocol: to.Ptr(armnetwork.ApplicationGatewayProtocolHTTP), - }, - }}, - RequestRoutingRules: []*armnetwork.ApplicationGatewayRequestRoutingRule{ - { - Name: to.Ptr("appgwrule"), - Properties: &armnetwork.ApplicationGatewayRequestRoutingRulePropertiesFormat{ - BackendAddressPool: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool"), - }, - BackendHTTPSettings: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/appgwbhs"), - }, - HTTPListener: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/httpListeners/appgwhl"), - }, - Priority: to.Ptr[int32](10), - RewriteRuleSet: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/rewriteRuleSets/rewriteRuleSet1"), - }, - RuleType: to.Ptr(armnetwork.ApplicationGatewayRequestRoutingRuleTypeBasic), - }, - }}, - RewriteRuleSets: []*armnetwork.ApplicationGatewayRewriteRuleSet{ - { - Name: to.Ptr("rewriteRuleSet1"), - Properties: &armnetwork.ApplicationGatewayRewriteRuleSetPropertiesFormat{ - RewriteRules: []*armnetwork.ApplicationGatewayRewriteRule{ - { - Name: to.Ptr("Set X-Forwarded-For"), - ActionSet: &armnetwork.ApplicationGatewayRewriteRuleActionSet{ - RequestHeaderConfigurations: []*armnetwork.ApplicationGatewayHeaderConfiguration{ - { - HeaderName: to.Ptr("X-Forwarded-For"), - HeaderValue: to.Ptr("{var_add_x_forwarded_for_proxy}"), - }}, - ResponseHeaderConfigurations: []*armnetwork.ApplicationGatewayHeaderConfiguration{ - { - HeaderName: to.Ptr("Strict-Transport-Security"), - HeaderValue: to.Ptr("max-age=31536000"), - }}, - URLConfiguration: &armnetwork.ApplicationGatewayURLConfiguration{ - ModifiedPath: to.Ptr("/abc"), - }, - }, - Conditions: []*armnetwork.ApplicationGatewayRewriteRuleCondition{ - { - IgnoreCase: to.Ptr(true), - Negate: to.Ptr(false), - Pattern: to.Ptr("^Bearer"), - Variable: to.Ptr("http_req_Authorization"), - }}, - RuleSequence: to.Ptr[int32](102), - }}, - }, - }}, - SKU: &armnetwork.ApplicationGatewaySKU{ - Name: to.Ptr(armnetwork.ApplicationGatewaySKUNameStandardV2), - Capacity: to.Ptr[int32](3), - Tier: to.Ptr(armnetwork.ApplicationGatewayTierStandardV2), - }, - SSLCertificates: []*armnetwork.ApplicationGatewaySSLCertificate{ - { - Name: to.Ptr("sslcert"), - Properties: &armnetwork.ApplicationGatewaySSLCertificatePropertiesFormat{ - Data: to.Ptr("****"), - Password: to.Ptr("****"), - }, - }, - { - Name: to.Ptr("sslcert2"), - Properties: &armnetwork.ApplicationGatewaySSLCertificatePropertiesFormat{ - KeyVaultSecretID: to.Ptr("https://kv/secret"), - }, - }}, - SSLProfiles: []*armnetwork.ApplicationGatewaySSLProfile{ - { - Name: to.Ptr("sslProfile1"), - Properties: &armnetwork.ApplicationGatewaySSLProfilePropertiesFormat{ - ClientAuthConfiguration: &armnetwork.ApplicationGatewayClientAuthConfiguration{ - VerifyClientCertIssuerDN: to.Ptr(true), - }, - SSLPolicy: &armnetwork.ApplicationGatewaySSLPolicy{ - CipherSuites: []*armnetwork.ApplicationGatewaySSLCipherSuite{ - to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128CBCSHA256)}, - MinProtocolVersion: to.Ptr(armnetwork.ApplicationGatewaySSLProtocolTLSv11), - PolicyType: to.Ptr(armnetwork.ApplicationGatewaySSLPolicyTypeCustom), - }, - TrustedClientCertificates: []*armnetwork.SubResource{ - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/trustedClientCertificates/clientcert"), - }}, - }, - }}, - TrustedClientCertificates: []*armnetwork.ApplicationGatewayTrustedClientCertificate{ - { - Name: to.Ptr("clientcert"), - Properties: &armnetwork.ApplicationGatewayTrustedClientCertificatePropertiesFormat{ - Data: to.Ptr("****"), - }, - }}, - TrustedRootCertificates: []*armnetwork.ApplicationGatewayTrustedRootCertificate{ - { - Name: to.Ptr("rootcert"), - Properties: &armnetwork.ApplicationGatewayTrustedRootCertificatePropertiesFormat{ - Data: to.Ptr("****"), - }, - }, - { - Name: to.Ptr("rootcert1"), - Properties: &armnetwork.ApplicationGatewayTrustedRootCertificatePropertiesFormat{ - KeyVaultSecretID: to.Ptr("https://kv/secret"), - }, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ApplicationGateway = armnetwork.ApplicationGateway{ - // Name: to.Ptr("appgw"), - // Type: to.Ptr("Microsoft.Network/applicationGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw"), - // Location: to.Ptr("southcentralus"), - // Properties: &armnetwork.ApplicationGatewayPropertiesFormat{ - // AuthenticationCertificates: []*armnetwork.ApplicationGatewayAuthenticationCertificate{ - // }, - // BackendAddressPools: []*armnetwork.ApplicationGatewayBackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool"), - // Name: to.Ptr("appgwpool"), - // Properties: &armnetwork.ApplicationGatewayBackendAddressPoolPropertiesFormat{ - // BackendAddresses: []*armnetwork.ApplicationGatewayBackendAddress{ - // { - // IPAddress: to.Ptr("10.0.1.1"), - // }, - // { - // IPAddress: to.Ptr("10.0.1.2"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool1"), - // Name: to.Ptr("appgwpool1"), - // Properties: &armnetwork.ApplicationGatewayBackendAddressPoolPropertiesFormat{ - // BackendAddresses: []*armnetwork.ApplicationGatewayBackendAddress{ - // { - // IPAddress: to.Ptr("10.0.0.1"), - // }, - // { - // IPAddress: to.Ptr("10.0.0.2"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // BackendHTTPSettingsCollection: []*armnetwork.ApplicationGatewayBackendHTTPSettings{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/appgwbhs"), - // Name: to.Ptr("appgwbhs"), - // Properties: &armnetwork.ApplicationGatewayBackendHTTPSettingsPropertiesFormat{ - // CookieBasedAffinity: to.Ptr(armnetwork.ApplicationGatewayCookieBasedAffinityDisabled), - // Port: to.Ptr[int32](80), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RequestTimeout: to.Ptr[int32](30), - // Protocol: to.Ptr(armnetwork.ApplicationGatewayProtocolHTTP), - // }, - // }}, - // FrontendIPConfigurations: []*armnetwork.ApplicationGatewayFrontendIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendIPConfigurations/appgwfip"), - // Name: to.Ptr("appgwfip"), - // Properties: &armnetwork.ApplicationGatewayFrontendIPConfigurationPropertiesFormat{ - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/appgwpip"), - // }, - // }, - // }}, - // FrontendPorts: []*armnetwork.ApplicationGatewayFrontendPort{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendPorts/appgwfp"), - // Name: to.Ptr("appgwfp"), - // Properties: &armnetwork.ApplicationGatewayFrontendPortPropertiesFormat{ - // Port: to.Ptr[int32](443), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendPorts/appgwfp80"), - // Name: to.Ptr("appgwfp80"), - // Properties: &armnetwork.ApplicationGatewayFrontendPortPropertiesFormat{ - // Port: to.Ptr[int32](80), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // GatewayIPConfigurations: []*armnetwork.ApplicationGatewayIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/gatewayIPConfigurations/appgwipc"), - // Name: to.Ptr("appgwipc"), - // Properties: &armnetwork.ApplicationGatewayIPConfigurationPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/virtualNetwork1/subnets/appgwsubnet"), - // }, - // }, - // }}, - // GlobalConfiguration: &armnetwork.ApplicationGatewayGlobalConfiguration{ - // EnableRequestBuffering: to.Ptr(true), - // EnableResponseBuffering: to.Ptr(true), - // }, - // HTTPListeners: []*armnetwork.ApplicationGatewayHTTPListener{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/httpListeners/appgwhl"), - // Name: to.Ptr("appgwhl"), - // Properties: &armnetwork.ApplicationGatewayHTTPListenerPropertiesFormat{ - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendIPConfigurations/appgwfip"), - // }, - // FrontendPort: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendPorts/appgwfp"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RequireServerNameIndication: to.Ptr(false), - // SSLCertificate: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/sslCertificates/sslcert"), - // }, - // SSLProfile: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/sslProfiles/sslProfile1"), - // }, - // Protocol: to.Ptr(armnetwork.ApplicationGatewayProtocolHTTPS), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/httpListeners/appgwhttplistener"), - // Name: to.Ptr("appgwhttplistener"), - // Properties: &armnetwork.ApplicationGatewayHTTPListenerPropertiesFormat{ - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendIPConfigurations/appgwfip"), - // }, - // FrontendPort: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendPorts/appgwfp80"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.ApplicationGatewayProtocolHTTP), - // }, - // }}, - // Listeners: []*armnetwork.ApplicationGatewayListener{ - // }, - // LoadDistributionPolicies: []*armnetwork.ApplicationGatewayLoadDistributionPolicy{ - // }, - // OperationalState: to.Ptr(armnetwork.ApplicationGatewayOperationalStateRunning), - // PrivateEndpointConnections: []*armnetwork.ApplicationGatewayPrivateEndpointConnection{ - // }, - // Probes: []*armnetwork.ApplicationGatewayProbe{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RedirectConfigurations: []*armnetwork.ApplicationGatewayRedirectConfiguration{ - // }, - // RequestRoutingRules: []*armnetwork.ApplicationGatewayRequestRoutingRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/requestRoutingRules/appgwrule"), - // Name: to.Ptr("appgwrule"), - // Properties: &armnetwork.ApplicationGatewayRequestRoutingRulePropertiesFormat{ - // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool"), - // }, - // BackendHTTPSettings: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/appgwbhs"), - // }, - // HTTPListener: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/httpListeners/appgwhl"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RewriteRuleSet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/rewriteRuleSets/rewriteRuleSet1"), - // }, - // RuleType: to.Ptr(armnetwork.ApplicationGatewayRequestRoutingRuleTypeBasic), - // }, - // }}, - // RewriteRuleSets: []*armnetwork.ApplicationGatewayRewriteRuleSet{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/rewriteRuleSets/rewriteRuleSet1"), - // Name: to.Ptr("rewriteRuleSet1"), - // Properties: &armnetwork.ApplicationGatewayRewriteRuleSetPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RewriteRules: []*armnetwork.ApplicationGatewayRewriteRule{ - // { - // Name: to.Ptr("Set X-Forwarded-For"), - // ActionSet: &armnetwork.ApplicationGatewayRewriteRuleActionSet{ - // RequestHeaderConfigurations: []*armnetwork.ApplicationGatewayHeaderConfiguration{ - // { - // HeaderName: to.Ptr("X-Forwarded-For"), - // HeaderValue: to.Ptr("{var_remote-addr}"), - // }}, - // ResponseHeaderConfigurations: []*armnetwork.ApplicationGatewayHeaderConfiguration{ - // { - // HeaderName: to.Ptr("Strict-Transport-Security"), - // HeaderValue: to.Ptr("max-age=31536000"), - // }}, - // URLConfiguration: &armnetwork.ApplicationGatewayURLConfiguration{ - // ModifiedPath: to.Ptr("/abc"), - // ModifiedQueryString: to.Ptr("x=y&a=b"), - // }, - // }, - // Conditions: []*armnetwork.ApplicationGatewayRewriteRuleCondition{ - // { - // IgnoreCase: to.Ptr(true), - // Negate: to.Ptr(false), - // Pattern: to.Ptr("^Bearer"), - // Variable: to.Ptr("http_req_Authorization"), - // }}, - // RuleSequence: to.Ptr[int32](102), - // }}, - // }, - // }}, - // RoutingRules: []*armnetwork.ApplicationGatewayRoutingRule{ - // }, - // SKU: &armnetwork.ApplicationGatewaySKU{ - // Name: to.Ptr(armnetwork.ApplicationGatewaySKUNameStandardMedium), - // Capacity: to.Ptr[int32](3), - // Tier: to.Ptr(armnetwork.ApplicationGatewayTierStandard), - // }, - // SSLCertificates: []*armnetwork.ApplicationGatewaySSLCertificate{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/sslCertificates/sslcert"), - // Name: to.Ptr("sslcert"), - // Properties: &armnetwork.ApplicationGatewaySSLCertificatePropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicCertData: to.Ptr("*****"), - // }, - // }}, - // SSLProfiles: []*armnetwork.ApplicationGatewaySSLProfile{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/sslProfiles/sslProfile1"), - // Name: to.Ptr("sslProfile1"), - // Properties: &armnetwork.ApplicationGatewaySSLProfilePropertiesFormat{ - // ClientAuthConfiguration: &armnetwork.ApplicationGatewayClientAuthConfiguration{ - // VerifyClientCertIssuerDN: to.Ptr(true), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SSLPolicy: &armnetwork.ApplicationGatewaySSLPolicy{ - // CipherSuites: []*armnetwork.ApplicationGatewaySSLCipherSuite{ - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128CBCSHA256)}, - // MinProtocolVersion: to.Ptr(armnetwork.ApplicationGatewaySSLProtocolTLSv11), - // PolicyType: to.Ptr(armnetwork.ApplicationGatewaySSLPolicyTypeCustom), - // }, - // TrustedClientCertificates: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/trustedClientCertificates/clientcert"), - // }}, - // }, - // }}, - // TrustedClientCertificates: []*armnetwork.ApplicationGatewayTrustedClientCertificate{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/trustedClientCertificates/clientcert"), - // Name: to.Ptr("clientcert"), - // Properties: &armnetwork.ApplicationGatewayTrustedClientCertificatePropertiesFormat{ - // Data: to.Ptr("****"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // URLPathMaps: []*armnetwork.ApplicationGatewayURLPathMap{ - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ApplicationGatewayUpdateTags.json -func ExampleApplicationGatewaysClient_UpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApplicationGatewaysClient().UpdateTags(ctx, "rg1", "AppGw", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ApplicationGateway = armnetwork.ApplicationGateway{ - // Name: to.Ptr("AppGw"), - // Type: to.Ptr("Microsoft.Network/applicationGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/AppGw"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armnetwork.ApplicationGatewayPropertiesFormat{ - // AuthenticationCertificates: []*armnetwork.ApplicationGatewayAuthenticationCertificate{ - // }, - // BackendAddressPools: []*armnetwork.ApplicationGatewayBackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/AppGw/backendAddressPools/Pool01"), - // Name: to.Ptr("Pool01"), - // Properties: &armnetwork.ApplicationGatewayBackendAddressPoolPropertiesFormat{ - // BackendAddresses: []*armnetwork.ApplicationGatewayBackendAddress{ - // { - // IPAddress: to.Ptr("10.10.10.1"), - // }, - // { - // IPAddress: to.Ptr("10.10.10.2"), - // }, - // { - // IPAddress: to.Ptr("10.10.10.3"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // BackendHTTPSettingsCollection: []*armnetwork.ApplicationGatewayBackendHTTPSettings{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/AppGw/backendHttpSettingsCollection/PoolSetting01"), - // Name: to.Ptr("PoolSetting01"), - // Properties: &armnetwork.ApplicationGatewayBackendHTTPSettingsPropertiesFormat{ - // CookieBasedAffinity: to.Ptr(armnetwork.ApplicationGatewayCookieBasedAffinityDisabled), - // PickHostNameFromBackendAddress: to.Ptr(false), - // Port: to.Ptr[int32](80), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RequestTimeout: to.Ptr[int32](30), - // Protocol: to.Ptr(armnetwork.ApplicationGatewayProtocolHTTP), - // }, - // }}, - // FrontendIPConfigurations: []*armnetwork.ApplicationGatewayFrontendIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/AppGw/frontendIPConfigurations/FrontEndConfig01"), - // Name: to.Ptr("FrontEndConfig01"), - // Properties: &armnetwork.ApplicationGatewayFrontendIPConfigurationPropertiesFormat{ - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/publicIp1"), - // }, - // }, - // }}, - // FrontendPorts: []*armnetwork.ApplicationGatewayFrontendPort{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/AppGw/frontendPorts/FrontEndPort01"), - // Name: to.Ptr("FrontEndPort01"), - // Properties: &armnetwork.ApplicationGatewayFrontendPortPropertiesFormat{ - // Port: to.Ptr[int32](80), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // GatewayIPConfigurations: []*armnetwork.ApplicationGatewayIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/AppGw/gatewayIPConfigurations/GatewayIp01"), - // Name: to.Ptr("GatewayIp01"), - // Properties: &armnetwork.ApplicationGatewayIPConfigurationPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet/subnets/subnet1"), - // }, - // }, - // }}, - // HTTPListeners: []*armnetwork.ApplicationGatewayHTTPListener{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/AppGw/httpListeners/listener1"), - // Name: to.Ptr("listener1"), - // Properties: &armnetwork.ApplicationGatewayHTTPListenerPropertiesFormat{ - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/AppGw/frontendIPConfigurations/FrontEndConfig01"), - // }, - // FrontendPort: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/AppGw/frontendPorts/FrontEndPort01"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RequireServerNameIndication: to.Ptr(false), - // Protocol: to.Ptr(armnetwork.ApplicationGatewayProtocolHTTP), - // }, - // }}, - // OperationalState: to.Ptr(armnetwork.ApplicationGatewayOperationalStateRunning), - // Probes: []*armnetwork.ApplicationGatewayProbe{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RedirectConfigurations: []*armnetwork.ApplicationGatewayRedirectConfiguration{ - // }, - // RequestRoutingRules: []*armnetwork.ApplicationGatewayRequestRoutingRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/AppGw/requestRoutingRules/Rule01"), - // Name: to.Ptr("Rule01"), - // Properties: &armnetwork.ApplicationGatewayRequestRoutingRulePropertiesFormat{ - // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/AppGw/backendAddressPools/Pool01"), - // }, - // BackendHTTPSettings: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/AppGw/backendHttpSettingsCollection/PoolSetting01"), - // }, - // HTTPListener: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/AppGw/httpListeners/listener1"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RuleType: to.Ptr(armnetwork.ApplicationGatewayRequestRoutingRuleTypeBasic), - // }, - // }}, - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // SKU: &armnetwork.ApplicationGatewaySKU{ - // Name: to.Ptr(armnetwork.ApplicationGatewaySKUNameStandardSmall), - // Capacity: to.Ptr[int32](2), - // Tier: to.Ptr(armnetwork.ApplicationGatewayTierStandard), - // }, - // SSLCertificates: []*armnetwork.ApplicationGatewaySSLCertificate{ - // }, - // URLPathMaps: []*armnetwork.ApplicationGatewayURLPathMap{ - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ApplicationGatewayList.json -func ExampleApplicationGatewaysClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewApplicationGatewaysClient().NewListPager("rg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ApplicationGatewayListResult = armnetwork.ApplicationGatewayListResult{ - // Value: []*armnetwork.ApplicationGateway{ - // { - // Name: to.Ptr("appgw"), - // Type: to.Ptr("Microsoft.Network/applicationGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw"), - // Location: to.Ptr("southcentralus"), - // Properties: &armnetwork.ApplicationGatewayPropertiesFormat{ - // AuthenticationCertificates: []*armnetwork.ApplicationGatewayAuthenticationCertificate{ - // }, - // BackendAddressPools: []*armnetwork.ApplicationGatewayBackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool"), - // Name: to.Ptr("appgwpool"), - // Properties: &armnetwork.ApplicationGatewayBackendAddressPoolPropertiesFormat{ - // BackendAddresses: []*armnetwork.ApplicationGatewayBackendAddress{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool1"), - // Name: to.Ptr("appgwpool1"), - // Properties: &armnetwork.ApplicationGatewayBackendAddressPoolPropertiesFormat{ - // BackendAddresses: []*armnetwork.ApplicationGatewayBackendAddress{ - // { - // }, - // { - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // BackendHTTPSettingsCollection: []*armnetwork.ApplicationGatewayBackendHTTPSettings{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/appgwbhs"), - // Name: to.Ptr("appgwbhs"), - // Properties: &armnetwork.ApplicationGatewayBackendHTTPSettingsPropertiesFormat{ - // CookieBasedAffinity: to.Ptr(armnetwork.ApplicationGatewayCookieBasedAffinityDisabled), - // Port: to.Ptr[int32](80), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RequestTimeout: to.Ptr[int32](30), - // Protocol: to.Ptr(armnetwork.ApplicationGatewayProtocolHTTP), - // }, - // }}, - // FrontendIPConfigurations: []*armnetwork.ApplicationGatewayFrontendIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendIPConfigurations/appgwfip"), - // Name: to.Ptr("appgwfip"), - // Properties: &armnetwork.ApplicationGatewayFrontendIPConfigurationPropertiesFormat{ - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/appgwpip"), - // }, - // }, - // }}, - // FrontendPorts: []*armnetwork.ApplicationGatewayFrontendPort{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendPorts/appgwfp"), - // Name: to.Ptr("appgwfp"), - // Properties: &armnetwork.ApplicationGatewayFrontendPortPropertiesFormat{ - // Port: to.Ptr[int32](443), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendPorts/appgwfp80"), - // Name: to.Ptr("appgwfp80"), - // Properties: &armnetwork.ApplicationGatewayFrontendPortPropertiesFormat{ - // Port: to.Ptr[int32](80), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // GatewayIPConfigurations: []*armnetwork.ApplicationGatewayIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/gatewayIPConfigurations/appgwipc"), - // Name: to.Ptr("appgwipc"), - // Properties: &armnetwork.ApplicationGatewayIPConfigurationPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/virtualNetwork1/subnets/appgwsubnet"), - // }, - // }, - // }}, - // GlobalConfiguration: &armnetwork.ApplicationGatewayGlobalConfiguration{ - // EnableRequestBuffering: to.Ptr(true), - // EnableResponseBuffering: to.Ptr(true), - // }, - // HTTPListeners: []*armnetwork.ApplicationGatewayHTTPListener{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/httpListeners/appgwhl"), - // Name: to.Ptr("appgwhl"), - // Properties: &armnetwork.ApplicationGatewayHTTPListenerPropertiesFormat{ - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendIPConfigurations/appgwfip"), - // }, - // FrontendPort: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendPorts/appgwfp"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RequireServerNameIndication: to.Ptr(false), - // SSLCertificate: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/sslCertificates/sslcert"), - // }, - // SSLProfile: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/sslProfiles/sslProfile1"), - // }, - // Protocol: to.Ptr(armnetwork.ApplicationGatewayProtocolHTTPS), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/httpListeners/appgwhttplistener"), - // Name: to.Ptr("appgwhttplistener"), - // Properties: &armnetwork.ApplicationGatewayHTTPListenerPropertiesFormat{ - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendIPConfigurations/appgwfip"), - // }, - // FrontendPort: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendPorts/appgwfp80"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.ApplicationGatewayProtocolHTTP), - // }, - // }}, - // LoadDistributionPolicies: []*armnetwork.ApplicationGatewayLoadDistributionPolicy{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1"), - // Name: to.Ptr("ldp1"), - // Properties: &armnetwork.ApplicationGatewayLoadDistributionPolicyPropertiesFormat{ - // LoadDistributionAlgorithm: to.Ptr(armnetwork.ApplicationGatewayLoadDistributionAlgorithmRoundRobin), - // LoadDistributionTargets: []*armnetwork.ApplicationGatewayLoadDistributionTarget{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1/loadDistributionTargets/ldt1"), - // Name: to.Ptr("ld11"), - // Properties: &armnetwork.ApplicationGatewayLoadDistributionTargetPropertiesFormat{ - // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool"), - // }, - // WeightPerServer: to.Ptr[int32](40), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1/loadDistributionTargets/ldt1"), - // Name: to.Ptr("ld11"), - // Properties: &armnetwork.ApplicationGatewayLoadDistributionTargetPropertiesFormat{ - // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool1"), - // }, - // WeightPerServer: to.Ptr[int32](60), - // }, - // }}, - // }, - // }}, - // OperationalState: to.Ptr(armnetwork.ApplicationGatewayOperationalStateRunning), - // PrivateEndpointConnections: []*armnetwork.ApplicationGatewayPrivateEndpointConnection{ - // }, - // PrivateLinkConfigurations: []*armnetwork.ApplicationGatewayPrivateLinkConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/privateLinkConfigurations/privateLink1"), - // Name: to.Ptr("privateLink1"), - // Properties: &armnetwork.ApplicationGatewayPrivateLinkConfigurationProperties{ - // IPConfigurations: []*armnetwork.ApplicationGatewayPrivateLinkIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/privateLinkConfigurations/privateLink1/privateLinkConfigurations/privateLink1/ipConfigurations/natNicIpconfig1"), - // Name: to.Ptr("natNicIpconfig1"), - // Properties: &armnetwork.ApplicationGatewayPrivateLinkIPConfigurationProperties{ - // Primary: to.Ptr(true), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/virtualNetwork1/subnets/appgwsubnet"), - // }, - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/privateLinkConfigurations/privateLink1/privateLinkConfigurations/privateLink1/ipConfigurations/natNicIpconfig2"), - // Name: to.Ptr("natNicIpconfig2"), - // Properties: &armnetwork.ApplicationGatewayPrivateLinkIPConfigurationProperties{ - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/virtualNetwork1/subnets/appgwsubnet"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // Probes: []*armnetwork.ApplicationGatewayProbe{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RequestRoutingRules: []*armnetwork.ApplicationGatewayRequestRoutingRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/requestRoutingRules/appgwrule"), - // Name: to.Ptr("appgwrule"), - // Properties: &armnetwork.ApplicationGatewayRequestRoutingRulePropertiesFormat{ - // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool"), - // }, - // BackendHTTPSettings: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/appgwbhs"), - // }, - // HTTPListener: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/httpListeners/appgwhl"), - // }, - // LoadDistributionPolicy: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1"), - // }, - // Priority: to.Ptr[int32](10), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RewriteRuleSet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/rewriteRuleSets/rewriteRuleSet1"), - // }, - // RuleType: to.Ptr(armnetwork.ApplicationGatewayRequestRoutingRuleTypeBasic), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/requestRoutingRules/appgwPathBasedRule"), - // Name: to.Ptr("appgwPathBasedRule"), - // Properties: &armnetwork.ApplicationGatewayRequestRoutingRulePropertiesFormat{ - // HTTPListener: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/httpListeners/appgwhttplistener"), - // }, - // Priority: to.Ptr[int32](20), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RuleType: to.Ptr(armnetwork.ApplicationGatewayRequestRoutingRuleTypePathBasedRouting), - // URLPathMap: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/urlPathMaps/pathMap1"), - // }, - // }, - // }}, - // RewriteRuleSets: []*armnetwork.ApplicationGatewayRewriteRuleSet{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/rewriteRuleSets/rewriteRuleSet1"), - // Name: to.Ptr("rewriteRuleSet1"), - // Properties: &armnetwork.ApplicationGatewayRewriteRuleSetPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RewriteRules: []*armnetwork.ApplicationGatewayRewriteRule{ - // { - // Name: to.Ptr("Set X-Forwarded-For"), - // ActionSet: &armnetwork.ApplicationGatewayRewriteRuleActionSet{ - // RequestHeaderConfigurations: []*armnetwork.ApplicationGatewayHeaderConfiguration{ - // { - // HeaderName: to.Ptr("X-Forwarded-For"), - // HeaderValue: to.Ptr("{var_remote-addr}"), - // }}, - // ResponseHeaderConfigurations: []*armnetwork.ApplicationGatewayHeaderConfiguration{ - // { - // HeaderName: to.Ptr("Strict-Transport-Security"), - // HeaderValue: to.Ptr("max-age=31536000"), - // }}, - // URLConfiguration: &armnetwork.ApplicationGatewayURLConfiguration{ - // ModifiedPath: to.Ptr("/abc"), - // ModifiedQueryString: to.Ptr("x=y&a=b"), - // Reroute: to.Ptr(false), - // }, - // }, - // Conditions: []*armnetwork.ApplicationGatewayRewriteRuleCondition{ - // { - // IgnoreCase: to.Ptr(true), - // Negate: to.Ptr(false), - // Pattern: to.Ptr("^Bearer"), - // Variable: to.Ptr("http_req_Authorization"), - // }}, - // RuleSequence: to.Ptr[int32](102), - // }}, - // }, - // }}, - // SKU: &armnetwork.ApplicationGatewaySKU{ - // Name: to.Ptr(armnetwork.ApplicationGatewaySKUNameStandardMedium), - // Capacity: to.Ptr[int32](3), - // Tier: to.Ptr(armnetwork.ApplicationGatewayTierStandard), - // }, - // SSLCertificates: []*armnetwork.ApplicationGatewaySSLCertificate{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/sslCertificates/sslcert"), - // Name: to.Ptr("sslcert"), - // Properties: &armnetwork.ApplicationGatewaySSLCertificatePropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicCertData: to.Ptr("*****"), - // }, - // }}, - // SSLProfiles: []*armnetwork.ApplicationGatewaySSLProfile{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/sslProfiles/sslProfile1"), - // Name: to.Ptr("sslProfile1"), - // Properties: &armnetwork.ApplicationGatewaySSLProfilePropertiesFormat{ - // ClientAuthConfiguration: &armnetwork.ApplicationGatewayClientAuthConfiguration{ - // VerifyClientCertIssuerDN: to.Ptr(true), - // VerifyClientRevocation: to.Ptr(armnetwork.ApplicationGatewayClientRevocationOptionsOCSP), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SSLPolicy: &armnetwork.ApplicationGatewaySSLPolicy{ - // CipherSuites: []*armnetwork.ApplicationGatewaySSLCipherSuite{ - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128CBCSHA256)}, - // MinProtocolVersion: to.Ptr(armnetwork.ApplicationGatewaySSLProtocolTLSv11), - // PolicyType: to.Ptr(armnetwork.ApplicationGatewaySSLPolicyTypeCustom), - // }, - // TrustedClientCertificates: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/trustedClientCertificates/clientcert"), - // }}, - // }, - // }}, - // TrustedClientCertificates: []*armnetwork.ApplicationGatewayTrustedClientCertificate{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/trustedClientCertificates/clientcert"), - // Name: to.Ptr("clientcert"), - // Properties: &armnetwork.ApplicationGatewayTrustedClientCertificatePropertiesFormat{ - // ClientCertIssuerDN: to.Ptr("CN=User1, OU=Eng, O=Company Ltd, L=D4, S=Arizona, C=US"), - // Data: to.Ptr("****"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ValidatedCertData: to.Ptr("****"), - // }, - // }}, - // URLPathMaps: []*armnetwork.ApplicationGatewayURLPathMap{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/urlPathMaps/pathMap1"), - // Name: to.Ptr("pathMap1"), - // Properties: &armnetwork.ApplicationGatewayURLPathMapPropertiesFormat{ - // DefaultBackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool"), - // }, - // DefaultBackendHTTPSettings: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/appgwbhs"), - // }, - // DefaultLoadDistributionPolicy: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1"), - // }, - // DefaultRewriteRuleSet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/rewriteRuleSets/rewriteRuleSet1"), - // }, - // PathRules: []*armnetwork.ApplicationGatewayPathRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/urlPathMaps/pathMap1/pathRules/apiPaths"), - // Name: to.Ptr("apiPaths"), - // Properties: &armnetwork.ApplicationGatewayPathRulePropertiesFormat{ - // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool"), - // }, - // BackendHTTPSettings: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/appgwbhs"), - // }, - // LoadDistributionPolicy: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1"), - // }, - // Paths: []*string{ - // to.Ptr("/api"), - // to.Ptr("/v1/api")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RewriteRuleSet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/rewriteRuleSets/rewriteRuleSet1"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ApplicationGatewayListAll.json -func ExampleApplicationGatewaysClient_NewListAllPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewApplicationGatewaysClient().NewListAllPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ApplicationGatewayListResult = armnetwork.ApplicationGatewayListResult{ - // Value: []*armnetwork.ApplicationGateway{ - // { - // Name: to.Ptr("appgw"), - // Type: to.Ptr("Microsoft.Network/applicationGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw"), - // Location: to.Ptr("southcentralus"), - // Properties: &armnetwork.ApplicationGatewayPropertiesFormat{ - // AuthenticationCertificates: []*armnetwork.ApplicationGatewayAuthenticationCertificate{ - // }, - // BackendAddressPools: []*armnetwork.ApplicationGatewayBackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool"), - // Name: to.Ptr("appgwpool"), - // Properties: &armnetwork.ApplicationGatewayBackendAddressPoolPropertiesFormat{ - // BackendAddresses: []*armnetwork.ApplicationGatewayBackendAddress{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool1"), - // Name: to.Ptr("appgwpool1"), - // Properties: &armnetwork.ApplicationGatewayBackendAddressPoolPropertiesFormat{ - // BackendAddresses: []*armnetwork.ApplicationGatewayBackendAddress{ - // { - // }, - // { - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // BackendHTTPSettingsCollection: []*armnetwork.ApplicationGatewayBackendHTTPSettings{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/appgwbhs"), - // Name: to.Ptr("appgwbhs"), - // Properties: &armnetwork.ApplicationGatewayBackendHTTPSettingsPropertiesFormat{ - // CookieBasedAffinity: to.Ptr(armnetwork.ApplicationGatewayCookieBasedAffinityDisabled), - // Port: to.Ptr[int32](80), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RequestTimeout: to.Ptr[int32](30), - // Protocol: to.Ptr(armnetwork.ApplicationGatewayProtocolHTTP), - // }, - // }}, - // FrontendIPConfigurations: []*armnetwork.ApplicationGatewayFrontendIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendIPConfigurations/appgwfip"), - // Name: to.Ptr("appgwfip"), - // Properties: &armnetwork.ApplicationGatewayFrontendIPConfigurationPropertiesFormat{ - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/appgwpip"), - // }, - // }, - // }}, - // FrontendPorts: []*armnetwork.ApplicationGatewayFrontendPort{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendPorts/appgwfp"), - // Name: to.Ptr("appgwfp"), - // Properties: &armnetwork.ApplicationGatewayFrontendPortPropertiesFormat{ - // Port: to.Ptr[int32](443), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendPorts/appgwfp80"), - // Name: to.Ptr("appgwfp80"), - // Properties: &armnetwork.ApplicationGatewayFrontendPortPropertiesFormat{ - // Port: to.Ptr[int32](80), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // GatewayIPConfigurations: []*armnetwork.ApplicationGatewayIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/gatewayIPConfigurations/appgwipc"), - // Name: to.Ptr("appgwipc"), - // Properties: &armnetwork.ApplicationGatewayIPConfigurationPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/virtualNetwork1/subnets/appgwsubnet"), - // }, - // }, - // }}, - // GlobalConfiguration: &armnetwork.ApplicationGatewayGlobalConfiguration{ - // EnableRequestBuffering: to.Ptr(true), - // EnableResponseBuffering: to.Ptr(true), - // }, - // HTTPListeners: []*armnetwork.ApplicationGatewayHTTPListener{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/httpListeners/appgwhl"), - // Name: to.Ptr("appgwhl"), - // Properties: &armnetwork.ApplicationGatewayHTTPListenerPropertiesFormat{ - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendIPConfigurations/appgwfip"), - // }, - // FrontendPort: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendPorts/appgwfp"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RequireServerNameIndication: to.Ptr(false), - // SSLCertificate: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/sslCertificates/sslcert"), - // }, - // SSLProfile: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/sslProfiles/sslProfile1"), - // }, - // Protocol: to.Ptr(armnetwork.ApplicationGatewayProtocolHTTPS), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/httpListeners/appgwhttplistener"), - // Name: to.Ptr("appgwhttplistener"), - // Properties: &armnetwork.ApplicationGatewayHTTPListenerPropertiesFormat{ - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendIPConfigurations/appgwfip"), - // }, - // FrontendPort: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendPorts/appgwfp80"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.ApplicationGatewayProtocolHTTP), - // }, - // }}, - // LoadDistributionPolicies: []*armnetwork.ApplicationGatewayLoadDistributionPolicy{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1"), - // Name: to.Ptr("ldp1"), - // Properties: &armnetwork.ApplicationGatewayLoadDistributionPolicyPropertiesFormat{ - // LoadDistributionAlgorithm: to.Ptr(armnetwork.ApplicationGatewayLoadDistributionAlgorithmRoundRobin), - // LoadDistributionTargets: []*armnetwork.ApplicationGatewayLoadDistributionTarget{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1/loadDistributionTargets/ldt1"), - // Name: to.Ptr("ld11"), - // Properties: &armnetwork.ApplicationGatewayLoadDistributionTargetPropertiesFormat{ - // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool"), - // }, - // WeightPerServer: to.Ptr[int32](40), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1/loadDistributionTargets/ldt1"), - // Name: to.Ptr("ld11"), - // Properties: &armnetwork.ApplicationGatewayLoadDistributionTargetPropertiesFormat{ - // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool1"), - // }, - // WeightPerServer: to.Ptr[int32](60), - // }, - // }}, - // }, - // }}, - // OperationalState: to.Ptr(armnetwork.ApplicationGatewayOperationalStateRunning), - // PrivateEndpointConnections: []*armnetwork.ApplicationGatewayPrivateEndpointConnection{ - // }, - // PrivateLinkConfigurations: []*armnetwork.ApplicationGatewayPrivateLinkConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/privateLinkConfigurations/privateLink1"), - // Name: to.Ptr("privateLink1"), - // Properties: &armnetwork.ApplicationGatewayPrivateLinkConfigurationProperties{ - // IPConfigurations: []*armnetwork.ApplicationGatewayPrivateLinkIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/privateLinkConfigurations/privateLink1/privateLinkConfigurations/privateLink1/ipConfigurations/natNicIpconfig1"), - // Name: to.Ptr("natNicIpconfig1"), - // Properties: &armnetwork.ApplicationGatewayPrivateLinkIPConfigurationProperties{ - // Primary: to.Ptr(true), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/virtualNetwork1/subnets/appgwsubnet"), - // }, - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/privateLinkConfigurations/privateLink1/privateLinkConfigurations/privateLink1/ipConfigurations/natNicIpconfig2"), - // Name: to.Ptr("natNicIpconfig2"), - // Properties: &armnetwork.ApplicationGatewayPrivateLinkIPConfigurationProperties{ - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/virtualNetwork1/subnets/appgwsubnet"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // Probes: []*armnetwork.ApplicationGatewayProbe{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RequestRoutingRules: []*armnetwork.ApplicationGatewayRequestRoutingRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/requestRoutingRules/appgwrule"), - // Name: to.Ptr("appgwrule"), - // Properties: &armnetwork.ApplicationGatewayRequestRoutingRulePropertiesFormat{ - // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool"), - // }, - // BackendHTTPSettings: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/appgwbhs"), - // }, - // HTTPListener: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/httpListeners/appgwhl"), - // }, - // LoadDistributionPolicy: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1"), - // }, - // Priority: to.Ptr[int32](10), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RewriteRuleSet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/rewriteRuleSets/rewriteRuleSet1"), - // }, - // RuleType: to.Ptr(armnetwork.ApplicationGatewayRequestRoutingRuleTypeBasic), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/requestRoutingRules/appgwPathBasedRule"), - // Name: to.Ptr("appgwPathBasedRule"), - // Properties: &armnetwork.ApplicationGatewayRequestRoutingRulePropertiesFormat{ - // HTTPListener: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/httpListeners/appgwhttplistener"), - // }, - // Priority: to.Ptr[int32](20), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RuleType: to.Ptr(armnetwork.ApplicationGatewayRequestRoutingRuleTypePathBasedRouting), - // URLPathMap: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/urlPathMaps/pathMap1"), - // }, - // }, - // }}, - // RewriteRuleSets: []*armnetwork.ApplicationGatewayRewriteRuleSet{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/rewriteRuleSets/rewriteRuleSet1"), - // Name: to.Ptr("rewriteRuleSet1"), - // Properties: &armnetwork.ApplicationGatewayRewriteRuleSetPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RewriteRules: []*armnetwork.ApplicationGatewayRewriteRule{ - // { - // Name: to.Ptr("Set X-Forwarded-For"), - // ActionSet: &armnetwork.ApplicationGatewayRewriteRuleActionSet{ - // RequestHeaderConfigurations: []*armnetwork.ApplicationGatewayHeaderConfiguration{ - // { - // HeaderName: to.Ptr("X-Forwarded-For"), - // HeaderValue: to.Ptr("{var_remote-addr}"), - // }}, - // ResponseHeaderConfigurations: []*armnetwork.ApplicationGatewayHeaderConfiguration{ - // { - // HeaderName: to.Ptr("Strict-Transport-Security"), - // HeaderValue: to.Ptr("max-age=31536000"), - // }}, - // URLConfiguration: &armnetwork.ApplicationGatewayURLConfiguration{ - // ModifiedPath: to.Ptr("/abc"), - // ModifiedQueryString: to.Ptr("x=y&a=b"), - // Reroute: to.Ptr(false), - // }, - // }, - // Conditions: []*armnetwork.ApplicationGatewayRewriteRuleCondition{ - // { - // IgnoreCase: to.Ptr(true), - // Negate: to.Ptr(false), - // Pattern: to.Ptr("^Bearer"), - // Variable: to.Ptr("http_req_Authorization"), - // }}, - // RuleSequence: to.Ptr[int32](102), - // }}, - // }, - // }}, - // SKU: &armnetwork.ApplicationGatewaySKU{ - // Name: to.Ptr(armnetwork.ApplicationGatewaySKUNameStandardMedium), - // Capacity: to.Ptr[int32](3), - // Tier: to.Ptr(armnetwork.ApplicationGatewayTierStandard), - // }, - // SSLCertificates: []*armnetwork.ApplicationGatewaySSLCertificate{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/sslCertificates/sslcert"), - // Name: to.Ptr("sslcert"), - // Properties: &armnetwork.ApplicationGatewaySSLCertificatePropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicCertData: to.Ptr("*****"), - // }, - // }}, - // SSLProfiles: []*armnetwork.ApplicationGatewaySSLProfile{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/sslProfiles/sslProfile1"), - // Name: to.Ptr("sslProfile1"), - // Properties: &armnetwork.ApplicationGatewaySSLProfilePropertiesFormat{ - // ClientAuthConfiguration: &armnetwork.ApplicationGatewayClientAuthConfiguration{ - // VerifyClientCertIssuerDN: to.Ptr(true), - // VerifyClientRevocation: to.Ptr(armnetwork.ApplicationGatewayClientRevocationOptionsOCSP), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SSLPolicy: &armnetwork.ApplicationGatewaySSLPolicy{ - // CipherSuites: []*armnetwork.ApplicationGatewaySSLCipherSuite{ - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128CBCSHA256)}, - // MinProtocolVersion: to.Ptr(armnetwork.ApplicationGatewaySSLProtocolTLSv11), - // PolicyType: to.Ptr(armnetwork.ApplicationGatewaySSLPolicyTypeCustom), - // }, - // TrustedClientCertificates: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/trustedClientCertificates/clientcert"), - // }}, - // }, - // }}, - // TrustedClientCertificates: []*armnetwork.ApplicationGatewayTrustedClientCertificate{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/trustedClientCertificates/clientcert"), - // Name: to.Ptr("clientcert"), - // Properties: &armnetwork.ApplicationGatewayTrustedClientCertificatePropertiesFormat{ - // ClientCertIssuerDN: to.Ptr("CN=User1, OU=Eng, O=Company Ltd, L=D4, S=Arizona, C=US"), - // Data: to.Ptr("****"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ValidatedCertData: to.Ptr("****"), - // }, - // }}, - // URLPathMaps: []*armnetwork.ApplicationGatewayURLPathMap{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/urlPathMaps/pathMap1"), - // Name: to.Ptr("pathMap1"), - // Properties: &armnetwork.ApplicationGatewayURLPathMapPropertiesFormat{ - // DefaultBackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool"), - // }, - // DefaultBackendHTTPSettings: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/appgwbhs"), - // }, - // DefaultLoadDistributionPolicy: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1"), - // }, - // DefaultRewriteRuleSet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/rewriteRuleSets/rewriteRuleSet1"), - // }, - // PathRules: []*armnetwork.ApplicationGatewayPathRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/urlPathMaps/pathMap1/pathRules/apiPaths"), - // Name: to.Ptr("apiPaths"), - // Properties: &armnetwork.ApplicationGatewayPathRulePropertiesFormat{ - // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool"), - // }, - // BackendHTTPSettings: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/appgwbhs"), - // }, - // LoadDistributionPolicy: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1"), - // }, - // Paths: []*string{ - // to.Ptr("/api"), - // to.Ptr("/v1/api")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RewriteRuleSet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/rewriteRuleSets/rewriteRuleSet1"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ApplicationGatewayStart.json -func ExampleApplicationGatewaysClient_BeginStart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewApplicationGatewaysClient().BeginStart(ctx, "rg1", "appgw", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ApplicationGatewayStop.json -func ExampleApplicationGatewaysClient_BeginStop() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewApplicationGatewaysClient().BeginStop(ctx, "rg1", "appgw", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ApplicationGatewayBackendHealthGet.json -func ExampleApplicationGatewaysClient_BeginBackendHealth() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewApplicationGatewaysClient().BeginBackendHealth(ctx, "appgw", "appgw", &armnetwork.ApplicationGatewaysClientBeginBackendHealthOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ApplicationGatewayBackendHealth = armnetwork.ApplicationGatewayBackendHealth{ - // BackendAddressPools: []*armnetwork.ApplicationGatewayBackendHealthPool{ - // { - // BackendAddressPool: &armnetwork.ApplicationGatewayBackendAddressPool{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendaddressPools/MFAnalyticsPool"), - // }, - // BackendHTTPSettingsCollection: []*armnetwork.ApplicationGatewayBackendHealthHTTPSettings{ - // { - // BackendHTTPSettings: &armnetwork.ApplicationGatewayBackendHTTPSettings{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/MFPoolSettings"), - // }, - // Servers: []*armnetwork.ApplicationGatewayBackendHealthServer{ - // { - // Address: to.Ptr("10.220.1.8"), - // Health: to.Ptr(armnetwork.ApplicationGatewayBackendHealthServerHealthUp), - // }}, - // }}, - // }, - // { - // BackendAddressPool: &armnetwork.ApplicationGatewayBackendAddressPool{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendaddressPools/MFPool"), - // }, - // BackendHTTPSettingsCollection: []*armnetwork.ApplicationGatewayBackendHealthHTTPSettings{ - // { - // BackendHTTPSettings: &armnetwork.ApplicationGatewayBackendHTTPSettings{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/MFPoolSettings"), - // }, - // Servers: []*armnetwork.ApplicationGatewayBackendHealthServer{ - // { - // Address: to.Ptr("10.220.1.4"), - // Health: to.Ptr(armnetwork.ApplicationGatewayBackendHealthServerHealthUp), - // }, - // { - // Address: to.Ptr("10.220.1.5"), - // Health: to.Ptr(armnetwork.ApplicationGatewayBackendHealthServerHealthUp), - // }}, - // }}, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ApplicationGatewayBackendHealthTest.json -func ExampleApplicationGatewaysClient_BeginBackendHealthOnDemand() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewApplicationGatewaysClient().BeginBackendHealthOnDemand(ctx, "rg1", "appgw", armnetwork.ApplicationGatewayOnDemandProbe{ - Path: to.Ptr("/"), - BackendAddressPool: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendaddressPools/MFAnalyticsPool"), - }, - BackendHTTPSettings: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/MFPoolSettings"), - }, - PickHostNameFromBackendHTTPSettings: to.Ptr(true), - Timeout: to.Ptr[int32](30), - Protocol: to.Ptr(armnetwork.ApplicationGatewayProtocolHTTP), - }, &armnetwork.ApplicationGatewaysClientBeginBackendHealthOnDemandOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ApplicationGatewayBackendHealthOnDemand = armnetwork.ApplicationGatewayBackendHealthOnDemand{ - // BackendAddressPool: &armnetwork.ApplicationGatewayBackendAddressPool{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendaddressPools/MFAnalyticsPool"), - // }, - // BackendHealthHTTPSettings: &armnetwork.ApplicationGatewayBackendHealthHTTPSettings{ - // BackendHTTPSettings: &armnetwork.ApplicationGatewayBackendHTTPSettings{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/MFPoolSettings"), - // }, - // Servers: []*armnetwork.ApplicationGatewayBackendHealthServer{ - // { - // Address: to.Ptr("10.220.1.4"), - // Health: to.Ptr(armnetwork.ApplicationGatewayBackendHealthServerHealthUp), - // }, - // { - // Address: to.Ptr("10.220.1.5"), - // Health: to.Ptr(armnetwork.ApplicationGatewayBackendHealthServerHealthUp), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ApplicationGatewayAvailableServerVariablesGet.json -func ExampleApplicationGatewaysClient_ListAvailableServerVariables() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApplicationGatewaysClient().ListAvailableServerVariables(ctx, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.StringArray = []*string{ - // to.Ptr("request_query")} -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ApplicationGatewayAvailableRequestHeadersGet.json -func ExampleApplicationGatewaysClient_ListAvailableRequestHeaders() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApplicationGatewaysClient().ListAvailableRequestHeaders(ctx, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.StringArray = []*string{ - // to.Ptr("Accept-Charset")} -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ApplicationGatewayAvailableResponseHeadersGet.json -func ExampleApplicationGatewaysClient_ListAvailableResponseHeaders() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApplicationGatewaysClient().ListAvailableResponseHeaders(ctx, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.StringArray = []*string{ - // to.Ptr("Access-Control-Allow-Origin")} -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ApplicationGatewayAvailableWafRuleSetsGet.json -func ExampleApplicationGatewaysClient_ListAvailableWafRuleSets() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApplicationGatewaysClient().ListAvailableWafRuleSets(ctx, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ApplicationGatewayAvailableWafRuleSetsResult = armnetwork.ApplicationGatewayAvailableWafRuleSetsResult{ - // Value: []*armnetwork.ApplicationGatewayFirewallRuleSet{ - // { - // Name: to.Ptr("OWASP_3.0"), - // Type: to.Ptr("Microsoft.Network/applicationGatewayAvailableWafRuleSets"), - // ID: to.Ptr("/subscriptions//resourceGroups//providers/Microsoft.Network/applicationGatewayAvailableWafRuleSets/"), - // Properties: &armnetwork.ApplicationGatewayFirewallRuleSetPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RuleGroups: []*armnetwork.ApplicationGatewayFirewallRuleGroup{ - // { - // Description: to.Ptr(""), - // RuleGroupName: to.Ptr("General"), - // Rules: []*armnetwork.ApplicationGatewayFirewallRule{ - // { - // Description: to.Ptr("Possible Multipart Unmatched Boundary."), - // RuleID: to.Ptr[int32](200004), - // RuleIDString: to.Ptr("200004"), - // }}, - // }}, - // RuleSetType: to.Ptr("OWASP"), - // RuleSetVersion: to.Ptr("3.0"), - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ApplicationGatewayAvailableSslOptionsGet.json -func ExampleApplicationGatewaysClient_ListAvailableSSLOptions() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApplicationGatewaysClient().ListAvailableSSLOptions(ctx, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ApplicationGatewayAvailableSSLOptions = armnetwork.ApplicationGatewayAvailableSSLOptions{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Network/ApplicationGatewayAvailableSslOptions"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups//providers/Microsoft.Network/ApplicationGatewayAvailableSslOptions/default"), - // Properties: &armnetwork.ApplicationGatewayAvailableSSLOptionsPropertiesFormat{ - // AvailableCipherSuites: []*armnetwork.ApplicationGatewaySSLCipherSuite{ - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES256GCMSHA384), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128GCMSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES256CBCSHA384), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128CBCSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES256CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHERSAWITHAES256GCMSHA384), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHERSAWITHAES128GCMSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHERSAWITHAES256CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHERSAWITHAES128CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES256GCMSHA384), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES128GCMSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES256CBCSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES128CBCSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES256CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES128CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES256GCMSHA384), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES128GCMSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES256CBCSHA384), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES128CBCSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES256CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES128CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITHAES256CBCSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITHAES128CBCSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITHAES256CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITHAES128CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITH3DESEDECBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITH3DESEDECBCSHA)}, - // AvailableProtocols: []*armnetwork.ApplicationGatewaySSLProtocol{ - // to.Ptr(armnetwork.ApplicationGatewaySSLProtocolTLSv10), - // to.Ptr(armnetwork.ApplicationGatewaySSLProtocolTLSv11), - // to.Ptr(armnetwork.ApplicationGatewaySSLProtocolTLSv12)}, - // DefaultPolicy: to.Ptr(armnetwork.ApplicationGatewaySSLPolicyNameAppGwSSLPolicy20150501), - // PredefinedPolicies: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups//providers/Microsoft.Network/ApplicationGatewayAvailableSslOptions/default/ApplicationGatewaySslPredefinedPolicy/AppGwSslPolicy20150501"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups//providers/Microsoft.Network/ApplicationGatewayAvailableSslOptions/default/ApplicationGatewaySslPredefinedPolicy/AppGwSslPolicy20170401"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups//providers/Microsoft.Network/ApplicationGatewayAvailableSslOptions/default/ApplicationGatewaySslPredefinedPolicy/AppGwSslPolicy20170401S"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ApplicationGatewayAvailableSslOptionsPredefinedPoliciesGet.json -func ExampleApplicationGatewaysClient_NewListAvailableSSLPredefinedPoliciesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewApplicationGatewaysClient().NewListAvailableSSLPredefinedPoliciesPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ApplicationGatewayAvailableSSLPredefinedPolicies = armnetwork.ApplicationGatewayAvailableSSLPredefinedPolicies{ - // Value: []*armnetwork.ApplicationGatewaySSLPredefinedPolicy{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups//providers/Microsoft.Network/ApplicationGatewayAvailableSslOptions/default/ApplicationGatewaySslPredefinedPolicy/AppGwSslPolicy20150501"), - // Name: to.Ptr("AppGwSslPolicy20150501"), - // Properties: &armnetwork.ApplicationGatewaySSLPredefinedPolicyPropertiesFormat{ - // CipherSuites: []*armnetwork.ApplicationGatewaySSLCipherSuite{ - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES256GCMSHA384), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128GCMSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES256CBCSHA384), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128CBCSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES256CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHERSAWITHAES256GCMSHA384), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHERSAWITHAES128GCMSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHERSAWITHAES256CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHERSAWITHAES128CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES256GCMSHA384), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES128GCMSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES256CBCSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES128CBCSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES256CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES128CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES256GCMSHA384), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES128GCMSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES256CBCSHA384), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES128CBCSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES256CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES128CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITHAES256CBCSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITHAES128CBCSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITHAES256CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITHAES128CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITH3DESEDECBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITH3DESEDECBCSHA)}, - // MinProtocolVersion: to.Ptr(armnetwork.ApplicationGatewaySSLProtocolTLSv10), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups//providers/Microsoft.Network/ApplicationGatewayAvailableSslOptions/default/ApplicationGatewaySslPredefinedPolicy/AppGwSslPolicy20170401"), - // Name: to.Ptr("AppGwSslPolicy20170401"), - // Properties: &armnetwork.ApplicationGatewaySSLPredefinedPolicyPropertiesFormat{ - // CipherSuites: []*armnetwork.ApplicationGatewaySSLCipherSuite{ - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES128GCMSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES256GCMSHA384), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES128CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES256CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES128CBCSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES256CBCSHA384), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES256GCMSHA384), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128GCMSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES256CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES256GCMSHA384), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES128GCMSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES256CBCSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES128CBCSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES256CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES128CBCSHA)}, - // MinProtocolVersion: to.Ptr(armnetwork.ApplicationGatewaySSLProtocolTLSv11), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups//providers/Microsoft.Network/ApplicationGatewayAvailableSslOptions/default/ApplicationGatewaySslPredefinedPolicy/AppGwSslPolicy20170401S"), - // Name: to.Ptr("AppGwSslPolicy20170401S"), - // Properties: &armnetwork.ApplicationGatewaySSLPredefinedPolicyPropertiesFormat{ - // CipherSuites: []*armnetwork.ApplicationGatewaySSLCipherSuite{ - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES128GCMSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES256GCMSHA384), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES128CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES256CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES128CBCSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES256CBCSHA384), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES256GCMSHA384), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128GCMSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES256CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES256GCMSHA384), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES128GCMSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES256CBCSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES128CBCSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES256CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES128CBCSHA)}, - // MinProtocolVersion: to.Ptr(armnetwork.ApplicationGatewaySSLProtocolTLSv12), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ApplicationGatewayAvailableSslOptionsPredefinedPolicyGet.json -func ExampleApplicationGatewaysClient_GetSSLPredefinedPolicy() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApplicationGatewaysClient().GetSSLPredefinedPolicy(ctx, "AppGwSslPolicy20150501", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ApplicationGatewaySSLPredefinedPolicy = armnetwork.ApplicationGatewaySSLPredefinedPolicy{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups//providers/Microsoft.Network/ApplicationGatewayAvailableSslOptions/default/ApplicationGatewaySslPredefinedPolicy/AppGwSslPolicy20150501"), - // Name: to.Ptr("AppGwSslPolicy20150501"), - // Properties: &armnetwork.ApplicationGatewaySSLPredefinedPolicyPropertiesFormat{ - // CipherSuites: []*armnetwork.ApplicationGatewaySSLCipherSuite{ - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES256GCMSHA384), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128GCMSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES256CBCSHA384), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128CBCSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES256CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHERSAWITHAES256GCMSHA384), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHERSAWITHAES128GCMSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHERSAWITHAES256CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHERSAWITHAES128CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES256GCMSHA384), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES128GCMSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES256CBCSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES128CBCSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES256CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES128CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES256GCMSHA384), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES128GCMSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES256CBCSHA384), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES128CBCSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES256CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES128CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITHAES256CBCSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITHAES128CBCSHA256), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITHAES256CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITHAES128CBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSRSAWITH3DESEDECBCSHA), - // to.Ptr(armnetwork.ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITH3DESEDECBCSHA)}, - // MinProtocolVersion: to.Ptr(armnetwork.ApplicationGatewaySSLProtocolTLSv10), - // }, - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/applicationgatewaywafdynamicmanifests_client.go b/sdk/resourcemanager/network/armnetwork/applicationgatewaywafdynamicmanifests_client.go index 5998f5ff9d66..56015e87353c 100644 --- a/sdk/resourcemanager/network/armnetwork/applicationgatewaywafdynamicmanifests_client.go +++ b/sdk/resourcemanager/network/armnetwork/applicationgatewaywafdynamicmanifests_client.go @@ -46,7 +46,7 @@ func NewApplicationGatewayWafDynamicManifestsClient(subscriptionID string, crede // NewGetPager - Gets the regional application gateway waf manifest. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - location - The region where the nrp are located at. // - options - ApplicationGatewayWafDynamicManifestsClientGetOptions contains the optional parameters for the ApplicationGatewayWafDynamicManifestsClient.NewGetPager // method. @@ -96,7 +96,7 @@ func (client *ApplicationGatewayWafDynamicManifestsClient) getCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/applicationgatewaywafdynamicmanifests_client_example_test.go b/sdk/resourcemanager/network/armnetwork/applicationgatewaywafdynamicmanifests_client_example_test.go deleted file mode 100644 index dd536b0806ee..000000000000 --- a/sdk/resourcemanager/network/armnetwork/applicationgatewaywafdynamicmanifests_client_example_test.go +++ /dev/null @@ -1,92 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/GetApplicationGatewayWafDynamicManifests.json -func ExampleApplicationGatewayWafDynamicManifestsClient_NewGetPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewApplicationGatewayWafDynamicManifestsClient().NewGetPager("westus", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ApplicationGatewayWafDynamicManifestResultList = armnetwork.ApplicationGatewayWafDynamicManifestResultList{ - // Value: []*armnetwork.ApplicationGatewayWafDynamicManifestResult{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Network/applicationGatewayWafDynamicManifest"), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/applicationGatewayWafDynamicManifests/default"), - // Properties: &armnetwork.ApplicationGatewayWafDynamicManifestPropertiesResult{ - // AvailableRuleSets: []*armnetwork.ApplicationGatewayFirewallManifestRuleSet{ - // { - // RuleGroups: []*armnetwork.ApplicationGatewayFirewallRuleGroup{ - // { - // Description: to.Ptr(""), - // RuleGroupName: to.Ptr("General"), - // Rules: []*armnetwork.ApplicationGatewayFirewallRule{ - // { - // Description: to.Ptr("Failed to Parse Request Body."), - // Action: to.Ptr(armnetwork.ApplicationGatewayWafRuleActionTypesAnomalyScoring), - // RuleID: to.Ptr[int32](200002), - // RuleIDString: to.Ptr("200002"), - // State: to.Ptr(armnetwork.ApplicationGatewayWafRuleStateTypesEnabled), - // }, - // { - // Description: to.Ptr("Multipart Request Body Strict Validation."), - // Action: to.Ptr(armnetwork.ApplicationGatewayWafRuleActionTypesAnomalyScoring), - // RuleID: to.Ptr[int32](200003), - // RuleIDString: to.Ptr("200003"), - // State: to.Ptr(armnetwork.ApplicationGatewayWafRuleStateTypesEnabled), - // }, - // { - // Description: to.Ptr("Possible Multipart Unmatched Boundary."), - // Action: to.Ptr(armnetwork.ApplicationGatewayWafRuleActionTypesAnomalyScoring), - // RuleID: to.Ptr[int32](200004), - // RuleIDString: to.Ptr("200004"), - // State: to.Ptr(armnetwork.ApplicationGatewayWafRuleStateTypesEnabled), - // }}, - // }}, - // RuleSetType: to.Ptr("OWASP"), - // RuleSetVersion: to.Ptr("3.2"), - // Status: to.Ptr(armnetwork.ApplicationGatewayRuleSetStatusOptions("0")), - // Tiers: []*armnetwork.ApplicationGatewayTierTypes{ - // to.Ptr(armnetwork.ApplicationGatewayTierTypesWAFV2)}, - // }}, - // DefaultRuleSet: &armnetwork.DefaultRuleSetPropertyFormat{ - // RuleSetType: to.Ptr("OWASP"), - // RuleSetVersion: to.Ptr("3.2"), - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/applicationgatewaywafdynamicmanifestsdefault_client.go b/sdk/resourcemanager/network/armnetwork/applicationgatewaywafdynamicmanifestsdefault_client.go index eb4ae9276035..eb6426bf815d 100644 --- a/sdk/resourcemanager/network/armnetwork/applicationgatewaywafdynamicmanifestsdefault_client.go +++ b/sdk/resourcemanager/network/armnetwork/applicationgatewaywafdynamicmanifestsdefault_client.go @@ -47,7 +47,7 @@ func NewApplicationGatewayWafDynamicManifestsDefaultClient(subscriptionID string // Get - Gets the regional application gateway waf manifest. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - location - The region where the nrp are located at. // - options - ApplicationGatewayWafDynamicManifestsDefaultClientGetOptions contains the optional parameters for the ApplicationGatewayWafDynamicManifestsDefaultClient.Get // method. @@ -89,7 +89,7 @@ func (client *ApplicationGatewayWafDynamicManifestsDefaultClient) getCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/applicationgatewaywafdynamicmanifestsdefault_client_example_test.go b/sdk/resourcemanager/network/armnetwork/applicationgatewaywafdynamicmanifestsdefault_client_example_test.go deleted file mode 100644 index 1ec1470d82f4..000000000000 --- a/sdk/resourcemanager/network/armnetwork/applicationgatewaywafdynamicmanifestsdefault_client_example_test.go +++ /dev/null @@ -1,84 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/GetApplicationGatewayWafDynamicManifestsDefault.json -func ExampleApplicationGatewayWafDynamicManifestsDefaultClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApplicationGatewayWafDynamicManifestsDefaultClient().Get(ctx, "westus", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ApplicationGatewayWafDynamicManifestResult = armnetwork.ApplicationGatewayWafDynamicManifestResult{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Network/applicationGatewayWafDynamicManifest"), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/applicationGatewayWafDynamicManifests/default"), - // Properties: &armnetwork.ApplicationGatewayWafDynamicManifestPropertiesResult{ - // AvailableRuleSets: []*armnetwork.ApplicationGatewayFirewallManifestRuleSet{ - // { - // RuleGroups: []*armnetwork.ApplicationGatewayFirewallRuleGroup{ - // { - // Description: to.Ptr(""), - // RuleGroupName: to.Ptr("General"), - // Rules: []*armnetwork.ApplicationGatewayFirewallRule{ - // { - // Description: to.Ptr("Failed to Parse Request Body."), - // Action: to.Ptr(armnetwork.ApplicationGatewayWafRuleActionTypesAnomalyScoring), - // RuleID: to.Ptr[int32](200002), - // RuleIDString: to.Ptr("200002"), - // State: to.Ptr(armnetwork.ApplicationGatewayWafRuleStateTypesEnabled), - // }, - // { - // Description: to.Ptr("Multipart Request Body Strict Validation."), - // Action: to.Ptr(armnetwork.ApplicationGatewayWafRuleActionTypesAnomalyScoring), - // RuleID: to.Ptr[int32](200003), - // RuleIDString: to.Ptr("200003"), - // State: to.Ptr(armnetwork.ApplicationGatewayWafRuleStateTypesEnabled), - // }, - // { - // Description: to.Ptr("Possible Multipart Unmatched Boundary."), - // Action: to.Ptr(armnetwork.ApplicationGatewayWafRuleActionTypesAnomalyScoring), - // RuleID: to.Ptr[int32](200004), - // RuleIDString: to.Ptr("200004"), - // State: to.Ptr(armnetwork.ApplicationGatewayWafRuleStateTypesEnabled), - // }}, - // }}, - // RuleSetType: to.Ptr("OWASP"), - // RuleSetVersion: to.Ptr("3.2"), - // Status: to.Ptr(armnetwork.ApplicationGatewayRuleSetStatusOptions("0")), - // Tiers: []*armnetwork.ApplicationGatewayTierTypes{ - // to.Ptr(armnetwork.ApplicationGatewayTierTypesWAFV2)}, - // }}, - // DefaultRuleSet: &armnetwork.DefaultRuleSetPropertyFormat{ - // RuleSetType: to.Ptr("OWASP"), - // RuleSetVersion: to.Ptr("3.2"), - // }, - // }, - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/applicationsecuritygroups_client.go b/sdk/resourcemanager/network/armnetwork/applicationsecuritygroups_client.go index 1f67027849ba..87f74c62dcb7 100644 --- a/sdk/resourcemanager/network/armnetwork/applicationsecuritygroups_client.go +++ b/sdk/resourcemanager/network/armnetwork/applicationsecuritygroups_client.go @@ -47,7 +47,7 @@ func NewApplicationSecurityGroupsClient(subscriptionID string, credential azcore // BeginCreateOrUpdate - Creates or updates an application security group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - applicationSecurityGroupName - The name of the application security group. // - parameters - Parameters supplied to the create or update ApplicationSecurityGroup operation. @@ -71,7 +71,7 @@ func (client *ApplicationSecurityGroupsClient) BeginCreateOrUpdate(ctx context.C // CreateOrUpdate - Creates or updates an application security group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *ApplicationSecurityGroupsClient) createOrUpdate(ctx context.Context, resourceGroupName string, applicationSecurityGroupName string, parameters ApplicationSecurityGroup, options *ApplicationSecurityGroupsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ApplicationSecurityGroupsClient.BeginCreateOrUpdate" @@ -113,7 +113,7 @@ func (client *ApplicationSecurityGroupsClient) createOrUpdateCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -125,7 +125,7 @@ func (client *ApplicationSecurityGroupsClient) createOrUpdateCreateRequest(ctx c // BeginDelete - Deletes the specified application security group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - applicationSecurityGroupName - The name of the application security group. // - options - ApplicationSecurityGroupsClientBeginDeleteOptions contains the optional parameters for the ApplicationSecurityGroupsClient.BeginDelete @@ -148,7 +148,7 @@ func (client *ApplicationSecurityGroupsClient) BeginDelete(ctx context.Context, // Delete - Deletes the specified application security group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *ApplicationSecurityGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, applicationSecurityGroupName string, options *ApplicationSecurityGroupsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ApplicationSecurityGroupsClient.BeginDelete" @@ -190,7 +190,7 @@ func (client *ApplicationSecurityGroupsClient) deleteCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -199,7 +199,7 @@ func (client *ApplicationSecurityGroupsClient) deleteCreateRequest(ctx context.C // Get - Gets information about the specified application security group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - applicationSecurityGroupName - The name of the application security group. // - options - ApplicationSecurityGroupsClientGetOptions contains the optional parameters for the ApplicationSecurityGroupsClient.Get @@ -246,7 +246,7 @@ func (client *ApplicationSecurityGroupsClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -263,7 +263,7 @@ func (client *ApplicationSecurityGroupsClient) getHandleResponse(resp *http.Resp // NewListPager - Gets all the application security groups in a resource group. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - options - ApplicationSecurityGroupsClientListOptions contains the optional parameters for the ApplicationSecurityGroupsClient.NewListPager // method. @@ -313,7 +313,7 @@ func (client *ApplicationSecurityGroupsClient) listCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -330,7 +330,7 @@ func (client *ApplicationSecurityGroupsClient) listHandleResponse(resp *http.Res // NewListAllPager - Gets all application security groups in a subscription. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - options - ApplicationSecurityGroupsClientListAllOptions contains the optional parameters for the ApplicationSecurityGroupsClient.NewListAllPager // method. func (client *ApplicationSecurityGroupsClient) NewListAllPager(options *ApplicationSecurityGroupsClientListAllOptions) *runtime.Pager[ApplicationSecurityGroupsClientListAllResponse] { @@ -375,7 +375,7 @@ func (client *ApplicationSecurityGroupsClient) listAllCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -393,7 +393,7 @@ func (client *ApplicationSecurityGroupsClient) listAllHandleResponse(resp *http. // UpdateTags - Updates an application security group's tags. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - applicationSecurityGroupName - The name of the application security group. // - parameters - Parameters supplied to update application security group tags. @@ -441,7 +441,7 @@ func (client *ApplicationSecurityGroupsClient) updateTagsCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/applicationsecuritygroups_client_example_test.go b/sdk/resourcemanager/network/armnetwork/applicationsecuritygroups_client_example_test.go deleted file mode 100644 index 7ae43e211bc5..000000000000 --- a/sdk/resourcemanager/network/armnetwork/applicationsecuritygroups_client_example_test.go +++ /dev/null @@ -1,242 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ApplicationSecurityGroupDelete.json -func ExampleApplicationSecurityGroupsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewApplicationSecurityGroupsClient().BeginDelete(ctx, "rg1", "test-asg", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ApplicationSecurityGroupGet.json -func ExampleApplicationSecurityGroupsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApplicationSecurityGroupsClient().Get(ctx, "rg1", "test-asg", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ApplicationSecurityGroup = armnetwork.ApplicationSecurityGroup{ - // Name: to.Ptr("test-asg"), - // Type: to.Ptr("Microsoft.Network/applicationSecurityGroups"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationSecurityGroups/test-asg"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.ApplicationSecurityGroupPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ApplicationSecurityGroupCreate.json -func ExampleApplicationSecurityGroupsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewApplicationSecurityGroupsClient().BeginCreateOrUpdate(ctx, "rg1", "test-asg", armnetwork.ApplicationSecurityGroup{ - Location: to.Ptr("westus"), - Properties: &armnetwork.ApplicationSecurityGroupPropertiesFormat{}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ApplicationSecurityGroup = armnetwork.ApplicationSecurityGroup{ - // Name: to.Ptr("test-asg"), - // Type: to.Ptr("Microsoft.Network/applicationSecurityGroups"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationSecurityGroups/test-asg"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.ApplicationSecurityGroupPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ApplicationSecurityGroupUpdateTags.json -func ExampleApplicationSecurityGroupsClient_UpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApplicationSecurityGroupsClient().UpdateTags(ctx, "rg1", "test-asg", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ApplicationSecurityGroup = armnetwork.ApplicationSecurityGroup{ - // Name: to.Ptr("test-asg"), - // Type: to.Ptr("Microsoft.Network/applicationSecurityGroups"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationSecurityGroups/test-asg"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armnetwork.ApplicationSecurityGroupPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ApplicationSecurityGroupListAll.json -func ExampleApplicationSecurityGroupsClient_NewListAllPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewApplicationSecurityGroupsClient().NewListAllPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ApplicationSecurityGroupListResult = armnetwork.ApplicationSecurityGroupListResult{ - // Value: []*armnetwork.ApplicationSecurityGroup{ - // { - // Name: to.Ptr("asg1"), - // Type: to.Ptr("Microsoft.Network/applicationSecurityGroups"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationSecurityGroups/asg1"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.ApplicationSecurityGroupPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // }, - // { - // Name: to.Ptr("asg2"), - // Type: to.Ptr("Microsoft.Network/applicationSecurityGroups"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationSecurityGroups/asg2"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.ApplicationSecurityGroupPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ApplicationSecurityGroupList.json -func ExampleApplicationSecurityGroupsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewApplicationSecurityGroupsClient().NewListPager("rg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ApplicationSecurityGroupListResult = armnetwork.ApplicationSecurityGroupListResult{ - // Value: []*armnetwork.ApplicationSecurityGroup{ - // { - // Name: to.Ptr("asg1"), - // Type: to.Ptr("Microsoft.Network/applicationSecurityGroups"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationSecurityGroups/asg1"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.ApplicationSecurityGroupPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // }, - // { - // Name: to.Ptr("asg2"), - // Type: to.Ptr("Microsoft.Network/applicationSecurityGroups"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationSecurityGroups/asg2"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.ApplicationSecurityGroupPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/autorest.md b/sdk/resourcemanager/network/armnetwork/autorest.md index 23ac7e27a9b2..a07245208816 100644 --- a/sdk/resourcemanager/network/armnetwork/autorest.md +++ b/sdk/resourcemanager/network/armnetwork/autorest.md @@ -5,12 +5,11 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/network/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/network/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION module: github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4 -module-version: 4.1.0-beta.1 -tag: package-2023-02 +module-version: 4.1.0 azcore-version: 1.8.0-beta.1 generate-fakes: true inject-spans: true diff --git a/sdk/resourcemanager/network/armnetwork/availabledelegations_client.go b/sdk/resourcemanager/network/armnetwork/availabledelegations_client.go index 4c9226c8f3bd..e5ad23972d7e 100644 --- a/sdk/resourcemanager/network/armnetwork/availabledelegations_client.go +++ b/sdk/resourcemanager/network/armnetwork/availabledelegations_client.go @@ -46,7 +46,7 @@ func NewAvailableDelegationsClient(subscriptionID string, credential azcore.Toke // NewListPager - Gets all of the available subnet delegations for this subscription in this region. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - location - The location of the subnet. // - options - AvailableDelegationsClientListOptions contains the optional parameters for the AvailableDelegationsClient.NewListPager // method. @@ -96,7 +96,7 @@ func (client *AvailableDelegationsClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/availabledelegations_client_example_test.go b/sdk/resourcemanager/network/armnetwork/availabledelegations_client_example_test.go deleted file mode 100644 index eea6a743ec10..000000000000 --- a/sdk/resourcemanager/network/armnetwork/availabledelegations_client_example_test.go +++ /dev/null @@ -1,54 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/AvailableDelegationsSubscriptionGet.json -func ExampleAvailableDelegationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAvailableDelegationsClient().NewListPager("westcentralus", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AvailableDelegationsResult = armnetwork.AvailableDelegationsResult{ - // Value: []*armnetwork.AvailableDelegation{ - // { - // Name: to.Ptr("Microsoft.Provider.resourceType"), - // Type: to.Ptr("Microsoft.Network/availableDelegations"), - // Actions: []*string{ - // to.Ptr("Microsoft.Network/resource/action")}, - // ID: to.Ptr("/subscriptions/subId/providers/Microsoft.Network/availableDelegations/Microsoft.Provider.resourceType"), - // ServiceName: to.Ptr("Microsoft.Provider/resourceType"), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/availableendpointservices_client.go b/sdk/resourcemanager/network/armnetwork/availableendpointservices_client.go index 448c41eab390..00fa61ed0585 100644 --- a/sdk/resourcemanager/network/armnetwork/availableendpointservices_client.go +++ b/sdk/resourcemanager/network/armnetwork/availableendpointservices_client.go @@ -46,7 +46,7 @@ func NewAvailableEndpointServicesClient(subscriptionID string, credential azcore // NewListPager - List what values of endpoint services are available for use. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - location - The location to check available endpoint services. // - options - AvailableEndpointServicesClientListOptions contains the optional parameters for the AvailableEndpointServicesClient.NewListPager // method. @@ -96,7 +96,7 @@ func (client *AvailableEndpointServicesClient) listCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/availableendpointservices_client_example_test.go b/sdk/resourcemanager/network/armnetwork/availableendpointservices_client_example_test.go deleted file mode 100644 index c4f753efb94f..000000000000 --- a/sdk/resourcemanager/network/armnetwork/availableendpointservices_client_example_test.go +++ /dev/null @@ -1,61 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/EndpointServicesList.json -func ExampleAvailableEndpointServicesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAvailableEndpointServicesClient().NewListPager("westus", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.EndpointServicesListResult = armnetwork.EndpointServicesListResult{ - // Value: []*armnetwork.EndpointServiceResult{ - // { - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/virtualNetworkEndpointServices/Microsoft.Storage"), - // Name: to.Ptr("Microsoft.Storage"), - // Type: to.Ptr("Microsoft.Network/virtualNetworkEndpointServices"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/virtualNetworkEndpointServices/Microsoft.Sql"), - // Name: to.Ptr("Microsoft.Sql"), - // Type: to.Ptr("Microsoft.Network/virtualNetworkEndpointServices"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/virtualNetworkEndpointServices/Microsoft.AzureActiveDirectory"), - // Name: to.Ptr("Microsoft.AzureActiveDirectory"), - // Type: to.Ptr("Microsoft.Network/virtualNetworkEndpointServices"), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/availableprivateendpointtypes_client.go b/sdk/resourcemanager/network/armnetwork/availableprivateendpointtypes_client.go index 98732ff98a7f..4d9ae561a317 100644 --- a/sdk/resourcemanager/network/armnetwork/availableprivateendpointtypes_client.go +++ b/sdk/resourcemanager/network/armnetwork/availableprivateendpointtypes_client.go @@ -47,7 +47,7 @@ func NewAvailablePrivateEndpointTypesClient(subscriptionID string, credential az // NewListPager - Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this // region. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - location - The location of the domain name. // - options - AvailablePrivateEndpointTypesClientListOptions contains the optional parameters for the AvailablePrivateEndpointTypesClient.NewListPager // method. @@ -97,7 +97,7 @@ func (client *AvailablePrivateEndpointTypesClient) listCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -115,7 +115,7 @@ func (client *AvailablePrivateEndpointTypesClient) listHandleResponse(resp *http // NewListByResourceGroupPager - Returns all of the resource types that can be linked to a Private Endpoint in this subscription // in this region. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - location - The location of the domain name. // - resourceGroupName - The name of the resource group. // - options - AvailablePrivateEndpointTypesClientListByResourceGroupOptions contains the optional parameters for the AvailablePrivateEndpointTypesClient.NewListByResourceGroupPager @@ -170,7 +170,7 @@ func (client *AvailablePrivateEndpointTypesClient) listByResourceGroupCreateRequ return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/availableprivateendpointtypes_client_example_test.go b/sdk/resourcemanager/network/armnetwork/availableprivateendpointtypes_client_example_test.go deleted file mode 100644 index 569df2742f8a..000000000000 --- a/sdk/resourcemanager/network/armnetwork/availableprivateendpointtypes_client_example_test.go +++ /dev/null @@ -1,84 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/AvailablePrivateEndpointTypesGet.json -func ExampleAvailablePrivateEndpointTypesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAvailablePrivateEndpointTypesClient().NewListPager("regionName", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AvailablePrivateEndpointTypesResult = armnetwork.AvailablePrivateEndpointTypesResult{ - // Value: []*armnetwork.AvailablePrivateEndpointType{ - // { - // Type: to.Ptr("Microsoft.Network/availablePrivateEndpointTypes"), - // ID: to.Ptr("/subscriptions/subId/providers/Microsoft.Network/availablePrivateEndpointTypes/Microsoft.Provider.resourceType"), - // ResourceName: to.Ptr("Microsoft.Provider/resourceType"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/AvailablePrivateEndpointTypesResourceGroupGet.json -func ExampleAvailablePrivateEndpointTypesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAvailablePrivateEndpointTypesClient().NewListByResourceGroupPager("regionName", "rg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AvailablePrivateEndpointTypesResult = armnetwork.AvailablePrivateEndpointTypesResult{ - // Value: []*armnetwork.AvailablePrivateEndpointType{ - // { - // Type: to.Ptr("Microsoft.Network/availablePrivateEndpointTypes"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/availablePrivateEndpointTypes/Microsoft.Provider.resourceType"), - // ResourceName: to.Ptr("Microsoft.Provider/resourceType"), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/availableresourcegroupdelegations_client.go b/sdk/resourcemanager/network/armnetwork/availableresourcegroupdelegations_client.go index a85a215f3e0b..2ecf44dfa174 100644 --- a/sdk/resourcemanager/network/armnetwork/availableresourcegroupdelegations_client.go +++ b/sdk/resourcemanager/network/armnetwork/availableresourcegroupdelegations_client.go @@ -46,7 +46,7 @@ func NewAvailableResourceGroupDelegationsClient(subscriptionID string, credentia // NewListPager - Gets all of the available subnet delegations for this resource group in this region. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - location - The location of the domain name. // - resourceGroupName - The name of the resource group. // - options - AvailableResourceGroupDelegationsClientListOptions contains the optional parameters for the AvailableResourceGroupDelegationsClient.NewListPager @@ -101,7 +101,7 @@ func (client *AvailableResourceGroupDelegationsClient) listCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/availableresourcegroupdelegations_client_example_test.go b/sdk/resourcemanager/network/armnetwork/availableresourcegroupdelegations_client_example_test.go deleted file mode 100644 index 819a98169b40..000000000000 --- a/sdk/resourcemanager/network/armnetwork/availableresourcegroupdelegations_client_example_test.go +++ /dev/null @@ -1,54 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/AvailableDelegationsResourceGroupGet.json -func ExampleAvailableResourceGroupDelegationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAvailableResourceGroupDelegationsClient().NewListPager("westcentralus", "rg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AvailableDelegationsResult = armnetwork.AvailableDelegationsResult{ - // Value: []*armnetwork.AvailableDelegation{ - // { - // Name: to.Ptr("Microsoft.Provider.resourceType"), - // Type: to.Ptr("Microsoft.Network/availableDelegations"), - // Actions: []*string{ - // to.Ptr("Microsoft.Network/resource/action")}, - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/availableDelegations/Microsoft.Provider.resourceType"), - // ServiceName: to.Ptr("Microsoft.Provider/resourceType"), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/availableservicealiases_client.go b/sdk/resourcemanager/network/armnetwork/availableservicealiases_client.go index 8e206368a973..a313bb73f105 100644 --- a/sdk/resourcemanager/network/armnetwork/availableservicealiases_client.go +++ b/sdk/resourcemanager/network/armnetwork/availableservicealiases_client.go @@ -46,7 +46,7 @@ func NewAvailableServiceAliasesClient(subscriptionID string, credential azcore.T // NewListPager - Gets all available service aliases for this subscription in this region. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - location - The location. // - options - AvailableServiceAliasesClientListOptions contains the optional parameters for the AvailableServiceAliasesClient.NewListPager // method. @@ -96,7 +96,7 @@ func (client *AvailableServiceAliasesClient) listCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -113,7 +113,7 @@ func (client *AvailableServiceAliasesClient) listHandleResponse(resp *http.Respo // NewListByResourceGroupPager - Gets all available service aliases for this resource group in this region. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - location - The location. // - options - AvailableServiceAliasesClientListByResourceGroupOptions contains the optional parameters for the AvailableServiceAliasesClient.NewListByResourceGroupPager @@ -168,7 +168,7 @@ func (client *AvailableServiceAliasesClient) listByResourceGroupCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/availableservicealiases_client_example_test.go b/sdk/resourcemanager/network/armnetwork/availableservicealiases_client_example_test.go deleted file mode 100644 index a0f79aba7607..000000000000 --- a/sdk/resourcemanager/network/armnetwork/availableservicealiases_client_example_test.go +++ /dev/null @@ -1,98 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/AvailableServiceAliasesList.json -func ExampleAvailableServiceAliasesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAvailableServiceAliasesClient().NewListPager("westcentralus", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AvailableServiceAliasesResult = armnetwork.AvailableServiceAliasesResult{ - // Value: []*armnetwork.AvailableServiceAlias{ - // { - // Name: to.Ptr("servicesAzure"), - // Type: to.Ptr("Microsoft.Network/AvailableServiceAliases"), - // ID: to.Ptr("/subscriptions/subId/providers/Microsoft.Network/AvailableServiceAliases/servicesAzure"), - // ResourceName: to.Ptr("/services/Azure"), - // }, - // { - // Name: to.Ptr("servicesAzureManagedInstance"), - // Type: to.Ptr("Microsoft.Network/AvailableServiceAliases"), - // ID: to.Ptr("/subscriptions/subId/providers/Microsoft.Network/AvailableServiceAliases/servicesAzureManagedInstance"), - // ResourceName: to.Ptr("/services/Azure/ManagedInstance"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/AvailableServiceAliasesListByResourceGroup.json -func ExampleAvailableServiceAliasesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAvailableServiceAliasesClient().NewListByResourceGroupPager("rg1", "westcentralus", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AvailableServiceAliasesResult = armnetwork.AvailableServiceAliasesResult{ - // Value: []*armnetwork.AvailableServiceAlias{ - // { - // Name: to.Ptr("servicesAzure"), - // Type: to.Ptr("Microsoft.Network/AvailableServiceAliases"), - // ID: to.Ptr("/subscriptions/subId/providers/Microsoft.Network/AvailableServiceAliases/servicesAzure"), - // ResourceName: to.Ptr("/services/Azure"), - // }, - // { - // Name: to.Ptr("servicesAzureManagedInstance"), - // Type: to.Ptr("Microsoft.Network/AvailableServiceAliases"), - // ID: to.Ptr("/subscriptions/subId/providers/Microsoft.Network/AvailableServiceAliases/servicesAzureManagedInstance"), - // ResourceName: to.Ptr("/services/Azure/ManagedInstance"), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/azurefirewallfqdntags_client.go b/sdk/resourcemanager/network/armnetwork/azurefirewallfqdntags_client.go index 7afe099022e8..27069ff5f6e3 100644 --- a/sdk/resourcemanager/network/armnetwork/azurefirewallfqdntags_client.go +++ b/sdk/resourcemanager/network/armnetwork/azurefirewallfqdntags_client.go @@ -46,7 +46,7 @@ func NewAzureFirewallFqdnTagsClient(subscriptionID string, credential azcore.Tok // NewListAllPager - Gets all the Azure Firewall FQDN Tags in a subscription. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - options - AzureFirewallFqdnTagsClientListAllOptions contains the optional parameters for the AzureFirewallFqdnTagsClient.NewListAllPager // method. func (client *AzureFirewallFqdnTagsClient) NewListAllPager(options *AzureFirewallFqdnTagsClientListAllOptions) *runtime.Pager[AzureFirewallFqdnTagsClientListAllResponse] { @@ -91,7 +91,7 @@ func (client *AzureFirewallFqdnTagsClient) listAllCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/azurefirewallfqdntags_client_example_test.go b/sdk/resourcemanager/network/armnetwork/azurefirewallfqdntags_client_example_test.go deleted file mode 100644 index 8b21f88d61fa..000000000000 --- a/sdk/resourcemanager/network/armnetwork/azurefirewallfqdntags_client_example_test.go +++ /dev/null @@ -1,60 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/AzureFirewallFqdnTagsListBySubscription.json -func ExampleAzureFirewallFqdnTagsClient_NewListAllPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAzureFirewallFqdnTagsClient().NewListAllPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AzureFirewallFqdnTagListResult = armnetwork.AzureFirewallFqdnTagListResult{ - // Value: []*armnetwork.AzureFirewallFqdnTag{ - // { - // Name: to.Ptr("azfwfqdntag"), - // Type: to.Ptr("Microsoft.Network/azureFirewallFqdnTags"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewallFqdnTags/azfwfqdntag"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.AzureFirewallFqdnTagPropertiesFormat{ - // FqdnTagName: to.Ptr("azfwfqdntag"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/azurefirewalls_client.go b/sdk/resourcemanager/network/armnetwork/azurefirewalls_client.go index bb3379f99b55..9c6bc7bd41da 100644 --- a/sdk/resourcemanager/network/armnetwork/azurefirewalls_client.go +++ b/sdk/resourcemanager/network/armnetwork/azurefirewalls_client.go @@ -47,7 +47,7 @@ func NewAzureFirewallsClient(subscriptionID string, credential azcore.TokenCrede // BeginCreateOrUpdate - Creates or updates the specified Azure Firewall. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - azureFirewallName - The name of the Azure Firewall. // - parameters - Parameters supplied to the create or update Azure Firewall operation. @@ -71,7 +71,7 @@ func (client *AzureFirewallsClient) BeginCreateOrUpdate(ctx context.Context, res // CreateOrUpdate - Creates or updates the specified Azure Firewall. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *AzureFirewallsClient) createOrUpdate(ctx context.Context, resourceGroupName string, azureFirewallName string, parameters AzureFirewall, options *AzureFirewallsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "AzureFirewallsClient.BeginCreateOrUpdate" @@ -113,7 +113,7 @@ func (client *AzureFirewallsClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -125,7 +125,7 @@ func (client *AzureFirewallsClient) createOrUpdateCreateRequest(ctx context.Cont // BeginDelete - Deletes the specified Azure Firewall. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - azureFirewallName - The name of the Azure Firewall. // - options - AzureFirewallsClientBeginDeleteOptions contains the optional parameters for the AzureFirewallsClient.BeginDelete @@ -148,7 +148,7 @@ func (client *AzureFirewallsClient) BeginDelete(ctx context.Context, resourceGro // Delete - Deletes the specified Azure Firewall. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *AzureFirewallsClient) deleteOperation(ctx context.Context, resourceGroupName string, azureFirewallName string, options *AzureFirewallsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "AzureFirewallsClient.BeginDelete" @@ -190,7 +190,7 @@ func (client *AzureFirewallsClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -199,7 +199,7 @@ func (client *AzureFirewallsClient) deleteCreateRequest(ctx context.Context, res // Get - Gets the specified Azure Firewall. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - azureFirewallName - The name of the Azure Firewall. // - options - AzureFirewallsClientGetOptions contains the optional parameters for the AzureFirewallsClient.Get method. @@ -245,7 +245,7 @@ func (client *AzureFirewallsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -262,7 +262,7 @@ func (client *AzureFirewallsClient) getHandleResponse(resp *http.Response) (Azur // NewListPager - Lists all Azure Firewalls in a resource group. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - options - AzureFirewallsClientListOptions contains the optional parameters for the AzureFirewallsClient.NewListPager method. func (client *AzureFirewallsClient) NewListPager(resourceGroupName string, options *AzureFirewallsClientListOptions) *runtime.Pager[AzureFirewallsClientListResponse] { @@ -311,7 +311,7 @@ func (client *AzureFirewallsClient) listCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -328,7 +328,7 @@ func (client *AzureFirewallsClient) listHandleResponse(resp *http.Response) (Azu // NewListAllPager - Gets all the Azure Firewalls in a subscription. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - options - AzureFirewallsClientListAllOptions contains the optional parameters for the AzureFirewallsClient.NewListAllPager // method. func (client *AzureFirewallsClient) NewListAllPager(options *AzureFirewallsClientListAllOptions) *runtime.Pager[AzureFirewallsClientListAllResponse] { @@ -373,7 +373,7 @@ func (client *AzureFirewallsClient) listAllCreateRequest(ctx context.Context, op return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -391,7 +391,7 @@ func (client *AzureFirewallsClient) listAllHandleResponse(resp *http.Response) ( // BeginListLearnedPrefixes - Retrieves a list of all IP prefixes that azure firewall has learned to not SNAT. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - azureFirewallName - The name of the azure firewall. // - options - AzureFirewallsClientBeginListLearnedPrefixesOptions contains the optional parameters for the AzureFirewallsClient.BeginListLearnedPrefixes @@ -414,7 +414,7 @@ func (client *AzureFirewallsClient) BeginListLearnedPrefixes(ctx context.Context // ListLearnedPrefixes - Retrieves a list of all IP prefixes that azure firewall has learned to not SNAT. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *AzureFirewallsClient) listLearnedPrefixes(ctx context.Context, resourceGroupName string, azureFirewallName string, options *AzureFirewallsClientBeginListLearnedPrefixesOptions) (*http.Response, error) { var err error const operationName = "AzureFirewallsClient.BeginListLearnedPrefixes" @@ -456,7 +456,7 @@ func (client *AzureFirewallsClient) listLearnedPrefixesCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -465,7 +465,7 @@ func (client *AzureFirewallsClient) listLearnedPrefixesCreateRequest(ctx context // BeginPacketCapture - Runs a packet capture on AzureFirewall. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - azureFirewallName - The name of the Azure Firewall. // - parameters - Parameters supplied to run packet capture on azure firewall. @@ -489,7 +489,7 @@ func (client *AzureFirewallsClient) BeginPacketCapture(ctx context.Context, reso // PacketCapture - Runs a packet capture on AzureFirewall. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *AzureFirewallsClient) packetCapture(ctx context.Context, resourceGroupName string, azureFirewallName string, parameters FirewallPacketCaptureParameters, options *AzureFirewallsClientBeginPacketCaptureOptions) (*http.Response, error) { var err error const operationName = "AzureFirewallsClient.BeginPacketCapture" @@ -531,7 +531,7 @@ func (client *AzureFirewallsClient) packetCaptureCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -543,7 +543,7 @@ func (client *AzureFirewallsClient) packetCaptureCreateRequest(ctx context.Conte // BeginUpdateTags - Updates tags of an Azure Firewall resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - azureFirewallName - The name of the Azure Firewall. // - parameters - Parameters supplied to update azure firewall tags. @@ -567,7 +567,7 @@ func (client *AzureFirewallsClient) BeginUpdateTags(ctx context.Context, resourc // UpdateTags - Updates tags of an Azure Firewall resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *AzureFirewallsClient) updateTags(ctx context.Context, resourceGroupName string, azureFirewallName string, parameters TagsObject, options *AzureFirewallsClientBeginUpdateTagsOptions) (*http.Response, error) { var err error const operationName = "AzureFirewallsClient.BeginUpdateTags" @@ -609,7 +609,7 @@ func (client *AzureFirewallsClient) updateTagsCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/azurefirewalls_client_example_test.go b/sdk/resourcemanager/network/armnetwork/azurefirewalls_client_example_test.go deleted file mode 100644 index 64c353987f26..000000000000 --- a/sdk/resourcemanager/network/armnetwork/azurefirewalls_client_example_test.go +++ /dev/null @@ -1,2934 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/AzureFirewallDelete.json -func ExampleAzureFirewallsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAzureFirewallsClient().BeginDelete(ctx, "rg1", "azurefirewall", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/AzureFirewallGet.json -func ExampleAzureFirewallsClient_Get_getAzureFirewall() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAzureFirewallsClient().Get(ctx, "rg1", "azurefirewall", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AzureFirewall = armnetwork.AzureFirewall{ - // Name: to.Ptr("azurefirewall"), - // Type: to.Ptr("Microsoft.Network/azureFirewalls"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.AzureFirewallPropertiesFormat{ - // AdditionalProperties: map[string]*string{ - // }, - // ApplicationRuleCollections: []*armnetwork.AzureFirewallApplicationRuleCollection{ - // { - // Name: to.Ptr("apprulecoll"), - // Properties: &armnetwork.AzureFirewallApplicationRuleCollectionPropertiesFormat{ - // Action: &armnetwork.AzureFirewallRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), - // }, - // Priority: to.Ptr[int32](110), - // Rules: []*armnetwork.AzureFirewallApplicationRule{ - // { - // Name: to.Ptr("rule1"), - // Description: to.Ptr("Deny inbound rule"), - // Protocols: []*armnetwork.AzureFirewallApplicationRuleProtocol{ - // { - // Port: to.Ptr[int32](443), - // ProtocolType: to.Ptr(armnetwork.AzureFirewallApplicationRuleProtocolTypeHTTPS), - // }}, - // SourceAddresses: []*string{ - // to.Ptr("216.58.216.164"), - // to.Ptr("10.0.0.0/24")}, - // TargetFqdns: []*string{ - // to.Ptr("www.test.com")}, - // }}, - // }, - // }}, - // IPConfigurations: []*armnetwork.AzureFirewallIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewallgw/ipConfigurations/azureFirewallIpConfiguration"), - // Name: to.Ptr("azureFirewallIpConfiguration"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.AzureFirewallIPConfigurationPropertiesFormat{ - // PrivateIPAddress: to.Ptr("10.0.0.0"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), - // }, - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet"), - // }, - // }, - // }}, - // IPGroups: []*armnetwork.AzureFirewallIPGroups{ - // }, - // NatRuleCollections: []*armnetwork.AzureFirewallNatRuleCollection{ - // { - // Name: to.Ptr("natrulecoll"), - // Properties: &armnetwork.AzureFirewallNatRuleCollectionProperties{ - // Action: &armnetwork.AzureFirewallNatRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallNatRCActionTypeDnat), - // }, - // Priority: to.Ptr[int32](112), - // Rules: []*armnetwork.AzureFirewallNatRule{ - // { - // Name: to.Ptr("DNAT-HTTPS-traffic"), - // Description: to.Ptr("D-NAT all outbound web traffic for inspection"), - // DestinationAddresses: []*string{ - // to.Ptr("1.2.3.4")}, - // DestinationPorts: []*string{ - // to.Ptr("443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("*")}, - // TranslatedAddress: to.Ptr("1.2.3.5"), - // TranslatedPort: to.Ptr("8443"), - // }, - // { - // Name: to.Ptr("DNAT-HTTP-traffic-With-FQDN"), - // Description: to.Ptr("D-NAT all inbound web traffic for inspection"), - // DestinationAddresses: []*string{ - // to.Ptr("1.2.3.4")}, - // DestinationPorts: []*string{ - // to.Ptr("80")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("*")}, - // TranslatedFqdn: to.Ptr("internalhttpserver"), - // TranslatedPort: to.Ptr("880"), - // }}, - // }, - // }}, - // NetworkRuleCollections: []*armnetwork.AzureFirewallNetworkRuleCollection{ - // { - // Name: to.Ptr("netrulecoll"), - // Properties: &armnetwork.AzureFirewallNetworkRuleCollectionPropertiesFormat{ - // Action: &armnetwork.AzureFirewallRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), - // }, - // Priority: to.Ptr[int32](112), - // Rules: []*armnetwork.AzureFirewallNetworkRule{ - // { - // Name: to.Ptr("L4-traffic"), - // Description: to.Ptr("Block traffic based on source IPs and ports"), - // DestinationAddresses: []*string{ - // to.Ptr("*")}, - // DestinationPorts: []*string{ - // to.Ptr("443-444"), - // to.Ptr("8443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("192.168.1.1-192.168.1.12"), - // to.Ptr("10.1.4.12-10.1.4.255")}, - // }, - // { - // Name: to.Ptr("L4-traffic-with-FQDN"), - // Description: to.Ptr("Block traffic based on source IPs and ports to amazon"), - // DestinationFqdns: []*string{ - // to.Ptr("www.amazon.com")}, - // DestinationPorts: []*string{ - // to.Ptr("443-444"), - // to.Ptr("8443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("10.2.4.12-10.2.4.255")}, - // }}, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SKU: &armnetwork.AzureFirewallSKU{ - // Name: to.Ptr(armnetwork.AzureFirewallSKUNameAZFWVnet), - // Tier: to.Ptr(armnetwork.AzureFirewallSKUTierStandard), - // }, - // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), - // }, - // Zones: []*string{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/AzureFirewallGetWithAdditionalProperties.json -func ExampleAzureFirewallsClient_Get_getAzureFirewallWithAdditionalProperties() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAzureFirewallsClient().Get(ctx, "rg1", "azurefirewall", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AzureFirewall = armnetwork.AzureFirewall{ - // Name: to.Ptr("azurefirewall"), - // Type: to.Ptr("Microsoft.Network/azureFirewalls"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.AzureFirewallPropertiesFormat{ - // AdditionalProperties: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // ApplicationRuleCollections: []*armnetwork.AzureFirewallApplicationRuleCollection{ - // { - // Name: to.Ptr("apprulecoll"), - // Properties: &armnetwork.AzureFirewallApplicationRuleCollectionPropertiesFormat{ - // Action: &armnetwork.AzureFirewallRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), - // }, - // Priority: to.Ptr[int32](110), - // Rules: []*armnetwork.AzureFirewallApplicationRule{ - // { - // Name: to.Ptr("rule1"), - // Description: to.Ptr("Deny inbound rule"), - // Protocols: []*armnetwork.AzureFirewallApplicationRuleProtocol{ - // { - // Port: to.Ptr[int32](443), - // ProtocolType: to.Ptr(armnetwork.AzureFirewallApplicationRuleProtocolTypeHTTPS), - // }}, - // SourceAddresses: []*string{ - // to.Ptr("216.58.216.164"), - // to.Ptr("10.0.0.0/24")}, - // TargetFqdns: []*string{ - // to.Ptr("www.test.com")}, - // }}, - // }, - // }}, - // IPConfigurations: []*armnetwork.AzureFirewallIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewallgw/ipConfigurations/azureFirewallIpConfiguration"), - // Name: to.Ptr("azureFirewallIpConfiguration"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.AzureFirewallIPConfigurationPropertiesFormat{ - // PrivateIPAddress: to.Ptr("10.0.0.0"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), - // }, - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet"), - // }, - // }, - // }}, - // NatRuleCollections: []*armnetwork.AzureFirewallNatRuleCollection{ - // { - // Name: to.Ptr("natrulecoll"), - // Properties: &armnetwork.AzureFirewallNatRuleCollectionProperties{ - // Action: &armnetwork.AzureFirewallNatRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallNatRCActionTypeDnat), - // }, - // Priority: to.Ptr[int32](112), - // Rules: []*armnetwork.AzureFirewallNatRule{ - // { - // Name: to.Ptr("DNAT-HTTPS-traffic"), - // Description: to.Ptr("D-NAT all outbound web traffic for inspection"), - // DestinationAddresses: []*string{ - // to.Ptr("1.2.3.4")}, - // DestinationPorts: []*string{ - // to.Ptr("443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("*")}, - // TranslatedAddress: to.Ptr("1.2.3.5"), - // TranslatedPort: to.Ptr("8443"), - // }, - // { - // Name: to.Ptr("DNAT-HTTP-traffic-With-FQDN"), - // Description: to.Ptr("D-NAT all inbound web traffic for inspection"), - // DestinationAddresses: []*string{ - // to.Ptr("1.2.3.4")}, - // DestinationPorts: []*string{ - // to.Ptr("80")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("*")}, - // TranslatedFqdn: to.Ptr("internalhttpserver"), - // TranslatedPort: to.Ptr("880"), - // }}, - // }, - // }}, - // NetworkRuleCollections: []*armnetwork.AzureFirewallNetworkRuleCollection{ - // { - // Name: to.Ptr("netrulecoll"), - // Properties: &armnetwork.AzureFirewallNetworkRuleCollectionPropertiesFormat{ - // Action: &armnetwork.AzureFirewallRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), - // }, - // Priority: to.Ptr[int32](112), - // Rules: []*armnetwork.AzureFirewallNetworkRule{ - // { - // Name: to.Ptr("L4-traffic"), - // Description: to.Ptr("Block traffic based on source IPs and ports"), - // DestinationAddresses: []*string{ - // to.Ptr("*")}, - // DestinationPorts: []*string{ - // to.Ptr("443-444"), - // to.Ptr("8443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("192.168.1.1-192.168.1.12"), - // to.Ptr("10.1.4.12-10.1.4.255")}, - // }, - // { - // Name: to.Ptr("L4-traffic-with-FQDN"), - // Description: to.Ptr("Block traffic based on source IPs and ports to amazon"), - // DestinationFqdns: []*string{ - // to.Ptr("www.amazon.com")}, - // DestinationPorts: []*string{ - // to.Ptr("443-444"), - // to.Ptr("8443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("10.2.4.12-10.2.4.255")}, - // }}, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SKU: &armnetwork.AzureFirewallSKU{ - // Name: to.Ptr(armnetwork.AzureFirewallSKUNameAZFWVnet), - // Tier: to.Ptr(armnetwork.AzureFirewallSKUTierStandard), - // }, - // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), - // }, - // Zones: []*string{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/AzureFirewallGetWithIpGroups.json -func ExampleAzureFirewallsClient_Get_getAzureFirewallWithIpGroups() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAzureFirewallsClient().Get(ctx, "rg1", "azurefirewall", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AzureFirewall = armnetwork.AzureFirewall{ - // Name: to.Ptr("azurefirewall"), - // Type: to.Ptr("Microsoft.Network/azureFirewalls"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.AzureFirewallPropertiesFormat{ - // AdditionalProperties: map[string]*string{ - // }, - // ApplicationRuleCollections: []*armnetwork.AzureFirewallApplicationRuleCollection{ - // { - // Name: to.Ptr("apprulecoll"), - // Properties: &armnetwork.AzureFirewallApplicationRuleCollectionPropertiesFormat{ - // Action: &armnetwork.AzureFirewallRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), - // }, - // Priority: to.Ptr[int32](110), - // Rules: []*armnetwork.AzureFirewallApplicationRule{ - // { - // Name: to.Ptr("rule1"), - // Description: to.Ptr("Deny inbound rule"), - // Protocols: []*armnetwork.AzureFirewallApplicationRuleProtocol{ - // { - // Port: to.Ptr[int32](443), - // ProtocolType: to.Ptr(armnetwork.AzureFirewallApplicationRuleProtocolTypeHTTPS), - // }}, - // SourceIPGroups: []*string{ - // to.Ptr("/subscriptions/subId/providers/Microsoft.Network/resourceGroup/myResourceGroup/ipGroups/ipGroups1")}, - // TargetFqdns: []*string{ - // to.Ptr("www.test.com")}, - // }}, - // }, - // }}, - // IPConfigurations: []*armnetwork.AzureFirewallIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewallgw/ipConfigurations/azureFirewallIpConfiguration"), - // Name: to.Ptr("azureFirewallIpConfiguration"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.AzureFirewallIPConfigurationPropertiesFormat{ - // PrivateIPAddress: to.Ptr("10.0.0.0"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), - // }, - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet"), - // }, - // }, - // }}, - // IPGroups: []*armnetwork.AzureFirewallIPGroups{ - // { - // ChangeNumber: to.Ptr("5"), - // ID: to.Ptr("/subscriptions/subId/providers/Microsoft.Network/resourceGroup/myResourceGroup/ipGroups/ipGroups1"), - // }, - // { - // ChangeNumber: to.Ptr("4"), - // ID: to.Ptr("/subscriptions/subId/providers/Microsoft.Network/resourceGroup/myResourceGroup/ipGroups/ipGroups2"), - // }, - // { - // ChangeNumber: to.Ptr("1"), - // ID: to.Ptr("/subscriptions/subId/providers/Microsoft.Network/resourceGroup/myResourceGroup/ipGroups/ipGroups3"), - // }}, - // NatRuleCollections: []*armnetwork.AzureFirewallNatRuleCollection{ - // { - // Name: to.Ptr("natrulecoll"), - // Properties: &armnetwork.AzureFirewallNatRuleCollectionProperties{ - // Action: &armnetwork.AzureFirewallNatRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallNatRCActionTypeDnat), - // }, - // Priority: to.Ptr[int32](112), - // Rules: []*armnetwork.AzureFirewallNatRule{ - // { - // Name: to.Ptr("DNAT-HTTPS-traffic"), - // Description: to.Ptr("D-NAT all outbound web traffic for inspection"), - // DestinationAddresses: []*string{ - // to.Ptr("1.2.3.4")}, - // DestinationPorts: []*string{ - // to.Ptr("443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("*")}, - // TranslatedAddress: to.Ptr("1.2.3.5"), - // TranslatedPort: to.Ptr("8443"), - // }, - // { - // Name: to.Ptr("DNAT-HTTP-traffic-With-FQDN"), - // Description: to.Ptr("D-NAT all inbound web traffic for inspection"), - // DestinationAddresses: []*string{ - // to.Ptr("1.2.3.4")}, - // DestinationPorts: []*string{ - // to.Ptr("80")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceIPGroups: []*string{ - // to.Ptr("/subscriptions/subId/providers/Microsoft.Network/resourceGroup/myResourceGroup/ipGroups/ipGroups1")}, - // TranslatedFqdn: to.Ptr("internalhttpserver"), - // TranslatedPort: to.Ptr("880"), - // }}, - // }, - // }}, - // NetworkRuleCollections: []*armnetwork.AzureFirewallNetworkRuleCollection{ - // { - // Name: to.Ptr("netrulecoll"), - // Properties: &armnetwork.AzureFirewallNetworkRuleCollectionPropertiesFormat{ - // Action: &armnetwork.AzureFirewallRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), - // }, - // Priority: to.Ptr[int32](112), - // Rules: []*armnetwork.AzureFirewallNetworkRule{ - // { - // Name: to.Ptr("L4-traffic"), - // Description: to.Ptr("Block traffic based on source IPs and ports"), - // DestinationIPGroups: []*string{ - // to.Ptr("/subscriptions/subId/providers/Microsoft.Network/resourceGroup/myResourceGroup/ipGroups/ipGroups2")}, - // DestinationPorts: []*string{ - // to.Ptr("443-444"), - // to.Ptr("8443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("192.168.1.1-192.168.1.12"), - // to.Ptr("10.1.4.12-10.1.4.255")}, - // }, - // { - // Name: to.Ptr("L4-traffic-with-FQDN"), - // Description: to.Ptr("Block traffic based on source IPs and ports to amazon"), - // DestinationFqdns: []*string{ - // to.Ptr("www.amazon.com")}, - // DestinationPorts: []*string{ - // to.Ptr("443-444"), - // to.Ptr("8443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceIPGroups: []*string{ - // to.Ptr("/subscriptions/subId/providers/Microsoft.Network/resourceGroup/myResourceGroup/ipGroups/ipGroups3")}, - // }}, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SKU: &armnetwork.AzureFirewallSKU{ - // Name: to.Ptr(armnetwork.AzureFirewallSKUNameAZFWVnet), - // Tier: to.Ptr(armnetwork.AzureFirewallSKUTierStandard), - // }, - // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), - // }, - // Zones: []*string{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/AzureFirewallGetWithZones.json -func ExampleAzureFirewallsClient_Get_getAzureFirewallWithZones() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAzureFirewallsClient().Get(ctx, "rg1", "azurefirewall", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AzureFirewall = armnetwork.AzureFirewall{ - // Name: to.Ptr("azurefirewall"), - // Type: to.Ptr("Microsoft.Network/azureFirewalls"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall"), - // Location: to.Ptr("West US 2"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.AzureFirewallPropertiesFormat{ - // AdditionalProperties: map[string]*string{ - // }, - // ApplicationRuleCollections: []*armnetwork.AzureFirewallApplicationRuleCollection{ - // { - // Name: to.Ptr("apprulecoll"), - // Properties: &armnetwork.AzureFirewallApplicationRuleCollectionPropertiesFormat{ - // Action: &armnetwork.AzureFirewallRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), - // }, - // Priority: to.Ptr[int32](110), - // Rules: []*armnetwork.AzureFirewallApplicationRule{ - // { - // Name: to.Ptr("rule1"), - // Description: to.Ptr("Deny inbound rule"), - // Protocols: []*armnetwork.AzureFirewallApplicationRuleProtocol{ - // { - // Port: to.Ptr[int32](443), - // ProtocolType: to.Ptr(armnetwork.AzureFirewallApplicationRuleProtocolTypeHTTPS), - // }}, - // SourceAddresses: []*string{ - // to.Ptr("216.58.216.164"), - // to.Ptr("10.0.0.0/24")}, - // TargetFqdns: []*string{ - // to.Ptr("www.test.com")}, - // }}, - // }, - // }}, - // IPConfigurations: []*armnetwork.AzureFirewallIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewallgw/ipConfigurations/azureFirewallIpConfiguration"), - // Name: to.Ptr("azureFirewallIpConfiguration"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.AzureFirewallIPConfigurationPropertiesFormat{ - // PrivateIPAddress: to.Ptr("10.0.0.0"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), - // }, - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet"), - // }, - // }, - // }}, - // IPGroups: []*armnetwork.AzureFirewallIPGroups{ - // }, - // NatRuleCollections: []*armnetwork.AzureFirewallNatRuleCollection{ - // { - // Name: to.Ptr("natrulecoll"), - // Properties: &armnetwork.AzureFirewallNatRuleCollectionProperties{ - // Action: &armnetwork.AzureFirewallNatRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallNatRCActionTypeDnat), - // }, - // Priority: to.Ptr[int32](112), - // Rules: []*armnetwork.AzureFirewallNatRule{ - // { - // Name: to.Ptr("DNAT-HTTPS-traffic"), - // Description: to.Ptr("D-NAT all outbound web traffic for inspection"), - // DestinationAddresses: []*string{ - // to.Ptr("1.2.3.4")}, - // DestinationPorts: []*string{ - // to.Ptr("443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("*")}, - // TranslatedAddress: to.Ptr("1.2.3.5"), - // TranslatedPort: to.Ptr("8443"), - // }, - // { - // Name: to.Ptr("DNAT-HTTP-traffic-With-FQDN"), - // Description: to.Ptr("D-NAT all inbound web traffic for inspection"), - // DestinationAddresses: []*string{ - // to.Ptr("1.2.3.4")}, - // DestinationPorts: []*string{ - // to.Ptr("80")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("*")}, - // TranslatedFqdn: to.Ptr("internalhttpserver"), - // TranslatedPort: to.Ptr("880"), - // }}, - // }, - // }}, - // NetworkRuleCollections: []*armnetwork.AzureFirewallNetworkRuleCollection{ - // { - // Name: to.Ptr("netrulecoll"), - // Properties: &armnetwork.AzureFirewallNetworkRuleCollectionPropertiesFormat{ - // Action: &armnetwork.AzureFirewallRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), - // }, - // Priority: to.Ptr[int32](112), - // Rules: []*armnetwork.AzureFirewallNetworkRule{ - // { - // Name: to.Ptr("L4-traffic"), - // Description: to.Ptr("Block traffic based on source IPs and ports"), - // DestinationAddresses: []*string{ - // to.Ptr("*")}, - // DestinationPorts: []*string{ - // to.Ptr("443-444"), - // to.Ptr("8443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("192.168.1.1-192.168.1.12"), - // to.Ptr("10.1.4.12-10.1.4.255")}, - // }, - // { - // Name: to.Ptr("L4-traffic-with-FQDN"), - // Description: to.Ptr("Block traffic based on source IPs and ports to amazon"), - // DestinationFqdns: []*string{ - // to.Ptr("www.amazon.com")}, - // DestinationPorts: []*string{ - // to.Ptr("443-444"), - // to.Ptr("8443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("10.2.4.12-10.2.4.255")}, - // }}, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SKU: &armnetwork.AzureFirewallSKU{ - // Name: to.Ptr(armnetwork.AzureFirewallSKUNameAZFWVnet), - // Tier: to.Ptr(armnetwork.AzureFirewallSKUTierStandard), - // }, - // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), - // }, - // Zones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/AzureFirewallGetWithMgmtSubnet.json -func ExampleAzureFirewallsClient_Get_getAzureFirewallWithManagementSubnet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAzureFirewallsClient().Get(ctx, "rg1", "azurefirewall", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AzureFirewall = armnetwork.AzureFirewall{ - // Name: to.Ptr("azurefirewall"), - // Type: to.Ptr("Microsoft.Network/azureFirewalls"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.AzureFirewallPropertiesFormat{ - // AdditionalProperties: map[string]*string{ - // }, - // ApplicationRuleCollections: []*armnetwork.AzureFirewallApplicationRuleCollection{ - // { - // Name: to.Ptr("apprulecoll"), - // Properties: &armnetwork.AzureFirewallApplicationRuleCollectionPropertiesFormat{ - // Action: &armnetwork.AzureFirewallRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), - // }, - // Priority: to.Ptr[int32](110), - // Rules: []*armnetwork.AzureFirewallApplicationRule{ - // { - // Name: to.Ptr("rule1"), - // Description: to.Ptr("Deny inbound rule"), - // Protocols: []*armnetwork.AzureFirewallApplicationRuleProtocol{ - // { - // Port: to.Ptr[int32](443), - // ProtocolType: to.Ptr(armnetwork.AzureFirewallApplicationRuleProtocolTypeHTTPS), - // }}, - // SourceAddresses: []*string{ - // to.Ptr("216.58.216.164"), - // to.Ptr("10.0.0.0/24")}, - // TargetFqdns: []*string{ - // to.Ptr("www.test.com")}, - // }}, - // }, - // }}, - // IPConfigurations: []*armnetwork.AzureFirewallIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewallgw/ipConfigurations/azureFirewallIpConfiguration"), - // Name: to.Ptr("azureFirewallIpConfiguration"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.AzureFirewallIPConfigurationPropertiesFormat{ - // PrivateIPAddress: to.Ptr("10.0.0.0"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), - // }, - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet"), - // }, - // }, - // }}, - // ManagementIPConfiguration: &armnetwork.AzureFirewallIPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewallgw/ipConfigurations/azureFirewallMgmtIpConfiguration"), - // Name: to.Ptr("azureFirewallMgmtIpConfiguration"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.AzureFirewallIPConfigurationPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/managementPipName"), - // }, - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallManagementSubnet"), - // }, - // }, - // }, - // NatRuleCollections: []*armnetwork.AzureFirewallNatRuleCollection{ - // { - // Name: to.Ptr("natrulecoll"), - // Properties: &armnetwork.AzureFirewallNatRuleCollectionProperties{ - // Action: &armnetwork.AzureFirewallNatRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallNatRCActionTypeDnat), - // }, - // Priority: to.Ptr[int32](112), - // Rules: []*armnetwork.AzureFirewallNatRule{ - // { - // Name: to.Ptr("DNAT-HTTPS-traffic"), - // Description: to.Ptr("D-NAT all outbound web traffic for inspection"), - // DestinationAddresses: []*string{ - // to.Ptr("1.2.3.4")}, - // DestinationPorts: []*string{ - // to.Ptr("443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("*")}, - // TranslatedAddress: to.Ptr("1.2.3.5"), - // TranslatedPort: to.Ptr("8443"), - // }, - // { - // Name: to.Ptr("DNAT-HTTP-traffic-With-FQDN"), - // Description: to.Ptr("D-NAT all inbound web traffic for inspection"), - // DestinationAddresses: []*string{ - // to.Ptr("1.2.3.4")}, - // DestinationPorts: []*string{ - // to.Ptr("80")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("*")}, - // TranslatedFqdn: to.Ptr("internalhttpserver"), - // TranslatedPort: to.Ptr("880"), - // }}, - // }, - // }}, - // NetworkRuleCollections: []*armnetwork.AzureFirewallNetworkRuleCollection{ - // { - // Name: to.Ptr("netrulecoll"), - // Properties: &armnetwork.AzureFirewallNetworkRuleCollectionPropertiesFormat{ - // Action: &armnetwork.AzureFirewallRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), - // }, - // Priority: to.Ptr[int32](112), - // Rules: []*armnetwork.AzureFirewallNetworkRule{ - // { - // Name: to.Ptr("L4-traffic"), - // Description: to.Ptr("Block traffic based on source IPs and ports"), - // DestinationAddresses: []*string{ - // to.Ptr("*")}, - // DestinationPorts: []*string{ - // to.Ptr("443-444"), - // to.Ptr("8443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("192.168.1.1-192.168.1.12"), - // to.Ptr("10.1.4.12-10.1.4.255")}, - // }, - // { - // Name: to.Ptr("L4-traffic-with-FQDN"), - // Description: to.Ptr("Block traffic based on source IPs and ports to amazon"), - // DestinationFqdns: []*string{ - // to.Ptr("www.amazon.com")}, - // DestinationPorts: []*string{ - // to.Ptr("443-444"), - // to.Ptr("8443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("10.2.4.12-10.2.4.255")}, - // }}, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SKU: &armnetwork.AzureFirewallSKU{ - // Name: to.Ptr(armnetwork.AzureFirewallSKUNameAZFWVnet), - // Tier: to.Ptr(armnetwork.AzureFirewallSKUTierStandard), - // }, - // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), - // }, - // Zones: []*string{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/AzureFirewallPut.json -func ExampleAzureFirewallsClient_BeginCreateOrUpdate_createAzureFirewall() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAzureFirewallsClient().BeginCreateOrUpdate(ctx, "rg1", "azurefirewall", armnetwork.AzureFirewall{ - Location: to.Ptr("West US"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, - Properties: &armnetwork.AzureFirewallPropertiesFormat{ - ApplicationRuleCollections: []*armnetwork.AzureFirewallApplicationRuleCollection{ - { - Name: to.Ptr("apprulecoll"), - Properties: &armnetwork.AzureFirewallApplicationRuleCollectionPropertiesFormat{ - Action: &armnetwork.AzureFirewallRCAction{ - Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), - }, - Priority: to.Ptr[int32](110), - Rules: []*armnetwork.AzureFirewallApplicationRule{ - { - Name: to.Ptr("rule1"), - Description: to.Ptr("Deny inbound rule"), - Protocols: []*armnetwork.AzureFirewallApplicationRuleProtocol{ - { - Port: to.Ptr[int32](443), - ProtocolType: to.Ptr(armnetwork.AzureFirewallApplicationRuleProtocolTypeHTTPS), - }}, - SourceAddresses: []*string{ - to.Ptr("216.58.216.164"), - to.Ptr("10.0.0.0/24")}, - TargetFqdns: []*string{ - to.Ptr("www.test.com")}, - }}, - }, - }}, - IPConfigurations: []*armnetwork.AzureFirewallIPConfiguration{ - { - Name: to.Ptr("azureFirewallIpConfiguration"), - Properties: &armnetwork.AzureFirewallIPConfigurationPropertiesFormat{ - PublicIPAddress: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), - }, - Subnet: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet"), - }, - }, - }}, - NatRuleCollections: []*armnetwork.AzureFirewallNatRuleCollection{ - { - Name: to.Ptr("natrulecoll"), - Properties: &armnetwork.AzureFirewallNatRuleCollectionProperties{ - Action: &armnetwork.AzureFirewallNatRCAction{ - Type: to.Ptr(armnetwork.AzureFirewallNatRCActionTypeDnat), - }, - Priority: to.Ptr[int32](112), - Rules: []*armnetwork.AzureFirewallNatRule{ - { - Name: to.Ptr("DNAT-HTTPS-traffic"), - Description: to.Ptr("D-NAT all outbound web traffic for inspection"), - DestinationAddresses: []*string{ - to.Ptr("1.2.3.4")}, - DestinationPorts: []*string{ - to.Ptr("443")}, - Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - SourceAddresses: []*string{ - to.Ptr("*")}, - TranslatedAddress: to.Ptr("1.2.3.5"), - TranslatedPort: to.Ptr("8443"), - }, - { - Name: to.Ptr("DNAT-HTTP-traffic-With-FQDN"), - Description: to.Ptr("D-NAT all inbound web traffic for inspection"), - DestinationAddresses: []*string{ - to.Ptr("1.2.3.4")}, - DestinationPorts: []*string{ - to.Ptr("80")}, - Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - SourceAddresses: []*string{ - to.Ptr("*")}, - TranslatedFqdn: to.Ptr("internalhttpserver"), - TranslatedPort: to.Ptr("880"), - }}, - }, - }}, - NetworkRuleCollections: []*armnetwork.AzureFirewallNetworkRuleCollection{ - { - Name: to.Ptr("netrulecoll"), - Properties: &armnetwork.AzureFirewallNetworkRuleCollectionPropertiesFormat{ - Action: &armnetwork.AzureFirewallRCAction{ - Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), - }, - Priority: to.Ptr[int32](112), - Rules: []*armnetwork.AzureFirewallNetworkRule{ - { - Name: to.Ptr("L4-traffic"), - Description: to.Ptr("Block traffic based on source IPs and ports"), - DestinationAddresses: []*string{ - to.Ptr("*")}, - DestinationPorts: []*string{ - to.Ptr("443-444"), - to.Ptr("8443")}, - Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - SourceAddresses: []*string{ - to.Ptr("192.168.1.1-192.168.1.12"), - to.Ptr("10.1.4.12-10.1.4.255")}, - }, - { - Name: to.Ptr("L4-traffic-with-FQDN"), - Description: to.Ptr("Block traffic based on source IPs and ports to amazon"), - DestinationFqdns: []*string{ - to.Ptr("www.amazon.com")}, - DestinationPorts: []*string{ - to.Ptr("443-444"), - to.Ptr("8443")}, - Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - SourceAddresses: []*string{ - to.Ptr("10.2.4.12-10.2.4.255")}, - }}, - }, - }}, - SKU: &armnetwork.AzureFirewallSKU{ - Name: to.Ptr(armnetwork.AzureFirewallSKUNameAZFWVnet), - Tier: to.Ptr(armnetwork.AzureFirewallSKUTierStandard), - }, - ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), - }, - Zones: []*string{}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AzureFirewall = armnetwork.AzureFirewall{ - // Name: to.Ptr("azurefirewall"), - // Type: to.Ptr("Microsoft.Network/azureFirewalls"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.AzureFirewallPropertiesFormat{ - // AdditionalProperties: map[string]*string{ - // }, - // ApplicationRuleCollections: []*armnetwork.AzureFirewallApplicationRuleCollection{ - // { - // Name: to.Ptr("apprulecoll"), - // Properties: &armnetwork.AzureFirewallApplicationRuleCollectionPropertiesFormat{ - // Action: &armnetwork.AzureFirewallRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), - // }, - // Priority: to.Ptr[int32](110), - // Rules: []*armnetwork.AzureFirewallApplicationRule{ - // { - // Name: to.Ptr("rule1"), - // Description: to.Ptr("Deny inbound rule"), - // Protocols: []*armnetwork.AzureFirewallApplicationRuleProtocol{ - // { - // Port: to.Ptr[int32](443), - // ProtocolType: to.Ptr(armnetwork.AzureFirewallApplicationRuleProtocolTypeHTTPS), - // }}, - // SourceAddresses: []*string{ - // to.Ptr("216.58.216.164"), - // to.Ptr("10.0.0.0/24")}, - // TargetFqdns: []*string{ - // to.Ptr("www.test.com")}, - // }}, - // }, - // }}, - // IPConfigurations: []*armnetwork.AzureFirewallIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azfirewallgw/ipConfigurations/azureFirewallIpConfiguration"), - // Name: to.Ptr("azureFirewallIpConfiguration"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.AzureFirewallIPConfigurationPropertiesFormat{ - // PrivateIPAddress: to.Ptr("10.0.0.0"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), - // }, - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet"), - // }, - // }, - // }}, - // IPGroups: []*armnetwork.AzureFirewallIPGroups{ - // }, - // NatRuleCollections: []*armnetwork.AzureFirewallNatRuleCollection{ - // { - // Name: to.Ptr("natrulecoll"), - // Properties: &armnetwork.AzureFirewallNatRuleCollectionProperties{ - // Action: &armnetwork.AzureFirewallNatRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallNatRCActionTypeDnat), - // }, - // Priority: to.Ptr[int32](112), - // Rules: []*armnetwork.AzureFirewallNatRule{ - // { - // Name: to.Ptr("DNAT-HTTPS-traffic"), - // Description: to.Ptr("D-NAT all outbound web traffic for inspection"), - // DestinationAddresses: []*string{ - // to.Ptr("1.2.3.4")}, - // DestinationPorts: []*string{ - // to.Ptr("443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("*")}, - // TranslatedAddress: to.Ptr("1.2.3.5"), - // TranslatedPort: to.Ptr("8443"), - // }, - // { - // Name: to.Ptr("DNAT-HTTP-traffic-With-FQDN"), - // Description: to.Ptr("D-NAT all inbound web traffic for inspection"), - // DestinationAddresses: []*string{ - // to.Ptr("1.2.3.4")}, - // DestinationPorts: []*string{ - // to.Ptr("80")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("*")}, - // TranslatedFqdn: to.Ptr("internalhttpserver"), - // TranslatedPort: to.Ptr("880"), - // }}, - // }, - // }}, - // NetworkRuleCollections: []*armnetwork.AzureFirewallNetworkRuleCollection{ - // { - // Name: to.Ptr("netrulecoll"), - // Properties: &armnetwork.AzureFirewallNetworkRuleCollectionPropertiesFormat{ - // Action: &armnetwork.AzureFirewallRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), - // }, - // Priority: to.Ptr[int32](112), - // Rules: []*armnetwork.AzureFirewallNetworkRule{ - // { - // Name: to.Ptr("L4-traffic"), - // Description: to.Ptr("Block traffic based on source IPs and ports"), - // DestinationAddresses: []*string{ - // to.Ptr("*")}, - // DestinationPorts: []*string{ - // to.Ptr("443-444"), - // to.Ptr("8443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("192.168.1.1-192.168.1.12"), - // to.Ptr("10.1.4.12-10.1.4.255")}, - // }, - // { - // Name: to.Ptr("L4-traffic-with-FQDN"), - // Description: to.Ptr("Block traffic based on source IPs and ports to amazon"), - // DestinationFqdns: []*string{ - // to.Ptr("www.amazon.com")}, - // DestinationPorts: []*string{ - // to.Ptr("443-444"), - // to.Ptr("8443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("10.2.4.12-10.2.4.255")}, - // }}, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SKU: &armnetwork.AzureFirewallSKU{ - // Name: to.Ptr(armnetwork.AzureFirewallSKUNameAZFWVnet), - // Tier: to.Ptr(armnetwork.AzureFirewallSKUTierStandard), - // }, - // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), - // }, - // Zones: []*string{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/AzureFirewallPutWithAdditionalProperties.json -func ExampleAzureFirewallsClient_BeginCreateOrUpdate_createAzureFirewallWithAdditionalProperties() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAzureFirewallsClient().BeginCreateOrUpdate(ctx, "rg1", "azurefirewall", armnetwork.AzureFirewall{ - Location: to.Ptr("West US"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, - Properties: &armnetwork.AzureFirewallPropertiesFormat{ - AdditionalProperties: map[string]*string{ - "key1": to.Ptr("value1"), - "key2": to.Ptr("value2"), - }, - ApplicationRuleCollections: []*armnetwork.AzureFirewallApplicationRuleCollection{ - { - Name: to.Ptr("apprulecoll"), - Properties: &armnetwork.AzureFirewallApplicationRuleCollectionPropertiesFormat{ - Action: &armnetwork.AzureFirewallRCAction{ - Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), - }, - Priority: to.Ptr[int32](110), - Rules: []*armnetwork.AzureFirewallApplicationRule{ - { - Name: to.Ptr("rule1"), - Description: to.Ptr("Deny inbound rule"), - Protocols: []*armnetwork.AzureFirewallApplicationRuleProtocol{ - { - Port: to.Ptr[int32](443), - ProtocolType: to.Ptr(armnetwork.AzureFirewallApplicationRuleProtocolTypeHTTPS), - }}, - SourceAddresses: []*string{ - to.Ptr("216.58.216.164"), - to.Ptr("10.0.0.0/24")}, - TargetFqdns: []*string{ - to.Ptr("www.test.com")}, - }}, - }, - }}, - IPConfigurations: []*armnetwork.AzureFirewallIPConfiguration{ - { - Name: to.Ptr("azureFirewallIpConfiguration"), - Properties: &armnetwork.AzureFirewallIPConfigurationPropertiesFormat{ - PublicIPAddress: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), - }, - Subnet: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet"), - }, - }, - }}, - IPGroups: []*armnetwork.AzureFirewallIPGroups{}, - NatRuleCollections: []*armnetwork.AzureFirewallNatRuleCollection{ - { - Name: to.Ptr("natrulecoll"), - Properties: &armnetwork.AzureFirewallNatRuleCollectionProperties{ - Action: &armnetwork.AzureFirewallNatRCAction{ - Type: to.Ptr(armnetwork.AzureFirewallNatRCActionTypeDnat), - }, - Priority: to.Ptr[int32](112), - Rules: []*armnetwork.AzureFirewallNatRule{ - { - Name: to.Ptr("DNAT-HTTPS-traffic"), - Description: to.Ptr("D-NAT all outbound web traffic for inspection"), - DestinationAddresses: []*string{ - to.Ptr("1.2.3.4")}, - DestinationPorts: []*string{ - to.Ptr("443")}, - Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - SourceAddresses: []*string{ - to.Ptr("*")}, - TranslatedAddress: to.Ptr("1.2.3.5"), - TranslatedPort: to.Ptr("8443"), - }, - { - Name: to.Ptr("DNAT-HTTP-traffic-With-FQDN"), - Description: to.Ptr("D-NAT all inbound web traffic for inspection"), - DestinationAddresses: []*string{ - to.Ptr("1.2.3.4")}, - DestinationPorts: []*string{ - to.Ptr("80")}, - Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - SourceAddresses: []*string{ - to.Ptr("*")}, - TranslatedFqdn: to.Ptr("internalhttpserver"), - TranslatedPort: to.Ptr("880"), - }}, - }, - }}, - NetworkRuleCollections: []*armnetwork.AzureFirewallNetworkRuleCollection{ - { - Name: to.Ptr("netrulecoll"), - Properties: &armnetwork.AzureFirewallNetworkRuleCollectionPropertiesFormat{ - Action: &armnetwork.AzureFirewallRCAction{ - Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), - }, - Priority: to.Ptr[int32](112), - Rules: []*armnetwork.AzureFirewallNetworkRule{ - { - Name: to.Ptr("L4-traffic"), - Description: to.Ptr("Block traffic based on source IPs and ports"), - DestinationAddresses: []*string{ - to.Ptr("*")}, - DestinationPorts: []*string{ - to.Ptr("443-444"), - to.Ptr("8443")}, - Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - SourceAddresses: []*string{ - to.Ptr("192.168.1.1-192.168.1.12"), - to.Ptr("10.1.4.12-10.1.4.255")}, - }, - { - Name: to.Ptr("L4-traffic-with-FQDN"), - Description: to.Ptr("Block traffic based on source IPs and ports to amazon"), - DestinationFqdns: []*string{ - to.Ptr("www.amazon.com")}, - DestinationPorts: []*string{ - to.Ptr("443-444"), - to.Ptr("8443")}, - Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - SourceAddresses: []*string{ - to.Ptr("10.2.4.12-10.2.4.255")}, - }}, - }, - }}, - SKU: &armnetwork.AzureFirewallSKU{ - Name: to.Ptr(armnetwork.AzureFirewallSKUNameAZFWVnet), - Tier: to.Ptr(armnetwork.AzureFirewallSKUTierStandard), - }, - ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), - }, - Zones: []*string{}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AzureFirewall = armnetwork.AzureFirewall{ - // Name: to.Ptr("azurefirewall"), - // Type: to.Ptr("Microsoft.Network/azureFirewalls"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.AzureFirewallPropertiesFormat{ - // AdditionalProperties: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // ApplicationRuleCollections: []*armnetwork.AzureFirewallApplicationRuleCollection{ - // { - // Name: to.Ptr("apprulecoll"), - // Properties: &armnetwork.AzureFirewallApplicationRuleCollectionPropertiesFormat{ - // Action: &armnetwork.AzureFirewallRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), - // }, - // Priority: to.Ptr[int32](110), - // Rules: []*armnetwork.AzureFirewallApplicationRule{ - // { - // Name: to.Ptr("rule1"), - // Description: to.Ptr("Deny inbound rule"), - // Protocols: []*armnetwork.AzureFirewallApplicationRuleProtocol{ - // { - // Port: to.Ptr[int32](443), - // ProtocolType: to.Ptr(armnetwork.AzureFirewallApplicationRuleProtocolTypeHTTPS), - // }}, - // SourceAddresses: []*string{ - // to.Ptr("216.58.216.164"), - // to.Ptr("10.0.0.0/24")}, - // TargetFqdns: []*string{ - // to.Ptr("www.test.com")}, - // }}, - // }, - // }}, - // IPConfigurations: []*armnetwork.AzureFirewallIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azfirewallgw/ipConfigurations/azureFirewallIpConfiguration"), - // Name: to.Ptr("azureFirewallIpConfiguration"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.AzureFirewallIPConfigurationPropertiesFormat{ - // PrivateIPAddress: to.Ptr("10.0.0.0"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), - // }, - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet"), - // }, - // }, - // }}, - // NatRuleCollections: []*armnetwork.AzureFirewallNatRuleCollection{ - // { - // Name: to.Ptr("natrulecoll"), - // Properties: &armnetwork.AzureFirewallNatRuleCollectionProperties{ - // Action: &armnetwork.AzureFirewallNatRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallNatRCActionTypeDnat), - // }, - // Priority: to.Ptr[int32](112), - // Rules: []*armnetwork.AzureFirewallNatRule{ - // { - // Name: to.Ptr("DNAT-HTTPS-traffic"), - // Description: to.Ptr("D-NAT all outbound web traffic for inspection"), - // DestinationAddresses: []*string{ - // to.Ptr("1.2.3.4")}, - // DestinationPorts: []*string{ - // to.Ptr("443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("*")}, - // TranslatedAddress: to.Ptr("1.2.3.5"), - // TranslatedPort: to.Ptr("8443"), - // }, - // { - // Name: to.Ptr("DNAT-HTTP-traffic-With-FQDN"), - // Description: to.Ptr("D-NAT all inbound web traffic for inspection"), - // DestinationAddresses: []*string{ - // to.Ptr("1.2.3.4")}, - // DestinationPorts: []*string{ - // to.Ptr("80")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("*")}, - // TranslatedFqdn: to.Ptr("internalhttpserver"), - // TranslatedPort: to.Ptr("880"), - // }}, - // }, - // }}, - // NetworkRuleCollections: []*armnetwork.AzureFirewallNetworkRuleCollection{ - // { - // Name: to.Ptr("netrulecoll"), - // Properties: &armnetwork.AzureFirewallNetworkRuleCollectionPropertiesFormat{ - // Action: &armnetwork.AzureFirewallRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), - // }, - // Priority: to.Ptr[int32](112), - // Rules: []*armnetwork.AzureFirewallNetworkRule{ - // { - // Name: to.Ptr("L4-traffic"), - // Description: to.Ptr("Block traffic based on source IPs and ports"), - // DestinationAddresses: []*string{ - // to.Ptr("*")}, - // DestinationPorts: []*string{ - // to.Ptr("443-444"), - // to.Ptr("8443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("192.168.1.1-192.168.1.12"), - // to.Ptr("10.1.4.12-10.1.4.255")}, - // }, - // { - // Name: to.Ptr("L4-traffic-with-FQDN"), - // Description: to.Ptr("Block traffic based on source IPs and ports to amazon"), - // DestinationFqdns: []*string{ - // to.Ptr("www.amazon.com")}, - // DestinationPorts: []*string{ - // to.Ptr("443-444"), - // to.Ptr("8443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("10.2.4.12-10.2.4.255")}, - // }}, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SKU: &armnetwork.AzureFirewallSKU{ - // Name: to.Ptr(armnetwork.AzureFirewallSKUNameAZFWVnet), - // Tier: to.Ptr(armnetwork.AzureFirewallSKUTierStandard), - // }, - // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), - // }, - // Zones: []*string{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/AzureFirewallPutWithIpGroups.json -func ExampleAzureFirewallsClient_BeginCreateOrUpdate_createAzureFirewallWithIpGroups() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAzureFirewallsClient().BeginCreateOrUpdate(ctx, "rg1", "azurefirewall", armnetwork.AzureFirewall{ - Location: to.Ptr("West US"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, - Properties: &armnetwork.AzureFirewallPropertiesFormat{ - ApplicationRuleCollections: []*armnetwork.AzureFirewallApplicationRuleCollection{ - { - Name: to.Ptr("apprulecoll"), - Properties: &armnetwork.AzureFirewallApplicationRuleCollectionPropertiesFormat{ - Action: &armnetwork.AzureFirewallRCAction{ - Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), - }, - Priority: to.Ptr[int32](110), - Rules: []*armnetwork.AzureFirewallApplicationRule{ - { - Name: to.Ptr("rule1"), - Description: to.Ptr("Deny inbound rule"), - Protocols: []*armnetwork.AzureFirewallApplicationRuleProtocol{ - { - Port: to.Ptr[int32](443), - ProtocolType: to.Ptr(armnetwork.AzureFirewallApplicationRuleProtocolTypeHTTPS), - }}, - SourceAddresses: []*string{ - to.Ptr("216.58.216.164"), - to.Ptr("10.0.0.0/24")}, - TargetFqdns: []*string{ - to.Ptr("www.test.com")}, - }}, - }, - }}, - IPConfigurations: []*armnetwork.AzureFirewallIPConfiguration{ - { - Name: to.Ptr("azureFirewallIpConfiguration"), - Properties: &armnetwork.AzureFirewallIPConfigurationPropertiesFormat{ - PublicIPAddress: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), - }, - Subnet: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet"), - }, - }, - }}, - NatRuleCollections: []*armnetwork.AzureFirewallNatRuleCollection{ - { - Name: to.Ptr("natrulecoll"), - Properties: &armnetwork.AzureFirewallNatRuleCollectionProperties{ - Action: &armnetwork.AzureFirewallNatRCAction{ - Type: to.Ptr(armnetwork.AzureFirewallNatRCActionTypeDnat), - }, - Priority: to.Ptr[int32](112), - Rules: []*armnetwork.AzureFirewallNatRule{ - { - Name: to.Ptr("DNAT-HTTPS-traffic"), - Description: to.Ptr("D-NAT all outbound web traffic for inspection"), - DestinationAddresses: []*string{ - to.Ptr("1.2.3.4")}, - DestinationPorts: []*string{ - to.Ptr("443")}, - Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - SourceAddresses: []*string{ - to.Ptr("*")}, - TranslatedAddress: to.Ptr("1.2.3.5"), - TranslatedPort: to.Ptr("8443"), - }, - { - Name: to.Ptr("DNAT-HTTP-traffic-With-FQDN"), - Description: to.Ptr("D-NAT all inbound web traffic for inspection"), - DestinationAddresses: []*string{ - to.Ptr("1.2.3.4")}, - DestinationPorts: []*string{ - to.Ptr("80")}, - Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - SourceAddresses: []*string{ - to.Ptr("*")}, - TranslatedFqdn: to.Ptr("internalhttpserver"), - TranslatedPort: to.Ptr("880"), - }}, - }, - }}, - NetworkRuleCollections: []*armnetwork.AzureFirewallNetworkRuleCollection{ - { - Name: to.Ptr("netrulecoll"), - Properties: &armnetwork.AzureFirewallNetworkRuleCollectionPropertiesFormat{ - Action: &armnetwork.AzureFirewallRCAction{ - Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), - }, - Priority: to.Ptr[int32](112), - Rules: []*armnetwork.AzureFirewallNetworkRule{ - { - Name: to.Ptr("L4-traffic"), - Description: to.Ptr("Block traffic based on source IPs and ports"), - DestinationAddresses: []*string{ - to.Ptr("*")}, - DestinationPorts: []*string{ - to.Ptr("443-444"), - to.Ptr("8443")}, - Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - SourceAddresses: []*string{ - to.Ptr("192.168.1.1-192.168.1.12"), - to.Ptr("10.1.4.12-10.1.4.255")}, - }, - { - Name: to.Ptr("L4-traffic-with-FQDN"), - Description: to.Ptr("Block traffic based on source IPs and ports to amazon"), - DestinationFqdns: []*string{ - to.Ptr("www.amazon.com")}, - DestinationPorts: []*string{ - to.Ptr("443-444"), - to.Ptr("8443")}, - Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - SourceAddresses: []*string{ - to.Ptr("10.2.4.12-10.2.4.255")}, - }}, - }, - }}, - SKU: &armnetwork.AzureFirewallSKU{ - Name: to.Ptr(armnetwork.AzureFirewallSKUNameAZFWVnet), - Tier: to.Ptr(armnetwork.AzureFirewallSKUTierStandard), - }, - ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), - }, - Zones: []*string{}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AzureFirewall = armnetwork.AzureFirewall{ - // Name: to.Ptr("azurefirewall"), - // Type: to.Ptr("Microsoft.Network/azureFirewalls"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.AzureFirewallPropertiesFormat{ - // AdditionalProperties: map[string]*string{ - // }, - // ApplicationRuleCollections: []*armnetwork.AzureFirewallApplicationRuleCollection{ - // { - // Name: to.Ptr("apprulecoll"), - // Properties: &armnetwork.AzureFirewallApplicationRuleCollectionPropertiesFormat{ - // Action: &armnetwork.AzureFirewallRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), - // }, - // Priority: to.Ptr[int32](110), - // Rules: []*armnetwork.AzureFirewallApplicationRule{ - // { - // Name: to.Ptr("rule1"), - // Description: to.Ptr("Deny inbound rule"), - // Protocols: []*armnetwork.AzureFirewallApplicationRuleProtocol{ - // { - // Port: to.Ptr[int32](443), - // ProtocolType: to.Ptr(armnetwork.AzureFirewallApplicationRuleProtocolTypeHTTPS), - // }}, - // SourceAddresses: []*string{ - // to.Ptr("216.58.216.164"), - // to.Ptr("10.0.0.0/24")}, - // TargetFqdns: []*string{ - // to.Ptr("www.test.com")}, - // }}, - // }, - // }}, - // IPConfigurations: []*armnetwork.AzureFirewallIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azfirewallgw/ipConfigurations/azureFirewallIpConfiguration"), - // Name: to.Ptr("azureFirewallIpConfiguration"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.AzureFirewallIPConfigurationPropertiesFormat{ - // PrivateIPAddress: to.Ptr("10.0.0.0"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), - // }, - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet"), - // }, - // }, - // }}, - // NatRuleCollections: []*armnetwork.AzureFirewallNatRuleCollection{ - // { - // Name: to.Ptr("natrulecoll"), - // Properties: &armnetwork.AzureFirewallNatRuleCollectionProperties{ - // Action: &armnetwork.AzureFirewallNatRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallNatRCActionTypeDnat), - // }, - // Priority: to.Ptr[int32](112), - // Rules: []*armnetwork.AzureFirewallNatRule{ - // { - // Name: to.Ptr("DNAT-HTTPS-traffic"), - // Description: to.Ptr("D-NAT all outbound web traffic for inspection"), - // DestinationAddresses: []*string{ - // to.Ptr("1.2.3.4")}, - // DestinationPorts: []*string{ - // to.Ptr("443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("*")}, - // TranslatedAddress: to.Ptr("1.2.3.5"), - // TranslatedPort: to.Ptr("8443"), - // }, - // { - // Name: to.Ptr("DNAT-HTTP-traffic-With-FQDN"), - // Description: to.Ptr("D-NAT all inbound web traffic for inspection"), - // DestinationAddresses: []*string{ - // to.Ptr("1.2.3.4")}, - // DestinationPorts: []*string{ - // to.Ptr("80")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("*")}, - // TranslatedFqdn: to.Ptr("internalhttpserver"), - // TranslatedPort: to.Ptr("880"), - // }}, - // }, - // }}, - // NetworkRuleCollections: []*armnetwork.AzureFirewallNetworkRuleCollection{ - // { - // Name: to.Ptr("netrulecoll"), - // Properties: &armnetwork.AzureFirewallNetworkRuleCollectionPropertiesFormat{ - // Action: &armnetwork.AzureFirewallRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), - // }, - // Priority: to.Ptr[int32](112), - // Rules: []*armnetwork.AzureFirewallNetworkRule{ - // { - // Name: to.Ptr("L4-traffic"), - // Description: to.Ptr("Block traffic based on source IPs and ports"), - // DestinationAddresses: []*string{ - // to.Ptr("*")}, - // DestinationPorts: []*string{ - // to.Ptr("443-444"), - // to.Ptr("8443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("192.168.1.1-192.168.1.12"), - // to.Ptr("10.1.4.12-10.1.4.255")}, - // }, - // { - // Name: to.Ptr("L4-traffic-with-FQDN"), - // Description: to.Ptr("Block traffic based on source IPs and ports to amazon"), - // DestinationFqdns: []*string{ - // to.Ptr("www.amazon.com")}, - // DestinationPorts: []*string{ - // to.Ptr("443-444"), - // to.Ptr("8443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("10.2.4.12-10.2.4.255")}, - // }}, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SKU: &armnetwork.AzureFirewallSKU{ - // Name: to.Ptr(armnetwork.AzureFirewallSKUNameAZFWVnet), - // Tier: to.Ptr(armnetwork.AzureFirewallSKUTierStandard), - // }, - // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), - // }, - // Zones: []*string{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/AzureFirewallPutWithZones.json -func ExampleAzureFirewallsClient_BeginCreateOrUpdate_createAzureFirewallWithZones() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAzureFirewallsClient().BeginCreateOrUpdate(ctx, "rg1", "azurefirewall", armnetwork.AzureFirewall{ - Location: to.Ptr("West US 2"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, - Properties: &armnetwork.AzureFirewallPropertiesFormat{ - ApplicationRuleCollections: []*armnetwork.AzureFirewallApplicationRuleCollection{ - { - Name: to.Ptr("apprulecoll"), - Properties: &armnetwork.AzureFirewallApplicationRuleCollectionPropertiesFormat{ - Action: &armnetwork.AzureFirewallRCAction{ - Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), - }, - Priority: to.Ptr[int32](110), - Rules: []*armnetwork.AzureFirewallApplicationRule{ - { - Name: to.Ptr("rule1"), - Description: to.Ptr("Deny inbound rule"), - Protocols: []*armnetwork.AzureFirewallApplicationRuleProtocol{ - { - Port: to.Ptr[int32](443), - ProtocolType: to.Ptr(armnetwork.AzureFirewallApplicationRuleProtocolTypeHTTPS), - }}, - SourceAddresses: []*string{ - to.Ptr("216.58.216.164"), - to.Ptr("10.0.0.0/24")}, - TargetFqdns: []*string{ - to.Ptr("www.test.com")}, - }}, - }, - }}, - IPConfigurations: []*armnetwork.AzureFirewallIPConfiguration{ - { - Name: to.Ptr("azureFirewallIpConfiguration"), - Properties: &armnetwork.AzureFirewallIPConfigurationPropertiesFormat{ - PublicIPAddress: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), - }, - Subnet: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet"), - }, - }, - }}, - NatRuleCollections: []*armnetwork.AzureFirewallNatRuleCollection{ - { - Name: to.Ptr("natrulecoll"), - Properties: &armnetwork.AzureFirewallNatRuleCollectionProperties{ - Action: &armnetwork.AzureFirewallNatRCAction{ - Type: to.Ptr(armnetwork.AzureFirewallNatRCActionTypeDnat), - }, - Priority: to.Ptr[int32](112), - Rules: []*armnetwork.AzureFirewallNatRule{ - { - Name: to.Ptr("DNAT-HTTPS-traffic"), - Description: to.Ptr("D-NAT all outbound web traffic for inspection"), - DestinationAddresses: []*string{ - to.Ptr("1.2.3.4")}, - DestinationPorts: []*string{ - to.Ptr("443")}, - Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - SourceAddresses: []*string{ - to.Ptr("*")}, - TranslatedAddress: to.Ptr("1.2.3.5"), - TranslatedPort: to.Ptr("8443"), - }, - { - Name: to.Ptr("DNAT-HTTP-traffic-With-FQDN"), - Description: to.Ptr("D-NAT all inbound web traffic for inspection"), - DestinationAddresses: []*string{ - to.Ptr("1.2.3.4")}, - DestinationPorts: []*string{ - to.Ptr("80")}, - Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - SourceAddresses: []*string{ - to.Ptr("*")}, - TranslatedFqdn: to.Ptr("internalhttpserver"), - TranslatedPort: to.Ptr("880"), - }}, - }, - }}, - NetworkRuleCollections: []*armnetwork.AzureFirewallNetworkRuleCollection{ - { - Name: to.Ptr("netrulecoll"), - Properties: &armnetwork.AzureFirewallNetworkRuleCollectionPropertiesFormat{ - Action: &armnetwork.AzureFirewallRCAction{ - Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), - }, - Priority: to.Ptr[int32](112), - Rules: []*armnetwork.AzureFirewallNetworkRule{ - { - Name: to.Ptr("L4-traffic"), - Description: to.Ptr("Block traffic based on source IPs and ports"), - DestinationAddresses: []*string{ - to.Ptr("*")}, - DestinationPorts: []*string{ - to.Ptr("443-444"), - to.Ptr("8443")}, - Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - SourceAddresses: []*string{ - to.Ptr("192.168.1.1-192.168.1.12"), - to.Ptr("10.1.4.12-10.1.4.255")}, - }, - { - Name: to.Ptr("L4-traffic-with-FQDN"), - Description: to.Ptr("Block traffic based on source IPs and ports to amazon"), - DestinationFqdns: []*string{ - to.Ptr("www.amazon.com")}, - DestinationPorts: []*string{ - to.Ptr("443-444"), - to.Ptr("8443")}, - Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - SourceAddresses: []*string{ - to.Ptr("10.2.4.12-10.2.4.255")}, - }}, - }, - }}, - SKU: &armnetwork.AzureFirewallSKU{ - Name: to.Ptr(armnetwork.AzureFirewallSKUNameAZFWVnet), - Tier: to.Ptr(armnetwork.AzureFirewallSKUTierStandard), - }, - ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), - }, - Zones: []*string{ - to.Ptr("1"), - to.Ptr("2"), - to.Ptr("3")}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AzureFirewall = armnetwork.AzureFirewall{ - // Name: to.Ptr("azurefirewall"), - // Type: to.Ptr("Microsoft.Network/azureFirewalls"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall"), - // Location: to.Ptr("West US 2"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.AzureFirewallPropertiesFormat{ - // AdditionalProperties: map[string]*string{ - // }, - // ApplicationRuleCollections: []*armnetwork.AzureFirewallApplicationRuleCollection{ - // { - // Name: to.Ptr("apprulecoll"), - // Properties: &armnetwork.AzureFirewallApplicationRuleCollectionPropertiesFormat{ - // Action: &armnetwork.AzureFirewallRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), - // }, - // Priority: to.Ptr[int32](110), - // Rules: []*armnetwork.AzureFirewallApplicationRule{ - // { - // Name: to.Ptr("rule1"), - // Description: to.Ptr("Deny inbound rule"), - // Protocols: []*armnetwork.AzureFirewallApplicationRuleProtocol{ - // { - // Port: to.Ptr[int32](443), - // ProtocolType: to.Ptr(armnetwork.AzureFirewallApplicationRuleProtocolTypeHTTPS), - // }}, - // SourceAddresses: []*string{ - // to.Ptr("216.58.216.164"), - // to.Ptr("10.0.0.0/24")}, - // TargetFqdns: []*string{ - // to.Ptr("www.test.com")}, - // }}, - // }, - // }}, - // IPConfigurations: []*armnetwork.AzureFirewallIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azfirewallgw/ipConfigurations/azureFirewallIpConfiguration"), - // Name: to.Ptr("azureFirewallIpConfiguration"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.AzureFirewallIPConfigurationPropertiesFormat{ - // PrivateIPAddress: to.Ptr("10.0.0.0"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), - // }, - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet"), - // }, - // }, - // }}, - // IPGroups: []*armnetwork.AzureFirewallIPGroups{ - // }, - // NatRuleCollections: []*armnetwork.AzureFirewallNatRuleCollection{ - // { - // Name: to.Ptr("natrulecoll"), - // Properties: &armnetwork.AzureFirewallNatRuleCollectionProperties{ - // Action: &armnetwork.AzureFirewallNatRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallNatRCActionTypeDnat), - // }, - // Priority: to.Ptr[int32](112), - // Rules: []*armnetwork.AzureFirewallNatRule{ - // { - // Name: to.Ptr("DNAT-HTTPS-traffic"), - // Description: to.Ptr("D-NAT all outbound web traffic for inspection"), - // DestinationAddresses: []*string{ - // to.Ptr("1.2.3.4")}, - // DestinationPorts: []*string{ - // to.Ptr("443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("*")}, - // TranslatedAddress: to.Ptr("1.2.3.5"), - // TranslatedPort: to.Ptr("8443"), - // }, - // { - // Name: to.Ptr("DNAT-HTTP-traffic-With-FQDN"), - // Description: to.Ptr("D-NAT all inbound web traffic for inspection"), - // DestinationAddresses: []*string{ - // to.Ptr("1.2.3.4")}, - // DestinationPorts: []*string{ - // to.Ptr("80")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("*")}, - // TranslatedFqdn: to.Ptr("internalhttpserver"), - // TranslatedPort: to.Ptr("880"), - // }}, - // }, - // }}, - // NetworkRuleCollections: []*armnetwork.AzureFirewallNetworkRuleCollection{ - // { - // Name: to.Ptr("netrulecoll"), - // Properties: &armnetwork.AzureFirewallNetworkRuleCollectionPropertiesFormat{ - // Action: &armnetwork.AzureFirewallRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), - // }, - // Priority: to.Ptr[int32](112), - // Rules: []*armnetwork.AzureFirewallNetworkRule{ - // { - // Name: to.Ptr("L4-traffic"), - // Description: to.Ptr("Block traffic based on source IPs and ports"), - // DestinationAddresses: []*string{ - // to.Ptr("*")}, - // DestinationPorts: []*string{ - // to.Ptr("443-444"), - // to.Ptr("8443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("192.168.1.1-192.168.1.12"), - // to.Ptr("10.1.4.12-10.1.4.255")}, - // }, - // { - // Name: to.Ptr("L4-traffic-with-FQDN"), - // Description: to.Ptr("Block traffic based on source IPs and ports to amazon"), - // DestinationFqdns: []*string{ - // to.Ptr("www.amazon.com")}, - // DestinationPorts: []*string{ - // to.Ptr("443-444"), - // to.Ptr("8443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("10.2.4.12-10.2.4.255")}, - // }}, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SKU: &armnetwork.AzureFirewallSKU{ - // Name: to.Ptr(armnetwork.AzureFirewallSKUNameAZFWVnet), - // Tier: to.Ptr(armnetwork.AzureFirewallSKUTierStandard), - // }, - // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), - // }, - // Zones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/AzureFirewallPutWithMgmtSubnet.json -func ExampleAzureFirewallsClient_BeginCreateOrUpdate_createAzureFirewallWithManagementSubnet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAzureFirewallsClient().BeginCreateOrUpdate(ctx, "rg1", "azurefirewall", armnetwork.AzureFirewall{ - Location: to.Ptr("West US"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, - Properties: &armnetwork.AzureFirewallPropertiesFormat{ - ApplicationRuleCollections: []*armnetwork.AzureFirewallApplicationRuleCollection{ - { - Name: to.Ptr("apprulecoll"), - Properties: &armnetwork.AzureFirewallApplicationRuleCollectionPropertiesFormat{ - Action: &armnetwork.AzureFirewallRCAction{ - Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), - }, - Priority: to.Ptr[int32](110), - Rules: []*armnetwork.AzureFirewallApplicationRule{ - { - Name: to.Ptr("rule1"), - Description: to.Ptr("Deny inbound rule"), - Protocols: []*armnetwork.AzureFirewallApplicationRuleProtocol{ - { - Port: to.Ptr[int32](443), - ProtocolType: to.Ptr(armnetwork.AzureFirewallApplicationRuleProtocolTypeHTTPS), - }}, - SourceAddresses: []*string{ - to.Ptr("216.58.216.164"), - to.Ptr("10.0.0.0/24")}, - TargetFqdns: []*string{ - to.Ptr("www.test.com")}, - }}, - }, - }}, - IPConfigurations: []*armnetwork.AzureFirewallIPConfiguration{ - { - Name: to.Ptr("azureFirewallIpConfiguration"), - Properties: &armnetwork.AzureFirewallIPConfigurationPropertiesFormat{ - PublicIPAddress: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), - }, - Subnet: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet"), - }, - }, - }}, - ManagementIPConfiguration: &armnetwork.AzureFirewallIPConfiguration{ - Name: to.Ptr("azureFirewallMgmtIpConfiguration"), - Properties: &armnetwork.AzureFirewallIPConfigurationPropertiesFormat{ - PublicIPAddress: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/managementPipName"), - }, - Subnet: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallManagementSubnet"), - }, - }, - }, - NatRuleCollections: []*armnetwork.AzureFirewallNatRuleCollection{ - { - Name: to.Ptr("natrulecoll"), - Properties: &armnetwork.AzureFirewallNatRuleCollectionProperties{ - Action: &armnetwork.AzureFirewallNatRCAction{ - Type: to.Ptr(armnetwork.AzureFirewallNatRCActionTypeDnat), - }, - Priority: to.Ptr[int32](112), - Rules: []*armnetwork.AzureFirewallNatRule{ - { - Name: to.Ptr("DNAT-HTTPS-traffic"), - Description: to.Ptr("D-NAT all outbound web traffic for inspection"), - DestinationAddresses: []*string{ - to.Ptr("1.2.3.4")}, - DestinationPorts: []*string{ - to.Ptr("443")}, - Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - SourceAddresses: []*string{ - to.Ptr("*")}, - TranslatedAddress: to.Ptr("1.2.3.5"), - TranslatedPort: to.Ptr("8443"), - }, - { - Name: to.Ptr("DNAT-HTTP-traffic-With-FQDN"), - Description: to.Ptr("D-NAT all inbound web traffic for inspection"), - DestinationAddresses: []*string{ - to.Ptr("1.2.3.4")}, - DestinationPorts: []*string{ - to.Ptr("80")}, - Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - SourceAddresses: []*string{ - to.Ptr("*")}, - TranslatedFqdn: to.Ptr("internalhttpserver"), - TranslatedPort: to.Ptr("880"), - }}, - }, - }}, - NetworkRuleCollections: []*armnetwork.AzureFirewallNetworkRuleCollection{ - { - Name: to.Ptr("netrulecoll"), - Properties: &armnetwork.AzureFirewallNetworkRuleCollectionPropertiesFormat{ - Action: &armnetwork.AzureFirewallRCAction{ - Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), - }, - Priority: to.Ptr[int32](112), - Rules: []*armnetwork.AzureFirewallNetworkRule{ - { - Name: to.Ptr("L4-traffic"), - Description: to.Ptr("Block traffic based on source IPs and ports"), - DestinationAddresses: []*string{ - to.Ptr("*")}, - DestinationPorts: []*string{ - to.Ptr("443-444"), - to.Ptr("8443")}, - Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - SourceAddresses: []*string{ - to.Ptr("192.168.1.1-192.168.1.12"), - to.Ptr("10.1.4.12-10.1.4.255")}, - }, - { - Name: to.Ptr("L4-traffic-with-FQDN"), - Description: to.Ptr("Block traffic based on source IPs and ports to amazon"), - DestinationFqdns: []*string{ - to.Ptr("www.amazon.com")}, - DestinationPorts: []*string{ - to.Ptr("443-444"), - to.Ptr("8443")}, - Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - SourceAddresses: []*string{ - to.Ptr("10.2.4.12-10.2.4.255")}, - }}, - }, - }}, - SKU: &armnetwork.AzureFirewallSKU{ - Name: to.Ptr(armnetwork.AzureFirewallSKUNameAZFWVnet), - Tier: to.Ptr(armnetwork.AzureFirewallSKUTierStandard), - }, - ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), - }, - Zones: []*string{}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AzureFirewall = armnetwork.AzureFirewall{ - // Name: to.Ptr("azurefirewall"), - // Type: to.Ptr("Microsoft.Network/azureFirewalls"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.AzureFirewallPropertiesFormat{ - // AdditionalProperties: map[string]*string{ - // }, - // ApplicationRuleCollections: []*armnetwork.AzureFirewallApplicationRuleCollection{ - // { - // Name: to.Ptr("apprulecoll"), - // Properties: &armnetwork.AzureFirewallApplicationRuleCollectionPropertiesFormat{ - // Action: &armnetwork.AzureFirewallRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), - // }, - // Priority: to.Ptr[int32](110), - // Rules: []*armnetwork.AzureFirewallApplicationRule{ - // { - // Name: to.Ptr("rule1"), - // Description: to.Ptr("Deny inbound rule"), - // Protocols: []*armnetwork.AzureFirewallApplicationRuleProtocol{ - // { - // Port: to.Ptr[int32](443), - // ProtocolType: to.Ptr(armnetwork.AzureFirewallApplicationRuleProtocolTypeHTTPS), - // }}, - // SourceAddresses: []*string{ - // to.Ptr("216.58.216.164"), - // to.Ptr("10.0.0.0/24")}, - // TargetFqdns: []*string{ - // to.Ptr("www.test.com")}, - // }}, - // }, - // }}, - // IPConfigurations: []*armnetwork.AzureFirewallIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azfirewallgw/ipConfigurations/azureFirewallIpConfiguration"), - // Name: to.Ptr("azureFirewallIpConfiguration"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.AzureFirewallIPConfigurationPropertiesFormat{ - // PrivateIPAddress: to.Ptr("10.0.0.0"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), - // }, - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet"), - // }, - // }, - // }}, - // NatRuleCollections: []*armnetwork.AzureFirewallNatRuleCollection{ - // { - // Name: to.Ptr("natrulecoll"), - // Properties: &armnetwork.AzureFirewallNatRuleCollectionProperties{ - // Action: &armnetwork.AzureFirewallNatRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallNatRCActionTypeDnat), - // }, - // Priority: to.Ptr[int32](112), - // Rules: []*armnetwork.AzureFirewallNatRule{ - // { - // Name: to.Ptr("DNAT-HTTPS-traffic"), - // Description: to.Ptr("D-NAT all outbound web traffic for inspection"), - // DestinationAddresses: []*string{ - // to.Ptr("1.2.3.4")}, - // DestinationPorts: []*string{ - // to.Ptr("443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("*")}, - // TranslatedAddress: to.Ptr("1.2.3.5"), - // TranslatedPort: to.Ptr("8443"), - // }, - // { - // Name: to.Ptr("DNAT-HTTP-traffic-With-FQDN"), - // Description: to.Ptr("D-NAT all inbound web traffic for inspection"), - // DestinationAddresses: []*string{ - // to.Ptr("1.2.3.4")}, - // DestinationPorts: []*string{ - // to.Ptr("80")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("*")}, - // TranslatedFqdn: to.Ptr("internalhttpserver"), - // TranslatedPort: to.Ptr("880"), - // }}, - // }, - // }}, - // NetworkRuleCollections: []*armnetwork.AzureFirewallNetworkRuleCollection{ - // { - // Name: to.Ptr("netrulecoll"), - // Properties: &armnetwork.AzureFirewallNetworkRuleCollectionPropertiesFormat{ - // Action: &armnetwork.AzureFirewallRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), - // }, - // Priority: to.Ptr[int32](112), - // Rules: []*armnetwork.AzureFirewallNetworkRule{ - // { - // Name: to.Ptr("L4-traffic"), - // Description: to.Ptr("Block traffic based on source IPs and ports"), - // DestinationAddresses: []*string{ - // to.Ptr("*")}, - // DestinationPorts: []*string{ - // to.Ptr("443-444"), - // to.Ptr("8443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("192.168.1.1-192.168.1.12"), - // to.Ptr("10.1.4.12-10.1.4.255")}, - // }, - // { - // Name: to.Ptr("L4-traffic-with-FQDN"), - // Description: to.Ptr("Block traffic based on source IPs and ports to amazon"), - // DestinationFqdns: []*string{ - // to.Ptr("www.amazon.com")}, - // DestinationPorts: []*string{ - // to.Ptr("443-444"), - // to.Ptr("8443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("10.2.4.12-10.2.4.255")}, - // }}, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SKU: &armnetwork.AzureFirewallSKU{ - // Name: to.Ptr(armnetwork.AzureFirewallSKUNameAZFWVnet), - // Tier: to.Ptr(armnetwork.AzureFirewallSKUTierStandard), - // }, - // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), - // }, - // Zones: []*string{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/AzureFirewallPutInHub.json -func ExampleAzureFirewallsClient_BeginCreateOrUpdate_createAzureFirewallInVirtualHub() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAzureFirewallsClient().BeginCreateOrUpdate(ctx, "rg1", "azurefirewall", armnetwork.AzureFirewall{ - Location: to.Ptr("West US"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, - Properties: &armnetwork.AzureFirewallPropertiesFormat{ - FirewallPolicy: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/policy1"), - }, - HubIPAddresses: &armnetwork.HubIPAddresses{ - PublicIPs: &armnetwork.HubPublicIPAddresses{ - Addresses: []*armnetwork.AzureFirewallPublicIPAddress{}, - Count: to.Ptr[int32](1), - }, - }, - SKU: &armnetwork.AzureFirewallSKU{ - Name: to.Ptr(armnetwork.AzureFirewallSKUNameAZFWHub), - Tier: to.Ptr(armnetwork.AzureFirewallSKUTierStandard), - }, - ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), - VirtualHub: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1"), - }, - }, - Zones: []*string{}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AzureFirewall = armnetwork.AzureFirewall{ - // Name: to.Ptr("azurefirewall"), - // Type: to.Ptr("Microsoft.Network/azureFirewalls"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.AzureFirewallPropertiesFormat{ - // AdditionalProperties: map[string]*string{ - // }, - // FirewallPolicy: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/policy1"), - // }, - // HubIPAddresses: &armnetwork.HubIPAddresses{ - // PrivateIPAddress: to.Ptr("10.0.0.0"), - // PublicIPs: &armnetwork.HubPublicIPAddresses{ - // Addresses: []*armnetwork.AzureFirewallPublicIPAddress{ - // { - // Address: to.Ptr("13.73.240.12"), - // }}, - // Count: to.Ptr[int32](1), - // }, - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SKU: &armnetwork.AzureFirewallSKU{ - // Name: to.Ptr(armnetwork.AzureFirewallSKUNameAZFWHub), - // Tier: to.Ptr(armnetwork.AzureFirewallSKUTierStandard), - // }, - // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), - // VirtualHub: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1"), - // }, - // }, - // Zones: []*string{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/AzureFirewallUpdateTags.json -func ExampleAzureFirewallsClient_BeginUpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAzureFirewallsClient().BeginUpdateTags(ctx, "azfwtest", "fw1", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AzureFirewall = armnetwork.AzureFirewall{ - // Name: to.Ptr("fw1"), - // Type: to.Ptr("Microsoft.Network/azureFirewalls"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/azfwtest/providers/Microsoft.Network/azureFirewalls/fw1"), - // Location: to.Ptr("brazilsouth"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armnetwork.AzureFirewallPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/AzureFirewallListByResourceGroup.json -func ExampleAzureFirewallsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAzureFirewallsClient().NewListPager("rg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AzureFirewallListResult = armnetwork.AzureFirewallListResult{ - // Value: []*armnetwork.AzureFirewall{ - // { - // Name: to.Ptr("azurefirewall"), - // Type: to.Ptr("Microsoft.Network/azureFirewalls"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.AzureFirewallPropertiesFormat{ - // AdditionalProperties: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // ApplicationRuleCollections: []*armnetwork.AzureFirewallApplicationRuleCollection{ - // { - // Name: to.Ptr("apprulecoll"), - // Properties: &armnetwork.AzureFirewallApplicationRuleCollectionPropertiesFormat{ - // Action: &armnetwork.AzureFirewallRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), - // }, - // Priority: to.Ptr[int32](110), - // Rules: []*armnetwork.AzureFirewallApplicationRule{ - // { - // Name: to.Ptr("rule1"), - // Description: to.Ptr("Deny inbound rule"), - // Protocols: []*armnetwork.AzureFirewallApplicationRuleProtocol{ - // { - // Port: to.Ptr[int32](443), - // ProtocolType: to.Ptr(armnetwork.AzureFirewallApplicationRuleProtocolTypeHTTPS), - // }}, - // SourceAddresses: []*string{ - // to.Ptr("216.58.216.164"), - // to.Ptr("10.0.0.0/24")}, - // TargetFqdns: []*string{ - // to.Ptr("www.test.com")}, - // }}, - // }, - // }}, - // IPConfigurations: []*armnetwork.AzureFirewallIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azfirewallgw/ipConfigurations/azureFirewallIpConfiguration"), - // Name: to.Ptr("azureFirewallIpConfiguration"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.AzureFirewallIPConfigurationPropertiesFormat{ - // PrivateIPAddress: to.Ptr("10.0.0.0"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), - // }, - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet"), - // }, - // }, - // }}, - // IPGroups: []*armnetwork.AzureFirewallIPGroups{ - // }, - // ManagementIPConfiguration: &armnetwork.AzureFirewallIPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewallgw/ipConfigurations/azureFirewallMgmtIpConfiguration"), - // Name: to.Ptr("azureFirewallMgmtIpConfiguration"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.AzureFirewallIPConfigurationPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/managementPipName"), - // }, - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallManagementSubnet"), - // }, - // }, - // }, - // NatRuleCollections: []*armnetwork.AzureFirewallNatRuleCollection{ - // { - // Name: to.Ptr("natrulecoll"), - // Properties: &armnetwork.AzureFirewallNatRuleCollectionProperties{ - // Action: &armnetwork.AzureFirewallNatRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallNatRCActionTypeDnat), - // }, - // Priority: to.Ptr[int32](112), - // Rules: []*armnetwork.AzureFirewallNatRule{ - // { - // Name: to.Ptr("DNAT-HTTPS-traffic"), - // Description: to.Ptr("D-NAT all outbound web traffic for inspection"), - // DestinationAddresses: []*string{ - // to.Ptr("1.2.3.4")}, - // DestinationPorts: []*string{ - // to.Ptr("443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("*")}, - // TranslatedAddress: to.Ptr("1.2.3.5"), - // TranslatedPort: to.Ptr("8443"), - // }, - // { - // Name: to.Ptr("DNAT-HTTP-traffic-With-FQDN"), - // Description: to.Ptr("D-NAT all inbound web traffic for inspection"), - // DestinationAddresses: []*string{ - // to.Ptr("1.2.3.4")}, - // DestinationPorts: []*string{ - // to.Ptr("80")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("*")}, - // TranslatedFqdn: to.Ptr("internalhttpserver"), - // TranslatedPort: to.Ptr("880"), - // }}, - // }, - // }}, - // NetworkRuleCollections: []*armnetwork.AzureFirewallNetworkRuleCollection{ - // { - // Name: to.Ptr("netrulecoll"), - // Properties: &armnetwork.AzureFirewallNetworkRuleCollectionPropertiesFormat{ - // Action: &armnetwork.AzureFirewallRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), - // }, - // Priority: to.Ptr[int32](112), - // Rules: []*armnetwork.AzureFirewallNetworkRule{ - // { - // Name: to.Ptr("L4-traffic"), - // Description: to.Ptr("Block traffic based on source IPs and ports"), - // DestinationAddresses: []*string{ - // to.Ptr("*")}, - // DestinationPorts: []*string{ - // to.Ptr("443-444"), - // to.Ptr("8443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("192.168.1.1-192.168.1.12"), - // to.Ptr("10.1.4.12-10.1.4.255")}, - // }, - // { - // Name: to.Ptr("L4-traffic-with-FQDN"), - // Description: to.Ptr("Block traffic based on source IPs and ports to amazon"), - // DestinationFqdns: []*string{ - // to.Ptr("www.amazon.com")}, - // DestinationPorts: []*string{ - // to.Ptr("443-444"), - // to.Ptr("8443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("10.2.4.12-10.2.4.255")}, - // }}, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), - // }, - // Zones: []*string{ - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/AzureFirewallListBySubscription.json -func ExampleAzureFirewallsClient_NewListAllPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAzureFirewallsClient().NewListAllPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AzureFirewallListResult = armnetwork.AzureFirewallListResult{ - // Value: []*armnetwork.AzureFirewall{ - // { - // Name: to.Ptr("azurefirewall"), - // Type: to.Ptr("Microsoft.Network/azureFirewalls"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.AzureFirewallPropertiesFormat{ - // AdditionalProperties: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // ApplicationRuleCollections: []*armnetwork.AzureFirewallApplicationRuleCollection{ - // { - // Name: to.Ptr("apprulecoll"), - // Properties: &armnetwork.AzureFirewallApplicationRuleCollectionPropertiesFormat{ - // Action: &armnetwork.AzureFirewallRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), - // }, - // Priority: to.Ptr[int32](110), - // Rules: []*armnetwork.AzureFirewallApplicationRule{ - // { - // Name: to.Ptr("rule1"), - // Description: to.Ptr("Deny inbound rule"), - // Protocols: []*armnetwork.AzureFirewallApplicationRuleProtocol{ - // { - // Port: to.Ptr[int32](443), - // ProtocolType: to.Ptr(armnetwork.AzureFirewallApplicationRuleProtocolTypeHTTPS), - // }}, - // SourceAddresses: []*string{ - // to.Ptr("216.58.216.164"), - // to.Ptr("10.0.0.0/24")}, - // TargetFqdns: []*string{ - // to.Ptr("www.test.com")}, - // }}, - // }, - // }}, - // IPConfigurations: []*armnetwork.AzureFirewallIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azfirewallgw/ipConfigurations/azureFirewallIpConfiguration"), - // Name: to.Ptr("azureFirewallIpConfiguration"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.AzureFirewallIPConfigurationPropertiesFormat{ - // PrivateIPAddress: to.Ptr("10.0.0.0"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), - // }, - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet"), - // }, - // }, - // }}, - // IPGroups: []*armnetwork.AzureFirewallIPGroups{ - // }, - // ManagementIPConfiguration: &armnetwork.AzureFirewallIPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewallgw/ipConfigurations/azureFirewallMgmtIpConfiguration"), - // Name: to.Ptr("azureFirewallMgmtIpConfiguration"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.AzureFirewallIPConfigurationPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/managementPipName"), - // }, - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallManagementSubnet"), - // }, - // }, - // }, - // NatRuleCollections: []*armnetwork.AzureFirewallNatRuleCollection{ - // { - // Name: to.Ptr("natrulecoll"), - // Properties: &armnetwork.AzureFirewallNatRuleCollectionProperties{ - // Action: &armnetwork.AzureFirewallNatRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallNatRCActionTypeDnat), - // }, - // Priority: to.Ptr[int32](112), - // Rules: []*armnetwork.AzureFirewallNatRule{ - // { - // Name: to.Ptr("DNAT-HTTPS-traffic"), - // Description: to.Ptr("D-NAT all outbound web traffic for inspection"), - // DestinationAddresses: []*string{ - // to.Ptr("1.2.3.4")}, - // DestinationPorts: []*string{ - // to.Ptr("443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("*")}, - // TranslatedAddress: to.Ptr("1.2.3.5"), - // TranslatedPort: to.Ptr("8443"), - // }, - // { - // Name: to.Ptr("DNAT-HTTP-traffic-With-FQDN"), - // Description: to.Ptr("D-NAT all inbound web traffic for inspection"), - // DestinationAddresses: []*string{ - // to.Ptr("1.2.3.4")}, - // DestinationPorts: []*string{ - // to.Ptr("80")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("*")}, - // TranslatedFqdn: to.Ptr("internalhttpserver"), - // TranslatedPort: to.Ptr("880"), - // }}, - // }, - // }}, - // NetworkRuleCollections: []*armnetwork.AzureFirewallNetworkRuleCollection{ - // { - // Name: to.Ptr("netrulecoll"), - // Properties: &armnetwork.AzureFirewallNetworkRuleCollectionPropertiesFormat{ - // Action: &armnetwork.AzureFirewallRCAction{ - // Type: to.Ptr(armnetwork.AzureFirewallRCActionTypeDeny), - // }, - // Priority: to.Ptr[int32](112), - // Rules: []*armnetwork.AzureFirewallNetworkRule{ - // { - // Name: to.Ptr("L4-traffic"), - // Description: to.Ptr("Block traffic based on source IPs and ports"), - // DestinationAddresses: []*string{ - // to.Ptr("*")}, - // DestinationPorts: []*string{ - // to.Ptr("443-444"), - // to.Ptr("8443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("192.168.1.1-192.168.1.12"), - // to.Ptr("10.1.4.12-10.1.4.255")}, - // }, - // { - // Name: to.Ptr("L4-traffic-with-FQDN"), - // Description: to.Ptr("Block traffic based on source IPs and ports to amazon"), - // DestinationFqdns: []*string{ - // to.Ptr("www.amazon.com")}, - // DestinationPorts: []*string{ - // to.Ptr("443-444"), - // to.Ptr("8443")}, - // Protocols: []*armnetwork.AzureFirewallNetworkRuleProtocol{ - // to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("10.2.4.12-10.2.4.255")}, - // }}, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), - // }, - // Zones: []*string{ - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/AzureFirewallListLearnedIPPrefixes.json -func ExampleAzureFirewallsClient_BeginListLearnedPrefixes() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAzureFirewallsClient().BeginListLearnedPrefixes(ctx, "rg1", "azureFirewall1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.IPPrefixesList = armnetwork.IPPrefixesList{ - // IPPrefixes: []*string{ - // to.Ptr("10.101.0.0/16"), - // to.Ptr("10.102.0.0/16")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/AzureFirewallPacketCapture.json -func ExampleAzureFirewallsClient_BeginPacketCapture() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAzureFirewallsClient().BeginPacketCapture(ctx, "rg1", "azureFirewall1", armnetwork.FirewallPacketCaptureParameters{ - Properties: &armnetwork.FirewallPacketCaptureParametersFormat{ - DurationInSeconds: to.Ptr[int32](300), - FileName: to.Ptr("azureFirewallPacketCapture"), - Filters: []*armnetwork.AzureFirewallPacketCaptureRule{ - { - DestinationPorts: []*string{ - to.Ptr("4500")}, - Destinations: []*string{ - to.Ptr("20.1.2.0")}, - Sources: []*string{ - to.Ptr("20.1.1.0")}, - }, - { - DestinationPorts: []*string{ - to.Ptr("123"), - to.Ptr("80")}, - Destinations: []*string{ - to.Ptr("10.1.2.0")}, - Sources: []*string{ - to.Ptr("10.1.1.0"), - to.Ptr("10.1.1.1")}, - }}, - Flags: []*armnetwork.AzureFirewallPacketCaptureFlags{ - { - Type: to.Ptr(armnetwork.AzureFirewallPacketCaptureFlagsTypeSyn), - }, - { - Type: to.Ptr(armnetwork.AzureFirewallPacketCaptureFlagsTypeFin), - }}, - NumberOfPacketsToCapture: to.Ptr[int32](5000), - SasURL: to.Ptr("someSASURL"), - Protocol: to.Ptr(armnetwork.AzureFirewallNetworkRuleProtocolAny), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/network/armnetwork/bastionhosts_client.go b/sdk/resourcemanager/network/armnetwork/bastionhosts_client.go index 2311f77fb9b5..497fa9352b74 100644 --- a/sdk/resourcemanager/network/armnetwork/bastionhosts_client.go +++ b/sdk/resourcemanager/network/armnetwork/bastionhosts_client.go @@ -47,7 +47,7 @@ func NewBastionHostsClient(subscriptionID string, credential azcore.TokenCredent // BeginCreateOrUpdate - Creates or updates the specified Bastion Host. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - bastionHostName - The name of the Bastion Host. // - parameters - Parameters supplied to the create or update Bastion Host operation. @@ -71,7 +71,7 @@ func (client *BastionHostsClient) BeginCreateOrUpdate(ctx context.Context, resou // CreateOrUpdate - Creates or updates the specified Bastion Host. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *BastionHostsClient) createOrUpdate(ctx context.Context, resourceGroupName string, bastionHostName string, parameters BastionHost, options *BastionHostsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "BastionHostsClient.BeginCreateOrUpdate" @@ -113,7 +113,7 @@ func (client *BastionHostsClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -125,7 +125,7 @@ func (client *BastionHostsClient) createOrUpdateCreateRequest(ctx context.Contex // BeginDelete - Deletes the specified Bastion Host. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - bastionHostName - The name of the Bastion Host. // - options - BastionHostsClientBeginDeleteOptions contains the optional parameters for the BastionHostsClient.BeginDelete @@ -148,7 +148,7 @@ func (client *BastionHostsClient) BeginDelete(ctx context.Context, resourceGroup // Delete - Deletes the specified Bastion Host. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *BastionHostsClient) deleteOperation(ctx context.Context, resourceGroupName string, bastionHostName string, options *BastionHostsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "BastionHostsClient.BeginDelete" @@ -190,7 +190,7 @@ func (client *BastionHostsClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -199,7 +199,7 @@ func (client *BastionHostsClient) deleteCreateRequest(ctx context.Context, resou // Get - Gets the specified Bastion Host. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - bastionHostName - The name of the Bastion Host. // - options - BastionHostsClientGetOptions contains the optional parameters for the BastionHostsClient.Get method. @@ -245,7 +245,7 @@ func (client *BastionHostsClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -262,7 +262,7 @@ func (client *BastionHostsClient) getHandleResponse(resp *http.Response) (Bastio // NewListPager - Lists all Bastion Hosts in a subscription. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - options - BastionHostsClientListOptions contains the optional parameters for the BastionHostsClient.NewListPager method. func (client *BastionHostsClient) NewListPager(options *BastionHostsClientListOptions) *runtime.Pager[BastionHostsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[BastionHostsClientListResponse]{ @@ -306,7 +306,7 @@ func (client *BastionHostsClient) listCreateRequest(ctx context.Context, options return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -323,7 +323,7 @@ func (client *BastionHostsClient) listHandleResponse(resp *http.Response) (Basti // NewListByResourceGroupPager - Lists all Bastion Hosts in a resource group. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - options - BastionHostsClientListByResourceGroupOptions contains the optional parameters for the BastionHostsClient.NewListByResourceGroupPager // method. @@ -373,7 +373,7 @@ func (client *BastionHostsClient) listByResourceGroupCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -391,7 +391,7 @@ func (client *BastionHostsClient) listByResourceGroupHandleResponse(resp *http.R // BeginUpdateTags - Updates Tags for BastionHost resource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - bastionHostName - The name of the Bastion Host. // - parameters - Parameters supplied to update BastionHost tags. @@ -415,7 +415,7 @@ func (client *BastionHostsClient) BeginUpdateTags(ctx context.Context, resourceG // UpdateTags - Updates Tags for BastionHost resource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *BastionHostsClient) updateTags(ctx context.Context, resourceGroupName string, bastionHostName string, parameters TagsObject, options *BastionHostsClientBeginUpdateTagsOptions) (*http.Response, error) { var err error const operationName = "BastionHostsClient.BeginUpdateTags" @@ -457,7 +457,7 @@ func (client *BastionHostsClient) updateTagsCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/bastionhosts_client_example_test.go b/sdk/resourcemanager/network/armnetwork/bastionhosts_client_example_test.go deleted file mode 100644 index b43aa1748621..000000000000 --- a/sdk/resourcemanager/network/armnetwork/bastionhosts_client_example_test.go +++ /dev/null @@ -1,376 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/BastionHostDelete.json -func ExampleBastionHostsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewBastionHostsClient().BeginDelete(ctx, "rg1", "bastionhosttenant", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/BastionHostGet.json -func ExampleBastionHostsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewBastionHostsClient().Get(ctx, "rg1", "bastionhosttenant'", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.BastionHost = armnetwork.BastionHost{ - // Name: to.Ptr("bastionhost'"), - // Type: to.Ptr("Microsoft.Network/bastionHosts"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhosttenant'"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.BastionHostPropertiesFormat{ - // DisableCopyPaste: to.Ptr(false), - // DNSName: to.Ptr("bst-9d89d361-100e-4c01-b92d-466548c476dc.bastion.azure.com"), - // EnableIPConnect: to.Ptr(false), - // EnableKerberos: to.Ptr(false), - // EnableShareableLink: to.Ptr(false), - // EnableTunneling: to.Ptr(false), - // IPConfigurations: []*armnetwork.BastionHostIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhosttenant/bastionHostIpConfigurations/bastionHostIpConfiguration"), - // Name: to.Ptr("bastionHostIpConfiguration"), - // Type: to.Ptr("Microsoft.Network/bastionHosts/bastionHostIpConfigurations"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.BastionHostIPConfigurationPropertiesFormat{ - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), - // }, - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/BastionHostSubnet"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ScaleUnits: to.Ptr[int32](2), - // }, - // SKU: &armnetwork.SKU{ - // Name: to.Ptr(armnetwork.BastionHostSKUNameStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/BastionHostPut.json -func ExampleBastionHostsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewBastionHostsClient().BeginCreateOrUpdate(ctx, "rg1", "bastionhosttenant", armnetwork.BastionHost{ - Properties: &armnetwork.BastionHostPropertiesFormat{ - IPConfigurations: []*armnetwork.BastionHostIPConfiguration{ - { - Name: to.Ptr("bastionHostIpConfiguration"), - Properties: &armnetwork.BastionHostIPConfigurationPropertiesFormat{ - PublicIPAddress: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), - }, - Subnet: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/BastionHostSubnet"), - }, - }, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.BastionHost = armnetwork.BastionHost{ - // Name: to.Ptr("bastionhost"), - // Type: to.Ptr("Microsoft.Network/bastionHosts"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhosttenant'"), - // Location: to.Ptr("West US"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.BastionHostPropertiesFormat{ - // DisableCopyPaste: to.Ptr(false), - // DNSName: to.Ptr("bst-9d89d361-100e-4c01-b92d-466548c476dc.bastion.azure.com"), - // EnableIPConnect: to.Ptr(false), - // EnableKerberos: to.Ptr(false), - // EnableShareableLink: to.Ptr(false), - // EnableTunneling: to.Ptr(false), - // IPConfigurations: []*armnetwork.BastionHostIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhosttenant/bastionHostIpConfigurations/bastionHostIpConfiguration"), - // Name: to.Ptr("bastionHostIpConfiguration"), - // Type: to.Ptr("Microsoft.Network/bastionHosts/bastionHostIpConfigurations"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.BastionHostIPConfigurationPropertiesFormat{ - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), - // }, - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/BastionHostSubnet"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ScaleUnits: to.Ptr[int32](2), - // }, - // SKU: &armnetwork.SKU{ - // Name: to.Ptr(armnetwork.BastionHostSKUNameStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/BastionHostPatch.json -func ExampleBastionHostsClient_BeginUpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewBastionHostsClient().BeginUpdateTags(ctx, "rg1", "bastionhosttenant", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.BastionHost = armnetwork.BastionHost{ - // Name: to.Ptr("bastionhosttenant"), - // Type: to.Ptr("Microsoft.Network/bastionHosts"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhosttenant'"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.BastionHostPropertiesFormat{ - // DisableCopyPaste: to.Ptr(false), - // DNSName: to.Ptr("bst-9d89d361-100e-4c01-b92d-466548c476dc.bastion.azure.com"), - // EnableIPConnect: to.Ptr(false), - // EnableKerberos: to.Ptr(false), - // EnableShareableLink: to.Ptr(false), - // EnableTunneling: to.Ptr(false), - // IPConfigurations: []*armnetwork.BastionHostIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhosttenant/bastionHostIpConfigurations/bastionHostIpConfiguration"), - // Name: to.Ptr("bastionHostIpConfiguration"), - // Type: to.Ptr("Microsoft.Network/bastionHosts/bastionHostIpConfigurations"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.BastionHostIPConfigurationPropertiesFormat{ - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), - // }, - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/BastionHostSubnet"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ScaleUnits: to.Ptr[int32](2), - // }, - // SKU: &armnetwork.SKU{ - // Name: to.Ptr(armnetwork.BastionHostSKUNameStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/BastionHostListBySubscription.json -func ExampleBastionHostsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewBastionHostsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.BastionHostListResult = armnetwork.BastionHostListResult{ - // Value: []*armnetwork.BastionHost{ - // { - // Name: to.Ptr("bastionhost'"), - // Type: to.Ptr("Microsoft.Network/bastionHosts"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhosttenant'"), - // Location: to.Ptr("West US"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.BastionHostPropertiesFormat{ - // DisableCopyPaste: to.Ptr(false), - // DNSName: to.Ptr("bst-9d89d361-100e-4c01-b92d-466548c476dc.bastion.azure.com"), - // EnableIPConnect: to.Ptr(false), - // EnableKerberos: to.Ptr(false), - // EnableShareableLink: to.Ptr(false), - // EnableTunneling: to.Ptr(false), - // IPConfigurations: []*armnetwork.BastionHostIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhosttenant/bastionHostIpConfigurations/bastionHostIpConfiguration"), - // Name: to.Ptr("bastionHostIpConfiguration"), - // Type: to.Ptr("Microsoft.Network/bastionHosts/bastionHostIpConfigurations"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.BastionHostIPConfigurationPropertiesFormat{ - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), - // }, - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/BastionHostSubnet"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ScaleUnits: to.Ptr[int32](2), - // }, - // SKU: &armnetwork.SKU{ - // Name: to.Ptr(armnetwork.BastionHostSKUNameStandard), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/BastionHostListByResourceGroup.json -func ExampleBastionHostsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewBastionHostsClient().NewListByResourceGroupPager("rg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.BastionHostListResult = armnetwork.BastionHostListResult{ - // Value: []*armnetwork.BastionHost{ - // { - // Name: to.Ptr("bastionhost'"), - // Type: to.Ptr("Microsoft.Network/bastionHosts"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhosttenant'"), - // Location: to.Ptr("West US"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.BastionHostPropertiesFormat{ - // DisableCopyPaste: to.Ptr(false), - // DNSName: to.Ptr("bst-9d89d361-100e-4c01-b92d-466548c476dc.bastion.azure.com"), - // EnableIPConnect: to.Ptr(false), - // EnableKerberos: to.Ptr(false), - // EnableShareableLink: to.Ptr(false), - // EnableTunneling: to.Ptr(false), - // IPConfigurations: []*armnetwork.BastionHostIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhosttenant/bastionHostIpConfigurations/bastionHostIpConfiguration"), - // Name: to.Ptr("bastionHostIpConfiguration"), - // Type: to.Ptr("Microsoft.Network/bastionHosts/bastionHostIpConfigurations"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.BastionHostIPConfigurationPropertiesFormat{ - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"), - // }, - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/BastionHostSubnet"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ScaleUnits: to.Ptr[int32](2), - // }, - // SKU: &armnetwork.SKU{ - // Name: to.Ptr(armnetwork.BastionHostSKUNameStandard), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/bgpservicecommunities_client.go b/sdk/resourcemanager/network/armnetwork/bgpservicecommunities_client.go index 5c91bc271a68..88bf734e858b 100644 --- a/sdk/resourcemanager/network/armnetwork/bgpservicecommunities_client.go +++ b/sdk/resourcemanager/network/armnetwork/bgpservicecommunities_client.go @@ -46,7 +46,7 @@ func NewBgpServiceCommunitiesClient(subscriptionID string, credential azcore.Tok // NewListPager - Gets all the available bgp service communities. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - options - BgpServiceCommunitiesClientListOptions contains the optional parameters for the BgpServiceCommunitiesClient.NewListPager // method. func (client *BgpServiceCommunitiesClient) NewListPager(options *BgpServiceCommunitiesClientListOptions) *runtime.Pager[BgpServiceCommunitiesClientListResponse] { @@ -91,7 +91,7 @@ func (client *BgpServiceCommunitiesClient) listCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/bgpservicecommunities_client_example_test.go b/sdk/resourcemanager/network/armnetwork/bgpservicecommunities_client_example_test.go deleted file mode 100644 index 70dd3f276ba5..000000000000 --- a/sdk/resourcemanager/network/armnetwork/bgpservicecommunities_client_example_test.go +++ /dev/null @@ -1,84 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ServiceCommunityList.json -func ExampleBgpServiceCommunitiesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewBgpServiceCommunitiesClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.BgpServiceCommunityListResult = armnetwork.BgpServiceCommunityListResult{ - // Value: []*armnetwork.BgpServiceCommunity{ - // { - // Name: to.Ptr("skype"), - // Type: to.Ptr("Microsoft.Network/bgpServiceCommunities"), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/bgpServiceCommunities/skype"), - // Properties: &armnetwork.BgpServiceCommunityPropertiesFormat{ - // BgpCommunities: []*armnetwork.BGPCommunity{ - // { - // CommunityName: to.Ptr("Skype For Business Online"), - // CommunityPrefixes: []*string{ - // to.Ptr("13.67.56.225/32"), - // to.Ptr("13.67.186.105/32")}, - // CommunityValue: to.Ptr("12076:5030"), - // IsAuthorizedToUse: to.Ptr(true), - // ServiceGroup: to.Ptr("O365"), - // ServiceSupportedRegion: to.Ptr("Global"), - // }}, - // ServiceName: to.Ptr("skype"), - // }, - // }, - // { - // Name: to.Ptr("exchange"), - // Type: to.Ptr("Microsoft.Network/bgpServiceCommunities"), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/bgpServiceCommunities/exchange"), - // Properties: &armnetwork.BgpServiceCommunityPropertiesFormat{ - // BgpCommunities: []*armnetwork.BGPCommunity{ - // { - // CommunityName: to.Ptr("Exchange Online"), - // CommunityPrefixes: []*string{ - // to.Ptr("13.67.56.225/32"), - // to.Ptr("13.67.186.105/32")}, - // CommunityValue: to.Ptr("12076:5040"), - // IsAuthorizedToUse: to.Ptr(true), - // ServiceGroup: to.Ptr("O365"), - // ServiceSupportedRegion: to.Ptr("Global"), - // }}, - // ServiceName: to.Ptr("exchange"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/configurationpolicygroups_client.go b/sdk/resourcemanager/network/armnetwork/configurationpolicygroups_client.go index d96a12269a1c..db780f348cbc 100644 --- a/sdk/resourcemanager/network/armnetwork/configurationpolicygroups_client.go +++ b/sdk/resourcemanager/network/armnetwork/configurationpolicygroups_client.go @@ -47,7 +47,7 @@ func NewConfigurationPolicyGroupsClient(subscriptionID string, credential azcore // BeginCreateOrUpdate - Creates a ConfigurationPolicyGroup if it doesn't exist else updates the existing one. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the ConfigurationPolicyGroup. // - vpnServerConfigurationName - The name of the VpnServerConfiguration. // - configurationPolicyGroupName - The name of the ConfigurationPolicyGroup. @@ -72,7 +72,7 @@ func (client *ConfigurationPolicyGroupsClient) BeginCreateOrUpdate(ctx context.C // CreateOrUpdate - Creates a ConfigurationPolicyGroup if it doesn't exist else updates the existing one. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *ConfigurationPolicyGroupsClient) createOrUpdate(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, configurationPolicyGroupName string, vpnServerConfigurationPolicyGroupParameters VPNServerConfigurationPolicyGroup, options *ConfigurationPolicyGroupsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ConfigurationPolicyGroupsClient.BeginCreateOrUpdate" @@ -118,7 +118,7 @@ func (client *ConfigurationPolicyGroupsClient) createOrUpdateCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, vpnServerConfigurationPolicyGroupParameters); err != nil { @@ -130,7 +130,7 @@ func (client *ConfigurationPolicyGroupsClient) createOrUpdateCreateRequest(ctx c // BeginDelete - Deletes a ConfigurationPolicyGroup. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the ConfigurationPolicyGroup. // - vpnServerConfigurationName - The name of the VpnServerConfiguration. // - configurationPolicyGroupName - The name of the ConfigurationPolicyGroup. @@ -154,7 +154,7 @@ func (client *ConfigurationPolicyGroupsClient) BeginDelete(ctx context.Context, // Delete - Deletes a ConfigurationPolicyGroup. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *ConfigurationPolicyGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, configurationPolicyGroupName string, options *ConfigurationPolicyGroupsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ConfigurationPolicyGroupsClient.BeginDelete" @@ -200,7 +200,7 @@ func (client *ConfigurationPolicyGroupsClient) deleteCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -209,7 +209,7 @@ func (client *ConfigurationPolicyGroupsClient) deleteCreateRequest(ctx context.C // Get - Retrieves the details of a ConfigurationPolicyGroup. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the VpnServerConfiguration. // - vpnServerConfigurationName - The name of the VpnServerConfiguration. // - configurationPolicyGroupName - The name of the ConfigurationPolicyGroup being retrieved. @@ -261,7 +261,7 @@ func (client *ConfigurationPolicyGroupsClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -278,7 +278,7 @@ func (client *ConfigurationPolicyGroupsClient) getHandleResponse(resp *http.Resp // NewListByVPNServerConfigurationPager - Lists all the configurationPolicyGroups in a resource group for a vpnServerConfiguration. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the VpnServerConfiguration. // - vpnServerConfigurationName - The name of the VpnServerConfiguration. // - options - ConfigurationPolicyGroupsClientListByVPNServerConfigurationOptions contains the optional parameters for the ConfigurationPolicyGroupsClient.NewListByVPNServerConfigurationPager @@ -333,7 +333,7 @@ func (client *ConfigurationPolicyGroupsClient) listByVPNServerConfigurationCreat return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/configurationpolicygroups_client_example_test.go b/sdk/resourcemanager/network/armnetwork/configurationpolicygroups_client_example_test.go deleted file mode 100644 index eab2e80d3f5a..000000000000 --- a/sdk/resourcemanager/network/armnetwork/configurationpolicygroups_client_example_test.go +++ /dev/null @@ -1,226 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ConfigurationPolicyGroupPut.json -func ExampleConfigurationPolicyGroupsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewConfigurationPolicyGroupsClient().BeginCreateOrUpdate(ctx, "rg1", "vpnServerConfiguration1", "policyGroup1", armnetwork.VPNServerConfigurationPolicyGroup{ - Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ - IsDefault: to.Ptr(true), - PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ - { - Name: to.Ptr("policy1"), - AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID), - AttributeValue: to.Ptr("6ad1bd08"), - }, - { - Name: to.Ptr("policy2"), - AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeCertificateGroupID), - AttributeValue: to.Ptr("red.com"), - }}, - Priority: to.Ptr[int32](0), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VPNServerConfigurationPolicyGroup = armnetwork.VPNServerConfigurationPolicyGroup{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"), - // Name: to.Ptr("policyGroup1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ - // IsDefault: to.Ptr(true), - // P2SConnectionConfigurations: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"), - // }}, - // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ - // { - // Name: to.Ptr("policy1"), - // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID), - // AttributeValue: to.Ptr("6ad1bd08"), - // }, - // { - // Name: to.Ptr("policy2"), - // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeCertificateGroupID), - // AttributeValue: to.Ptr("red.com"), - // }}, - // Priority: to.Ptr[int32](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ConfigurationPolicyGroupDelete.json -func ExampleConfigurationPolicyGroupsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewConfigurationPolicyGroupsClient().BeginDelete(ctx, "rg1", "vpnServerConfiguration1", "policyGroup1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ConfigurationPolicyGroupGet.json -func ExampleConfigurationPolicyGroupsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewConfigurationPolicyGroupsClient().Get(ctx, "rg1", "vpnServerConfiguration1", "policyGroup1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VPNServerConfigurationPolicyGroup = armnetwork.VPNServerConfigurationPolicyGroup{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"), - // Name: to.Ptr("policyGroup1"), - // Type: to.Ptr("Microsoft.Network/vpnServerConfigurations/configurationPolicyGroups"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ - // IsDefault: to.Ptr(true), - // P2SConnectionConfigurations: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"), - // }}, - // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ - // { - // Name: to.Ptr("policy1"), - // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID), - // AttributeValue: to.Ptr("6ad1bd08"), - // }, - // { - // Name: to.Ptr("policy2"), - // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeCertificateGroupID), - // AttributeValue: to.Ptr("red.com"), - // }}, - // Priority: to.Ptr[int32](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ConfigurationPolicyGroupListByVpnServerConfiguration.json -func ExampleConfigurationPolicyGroupsClient_NewListByVPNServerConfigurationPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewConfigurationPolicyGroupsClient().NewListByVPNServerConfigurationPager("rg1", "vpnServerConfiguration1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ListVPNServerConfigurationPolicyGroupsResult = armnetwork.ListVPNServerConfigurationPolicyGroupsResult{ - // Value: []*armnetwork.VPNServerConfigurationPolicyGroup{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"), - // Name: to.Ptr("policyGroup1"), - // Type: to.Ptr("Microsoft.Network/vpnServerConfigurations/configurationPolicyGroups"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ - // IsDefault: to.Ptr(true), - // P2SConnectionConfigurations: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"), - // }}, - // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ - // { - // Name: to.Ptr("policy1"), - // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID), - // AttributeValue: to.Ptr("6ad1bd08"), - // }, - // { - // Name: to.Ptr("policy2"), - // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeCertificateGroupID), - // AttributeValue: to.Ptr("red.com"), - // }}, - // Priority: to.Ptr[int32](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup2"), - // Name: to.Ptr("policyGroup2"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ - // IsDefault: to.Ptr(true), - // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ - // { - // Name: to.Ptr("policy1"), - // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID), - // AttributeValue: to.Ptr("6ad1bd08"), - // }, - // { - // Name: to.Ptr("policy2"), - // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeCertificateGroupID), - // AttributeValue: to.Ptr("red.com"), - // }}, - // Priority: to.Ptr[int32](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/connectionmonitors_client.go b/sdk/resourcemanager/network/armnetwork/connectionmonitors_client.go index 6fe26f597c21..58a367cbed2e 100644 --- a/sdk/resourcemanager/network/armnetwork/connectionmonitors_client.go +++ b/sdk/resourcemanager/network/armnetwork/connectionmonitors_client.go @@ -47,7 +47,7 @@ func NewConnectionMonitorsClient(subscriptionID string, credential azcore.TokenC // BeginCreateOrUpdate - Create or update a connection monitor. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group containing Network Watcher. // - networkWatcherName - The name of the Network Watcher resource. // - connectionMonitorName - The name of the connection monitor. @@ -72,7 +72,7 @@ func (client *ConnectionMonitorsClient) BeginCreateOrUpdate(ctx context.Context, // CreateOrUpdate - Create or update a connection monitor. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *ConnectionMonitorsClient) createOrUpdate(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, parameters ConnectionMonitor, options *ConnectionMonitorsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ConnectionMonitorsClient.BeginCreateOrUpdate" @@ -118,7 +118,7 @@ func (client *ConnectionMonitorsClient) createOrUpdateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") if options != nil && options.Migrate != nil { reqQP.Set("migrate", *options.Migrate) } @@ -133,7 +133,7 @@ func (client *ConnectionMonitorsClient) createOrUpdateCreateRequest(ctx context. // BeginDelete - Deletes the specified connection monitor. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group containing Network Watcher. // - networkWatcherName - The name of the Network Watcher resource. // - connectionMonitorName - The name of the connection monitor. @@ -157,7 +157,7 @@ func (client *ConnectionMonitorsClient) BeginDelete(ctx context.Context, resourc // Delete - Deletes the specified connection monitor. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *ConnectionMonitorsClient) deleteOperation(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, options *ConnectionMonitorsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ConnectionMonitorsClient.BeginDelete" @@ -203,7 +203,7 @@ func (client *ConnectionMonitorsClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -212,7 +212,7 @@ func (client *ConnectionMonitorsClient) deleteCreateRequest(ctx context.Context, // Get - Gets a connection monitor by name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group containing Network Watcher. // - networkWatcherName - The name of the Network Watcher resource. // - connectionMonitorName - The name of the connection monitor. @@ -263,7 +263,7 @@ func (client *ConnectionMonitorsClient) getCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -280,7 +280,7 @@ func (client *ConnectionMonitorsClient) getHandleResponse(resp *http.Response) ( // NewListPager - Lists all connection monitors for the specified Network Watcher. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group containing Network Watcher. // - networkWatcherName - The name of the Network Watcher resource. // - options - ConnectionMonitorsClientListOptions contains the optional parameters for the ConnectionMonitorsClient.NewListPager @@ -329,7 +329,7 @@ func (client *ConnectionMonitorsClient) listCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -347,7 +347,7 @@ func (client *ConnectionMonitorsClient) listHandleResponse(resp *http.Response) // BeginQuery - Query a snapshot of the most recent connection states. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group containing Network Watcher. // - networkWatcherName - The name of the Network Watcher resource. // - connectionMonitorName - The name given to the connection monitor. @@ -371,7 +371,7 @@ func (client *ConnectionMonitorsClient) BeginQuery(ctx context.Context, resource // Query - Query a snapshot of the most recent connection states. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *ConnectionMonitorsClient) query(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, options *ConnectionMonitorsClientBeginQueryOptions) (*http.Response, error) { var err error const operationName = "ConnectionMonitorsClient.BeginQuery" @@ -417,7 +417,7 @@ func (client *ConnectionMonitorsClient) queryCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -426,7 +426,7 @@ func (client *ConnectionMonitorsClient) queryCreateRequest(ctx context.Context, // BeginStart - Starts the specified connection monitor. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group containing Network Watcher. // - networkWatcherName - The name of the Network Watcher resource. // - connectionMonitorName - The name of the connection monitor. @@ -450,7 +450,7 @@ func (client *ConnectionMonitorsClient) BeginStart(ctx context.Context, resource // Start - Starts the specified connection monitor. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *ConnectionMonitorsClient) start(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, options *ConnectionMonitorsClientBeginStartOptions) (*http.Response, error) { var err error const operationName = "ConnectionMonitorsClient.BeginStart" @@ -496,7 +496,7 @@ func (client *ConnectionMonitorsClient) startCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -505,7 +505,7 @@ func (client *ConnectionMonitorsClient) startCreateRequest(ctx context.Context, // BeginStop - Stops the specified connection monitor. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group containing Network Watcher. // - networkWatcherName - The name of the Network Watcher resource. // - connectionMonitorName - The name of the connection monitor. @@ -529,7 +529,7 @@ func (client *ConnectionMonitorsClient) BeginStop(ctx context.Context, resourceG // Stop - Stops the specified connection monitor. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *ConnectionMonitorsClient) stop(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, options *ConnectionMonitorsClientBeginStopOptions) (*http.Response, error) { var err error const operationName = "ConnectionMonitorsClient.BeginStop" @@ -575,7 +575,7 @@ func (client *ConnectionMonitorsClient) stopCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -584,7 +584,7 @@ func (client *ConnectionMonitorsClient) stopCreateRequest(ctx context.Context, r // UpdateTags - Update tags of the specified connection monitor. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkWatcherName - The name of the network watcher. // - connectionMonitorName - The name of the connection monitor. @@ -637,7 +637,7 @@ func (client *ConnectionMonitorsClient) updateTagsCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/connectionmonitors_client_example_test.go b/sdk/resourcemanager/network/armnetwork/connectionmonitors_client_example_test.go deleted file mode 100644 index f0d941295f93..000000000000 --- a/sdk/resourcemanager/network/armnetwork/connectionmonitors_client_example_test.go +++ /dev/null @@ -1,579 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkWatcherConnectionMonitorCreate.json -func ExampleConnectionMonitorsClient_BeginCreateOrUpdate_createConnectionMonitorV1() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewConnectionMonitorsClient().BeginCreateOrUpdate(ctx, "rg1", "nw1", "cm1", armnetwork.ConnectionMonitor{ - Location: to.Ptr("eastus"), - Properties: &armnetwork.ConnectionMonitorParameters{ - Endpoints: []*armnetwork.ConnectionMonitorEndpoint{ - { - Name: to.Ptr("source"), - ResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/ct1"), - }, - { - Name: to.Ptr("destination"), - Address: to.Ptr("bing.com"), - }}, - TestConfigurations: []*armnetwork.ConnectionMonitorTestConfiguration{ - { - Name: to.Ptr("tcp"), - TCPConfiguration: &armnetwork.ConnectionMonitorTCPConfiguration{ - Port: to.Ptr[int32](80), - }, - TestFrequencySec: to.Ptr[int32](60), - Protocol: to.Ptr(armnetwork.ConnectionMonitorTestConfigurationProtocolTCP), - }}, - TestGroups: []*armnetwork.ConnectionMonitorTestGroup{ - { - Name: to.Ptr("tg"), - Destinations: []*string{ - to.Ptr("destination")}, - Sources: []*string{ - to.Ptr("source")}, - TestConfigurations: []*string{ - to.Ptr("tcp")}, - }}, - }, - }, &armnetwork.ConnectionMonitorsClientBeginCreateOrUpdateOptions{Migrate: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ConnectionMonitorResult = armnetwork.ConnectionMonitorResult{ - // Name: to.Ptr("cm1"), - // Type: to.Ptr("Microsoft.Network/networkWatchers/connectionMonitors"), - // Etag: to.Ptr("W/\"e7497f26-5f09-4559-900b-fe98f3dedb6f\""), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw1/connectionMonitors/cm1"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.ConnectionMonitorResultProperties{ - // Endpoints: []*armnetwork.ConnectionMonitorEndpoint{ - // { - // Name: to.Ptr("source"), - // ResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/ct1"), - // }, - // { - // Name: to.Ptr("destination"), - // Address: to.Ptr("bing.com"), - // }}, - // TestConfigurations: []*armnetwork.ConnectionMonitorTestConfiguration{ - // { - // Name: to.Ptr("tcp"), - // TCPConfiguration: &armnetwork.ConnectionMonitorTCPConfiguration{ - // Port: to.Ptr[int32](80), - // }, - // TestFrequencySec: to.Ptr[int32](60), - // Protocol: to.Ptr(armnetwork.ConnectionMonitorTestConfigurationProtocolTCP), - // }}, - // TestGroups: []*armnetwork.ConnectionMonitorTestGroup{ - // { - // Name: to.Ptr("tg"), - // Destinations: []*string{ - // to.Ptr("destination")}, - // Sources: []*string{ - // to.Ptr("source")}, - // TestConfigurations: []*string{ - // to.Ptr("tcp")}, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkWatcherConnectionMonitorV2Create.json -func ExampleConnectionMonitorsClient_BeginCreateOrUpdate_createConnectionMonitorV2() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewConnectionMonitorsClient().BeginCreateOrUpdate(ctx, "rg1", "nw1", "cm1", armnetwork.ConnectionMonitor{ - Properties: &armnetwork.ConnectionMonitorParameters{ - Endpoints: []*armnetwork.ConnectionMonitorEndpoint{ - { - Name: to.Ptr("vm1"), - ResourceID: to.Ptr("/subscriptions/96e68903-0a56-4819-9987-8d08ad6a1f99/resourceGroups/NwRgIrinaCentralUSEUAP/providers/Microsoft.Compute/virtualMachines/vm1"), - }, - { - Name: to.Ptr("CanaryWorkspaceVamshi"), - Filter: &armnetwork.ConnectionMonitorEndpointFilter{ - Type: to.Ptr(armnetwork.ConnectionMonitorEndpointFilterTypeInclude), - Items: []*armnetwork.ConnectionMonitorEndpointFilterItem{ - { - Type: to.Ptr(armnetwork.ConnectionMonitorEndpointFilterItemTypeAgentAddress), - Address: to.Ptr("npmuser"), - }}, - }, - ResourceID: to.Ptr("/subscriptions/96e68903-0a56-4819-9987-8d08ad6a1f99/resourceGroups/vasamudrRG/providers/Microsoft.OperationalInsights/workspaces/vasamudrWorkspace"), - }, - { - Name: to.Ptr("bing"), - Address: to.Ptr("bing.com"), - }, - { - Name: to.Ptr("google"), - Address: to.Ptr("google.com"), - }}, - Outputs: []*armnetwork.ConnectionMonitorOutput{}, - TestConfigurations: []*armnetwork.ConnectionMonitorTestConfiguration{ - { - Name: to.Ptr("testConfig1"), - TCPConfiguration: &armnetwork.ConnectionMonitorTCPConfiguration{ - DisableTraceRoute: to.Ptr(false), - Port: to.Ptr[int32](80), - }, - TestFrequencySec: to.Ptr[int32](60), - Protocol: to.Ptr(armnetwork.ConnectionMonitorTestConfigurationProtocolTCP), - }}, - TestGroups: []*armnetwork.ConnectionMonitorTestGroup{ - { - Name: to.Ptr("test1"), - Destinations: []*string{ - to.Ptr("bing"), - to.Ptr("google")}, - Disable: to.Ptr(false), - Sources: []*string{ - to.Ptr("vm1"), - to.Ptr("CanaryWorkspaceVamshi")}, - TestConfigurations: []*string{ - to.Ptr("testConfig1")}, - }}, - }, - }, &armnetwork.ConnectionMonitorsClientBeginCreateOrUpdateOptions{Migrate: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ConnectionMonitorResult = armnetwork.ConnectionMonitorResult{ - // Name: to.Ptr("cm1"), - // Type: to.Ptr("Microsoft.Network/networkWatchers/connectionMonitors"), - // Etag: to.Ptr("W/\"e7497f26-5f09-4559-900b-fe98f3dedb6f\""), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw1/connectionMonitors/cm1"), - // Location: to.Ptr("centraluseuap"), - // Properties: &armnetwork.ConnectionMonitorResultProperties{ - // Endpoints: []*armnetwork.ConnectionMonitorEndpoint{ - // { - // Name: to.Ptr("vm1"), - // ResourceID: to.Ptr("/subscriptions/96e68903-0a56-4819-9987-8d08ad6a1f99/resourceGroups/NwRgIrinaCentralUSEUAP/providers/Microsoft.Compute/virtualMachines/vm1"), - // }, - // { - // Name: to.Ptr("CanaryWorkspaceVamshi"), - // Filter: &armnetwork.ConnectionMonitorEndpointFilter{ - // Type: to.Ptr(armnetwork.ConnectionMonitorEndpointFilterTypeInclude), - // Items: []*armnetwork.ConnectionMonitorEndpointFilterItem{ - // { - // Type: to.Ptr(armnetwork.ConnectionMonitorEndpointFilterItemTypeAgentAddress), - // Address: to.Ptr("npmuser"), - // }}, - // }, - // ResourceID: to.Ptr("/subscriptions/96e68903-0a56-4819-9987-8d08ad6a1f99/resourceGroups/vasamudrRG/providers/Microsoft.OperationalInsights/workspaces/vasamudrWorkspace"), - // }, - // { - // Name: to.Ptr("bing"), - // Address: to.Ptr("bing.com"), - // }, - // { - // Name: to.Ptr("google"), - // Address: to.Ptr("google.com"), - // }}, - // Outputs: []*armnetwork.ConnectionMonitorOutput{ - // }, - // TestConfigurations: []*armnetwork.ConnectionMonitorTestConfiguration{ - // { - // Name: to.Ptr("testConfig1"), - // TCPConfiguration: &armnetwork.ConnectionMonitorTCPConfiguration{ - // DisableTraceRoute: to.Ptr(false), - // Port: to.Ptr[int32](80), - // }, - // TestFrequencySec: to.Ptr[int32](60), - // Protocol: to.Ptr(armnetwork.ConnectionMonitorTestConfigurationProtocolTCP), - // }}, - // TestGroups: []*armnetwork.ConnectionMonitorTestGroup{ - // { - // Name: to.Ptr("test1"), - // Destinations: []*string{ - // to.Ptr("bing"), - // to.Ptr("google")}, - // Disable: to.Ptr(false), - // Sources: []*string{ - // to.Ptr("vm1"), - // to.Ptr("CanaryWorkspaceVamshi")}, - // TestConfigurations: []*string{ - // to.Ptr("testConfig1")}, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkWatcherConnectionMonitorGet.json -func ExampleConnectionMonitorsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewConnectionMonitorsClient().Get(ctx, "rg1", "nw1", "cm1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ConnectionMonitorResult = armnetwork.ConnectionMonitorResult{ - // Name: to.Ptr("cm1"), - // Type: to.Ptr("Microsoft.Network/networkWatchers/connectionMonitors"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw1/connectionMonitors/cm1"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.ConnectionMonitorResultProperties{ - // Endpoints: []*armnetwork.ConnectionMonitorEndpoint{ - // { - // Name: to.Ptr("source"), - // ResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/ct1"), - // }, - // { - // Name: to.Ptr("destination"), - // Address: to.Ptr("bing.com"), - // }}, - // TestConfigurations: []*armnetwork.ConnectionMonitorTestConfiguration{ - // { - // Name: to.Ptr("tcp"), - // TCPConfiguration: &armnetwork.ConnectionMonitorTCPConfiguration{ - // Port: to.Ptr[int32](80), - // }, - // TestFrequencySec: to.Ptr[int32](60), - // Protocol: to.Ptr(armnetwork.ConnectionMonitorTestConfigurationProtocolTCP), - // }}, - // TestGroups: []*armnetwork.ConnectionMonitorTestGroup{ - // { - // Name: to.Ptr("tg"), - // Destinations: []*string{ - // to.Ptr("destination")}, - // Sources: []*string{ - // to.Ptr("source")}, - // TestConfigurations: []*string{ - // to.Ptr("tcp")}, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkWatcherConnectionMonitorDelete.json -func ExampleConnectionMonitorsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewConnectionMonitorsClient().BeginDelete(ctx, "rg1", "nw1", "cm1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkWatcherConnectionMonitorUpdateTags.json -func ExampleConnectionMonitorsClient_UpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewConnectionMonitorsClient().UpdateTags(ctx, "rg1", "nw1", "cm1", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ConnectionMonitorResult = armnetwork.ConnectionMonitorResult{ - // Name: to.Ptr("cm1"), - // Type: to.Ptr("Microsoft.Network/networkWatchers/connectionMonitors"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // ID: to.Ptr("/subscriptions/subid/`/rg1/providers/Microsoft.Network/networkWatchers/nw1/connectionMonitors/cm1"), - // Location: to.Ptr("westcentralus"), - // Properties: &armnetwork.ConnectionMonitorResultProperties{ - // AutoStart: to.Ptr(true), - // Destination: &armnetwork.ConnectionMonitorDestination{ - // Address: to.Ptr("bing.com"), - // Port: to.Ptr[int32](80), - // }, - // MonitoringIntervalInSeconds: to.Ptr[int32](60), - // Source: &armnetwork.ConnectionMonitorSource{ - // Port: to.Ptr[int32](0), - // ResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/vm1"), - // }, - // MonitoringStatus: to.Ptr("Running"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-04T02:48:10.6797393Z"); return t}()), - // }, - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkWatcherConnectionMonitorStop.json -func ExampleConnectionMonitorsClient_BeginStop() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewConnectionMonitorsClient().BeginStop(ctx, "rg1", "nw1", "cm1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkWatcherConnectionMonitorStart.json -func ExampleConnectionMonitorsClient_BeginStart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewConnectionMonitorsClient().BeginStart(ctx, "rg1", "nw1", "cm1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkWatcherConnectionMonitorQuery.json -func ExampleConnectionMonitorsClient_BeginQuery() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewConnectionMonitorsClient().BeginQuery(ctx, "rg1", "nw1", "cm1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ConnectionMonitorQueryResult = armnetwork.ConnectionMonitorQueryResult{ - // SourceStatus: to.Ptr(armnetwork.ConnectionMonitorSourceStatusActive), - // States: []*armnetwork.ConnectionStateSnapshot{ - // { - // ConnectionState: to.Ptr(armnetwork.ConnectionStateReachable), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-08T05:12:41.5265438Z"); return t}()), - // EvaluationState: to.Ptr(armnetwork.EvaluationStateCompleted), - // Hops: []*armnetwork.ConnectivityHop{ - // { - // Type: to.Ptr("Source"), - // Address: to.Ptr("10.1.1.4"), - // ID: to.Ptr("7dbbe7aa-60ba-4650-831e-63d775d38e9e"), - // Issues: []*armnetwork.ConnectivityIssue{ - // }, - // NextHopIDs: []*string{ - // to.Ptr("75c8d819-b208-4584-a311-1aa45ce753f9")}, - // ResourceID: to.Ptr("subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/nic0/ipConfigurations/ipconfig1"), - // }, - // { - // Type: to.Ptr("VirtualNetwork"), - // Address: to.Ptr("192.168.100.4"), - // ID: to.Ptr("75c8d819-b208-4584-a311-1aa45ce753f9"), - // Issues: []*armnetwork.ConnectivityIssue{ - // }, - // NextHopIDs: []*string{ - // }, - // ResourceID: to.Ptr("subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/nic1/ipConfigurations/ipconfig1"), - // }}, - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-08T03:42:33.3387305Z"); return t}()), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkWatcherConnectionMonitorList.json -func ExampleConnectionMonitorsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewConnectionMonitorsClient().NewListPager("rg1", "nw1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ConnectionMonitorListResult = armnetwork.ConnectionMonitorListResult{ - // Value: []*armnetwork.ConnectionMonitorResult{ - // { - // Name: to.Ptr("cm1"), - // Type: to.Ptr("Microsoft.Network/networkWatchers/connectionMonitors"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw1/connectionMonitors/cm1"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.ConnectionMonitorResultProperties{ - // Endpoints: []*armnetwork.ConnectionMonitorEndpoint{ - // { - // Name: to.Ptr("source"), - // ResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/ct1"), - // }, - // { - // Name: to.Ptr("destination"), - // Address: to.Ptr("bing.com"), - // }}, - // TestConfigurations: []*armnetwork.ConnectionMonitorTestConfiguration{ - // { - // Name: to.Ptr("tcp"), - // TCPConfiguration: &armnetwork.ConnectionMonitorTCPConfiguration{ - // Port: to.Ptr[int32](80), - // }, - // TestFrequencySec: to.Ptr[int32](60), - // Protocol: to.Ptr(armnetwork.ConnectionMonitorTestConfigurationProtocolTCP), - // }}, - // TestGroups: []*armnetwork.ConnectionMonitorTestGroup{ - // { - // Name: to.Ptr("tg"), - // Destinations: []*string{ - // to.Ptr("destination")}, - // Sources: []*string{ - // to.Ptr("source")}, - // TestConfigurations: []*string{ - // to.Ptr("tcp")}, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }, - // { - // Name: to.Ptr("cm2"), - // Type: to.Ptr("Microsoft.Network/networkWatchers/connectionMonitors"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw1/connectionMonitors/cm2"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.ConnectionMonitorResultProperties{ - // Endpoints: []*armnetwork.ConnectionMonitorEndpoint{ - // { - // Name: to.Ptr("source"), - // ResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/ct2"), - // }, - // { - // Name: to.Ptr("destination"), - // Address: to.Ptr("google.com"), - // }}, - // TestConfigurations: []*armnetwork.ConnectionMonitorTestConfiguration{ - // { - // Name: to.Ptr("tcp"), - // TCPConfiguration: &armnetwork.ConnectionMonitorTCPConfiguration{ - // Port: to.Ptr[int32](80), - // }, - // TestFrequencySec: to.Ptr[int32](60), - // Protocol: to.Ptr(armnetwork.ConnectionMonitorTestConfigurationProtocolTCP), - // }}, - // TestGroups: []*armnetwork.ConnectionMonitorTestGroup{ - // { - // Name: to.Ptr("tg"), - // Destinations: []*string{ - // to.Ptr("destination")}, - // Sources: []*string{ - // to.Ptr("source")}, - // TestConfigurations: []*string{ - // to.Ptr("tcp")}, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/connectivityconfigurations_client.go b/sdk/resourcemanager/network/armnetwork/connectivityconfigurations_client.go index cde706bdf921..6e9a3223e4e6 100644 --- a/sdk/resourcemanager/network/armnetwork/connectivityconfigurations_client.go +++ b/sdk/resourcemanager/network/armnetwork/connectivityconfigurations_client.go @@ -48,7 +48,7 @@ func NewConnectivityConfigurationsClient(subscriptionID string, credential azcor // CreateOrUpdate - Creates/Updates a new network manager connectivity configuration // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager connectivity configuration. @@ -101,7 +101,7 @@ func (client *ConnectivityConfigurationsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, connectivityConfiguration); err != nil { @@ -123,7 +123,7 @@ func (client *ConnectivityConfigurationsClient) createOrUpdateHandleResponse(res // and connectivity configuration name // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager connectivity configuration. @@ -148,7 +148,7 @@ func (client *ConnectivityConfigurationsClient) BeginDelete(ctx context.Context, // connectivity configuration name // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *ConnectivityConfigurationsClient) deleteOperation(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, options *ConnectivityConfigurationsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ConnectivityConfigurationsClient.BeginDelete" @@ -194,7 +194,7 @@ func (client *ConnectivityConfigurationsClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } @@ -207,7 +207,7 @@ func (client *ConnectivityConfigurationsClient) deleteCreateRequest(ctx context. // Configuration name // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager connectivity configuration. @@ -259,7 +259,7 @@ func (client *ConnectivityConfigurationsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -276,7 +276,7 @@ func (client *ConnectivityConfigurationsClient) getHandleResponse(resp *http.Res // NewListPager - Lists all the network manager connectivity configuration in a specified network manager. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - options - ConnectivityConfigurationsClientListOptions contains the optional parameters for the ConnectivityConfigurationsClient.NewListPager @@ -331,7 +331,7 @@ func (client *ConnectivityConfigurationsClient) listCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } diff --git a/sdk/resourcemanager/network/armnetwork/connectivityconfigurations_client_example_test.go b/sdk/resourcemanager/network/armnetwork/connectivityconfigurations_client_example_test.go deleted file mode 100644 index d2d959f01fa9..000000000000 --- a/sdk/resourcemanager/network/armnetwork/connectivityconfigurations_client_example_test.go +++ /dev/null @@ -1,228 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkManagerConnectivityConfigurationGet.json -func ExampleConnectivityConfigurationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewConnectivityConfigurationsClient().Get(ctx, "myResourceGroup", "testNetworkManager", "myTestConnectivityConfig", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ConnectivityConfiguration = armnetwork.ConnectivityConfiguration{ - // Name: to.Ptr("myTestConnectivityConfig"), - // Type: to.Ptr("Microsoft.Network/networkManagers/connectivityConfigurations"), - // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/connectivityConfigurations/myTestConnectivityConfig"), - // Properties: &armnetwork.ConnectivityConfigurationProperties{ - // Description: to.Ptr("Sample Configuration"), - // AppliesToGroups: []*armnetwork.ConnectivityGroupItem{ - // { - // GroupConnectivity: to.Ptr(armnetwork.GroupConnectivityNone), - // IsGlobal: to.Ptr(armnetwork.IsGlobalFalse), - // NetworkGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/group1"), - // UseHubGateway: to.Ptr(armnetwork.UseHubGatewayTrue), - // }}, - // ConnectivityTopology: to.Ptr(armnetwork.ConnectivityTopologyHubAndSpoke), - // DeleteExistingPeering: to.Ptr(armnetwork.DeleteExistingPeeringTrue), - // Hubs: []*armnetwork.Hub{ - // { - // ResourceID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myHubVnet"), - // ResourceType: to.Ptr("Microsoft.Network/virtualNetworks"), - // }}, - // IsGlobal: to.Ptr(armnetwork.IsGlobalTrue), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkManagerConnectivityConfigurationPut.json -func ExampleConnectivityConfigurationsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewConnectivityConfigurationsClient().CreateOrUpdate(ctx, "myResourceGroup", "testNetworkManager", "myTestConnectivityConfig", armnetwork.ConnectivityConfiguration{ - Properties: &armnetwork.ConnectivityConfigurationProperties{ - Description: to.Ptr("Sample Configuration"), - AppliesToGroups: []*armnetwork.ConnectivityGroupItem{ - { - GroupConnectivity: to.Ptr(armnetwork.GroupConnectivityNone), - IsGlobal: to.Ptr(armnetwork.IsGlobalFalse), - NetworkGroupID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/group1"), - UseHubGateway: to.Ptr(armnetwork.UseHubGatewayTrue), - }}, - ConnectivityTopology: to.Ptr(armnetwork.ConnectivityTopologyHubAndSpoke), - DeleteExistingPeering: to.Ptr(armnetwork.DeleteExistingPeeringTrue), - Hubs: []*armnetwork.Hub{ - { - ResourceID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myTestConnectivityConfig"), - ResourceType: to.Ptr("Microsoft.Network/virtualNetworks"), - }}, - IsGlobal: to.Ptr(armnetwork.IsGlobalTrue), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ConnectivityConfiguration = armnetwork.ConnectivityConfiguration{ - // Name: to.Ptr("myTestConnectivityConfig"), - // Type: to.Ptr("Microsoft.Network/networkManagers/connectivityConfigurations"), - // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/connectivityConfigurations/myTestConnectivityConfig"), - // Properties: &armnetwork.ConnectivityConfigurationProperties{ - // Description: to.Ptr("Sample Connectivity Configuration"), - // AppliesToGroups: []*armnetwork.ConnectivityGroupItem{ - // { - // GroupConnectivity: to.Ptr(armnetwork.GroupConnectivityNone), - // IsGlobal: to.Ptr(armnetwork.IsGlobalFalse), - // NetworkGroupID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/groups/group1"), - // UseHubGateway: to.Ptr(armnetwork.UseHubGatewayTrue), - // }}, - // ConnectivityTopology: to.Ptr(armnetwork.ConnectivityTopologyHubAndSpoke), - // DeleteExistingPeering: to.Ptr(armnetwork.DeleteExistingPeeringTrue), - // Hubs: []*armnetwork.Hub{ - // { - // ResourceID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myTestConnectivityConfig"), - // ResourceType: to.Ptr("Microsoft.Network/virtualNetworks"), - // }}, - // IsGlobal: to.Ptr(armnetwork.IsGlobalTrue), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkManagerConnectivityConfigurationDelete.json -func ExampleConnectivityConfigurationsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewConnectivityConfigurationsClient().BeginDelete(ctx, "myResourceGroup", "testNetworkManager", "myTestConnectivityConfig", &armnetwork.ConnectivityConfigurationsClientBeginDeleteOptions{Force: to.Ptr(false)}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkManagerConnectivityConfigurationList.json -func ExampleConnectivityConfigurationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewConnectivityConfigurationsClient().NewListPager("myResourceGroup", "testNetworkManager", &armnetwork.ConnectivityConfigurationsClientListOptions{Top: nil, - SkipToken: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ConnectivityConfigurationListResult = armnetwork.ConnectivityConfigurationListResult{ - // Value: []*armnetwork.ConnectivityConfiguration{ - // { - // Name: to.Ptr("myTestConnectivityConfig"), - // Type: to.Ptr("Microsoft.Network/networkManagers/connectivityConfigurations"), - // ID: to.Ptr("subscription/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/connectivityConfigurations/myTestConnectivityConfig"), - // Properties: &armnetwork.ConnectivityConfigurationProperties{ - // Description: to.Ptr("Sample Configuration"), - // AppliesToGroups: []*armnetwork.ConnectivityGroupItem{ - // { - // GroupConnectivity: to.Ptr(armnetwork.GroupConnectivityNone), - // IsGlobal: to.Ptr(armnetwork.IsGlobalFalse), - // NetworkGroupID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/netwrokGroups/group1"), - // UseHubGateway: to.Ptr(armnetwork.UseHubGatewayTrue), - // }}, - // ConnectivityTopology: to.Ptr(armnetwork.ConnectivityTopologyHubAndSpoke), - // DeleteExistingPeering: to.Ptr(armnetwork.DeleteExistingPeeringTrue), - // Hubs: []*armnetwork.Hub{ - // { - // ResourceID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myHubVnet"), - // ResourceType: to.Ptr("Microsoft.Network/virtualNetworks"), - // }}, - // IsGlobal: to.Ptr(armnetwork.IsGlobalTrue), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/constants.go b/sdk/resourcemanager/network/armnetwork/constants.go index 6e4fa9b33233..79f7b5913732 100644 --- a/sdk/resourcemanager/network/armnetwork/constants.go +++ b/sdk/resourcemanager/network/armnetwork/constants.go @@ -10,7 +10,7 @@ package armnetwork const ( moduleName = "armnetwork" - moduleVersion = "v4.1.0-beta.1" + moduleVersion = "v4.1.0" ) // Access - Access to be allowed or denied. @@ -351,6 +351,7 @@ func PossibleApplicationGatewayRuleSetStatusOptionsValues() []ApplicationGateway type ApplicationGatewaySKUName string const ( + ApplicationGatewaySKUNameBasic ApplicationGatewaySKUName = "Basic" ApplicationGatewaySKUNameStandardLarge ApplicationGatewaySKUName = "Standard_Large" ApplicationGatewaySKUNameStandardMedium ApplicationGatewaySKUName = "Standard_Medium" ApplicationGatewaySKUNameStandardSmall ApplicationGatewaySKUName = "Standard_Small" @@ -363,6 +364,7 @@ const ( // PossibleApplicationGatewaySKUNameValues returns the possible values for the ApplicationGatewaySKUName const type. func PossibleApplicationGatewaySKUNameValues() []ApplicationGatewaySKUName { return []ApplicationGatewaySKUName{ + ApplicationGatewaySKUNameBasic, ApplicationGatewaySKUNameStandardLarge, ApplicationGatewaySKUNameStandardMedium, ApplicationGatewaySKUNameStandardSmall, @@ -505,6 +507,7 @@ func PossibleApplicationGatewaySSLProtocolValues() []ApplicationGatewaySSLProtoc type ApplicationGatewayTier string const ( + ApplicationGatewayTierBasic ApplicationGatewayTier = "Basic" ApplicationGatewayTierStandard ApplicationGatewayTier = "Standard" ApplicationGatewayTierStandardV2 ApplicationGatewayTier = "Standard_v2" ApplicationGatewayTierWAF ApplicationGatewayTier = "WAF" @@ -514,6 +517,7 @@ const ( // PossibleApplicationGatewayTierValues returns the possible values for the ApplicationGatewayTier const type. func PossibleApplicationGatewayTierValues() []ApplicationGatewayTier { return []ApplicationGatewayTier{ + ApplicationGatewayTierBasic, ApplicationGatewayTierStandard, ApplicationGatewayTierStandardV2, ApplicationGatewayTierWAF, @@ -3385,6 +3389,22 @@ func PossibleSlotTypeValues() []SlotType { } } +// SyncMode - Backend address synchronous mode for the backend pool +type SyncMode string + +const ( + SyncModeAutomatic SyncMode = "Automatic" + SyncModeManual SyncMode = "Manual" +) + +// PossibleSyncModeValues returns the possible values for the SyncMode const type. +func PossibleSyncModeValues() []SyncMode { + return []SyncMode{ + SyncModeAutomatic, + SyncModeManual, + } +} + type SyncRemoteAddressSpace string const ( diff --git a/sdk/resourcemanager/network/armnetwork/customipprefixes_client.go b/sdk/resourcemanager/network/armnetwork/customipprefixes_client.go index f7583862fa04..12e583a2e3d0 100644 --- a/sdk/resourcemanager/network/armnetwork/customipprefixes_client.go +++ b/sdk/resourcemanager/network/armnetwork/customipprefixes_client.go @@ -47,7 +47,7 @@ func NewCustomIPPrefixesClient(subscriptionID string, credential azcore.TokenCre // BeginCreateOrUpdate - Creates or updates a custom IP prefix. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - customIPPrefixName - The name of the custom IP prefix. // - parameters - Parameters supplied to the create or update custom IP prefix operation. @@ -71,7 +71,7 @@ func (client *CustomIPPrefixesClient) BeginCreateOrUpdate(ctx context.Context, r // CreateOrUpdate - Creates or updates a custom IP prefix. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *CustomIPPrefixesClient) createOrUpdate(ctx context.Context, resourceGroupName string, customIPPrefixName string, parameters CustomIPPrefix, options *CustomIPPrefixesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "CustomIPPrefixesClient.BeginCreateOrUpdate" @@ -113,7 +113,7 @@ func (client *CustomIPPrefixesClient) createOrUpdateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -125,7 +125,7 @@ func (client *CustomIPPrefixesClient) createOrUpdateCreateRequest(ctx context.Co // BeginDelete - Deletes the specified custom IP prefix. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - customIPPrefixName - The name of the CustomIpPrefix. // - options - CustomIPPrefixesClientBeginDeleteOptions contains the optional parameters for the CustomIPPrefixesClient.BeginDelete @@ -148,7 +148,7 @@ func (client *CustomIPPrefixesClient) BeginDelete(ctx context.Context, resourceG // Delete - Deletes the specified custom IP prefix. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *CustomIPPrefixesClient) deleteOperation(ctx context.Context, resourceGroupName string, customIPPrefixName string, options *CustomIPPrefixesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "CustomIPPrefixesClient.BeginDelete" @@ -190,7 +190,7 @@ func (client *CustomIPPrefixesClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -199,7 +199,7 @@ func (client *CustomIPPrefixesClient) deleteCreateRequest(ctx context.Context, r // Get - Gets the specified custom IP prefix in a specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - customIPPrefixName - The name of the custom IP prefix. // - options - CustomIPPrefixesClientGetOptions contains the optional parameters for the CustomIPPrefixesClient.Get method. @@ -245,7 +245,7 @@ func (client *CustomIPPrefixesClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } @@ -265,7 +265,7 @@ func (client *CustomIPPrefixesClient) getHandleResponse(resp *http.Response) (Cu // NewListPager - Gets all custom IP prefixes in a resource group. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - options - CustomIPPrefixesClientListOptions contains the optional parameters for the CustomIPPrefixesClient.NewListPager // method. @@ -315,7 +315,7 @@ func (client *CustomIPPrefixesClient) listCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -332,7 +332,7 @@ func (client *CustomIPPrefixesClient) listHandleResponse(resp *http.Response) (C // NewListAllPager - Gets all the custom IP prefixes in a subscription. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - options - CustomIPPrefixesClientListAllOptions contains the optional parameters for the CustomIPPrefixesClient.NewListAllPager // method. func (client *CustomIPPrefixesClient) NewListAllPager(options *CustomIPPrefixesClientListAllOptions) *runtime.Pager[CustomIPPrefixesClientListAllResponse] { @@ -377,7 +377,7 @@ func (client *CustomIPPrefixesClient) listAllCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -395,7 +395,7 @@ func (client *CustomIPPrefixesClient) listAllHandleResponse(resp *http.Response) // UpdateTags - Updates custom IP prefix tags. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - customIPPrefixName - The name of the custom IP prefix. // - parameters - Parameters supplied to update custom IP prefix tags. @@ -443,7 +443,7 @@ func (client *CustomIPPrefixesClient) updateTagsCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/customipprefixes_client_example_test.go b/sdk/resourcemanager/network/armnetwork/customipprefixes_client_example_test.go deleted file mode 100644 index 398fe591e9b0..000000000000 --- a/sdk/resourcemanager/network/armnetwork/customipprefixes_client_example_test.go +++ /dev/null @@ -1,627 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/CustomIpPrefixDelete.json -func ExampleCustomIPPrefixesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCustomIPPrefixesClient().BeginDelete(ctx, "rg1", "test-customipprefix", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/CustomIpPrefixGet.json -func ExampleCustomIPPrefixesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCustomIPPrefixesClient().Get(ctx, "rg1", "test-customipprefix", &armnetwork.CustomIPPrefixesClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CustomIPPrefix = armnetwork.CustomIPPrefix{ - // Name: to.Ptr("test-customipprefix"), - // Type: to.Ptr("Microsoft.Network/customIpPrefixes"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/customIpPrefixes/test-customipprefix"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.CustomIPPrefixPropertiesFormat{ - // AuthorizationMessage: to.Ptr("authorizationMessage"), - // ChildCustomIPPrefixes: []*armnetwork.SubResource{ - // }, - // Cidr: to.Ptr("0.0.0.0/24"), - // CommissionedState: to.Ptr(armnetwork.CommissionedStateCommissioned), - // ExpressRouteAdvertise: to.Ptr(false), - // FailedReason: to.Ptr(""), - // NoInternetAdvertise: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPPrefixes: []*armnetwork.SubResource{ - // }, - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // SignedMessage: to.Ptr("signedMessage"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/CustomIpPrefixCreateCustomizedValues.json -func ExampleCustomIPPrefixesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCustomIPPrefixesClient().BeginCreateOrUpdate(ctx, "rg1", "test-customipprefix", armnetwork.CustomIPPrefix{ - Location: to.Ptr("westus"), - Properties: &armnetwork.CustomIPPrefixPropertiesFormat{ - Cidr: to.Ptr("0.0.0.0/24"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CustomIPPrefix = armnetwork.CustomIPPrefix{ - // Name: to.Ptr("test-customipprefix"), - // Type: to.Ptr("Microsoft.Network/customIpPrefixes"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/customIpPrefixes/test-customipprefix"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.CustomIPPrefixPropertiesFormat{ - // AuthorizationMessage: to.Ptr("authorizationMessage"), - // ChildCustomIPPrefixes: []*armnetwork.SubResource{ - // }, - // Cidr: to.Ptr("192.168.254.2/24"), - // CommissionedState: to.Ptr(armnetwork.CommissionedStateProvisioning), - // FailedReason: to.Ptr(""), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPPrefixes: []*armnetwork.SubResource{ - // }, - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // SignedMessage: to.Ptr("signedMessage"), - // }, - // Zones: []*string{ - // to.Ptr("1")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/CustomIpPrefixUpdateTags.json -func ExampleCustomIPPrefixesClient_UpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCustomIPPrefixesClient().UpdateTags(ctx, "rg1", "test-customipprefix", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CustomIPPrefix = armnetwork.CustomIPPrefix{ - // Name: to.Ptr("test-customipprefix"), - // Type: to.Ptr("Microsoft.Network/customIpPrefixes"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/customIpPrefixes/test-customipprefix"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.CustomIPPrefixPropertiesFormat{ - // AuthorizationMessage: to.Ptr("authorizationMessage"), - // ChildCustomIPPrefixes: []*armnetwork.SubResource{ - // }, - // Cidr: to.Ptr("192.168.254.2/24"), - // CommissionedState: to.Ptr(armnetwork.CommissionedStateProvisioning), - // FailedReason: to.Ptr(""), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPPrefixes: []*armnetwork.SubResource{ - // }, - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // SignedMessage: to.Ptr("signedMessage"), - // }, - // Zones: []*string{ - // to.Ptr("1")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/CustomIpPrefixListAll.json -func ExampleCustomIPPrefixesClient_NewListAllPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCustomIPPrefixesClient().NewListAllPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CustomIPPrefixListResult = armnetwork.CustomIPPrefixListResult{ - // Value: []*armnetwork.CustomIPPrefix{ - // { - // Name: to.Ptr("test-customipprefix"), - // Type: to.Ptr("Microsoft.Network/customIpPrefixes"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/customIpPrefixes/test-customipprefix"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.CustomIPPrefixPropertiesFormat{ - // AuthorizationMessage: to.Ptr("authorizationMessage"), - // ChildCustomIPPrefixes: []*armnetwork.SubResource{ - // }, - // Cidr: to.Ptr("0.0.0.0/24"), - // CommissionedState: to.Ptr(armnetwork.CommissionedStateCommissioned), - // ExpressRouteAdvertise: to.Ptr(false), - // FailedReason: to.Ptr(""), - // NoInternetAdvertise: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPPrefixes: []*armnetwork.SubResource{ - // }, - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // SignedMessage: to.Ptr("signedMessage"), - // }, - // }, - // { - // Name: to.Ptr("test-customipprefix2"), - // Type: to.Ptr("Microsoft.Network/customIpPrefixes"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/customIpPrefixes/test-customipprefix2"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.CustomIPPrefixPropertiesFormat{ - // AuthorizationMessage: to.Ptr("authorizationMessage"), - // ChildCustomIPPrefixes: []*armnetwork.SubResource{ - // }, - // Cidr: to.Ptr("0.0.2.0/23"), - // CommissionedState: to.Ptr(armnetwork.CommissionedStateCommissioned), - // ExpressRouteAdvertise: to.Ptr(false), - // FailedReason: to.Ptr(""), - // NoInternetAdvertise: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPPrefixes: []*armnetwork.SubResource{ - // }, - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // SignedMessage: to.Ptr("signedMessage"), - // }, - // }, - // { - // Name: to.Ptr("test-customipprefix3"), - // Type: to.Ptr("Microsoft.Network/customIpPrefixes"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg3/providers/Microsoft.Network/customIpPrefixes/test-customipprefix3"), - // Location: to.Ptr("eastus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.CustomIPPrefixPropertiesFormat{ - // AuthorizationMessage: to.Ptr("authorizationMessage"), - // ChildCustomIPPrefixes: []*armnetwork.SubResource{ - // }, - // Cidr: to.Ptr("0.0.4.0/22"), - // CommissionedState: to.Ptr(armnetwork.CommissionedStateProvisioning), - // ExpressRouteAdvertise: to.Ptr(false), - // FailedReason: to.Ptr(""), - // NoInternetAdvertise: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPPrefixes: []*armnetwork.SubResource{ - // }, - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // SignedMessage: to.Ptr("signedMessage"), - // }, - // }, - // { - // Name: to.Ptr("test-customipprefix4"), - // Type: to.Ptr("Microsoft.Network/customIpPrefixes"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg3/providers/Microsoft.Network/customIpPrefixes/test-customipprefix4"), - // Location: to.Ptr("eastus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.CustomIPPrefixPropertiesFormat{ - // AuthorizationMessage: to.Ptr("authorizationMessage"), - // ChildCustomIPPrefixes: []*armnetwork.SubResource{ - // }, - // Cidr: to.Ptr("2607:f0d1:1002:0001::/64"), - // CommissionedState: to.Ptr(armnetwork.CommissionedStateCommissioned), - // CustomIPPrefixParent: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg3/providers/Microsoft.Network/customIpPrefixes/test-customipprefix5"), - // }, - // ExpressRouteAdvertise: to.Ptr(false), - // FailedReason: to.Ptr(""), - // NoInternetAdvertise: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPPrefixes: []*armnetwork.SubResource{ - // }, - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // SignedMessage: to.Ptr("signedMessage"), - // }, - // }, - // { - // Name: to.Ptr("test-customipprefix5"), - // Type: to.Ptr("Microsoft.Network/customIpPrefixes"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg3/providers/Microsoft.Network/customIpPrefixes/test-customipprefix5"), - // Location: to.Ptr("eastus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.CustomIPPrefixPropertiesFormat{ - // AuthorizationMessage: to.Ptr("authorizationMessage"), - // ChildCustomIPPrefixes: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg3/providers/Microsoft.Network/customIpPrefixes/test-customipprefix4"), - // }}, - // Cidr: to.Ptr("2607:f0d1:1002::/48"), - // CommissionedState: to.Ptr(armnetwork.CommissionedStateProvisioned), - // ExpressRouteAdvertise: to.Ptr(false), - // FailedReason: to.Ptr(""), - // NoInternetAdvertise: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPPrefixes: []*armnetwork.SubResource{ - // }, - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // SignedMessage: to.Ptr("signedMessage"), - // }, - // }, - // { - // Name: to.Ptr("test-customipprefix6"), - // Type: to.Ptr("Microsoft.Network/customIpPrefixes"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg3/providers/Microsoft.Network/customIpPrefixes/test-customipprefix6"), - // Location: to.Ptr("eastus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.CustomIPPrefixPropertiesFormat{ - // AuthorizationMessage: to.Ptr("authorizationMessage"), - // ChildCustomIPPrefixes: []*armnetwork.SubResource{ - // }, - // Cidr: to.Ptr("0.0.5.0/22"), - // CommissionedState: to.Ptr(armnetwork.CommissionedState("ProvisionFailed")), - // ExpressRouteAdvertise: to.Ptr(false), - // FailedReason: to.Ptr("CustomerSignatureNotVerified"), - // NoInternetAdvertise: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPPrefixes: []*armnetwork.SubResource{ - // }, - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // SignedMessage: to.Ptr("signedMessage"), - // }, - // }, - // { - // Name: to.Ptr("test-customipprefix6"), - // Type: to.Ptr("Microsoft.Network/customIpPrefixes"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg3/providers/Microsoft.Network/customIpPrefixes/test-customipprefix7"), - // Location: to.Ptr("eastus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.CustomIPPrefixPropertiesFormat{ - // AuthorizationMessage: to.Ptr("authorizationMessage"), - // ChildCustomIPPrefixes: []*armnetwork.SubResource{ - // }, - // Cidr: to.Ptr("0.0.6.0/22"), - // CommissionedState: to.Ptr(armnetwork.CommissionedStateCommissioning), - // ExpressRouteAdvertise: to.Ptr(false), - // FailedReason: to.Ptr(""), - // NoInternetAdvertise: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPPrefixes: []*armnetwork.SubResource{ - // }, - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // SignedMessage: to.Ptr("signedMessage"), - // }, - // }, - // { - // Name: to.Ptr("test-customipprefix6"), - // Type: to.Ptr("Microsoft.Network/customIpPrefixes"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg3/providers/Microsoft.Network/customIpPrefixes/test-customipprefix8"), - // Location: to.Ptr("eastus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.CustomIPPrefixPropertiesFormat{ - // AuthorizationMessage: to.Ptr("authorizationMessage"), - // ChildCustomIPPrefixes: []*armnetwork.SubResource{ - // }, - // Cidr: to.Ptr("0.0.7.0/22"), - // CommissionedState: to.Ptr(armnetwork.CommissionedStateCommissioning), - // ExpressRouteAdvertise: to.Ptr(false), - // FailedReason: to.Ptr(""), - // NoInternetAdvertise: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPPrefixes: []*armnetwork.SubResource{ - // }, - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // SignedMessage: to.Ptr("signedMessage"), - // }, - // }, - // { - // Name: to.Ptr("test-customipprefix6"), - // Type: to.Ptr("Microsoft.Network/customIpPrefixes"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg3/providers/Microsoft.Network/customIpPrefixes/test-customipprefix8"), - // Location: to.Ptr("eastus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.CustomIPPrefixPropertiesFormat{ - // Asn: to.Ptr("11"), - // AuthorizationMessage: to.Ptr("authorizationMessage"), - // ChildCustomIPPrefixes: []*armnetwork.SubResource{ - // }, - // Cidr: to.Ptr("0.0.7.0/22"), - // CommissionedState: to.Ptr(armnetwork.CommissionedStateCommissioning), - // ExpressRouteAdvertise: to.Ptr(false), - // FailedReason: to.Ptr(""), - // NoInternetAdvertise: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPPrefixes: []*armnetwork.SubResource{ - // }, - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // SignedMessage: to.Ptr("signedMessage"), - // }, - // }, - // { - // Name: to.Ptr("test-customipprefix6"), - // Type: to.Ptr("Microsoft.Network/customIpPrefixes"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg3/providers/Microsoft.Network/customIpPrefixes/test-customipprefix8"), - // Location: to.Ptr("eastus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.CustomIPPrefixPropertiesFormat{ - // AuthorizationMessage: to.Ptr("authorizationMessage"), - // ChildCustomIPPrefixes: []*armnetwork.SubResource{ - // }, - // Cidr: to.Ptr("0.0.7.0/22"), - // CommissionedState: to.Ptr(armnetwork.CommissionedStateCommissioning), - // ExpressRouteAdvertise: to.Ptr(false), - // FailedReason: to.Ptr(""), - // Geo: to.Ptr(armnetwork.GeoGLOBAL), - // NoInternetAdvertise: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPPrefixes: []*armnetwork.SubResource{ - // }, - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // SignedMessage: to.Ptr("signedMessage"), - // }, - // }, - // { - // Name: to.Ptr("test-customipprefix6"), - // Type: to.Ptr("Microsoft.Network/customIpPrefixes"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg3/providers/Microsoft.Network/customIpPrefixes/test-customipprefix8"), - // Location: to.Ptr("eastus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.CustomIPPrefixPropertiesFormat{ - // AuthorizationMessage: to.Ptr("authorizationMessage"), - // ChildCustomIPPrefixes: []*armnetwork.SubResource{ - // }, - // Cidr: to.Ptr("0.0.7.0/22"), - // CommissionedState: to.Ptr(armnetwork.CommissionedStateCommissioning), - // ExpressRouteAdvertise: to.Ptr(true), - // FailedReason: to.Ptr(""), - // NoInternetAdvertise: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPPrefixes: []*armnetwork.SubResource{ - // }, - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // SignedMessage: to.Ptr("signedMessage"), - // }, - // }, - // { - // Name: to.Ptr("test-customipprefix6"), - // Type: to.Ptr("Microsoft.Network/customIpPrefixes"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg3/providers/Microsoft.Network/customIpPrefixes/test-customipprefix8"), - // Location: to.Ptr("eastus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.CustomIPPrefixPropertiesFormat{ - // AuthorizationMessage: to.Ptr("authorizationMessage"), - // ChildCustomIPPrefixes: []*armnetwork.SubResource{ - // }, - // Cidr: to.Ptr("0.0.7.0/22"), - // CommissionedState: to.Ptr(armnetwork.CommissionedStateCommissioning), - // ExpressRouteAdvertise: to.Ptr(true), - // FailedReason: to.Ptr(""), - // NoInternetAdvertise: to.Ptr(false), - // PrefixType: to.Ptr(armnetwork.CustomIPPrefixTypeParent), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPPrefixes: []*armnetwork.SubResource{ - // }, - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // SignedMessage: to.Ptr("signedMessage"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/CustomIpPrefixList.json -func ExampleCustomIPPrefixesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCustomIPPrefixesClient().NewListPager("rg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CustomIPPrefixListResult = armnetwork.CustomIPPrefixListResult{ - // Value: []*armnetwork.CustomIPPrefix{ - // { - // Name: to.Ptr("test-customipprefix"), - // Type: to.Ptr("Microsoft.Network/customIpPrefixes"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/customIpPrefixes/test-customipprefix"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.CustomIPPrefixPropertiesFormat{ - // AuthorizationMessage: to.Ptr("authorizationMessage"), - // ChildCustomIPPrefixes: []*armnetwork.SubResource{ - // }, - // Cidr: to.Ptr("0.0.0.0/24"), - // CommissionedState: to.Ptr(armnetwork.CommissionedStateCommissioned), - // ExpressRouteAdvertise: to.Ptr(false), - // FailedReason: to.Ptr(""), - // NoInternetAdvertise: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPPrefixes: []*armnetwork.SubResource{ - // }, - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // SignedMessage: to.Ptr("signedMessage"), - // }, - // }, - // { - // Name: to.Ptr("test-customipprefix2"), - // Type: to.Ptr("Microsoft.Network/customIpPrefixes"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/customIpPrefixes/test-customipprefix2"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.CustomIPPrefixPropertiesFormat{ - // AuthorizationMessage: to.Ptr("authorizationMessage"), - // ChildCustomIPPrefixes: []*armnetwork.SubResource{ - // }, - // Cidr: to.Ptr("0.0.1.0/30"), - // CommissionedState: to.Ptr(armnetwork.CommissionedStateCommissioned), - // ExpressRouteAdvertise: to.Ptr(false), - // FailedReason: to.Ptr(""), - // NoInternetAdvertise: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPPrefixes: []*armnetwork.SubResource{ - // }, - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // SignedMessage: to.Ptr("signedMessage"), - // }, - // }, - // { - // Name: to.Ptr("test-customipprefix4"), - // Type: to.Ptr("Microsoft.Network/customIpPrefixes"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg3/providers/Microsoft.Network/customIpPrefixes/test-customipprefix4"), - // Location: to.Ptr("eastus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.CustomIPPrefixPropertiesFormat{ - // AuthorizationMessage: to.Ptr("authorizationMessage"), - // ChildCustomIPPrefixes: []*armnetwork.SubResource{ - // }, - // Cidr: to.Ptr("2607:f0d1:1002:0001::/64"), - // CommissionedState: to.Ptr(armnetwork.CommissionedStateCommissioned), - // CustomIPPrefixParent: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg3/providers/Microsoft.Network/customIpPrefixes/test-customipprefix5"), - // }, - // ExpressRouteAdvertise: to.Ptr(false), - // FailedReason: to.Ptr(""), - // NoInternetAdvertise: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPPrefixes: []*armnetwork.SubResource{ - // }, - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // SignedMessage: to.Ptr("signedMessage"), - // }, - // }, - // { - // Name: to.Ptr("test-customipprefix5"), - // Type: to.Ptr("Microsoft.Network/customIpPrefixes"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg3/providers/Microsoft.Network/customIpPrefixes/test-customipprefix5"), - // Location: to.Ptr("eastus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.CustomIPPrefixPropertiesFormat{ - // AuthorizationMessage: to.Ptr("authorizationMessage"), - // ChildCustomIPPrefixes: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg3/providers/Microsoft.Network/customIpPrefixes/test-customipprefix4"), - // }}, - // Cidr: to.Ptr("2607:f0d1:1002::/48"), - // CommissionedState: to.Ptr(armnetwork.CommissionedStateProvisioned), - // ExpressRouteAdvertise: to.Ptr(false), - // FailedReason: to.Ptr(""), - // NoInternetAdvertise: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPPrefixes: []*armnetwork.SubResource{ - // }, - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // SignedMessage: to.Ptr("signedMessage"), - // }, - // }, - // { - // Name: to.Ptr("test-customipprefix6"), - // Type: to.Ptr("Microsoft.Network/customIpPrefixes"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg3/providers/Microsoft.Network/customIpPrefixes/test-customipprefix8"), - // Location: to.Ptr("eastus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.CustomIPPrefixPropertiesFormat{ - // AuthorizationMessage: to.Ptr("authorizationMessage"), - // ChildCustomIPPrefixes: []*armnetwork.SubResource{ - // }, - // Cidr: to.Ptr("0.0.7.0/22"), - // CommissionedState: to.Ptr(armnetwork.CommissionedStateCommissioning), - // ExpressRouteAdvertise: to.Ptr(false), - // FailedReason: to.Ptr(""), - // NoInternetAdvertise: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPPrefixes: []*armnetwork.SubResource{ - // }, - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // SignedMessage: to.Ptr("signedMessage"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/ddoscustompolicies_client.go b/sdk/resourcemanager/network/armnetwork/ddoscustompolicies_client.go index a2b9b5fb367f..74997485d5d8 100644 --- a/sdk/resourcemanager/network/armnetwork/ddoscustompolicies_client.go +++ b/sdk/resourcemanager/network/armnetwork/ddoscustompolicies_client.go @@ -47,7 +47,7 @@ func NewDdosCustomPoliciesClient(subscriptionID string, credential azcore.TokenC // BeginCreateOrUpdate - Creates or updates a DDoS custom policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - ddosCustomPolicyName - The name of the DDoS custom policy. // - parameters - Parameters supplied to the create or update operation. @@ -71,7 +71,7 @@ func (client *DdosCustomPoliciesClient) BeginCreateOrUpdate(ctx context.Context, // CreateOrUpdate - Creates or updates a DDoS custom policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *DdosCustomPoliciesClient) createOrUpdate(ctx context.Context, resourceGroupName string, ddosCustomPolicyName string, parameters DdosCustomPolicy, options *DdosCustomPoliciesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "DdosCustomPoliciesClient.BeginCreateOrUpdate" @@ -113,7 +113,7 @@ func (client *DdosCustomPoliciesClient) createOrUpdateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -125,7 +125,7 @@ func (client *DdosCustomPoliciesClient) createOrUpdateCreateRequest(ctx context. // BeginDelete - Deletes the specified DDoS custom policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - ddosCustomPolicyName - The name of the DDoS custom policy. // - options - DdosCustomPoliciesClientBeginDeleteOptions contains the optional parameters for the DdosCustomPoliciesClient.BeginDelete @@ -148,7 +148,7 @@ func (client *DdosCustomPoliciesClient) BeginDelete(ctx context.Context, resourc // Delete - Deletes the specified DDoS custom policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *DdosCustomPoliciesClient) deleteOperation(ctx context.Context, resourceGroupName string, ddosCustomPolicyName string, options *DdosCustomPoliciesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "DdosCustomPoliciesClient.BeginDelete" @@ -190,7 +190,7 @@ func (client *DdosCustomPoliciesClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -199,7 +199,7 @@ func (client *DdosCustomPoliciesClient) deleteCreateRequest(ctx context.Context, // Get - Gets information about the specified DDoS custom policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - ddosCustomPolicyName - The name of the DDoS custom policy. // - options - DdosCustomPoliciesClientGetOptions contains the optional parameters for the DdosCustomPoliciesClient.Get method. @@ -245,7 +245,7 @@ func (client *DdosCustomPoliciesClient) getCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -263,7 +263,7 @@ func (client *DdosCustomPoliciesClient) getHandleResponse(resp *http.Response) ( // UpdateTags - Update a DDoS custom policy tags. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - ddosCustomPolicyName - The name of the DDoS custom policy. // - parameters - Parameters supplied to update DDoS custom policy resource tags. @@ -311,7 +311,7 @@ func (client *DdosCustomPoliciesClient) updateTagsCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/ddoscustompolicies_client_example_test.go b/sdk/resourcemanager/network/armnetwork/ddoscustompolicies_client_example_test.go deleted file mode 100644 index 461caa7fcd36..000000000000 --- a/sdk/resourcemanager/network/armnetwork/ddoscustompolicies_client_example_test.go +++ /dev/null @@ -1,145 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/DdosCustomPolicyDelete.json -func ExampleDdosCustomPoliciesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDdosCustomPoliciesClient().BeginDelete(ctx, "rg1", "test-ddos-custom-policy", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/DdosCustomPolicyGet.json -func ExampleDdosCustomPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDdosCustomPoliciesClient().Get(ctx, "rg1", "test-ddos-custom-policy", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DdosCustomPolicy = armnetwork.DdosCustomPolicy{ - // Name: to.Ptr("test-ddos-custom-policy"), - // Type: to.Ptr("Microsoft.Network/ddosCustomPolicies"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/ddosCustomPolicies/test-ddos-custom-policy"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.DdosCustomPolicyPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/DdosCustomPolicyCreate.json -func ExampleDdosCustomPoliciesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDdosCustomPoliciesClient().BeginCreateOrUpdate(ctx, "rg1", "test-ddos-custom-policy", armnetwork.DdosCustomPolicy{ - Location: to.Ptr("centraluseuap"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DdosCustomPolicy = armnetwork.DdosCustomPolicy{ - // Name: to.Ptr("test-ddos-custom-policy"), - // Type: to.Ptr("Microsoft.Network/ddosCustomPolicies"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/ddosCustomPolicies/test-ddos-custom-policy"), - // Location: to.Ptr("centraluseuap"), - // Properties: &armnetwork.DdosCustomPolicyPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/DdosCustomPolicyUpdateTags.json -func ExampleDdosCustomPoliciesClient_UpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDdosCustomPoliciesClient().UpdateTags(ctx, "rg1", "test-ddos-custom-policy", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DdosCustomPolicy = armnetwork.DdosCustomPolicy{ - // Name: to.Ptr("test-ddos-custom-policy"), - // Type: to.Ptr("Microsoft.Network/ddosCustomPolicies"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/ddosCustomPolicies/test-ddos-custom-policy"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armnetwork.DdosCustomPolicyPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/ddosprotectionplans_client.go b/sdk/resourcemanager/network/armnetwork/ddosprotectionplans_client.go index d11362c06a4f..b50fe38a9b10 100644 --- a/sdk/resourcemanager/network/armnetwork/ddosprotectionplans_client.go +++ b/sdk/resourcemanager/network/armnetwork/ddosprotectionplans_client.go @@ -47,7 +47,7 @@ func NewDdosProtectionPlansClient(subscriptionID string, credential azcore.Token // BeginCreateOrUpdate - Creates or updates a DDoS protection plan. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - ddosProtectionPlanName - The name of the DDoS protection plan. // - parameters - Parameters supplied to the create or update operation. @@ -71,7 +71,7 @@ func (client *DdosProtectionPlansClient) BeginCreateOrUpdate(ctx context.Context // CreateOrUpdate - Creates or updates a DDoS protection plan. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *DdosProtectionPlansClient) createOrUpdate(ctx context.Context, resourceGroupName string, ddosProtectionPlanName string, parameters DdosProtectionPlan, options *DdosProtectionPlansClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "DdosProtectionPlansClient.BeginCreateOrUpdate" @@ -113,7 +113,7 @@ func (client *DdosProtectionPlansClient) createOrUpdateCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -125,7 +125,7 @@ func (client *DdosProtectionPlansClient) createOrUpdateCreateRequest(ctx context // BeginDelete - Deletes the specified DDoS protection plan. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - ddosProtectionPlanName - The name of the DDoS protection plan. // - options - DdosProtectionPlansClientBeginDeleteOptions contains the optional parameters for the DdosProtectionPlansClient.BeginDelete @@ -148,7 +148,7 @@ func (client *DdosProtectionPlansClient) BeginDelete(ctx context.Context, resour // Delete - Deletes the specified DDoS protection plan. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *DdosProtectionPlansClient) deleteOperation(ctx context.Context, resourceGroupName string, ddosProtectionPlanName string, options *DdosProtectionPlansClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "DdosProtectionPlansClient.BeginDelete" @@ -190,7 +190,7 @@ func (client *DdosProtectionPlansClient) deleteCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -199,7 +199,7 @@ func (client *DdosProtectionPlansClient) deleteCreateRequest(ctx context.Context // Get - Gets information about the specified DDoS protection plan. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - ddosProtectionPlanName - The name of the DDoS protection plan. // - options - DdosProtectionPlansClientGetOptions contains the optional parameters for the DdosProtectionPlansClient.Get method. @@ -245,7 +245,7 @@ func (client *DdosProtectionPlansClient) getCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -262,7 +262,7 @@ func (client *DdosProtectionPlansClient) getHandleResponse(resp *http.Response) // NewListPager - Gets all DDoS protection plans in a subscription. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - options - DdosProtectionPlansClientListOptions contains the optional parameters for the DdosProtectionPlansClient.NewListPager // method. func (client *DdosProtectionPlansClient) NewListPager(options *DdosProtectionPlansClientListOptions) *runtime.Pager[DdosProtectionPlansClientListResponse] { @@ -307,7 +307,7 @@ func (client *DdosProtectionPlansClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -324,7 +324,7 @@ func (client *DdosProtectionPlansClient) listHandleResponse(resp *http.Response) // NewListByResourceGroupPager - Gets all the DDoS protection plans in a resource group. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - options - DdosProtectionPlansClientListByResourceGroupOptions contains the optional parameters for the DdosProtectionPlansClient.NewListByResourceGroupPager // method. @@ -374,7 +374,7 @@ func (client *DdosProtectionPlansClient) listByResourceGroupCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -392,7 +392,7 @@ func (client *DdosProtectionPlansClient) listByResourceGroupHandleResponse(resp // UpdateTags - Update a DDoS protection plan tags. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - ddosProtectionPlanName - The name of the DDoS protection plan. // - parameters - Parameters supplied to the update DDoS protection plan resource tags. @@ -440,7 +440,7 @@ func (client *DdosProtectionPlansClient) updateTagsCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/ddosprotectionplans_client_example_test.go b/sdk/resourcemanager/network/armnetwork/ddosprotectionplans_client_example_test.go deleted file mode 100644 index 5f4ca338907f..000000000000 --- a/sdk/resourcemanager/network/armnetwork/ddosprotectionplans_client_example_test.go +++ /dev/null @@ -1,296 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/DdosProtectionPlanDelete.json -func ExampleDdosProtectionPlansClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDdosProtectionPlansClient().BeginDelete(ctx, "rg1", "test-plan", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/DdosProtectionPlanGet.json -func ExampleDdosProtectionPlansClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDdosProtectionPlansClient().Get(ctx, "rg1", "test-plan", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DdosProtectionPlan = armnetwork.DdosProtectionPlan{ - // Name: to.Ptr("test-plan"), - // Type: to.Ptr("Microsoft.Network/ddosProtectionPlans"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/ddosProtectionPlans/test-plan"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.DdosProtectionPlanPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddresses: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-pip"), - // }}, - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // VirtualNetworks: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/DdosProtectionPlanCreate.json -func ExampleDdosProtectionPlansClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDdosProtectionPlansClient().BeginCreateOrUpdate(ctx, "rg1", "test-plan", armnetwork.DdosProtectionPlan{ - Location: to.Ptr("westus"), - Properties: &armnetwork.DdosProtectionPlanPropertiesFormat{}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DdosProtectionPlan = armnetwork.DdosProtectionPlan{ - // Name: to.Ptr("test-plan"), - // Type: to.Ptr("Microsoft.Network/ddosProtectionPlans"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/ddosProtectionPlans/test-plan"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.DdosProtectionPlanPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddresses: []*armnetwork.SubResource{ - // }, - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // VirtualNetworks: []*armnetwork.SubResource{ - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/DdosProtectionPlanUpdateTags.json -func ExampleDdosProtectionPlansClient_UpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDdosProtectionPlansClient().UpdateTags(ctx, "rg1", "test-plan", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DdosProtectionPlan = armnetwork.DdosProtectionPlan{ - // Name: to.Ptr("test-plan"), - // Type: to.Ptr("Microsoft.Network/ddosProtectionPlans"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/ddosProtectionPlans/test-plan"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.DdosProtectionPlanPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddresses: []*armnetwork.SubResource{ - // }, - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // VirtualNetworks: []*armnetwork.SubResource{ - // }, - // }, - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/DdosProtectionPlanListAll.json -func ExampleDdosProtectionPlansClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDdosProtectionPlansClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DdosProtectionPlanListResult = armnetwork.DdosProtectionPlanListResult{ - // Value: []*armnetwork.DdosProtectionPlan{ - // { - // Name: to.Ptr("plan1"), - // Type: to.Ptr("Microsoft.Network/ddosProtectionPlans"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/ddosProtectionPlans/plan1"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.DdosProtectionPlanPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddresses: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-pip"), - // }}, - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // VirtualNetworks: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet1"), - // }}, - // }, - // }, - // { - // Name: to.Ptr("plan2"), - // Type: to.Ptr("Microsoft.Network/ddosProtectionPlans"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/ddosProtectionPlans/plan2"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.DdosProtectionPlanPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddresses: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-pip2"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-pip3"), - // }}, - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // VirtualNetworks: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet2"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet3"), - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/DdosProtectionPlanList.json -func ExampleDdosProtectionPlansClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDdosProtectionPlansClient().NewListByResourceGroupPager("rg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DdosProtectionPlanListResult = armnetwork.DdosProtectionPlanListResult{ - // Value: []*armnetwork.DdosProtectionPlan{ - // { - // Name: to.Ptr("plan1"), - // Type: to.Ptr("Microsoft.Network/ddosProtectionPlans"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/ddosProtectionPlans/plan1"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.DdosProtectionPlanPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddresses: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-pip"), - // }}, - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // VirtualNetworks: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet"), - // }}, - // }, - // }, - // { - // Name: to.Ptr("plan2"), - // Type: to.Ptr("Microsoft.Network/ddosProtectionPlans"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/ddosProtectionPlans/plan2"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.DdosProtectionPlanPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddresses: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-pip"), - // }}, - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // VirtualNetworks: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet"), - // }}, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/defaultsecurityrules_client.go b/sdk/resourcemanager/network/armnetwork/defaultsecurityrules_client.go index 8a23047c4a4c..d4d3eee41c0a 100644 --- a/sdk/resourcemanager/network/armnetwork/defaultsecurityrules_client.go +++ b/sdk/resourcemanager/network/armnetwork/defaultsecurityrules_client.go @@ -47,7 +47,7 @@ func NewDefaultSecurityRulesClient(subscriptionID string, credential azcore.Toke // Get - Get the specified default network security rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkSecurityGroupName - The name of the network security group. // - defaultSecurityRuleName - The name of the default security rule. @@ -99,7 +99,7 @@ func (client *DefaultSecurityRulesClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -116,7 +116,7 @@ func (client *DefaultSecurityRulesClient) getHandleResponse(resp *http.Response) // NewListPager - Gets all default security rules in a network security group. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkSecurityGroupName - The name of the network security group. // - options - DefaultSecurityRulesClientListOptions contains the optional parameters for the DefaultSecurityRulesClient.NewListPager @@ -171,7 +171,7 @@ func (client *DefaultSecurityRulesClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/defaultsecurityrules_client_example_test.go b/sdk/resourcemanager/network/armnetwork/defaultsecurityrules_client_example_test.go deleted file mode 100644 index 31cc7a110d0a..000000000000 --- a/sdk/resourcemanager/network/armnetwork/defaultsecurityrules_client_example_test.go +++ /dev/null @@ -1,234 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/DefaultSecurityRuleList.json -func ExampleDefaultSecurityRulesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDefaultSecurityRulesClient().NewListPager("testrg", "nsg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SecurityRuleListResult = armnetwork.SecurityRuleListResult{ - // Value: []*armnetwork.SecurityRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/AllowVnetInBound"), - // Name: to.Ptr("AllowVnetInBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow inbound traffic from all VMs in VNET"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("VirtualNetwork"), - // DestinationAddressPrefixes: []*string{ - // }, - // DestinationPortRange: to.Ptr("*"), - // DestinationPortRanges: []*string{ - // }, - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](65000), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("VirtualNetwork"), - // SourceAddressPrefixes: []*string{ - // }, - // SourcePortRange: to.Ptr("*"), - // SourcePortRanges: []*string{ - // }, - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/AllowAzureLoadBalancerInBound"), - // Name: to.Ptr("AllowAzureLoadBalancerInBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow inbound traffic from azure load balancer"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationAddressPrefixes: []*string{ - // }, - // DestinationPortRange: to.Ptr("*"), - // DestinationPortRanges: []*string{ - // }, - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](65001), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("AzureLoadBalancer"), - // SourceAddressPrefixes: []*string{ - // }, - // SourcePortRange: to.Ptr("*"), - // SourcePortRanges: []*string{ - // }, - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/DenyAllInBound"), - // Name: to.Ptr("DenyAllInBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Deny all inbound traffic"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessDeny), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationAddressPrefixes: []*string{ - // }, - // DestinationPortRange: to.Ptr("*"), - // DestinationPortRanges: []*string{ - // }, - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](65500), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("*"), - // SourceAddressPrefixes: []*string{ - // }, - // SourcePortRange: to.Ptr("*"), - // SourcePortRanges: []*string{ - // }, - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/AllowVnetOutBound"), - // Name: to.Ptr("AllowVnetOutBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow outbound traffic from all VMs to all VMs in VNET"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("VirtualNetwork"), - // DestinationAddressPrefixes: []*string{ - // }, - // DestinationPortRange: to.Ptr("*"), - // DestinationPortRanges: []*string{ - // }, - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), - // Priority: to.Ptr[int32](65000), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("VirtualNetwork"), - // SourceAddressPrefixes: []*string{ - // }, - // SourcePortRange: to.Ptr("*"), - // SourcePortRanges: []*string{ - // }, - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/AllowInternetOutBound"), - // Name: to.Ptr("AllowInternetOutBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow outbound traffic from all VMs to Internet"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("Internet"), - // DestinationAddressPrefixes: []*string{ - // }, - // DestinationPortRange: to.Ptr("*"), - // DestinationPortRanges: []*string{ - // }, - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), - // Priority: to.Ptr[int32](65001), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("*"), - // SourceAddressPrefixes: []*string{ - // }, - // SourcePortRange: to.Ptr("*"), - // SourcePortRanges: []*string{ - // }, - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/DenyAllOutBound"), - // Name: to.Ptr("DenyAllOutBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Deny all outbound traffic"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessDeny), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationAddressPrefixes: []*string{ - // }, - // DestinationPortRange: to.Ptr("*"), - // DestinationPortRanges: []*string{ - // }, - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), - // Priority: to.Ptr[int32](65500), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("*"), - // SourceAddressPrefixes: []*string{ - // }, - // SourcePortRange: to.Ptr("*"), - // SourcePortRanges: []*string{ - // }, - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/DefaultSecurityRuleGet.json -func ExampleDefaultSecurityRulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDefaultSecurityRulesClient().Get(ctx, "testrg", "nsg1", "AllowVnetInBound", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SecurityRule = armnetwork.SecurityRule{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/AllowVnetInBound"), - // Name: to.Ptr("AllowVnetInBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow inbound traffic from all VMs in VNET"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("VirtualNetwork"), - // DestinationAddressPrefixes: []*string{ - // }, - // DestinationPortRange: to.Ptr("*"), - // DestinationPortRanges: []*string{ - // }, - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](65000), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("VirtualNetwork"), - // SourceAddressPrefixes: []*string{ - // }, - // SourcePortRange: to.Ptr("*"), - // SourcePortRanges: []*string{ - // }, - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/dscpconfiguration_client.go b/sdk/resourcemanager/network/armnetwork/dscpconfiguration_client.go index 052b8e9534b1..d4b9708df30c 100644 --- a/sdk/resourcemanager/network/armnetwork/dscpconfiguration_client.go +++ b/sdk/resourcemanager/network/armnetwork/dscpconfiguration_client.go @@ -47,7 +47,7 @@ func NewDscpConfigurationClient(subscriptionID string, credential azcore.TokenCr // BeginCreateOrUpdate - Creates or updates a DSCP Configuration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - dscpConfigurationName - The name of the resource. // - parameters - Parameters supplied to the create or update dscp configuration operation. @@ -71,7 +71,7 @@ func (client *DscpConfigurationClient) BeginCreateOrUpdate(ctx context.Context, // CreateOrUpdate - Creates or updates a DSCP Configuration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *DscpConfigurationClient) createOrUpdate(ctx context.Context, resourceGroupName string, dscpConfigurationName string, parameters DscpConfiguration, options *DscpConfigurationClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "DscpConfigurationClient.BeginCreateOrUpdate" @@ -113,7 +113,7 @@ func (client *DscpConfigurationClient) createOrUpdateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -125,7 +125,7 @@ func (client *DscpConfigurationClient) createOrUpdateCreateRequest(ctx context.C // BeginDelete - Deletes a DSCP Configuration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - dscpConfigurationName - The name of the resource. // - options - DscpConfigurationClientBeginDeleteOptions contains the optional parameters for the DscpConfigurationClient.BeginDelete @@ -148,7 +148,7 @@ func (client *DscpConfigurationClient) BeginDelete(ctx context.Context, resource // Delete - Deletes a DSCP Configuration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *DscpConfigurationClient) deleteOperation(ctx context.Context, resourceGroupName string, dscpConfigurationName string, options *DscpConfigurationClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "DscpConfigurationClient.BeginDelete" @@ -190,7 +190,7 @@ func (client *DscpConfigurationClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -199,7 +199,7 @@ func (client *DscpConfigurationClient) deleteCreateRequest(ctx context.Context, // Get - Gets a DSCP Configuration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - dscpConfigurationName - The name of the resource. // - options - DscpConfigurationClientGetOptions contains the optional parameters for the DscpConfigurationClient.Get method. @@ -245,7 +245,7 @@ func (client *DscpConfigurationClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -262,7 +262,7 @@ func (client *DscpConfigurationClient) getHandleResponse(resp *http.Response) (D // NewListPager - Gets a DSCP Configuration. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - options - DscpConfigurationClientListOptions contains the optional parameters for the DscpConfigurationClient.NewListPager // method. @@ -312,7 +312,7 @@ func (client *DscpConfigurationClient) listCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -329,7 +329,7 @@ func (client *DscpConfigurationClient) listHandleResponse(resp *http.Response) ( // NewListAllPager - Gets all dscp configurations in a subscription. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - options - DscpConfigurationClientListAllOptions contains the optional parameters for the DscpConfigurationClient.NewListAllPager // method. func (client *DscpConfigurationClient) NewListAllPager(options *DscpConfigurationClientListAllOptions) *runtime.Pager[DscpConfigurationClientListAllResponse] { @@ -374,7 +374,7 @@ func (client *DscpConfigurationClient) listAllCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/dscpconfiguration_client_example_test.go b/sdk/resourcemanager/network/armnetwork/dscpconfiguration_client_example_test.go deleted file mode 100644 index 3e09f2bb6582..000000000000 --- a/sdk/resourcemanager/network/armnetwork/dscpconfiguration_client_example_test.go +++ /dev/null @@ -1,592 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/DscpConfigurationCreate.json -func ExampleDscpConfigurationClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDscpConfigurationClient().BeginCreateOrUpdate(ctx, "rg1", "mydscpconfig", armnetwork.DscpConfiguration{ - Location: to.Ptr("eastus"), - Properties: &armnetwork.DscpConfigurationPropertiesFormat{ - QosDefinitionCollection: []*armnetwork.QosDefinition{ - { - DestinationIPRanges: []*armnetwork.QosIPRange{ - { - EndIP: to.Ptr("127.0.10.2"), - StartIP: to.Ptr("127.0.10.1"), - }}, - DestinationPortRanges: []*armnetwork.QosPortRange{ - { - End: to.Ptr[int32](15), - Start: to.Ptr[int32](15), - }}, - Markings: []*int32{ - to.Ptr[int32](1)}, - SourceIPRanges: []*armnetwork.QosIPRange{ - { - EndIP: to.Ptr("127.0.0.2"), - StartIP: to.Ptr("127.0.0.1"), - }}, - SourcePortRanges: []*armnetwork.QosPortRange{ - { - End: to.Ptr[int32](11), - Start: to.Ptr[int32](10), - }, - { - End: to.Ptr[int32](21), - Start: to.Ptr[int32](20), - }}, - Protocol: to.Ptr(armnetwork.ProtocolTypeTCP), - }, - { - DestinationIPRanges: []*armnetwork.QosIPRange{ - { - EndIP: to.Ptr("12.0.10.2"), - StartIP: to.Ptr("12.0.10.1"), - }}, - DestinationPortRanges: []*armnetwork.QosPortRange{ - { - End: to.Ptr[int32](52), - Start: to.Ptr[int32](51), - }}, - Markings: []*int32{ - to.Ptr[int32](2)}, - SourceIPRanges: []*armnetwork.QosIPRange{ - { - EndIP: to.Ptr("12.0.0.2"), - StartIP: to.Ptr("12.0.0.1"), - }}, - SourcePortRanges: []*armnetwork.QosPortRange{ - { - End: to.Ptr[int32](12), - Start: to.Ptr[int32](11), - }}, - Protocol: to.Ptr(armnetwork.ProtocolTypeUDP), - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DscpConfiguration = armnetwork.DscpConfiguration{ - // Name: to.Ptr("mydscpConfig"), - // Type: to.Ptr("Microsoft.Network/dscpConfiguration"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dscpConfiguration/mydscpConfig"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.DscpConfigurationPropertiesFormat{ - // AssociatedNetworkInterfaces: []*armnetwork.Interface{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // QosCollectionID: to.Ptr("0f8fad5b-d9cb-469f-a165-70867728950e"), - // QosDefinitionCollection: []*armnetwork.QosDefinition{ - // { - // DestinationIPRanges: []*armnetwork.QosIPRange{ - // { - // EndIP: to.Ptr("127.0.10.2"), - // StartIP: to.Ptr("127.0.10.1"), - // }}, - // DestinationPortRanges: []*armnetwork.QosPortRange{ - // { - // End: to.Ptr[int32](62), - // Start: to.Ptr[int32](61), - // }}, - // Markings: []*int32{ - // to.Ptr[int32](1)}, - // SourceIPRanges: []*armnetwork.QosIPRange{ - // { - // EndIP: to.Ptr("127.0.0.2"), - // StartIP: to.Ptr("127.0.0.1"), - // }}, - // SourcePortRanges: []*armnetwork.QosPortRange{ - // { - // End: to.Ptr[int32](12), - // Start: to.Ptr[int32](11), - // }}, - // Protocol: to.Ptr(armnetwork.ProtocolTypeTCP), - // }, - // { - // DestinationIPRanges: []*armnetwork.QosIPRange{ - // { - // EndIP: to.Ptr("12.0.10.2"), - // StartIP: to.Ptr("12.0.10.1"), - // }}, - // DestinationPortRanges: []*armnetwork.QosPortRange{ - // { - // End: to.Ptr[int32](52), - // Start: to.Ptr[int32](51), - // }}, - // Markings: []*int32{ - // to.Ptr[int32](2)}, - // SourceIPRanges: []*armnetwork.QosIPRange{ - // { - // EndIP: to.Ptr("12.0.0.2"), - // StartIP: to.Ptr("12.0.0.1"), - // }}, - // SourcePortRanges: []*armnetwork.QosPortRange{ - // { - // End: to.Ptr[int32](12), - // Start: to.Ptr[int32](11), - // }}, - // Protocol: to.Ptr(armnetwork.ProtocolTypeUDP), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/DscpConfigurationDelete.json -func ExampleDscpConfigurationClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDscpConfigurationClient().BeginDelete(ctx, "rg1", "mydscpConfig", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/DscpConfigurationGet.json -func ExampleDscpConfigurationClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDscpConfigurationClient().Get(ctx, "rg1", "mydscpConfig", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DscpConfiguration = armnetwork.DscpConfiguration{ - // Name: to.Ptr("mydscpConfig"), - // Type: to.Ptr("Microsoft.Network/dscpConfiguration"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dscpConfiguration/mydscpConfig"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.DscpConfigurationPropertiesFormat{ - // AssociatedNetworkInterfaces: []*armnetwork.Interface{ - // { - // }, - // { - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // QosCollectionID: to.Ptr("0f8fad5b-d9cb-469f-a165-70867728950e"), - // QosDefinitionCollection: []*armnetwork.QosDefinition{ - // { - // DestinationIPRanges: []*armnetwork.QosIPRange{ - // { - // EndIP: to.Ptr("127.0.10.2"), - // StartIP: to.Ptr("127.0.10.1"), - // }}, - // DestinationPortRanges: []*armnetwork.QosPortRange{ - // { - // End: to.Ptr[int32](62), - // Start: to.Ptr[int32](61), - // }}, - // Markings: []*int32{ - // to.Ptr[int32](1)}, - // SourceIPRanges: []*armnetwork.QosIPRange{ - // { - // EndIP: to.Ptr("127.0.0.2"), - // StartIP: to.Ptr("127.0.0.1"), - // }}, - // SourcePortRanges: []*armnetwork.QosPortRange{ - // { - // End: to.Ptr[int32](12), - // Start: to.Ptr[int32](11), - // }}, - // Protocol: to.Ptr(armnetwork.ProtocolTypeTCP), - // }, - // { - // DestinationIPRanges: []*armnetwork.QosIPRange{ - // { - // EndIP: to.Ptr("12.0.10.2"), - // StartIP: to.Ptr("12.0.10.1"), - // }}, - // DestinationPortRanges: []*armnetwork.QosPortRange{ - // { - // End: to.Ptr[int32](52), - // Start: to.Ptr[int32](51), - // }}, - // Markings: []*int32{ - // to.Ptr[int32](2)}, - // SourceIPRanges: []*armnetwork.QosIPRange{ - // { - // EndIP: to.Ptr("12.0.0.2"), - // StartIP: to.Ptr("12.0.0.1"), - // }}, - // SourcePortRanges: []*armnetwork.QosPortRange{ - // { - // End: to.Ptr[int32](12), - // Start: to.Ptr[int32](11), - // }}, - // Protocol: to.Ptr(armnetwork.ProtocolTypeUDP), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/DscpConfigurationList.json -func ExampleDscpConfigurationClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDscpConfigurationClient().NewListPager("rg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DscpConfigurationListResult = armnetwork.DscpConfigurationListResult{ - // Value: []*armnetwork.DscpConfiguration{ - // { - // Name: to.Ptr("mydscpConfig"), - // Type: to.Ptr("Microsoft.Network/dscpConfiguration"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dscpConfiguration/mydscpConfig"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.DscpConfigurationPropertiesFormat{ - // AssociatedNetworkInterfaces: []*armnetwork.Interface{ - // { - // }, - // { - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // QosCollectionID: to.Ptr("0f8fad5b-d9cb-469f-a165-70867728950e"), - // QosDefinitionCollection: []*armnetwork.QosDefinition{ - // { - // DestinationIPRanges: []*armnetwork.QosIPRange{ - // { - // EndIP: to.Ptr("127.0.10.2"), - // StartIP: to.Ptr("127.0.10.1"), - // }}, - // DestinationPortRanges: []*armnetwork.QosPortRange{ - // { - // End: to.Ptr[int32](62), - // Start: to.Ptr[int32](61), - // }}, - // Markings: []*int32{ - // to.Ptr[int32](1)}, - // SourceIPRanges: []*armnetwork.QosIPRange{ - // { - // EndIP: to.Ptr("127.0.0.2"), - // StartIP: to.Ptr("127.0.0.1"), - // }}, - // SourcePortRanges: []*armnetwork.QosPortRange{ - // { - // End: to.Ptr[int32](12), - // Start: to.Ptr[int32](11), - // }}, - // Protocol: to.Ptr(armnetwork.ProtocolTypeTCP), - // }, - // { - // DestinationIPRanges: []*armnetwork.QosIPRange{ - // { - // EndIP: to.Ptr("12.0.10.2"), - // StartIP: to.Ptr("12.0.10.1"), - // }}, - // DestinationPortRanges: []*armnetwork.QosPortRange{ - // { - // End: to.Ptr[int32](52), - // Start: to.Ptr[int32](51), - // }}, - // Markings: []*int32{ - // to.Ptr[int32](2)}, - // SourceIPRanges: []*armnetwork.QosIPRange{ - // { - // EndIP: to.Ptr("12.0.0.2"), - // StartIP: to.Ptr("12.0.0.1"), - // }}, - // SourcePortRanges: []*armnetwork.QosPortRange{ - // { - // End: to.Ptr[int32](12), - // Start: to.Ptr[int32](11), - // }}, - // Protocol: to.Ptr(armnetwork.ProtocolTypeUDP), - // }}, - // }, - // }, - // { - // Name: to.Ptr("mydscpConfig2"), - // Type: to.Ptr("Microsoft.Network/dscpConfiguration"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dscpConfiguration/mydscpConfig2"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.DscpConfigurationPropertiesFormat{ - // AssociatedNetworkInterfaces: []*armnetwork.Interface{ - // { - // }, - // { - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // QosCollectionID: to.Ptr("9as24mf6-d9cb-7a7f-a165-70867728950e"), - // QosDefinitionCollection: []*armnetwork.QosDefinition{ - // { - // DestinationIPRanges: []*armnetwork.QosIPRange{ - // { - // EndIP: to.Ptr("127.0.10.2"), - // StartIP: to.Ptr("127.0.10.1"), - // }}, - // DestinationPortRanges: []*armnetwork.QosPortRange{ - // { - // End: to.Ptr[int32](62), - // Start: to.Ptr[int32](61), - // }}, - // Markings: []*int32{ - // to.Ptr[int32](1)}, - // SourceIPRanges: []*armnetwork.QosIPRange{ - // { - // EndIP: to.Ptr("127.0.0.2"), - // StartIP: to.Ptr("127.0.0.1"), - // }}, - // SourcePortRanges: []*armnetwork.QosPortRange{ - // { - // End: to.Ptr[int32](12), - // Start: to.Ptr[int32](11), - // }}, - // Protocol: to.Ptr(armnetwork.ProtocolTypeTCP), - // }, - // { - // DestinationIPRanges: []*armnetwork.QosIPRange{ - // { - // EndIP: to.Ptr("12.0.10.2"), - // StartIP: to.Ptr("12.0.10.1"), - // }}, - // DestinationPortRanges: []*armnetwork.QosPortRange{ - // { - // End: to.Ptr[int32](52), - // Start: to.Ptr[int32](51), - // }}, - // Markings: []*int32{ - // to.Ptr[int32](2)}, - // SourceIPRanges: []*armnetwork.QosIPRange{ - // { - // EndIP: to.Ptr("12.0.0.2"), - // StartIP: to.Ptr("12.0.0.1"), - // }}, - // SourcePortRanges: []*armnetwork.QosPortRange{ - // { - // End: to.Ptr[int32](12), - // Start: to.Ptr[int32](11), - // }}, - // Protocol: to.Ptr(armnetwork.ProtocolTypeUDP), - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/DscpConfigurationListAll.json -func ExampleDscpConfigurationClient_NewListAllPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDscpConfigurationClient().NewListAllPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DscpConfigurationListResult = armnetwork.DscpConfigurationListResult{ - // Value: []*armnetwork.DscpConfiguration{ - // { - // Name: to.Ptr("mydscpConfig"), - // Type: to.Ptr("Microsoft.Network/dscpConfiguration"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dscpConfiguration/mydscpConfig"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.DscpConfigurationPropertiesFormat{ - // AssociatedNetworkInterfaces: []*armnetwork.Interface{ - // { - // }, - // { - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // QosCollectionID: to.Ptr("0f8fad5b-d9cb-469f-a165-70867728950e"), - // QosDefinitionCollection: []*armnetwork.QosDefinition{ - // { - // DestinationIPRanges: []*armnetwork.QosIPRange{ - // { - // EndIP: to.Ptr("127.0.10.2"), - // StartIP: to.Ptr("127.0.10.1"), - // }}, - // DestinationPortRanges: []*armnetwork.QosPortRange{ - // { - // End: to.Ptr[int32](62), - // Start: to.Ptr[int32](61), - // }}, - // Markings: []*int32{ - // to.Ptr[int32](1)}, - // SourceIPRanges: []*armnetwork.QosIPRange{ - // { - // EndIP: to.Ptr("127.0.0.2"), - // StartIP: to.Ptr("127.0.0.1"), - // }}, - // SourcePortRanges: []*armnetwork.QosPortRange{ - // { - // End: to.Ptr[int32](12), - // Start: to.Ptr[int32](11), - // }}, - // Protocol: to.Ptr(armnetwork.ProtocolTypeTCP), - // }, - // { - // DestinationIPRanges: []*armnetwork.QosIPRange{ - // { - // EndIP: to.Ptr("12.0.10.2"), - // StartIP: to.Ptr("12.0.10.1"), - // }}, - // DestinationPortRanges: []*armnetwork.QosPortRange{ - // { - // End: to.Ptr[int32](52), - // Start: to.Ptr[int32](51), - // }}, - // Markings: []*int32{ - // to.Ptr[int32](2)}, - // SourceIPRanges: []*armnetwork.QosIPRange{ - // { - // EndIP: to.Ptr("12.0.0.2"), - // StartIP: to.Ptr("12.0.0.1"), - // }}, - // SourcePortRanges: []*armnetwork.QosPortRange{ - // { - // End: to.Ptr[int32](12), - // Start: to.Ptr[int32](11), - // }}, - // Protocol: to.Ptr(armnetwork.ProtocolTypeUDP), - // }}, - // }, - // }, - // { - // Name: to.Ptr("mydscpConfig2"), - // Type: to.Ptr("Microsoft.Network/dscpConfiguration"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/dscpConfiguration/mydscpConfig2"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.DscpConfigurationPropertiesFormat{ - // AssociatedNetworkInterfaces: []*armnetwork.Interface{ - // { - // }, - // { - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // QosCollectionID: to.Ptr("9as24mf6-d9cb-7a7f-a165-70867728950e"), - // QosDefinitionCollection: []*armnetwork.QosDefinition{ - // { - // DestinationIPRanges: []*armnetwork.QosIPRange{ - // { - // EndIP: to.Ptr("127.0.10.2"), - // StartIP: to.Ptr("127.0.10.1"), - // }}, - // DestinationPortRanges: []*armnetwork.QosPortRange{ - // { - // End: to.Ptr[int32](62), - // Start: to.Ptr[int32](61), - // }}, - // Markings: []*int32{ - // to.Ptr[int32](1)}, - // SourceIPRanges: []*armnetwork.QosIPRange{ - // { - // EndIP: to.Ptr("127.0.0.2"), - // StartIP: to.Ptr("127.0.0.1"), - // }}, - // SourcePortRanges: []*armnetwork.QosPortRange{ - // { - // End: to.Ptr[int32](12), - // Start: to.Ptr[int32](11), - // }}, - // Protocol: to.Ptr(armnetwork.ProtocolTypeTCP), - // }, - // { - // DestinationIPRanges: []*armnetwork.QosIPRange{ - // { - // EndIP: to.Ptr("12.0.10.2"), - // StartIP: to.Ptr("12.0.10.1"), - // }}, - // DestinationPortRanges: []*armnetwork.QosPortRange{ - // { - // End: to.Ptr[int32](52), - // Start: to.Ptr[int32](51), - // }}, - // Markings: []*int32{ - // to.Ptr[int32](2)}, - // SourceIPRanges: []*armnetwork.QosIPRange{ - // { - // EndIP: to.Ptr("12.0.0.2"), - // StartIP: to.Ptr("12.0.0.1"), - // }}, - // SourcePortRanges: []*armnetwork.QosPortRange{ - // { - // End: to.Ptr[int32](12), - // Start: to.Ptr[int32](11), - // }}, - // Protocol: to.Ptr(armnetwork.ProtocolTypeUDP), - // }}, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/expressroutecircuitauthorizations_client.go b/sdk/resourcemanager/network/armnetwork/expressroutecircuitauthorizations_client.go index 0c7bc33f80a0..d35c1e1737ed 100644 --- a/sdk/resourcemanager/network/armnetwork/expressroutecircuitauthorizations_client.go +++ b/sdk/resourcemanager/network/armnetwork/expressroutecircuitauthorizations_client.go @@ -47,7 +47,7 @@ func NewExpressRouteCircuitAuthorizationsClient(subscriptionID string, credentia // BeginCreateOrUpdate - Creates or updates an authorization in the specified express route circuit. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - circuitName - The name of the express route circuit. // - authorizationName - The name of the authorization. @@ -72,7 +72,7 @@ func (client *ExpressRouteCircuitAuthorizationsClient) BeginCreateOrUpdate(ctx c // CreateOrUpdate - Creates or updates an authorization in the specified express route circuit. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *ExpressRouteCircuitAuthorizationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, circuitName string, authorizationName string, authorizationParameters ExpressRouteCircuitAuthorization, options *ExpressRouteCircuitAuthorizationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ExpressRouteCircuitAuthorizationsClient.BeginCreateOrUpdate" @@ -118,7 +118,7 @@ func (client *ExpressRouteCircuitAuthorizationsClient) createOrUpdateCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, authorizationParameters); err != nil { @@ -130,7 +130,7 @@ func (client *ExpressRouteCircuitAuthorizationsClient) createOrUpdateCreateReque // BeginDelete - Deletes the specified authorization from the specified express route circuit. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - circuitName - The name of the express route circuit. // - authorizationName - The name of the authorization. @@ -154,7 +154,7 @@ func (client *ExpressRouteCircuitAuthorizationsClient) BeginDelete(ctx context.C // Delete - Deletes the specified authorization from the specified express route circuit. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *ExpressRouteCircuitAuthorizationsClient) deleteOperation(ctx context.Context, resourceGroupName string, circuitName string, authorizationName string, options *ExpressRouteCircuitAuthorizationsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ExpressRouteCircuitAuthorizationsClient.BeginDelete" @@ -200,7 +200,7 @@ func (client *ExpressRouteCircuitAuthorizationsClient) deleteCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -209,7 +209,7 @@ func (client *ExpressRouteCircuitAuthorizationsClient) deleteCreateRequest(ctx c // Get - Gets the specified authorization from the specified express route circuit. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - circuitName - The name of the express route circuit. // - authorizationName - The name of the authorization. @@ -261,7 +261,7 @@ func (client *ExpressRouteCircuitAuthorizationsClient) getCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -278,7 +278,7 @@ func (client *ExpressRouteCircuitAuthorizationsClient) getHandleResponse(resp *h // NewListPager - Gets all authorizations in an express route circuit. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - circuitName - The name of the circuit. // - options - ExpressRouteCircuitAuthorizationsClientListOptions contains the optional parameters for the ExpressRouteCircuitAuthorizationsClient.NewListPager @@ -333,7 +333,7 @@ func (client *ExpressRouteCircuitAuthorizationsClient) listCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/expressroutecircuitauthorizations_client_example_test.go b/sdk/resourcemanager/network/armnetwork/expressroutecircuitauthorizations_client_example_test.go deleted file mode 100644 index 8412ab972018..000000000000 --- a/sdk/resourcemanager/network/armnetwork/expressroutecircuitauthorizations_client_example_test.go +++ /dev/null @@ -1,143 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ExpressRouteCircuitAuthorizationDelete.json -func ExampleExpressRouteCircuitAuthorizationsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewExpressRouteCircuitAuthorizationsClient().BeginDelete(ctx, "rg1", "circuitName", "authorizationName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ExpressRouteCircuitAuthorizationGet.json -func ExampleExpressRouteCircuitAuthorizationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewExpressRouteCircuitAuthorizationsClient().Get(ctx, "rg1", "circuitName", "authorizationName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ExpressRouteCircuitAuthorization = armnetwork.ExpressRouteCircuitAuthorization{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName/authorizations/MyAuthorization1"), - // Name: to.Ptr("MyAuthorization1"), - // Type: to.Ptr("Microsoft.Network/expressRouteCircuits/authorizations"), - // Etag: to.Ptr("W/\"e33c875f-48df-4a91-b7d3-eb95b5ddbb89\""), - // Properties: &armnetwork.AuthorizationPropertiesFormat{ - // AuthorizationKey: to.Ptr("authKey"), - // AuthorizationUseStatus: to.Ptr(armnetwork.AuthorizationUseStatusAvailable), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ExpressRouteCircuitAuthorizationCreate.json -func ExampleExpressRouteCircuitAuthorizationsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewExpressRouteCircuitAuthorizationsClient().BeginCreateOrUpdate(ctx, "rg1", "circuitName", "authorizatinName", armnetwork.ExpressRouteCircuitAuthorization{ - Properties: &armnetwork.AuthorizationPropertiesFormat{}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ExpressRouteCircuitAuthorization = armnetwork.ExpressRouteCircuitAuthorization{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName/authorizations/authorizationName"), - // Name: to.Ptr("authorizationName"), - // Etag: to.Ptr("W/\"e22dd4b2-4c24-44cf-b702-70a472b62914\""), - // Properties: &armnetwork.AuthorizationPropertiesFormat{ - // AuthorizationUseStatus: to.Ptr(armnetwork.AuthorizationUseStatusAvailable), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ExpressRouteCircuitAuthorizationList.json -func ExampleExpressRouteCircuitAuthorizationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewExpressRouteCircuitAuthorizationsClient().NewListPager("rg1", "circuitName", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AuthorizationListResult = armnetwork.AuthorizationListResult{ - // Value: []*armnetwork.ExpressRouteCircuitAuthorization{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName/authorizations/MyAuthorization1"), - // Name: to.Ptr("MyAuthorization1"), - // Etag: to.Ptr("W/\"e33c875f-48df-4a91-b7d3-eb95b5ddbb89\""), - // Properties: &armnetwork.AuthorizationPropertiesFormat{ - // AuthorizationKey: to.Ptr("authKey"), - // AuthorizationUseStatus: to.Ptr(armnetwork.AuthorizationUseStatusAvailable), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/expressroutecircuitconnections_client.go b/sdk/resourcemanager/network/armnetwork/expressroutecircuitconnections_client.go index 3aac3a45a806..f322ea4e9ac5 100644 --- a/sdk/resourcemanager/network/armnetwork/expressroutecircuitconnections_client.go +++ b/sdk/resourcemanager/network/armnetwork/expressroutecircuitconnections_client.go @@ -47,7 +47,7 @@ func NewExpressRouteCircuitConnectionsClient(subscriptionID string, credential a // BeginCreateOrUpdate - Creates or updates a Express Route Circuit Connection in the specified express route circuits. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - circuitName - The name of the express route circuit. // - peeringName - The name of the peering. @@ -74,7 +74,7 @@ func (client *ExpressRouteCircuitConnectionsClient) BeginCreateOrUpdate(ctx cont // CreateOrUpdate - Creates or updates a Express Route Circuit Connection in the specified express route circuits. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *ExpressRouteCircuitConnectionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, connectionName string, expressRouteCircuitConnectionParameters ExpressRouteCircuitConnection, options *ExpressRouteCircuitConnectionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ExpressRouteCircuitConnectionsClient.BeginCreateOrUpdate" @@ -124,7 +124,7 @@ func (client *ExpressRouteCircuitConnectionsClient) createOrUpdateCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, expressRouteCircuitConnectionParameters); err != nil { @@ -136,7 +136,7 @@ func (client *ExpressRouteCircuitConnectionsClient) createOrUpdateCreateRequest( // BeginDelete - Deletes the specified Express Route Circuit Connection from the specified express route circuit. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - circuitName - The name of the express route circuit. // - peeringName - The name of the peering. @@ -161,7 +161,7 @@ func (client *ExpressRouteCircuitConnectionsClient) BeginDelete(ctx context.Cont // Delete - Deletes the specified Express Route Circuit Connection from the specified express route circuit. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *ExpressRouteCircuitConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, connectionName string, options *ExpressRouteCircuitConnectionsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ExpressRouteCircuitConnectionsClient.BeginDelete" @@ -211,7 +211,7 @@ func (client *ExpressRouteCircuitConnectionsClient) deleteCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -220,7 +220,7 @@ func (client *ExpressRouteCircuitConnectionsClient) deleteCreateRequest(ctx cont // Get - Gets the specified Express Route Circuit Connection from the specified express route circuit. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - circuitName - The name of the express route circuit. // - peeringName - The name of the peering. @@ -277,7 +277,7 @@ func (client *ExpressRouteCircuitConnectionsClient) getCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -294,7 +294,7 @@ func (client *ExpressRouteCircuitConnectionsClient) getHandleResponse(resp *http // NewListPager - Gets all global reach connections associated with a private peering in an express route circuit. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - circuitName - The name of the circuit. // - peeringName - The name of the peering. @@ -354,7 +354,7 @@ func (client *ExpressRouteCircuitConnectionsClient) listCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/expressroutecircuitconnections_client_example_test.go b/sdk/resourcemanager/network/armnetwork/expressroutecircuitconnections_client_example_test.go deleted file mode 100644 index 46ab36ded333..000000000000 --- a/sdk/resourcemanager/network/armnetwork/expressroutecircuitconnections_client_example_test.go +++ /dev/null @@ -1,206 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ExpressRouteCircuitConnectionDelete.json -func ExampleExpressRouteCircuitConnectionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewExpressRouteCircuitConnectionsClient().BeginDelete(ctx, "rg1", "ExpressRouteARMCircuitA", "AzurePrivatePeering", "circuitConnectionUSAUS", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ExpressRouteCircuitConnectionGet.json -func ExampleExpressRouteCircuitConnectionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewExpressRouteCircuitConnectionsClient().Get(ctx, "rg1", "ExpressRouteARMCircuitA", "AzurePrivatePeering", "circuitConnectionUSAUS", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ExpressRouteCircuitConnection = armnetwork.ExpressRouteCircuitConnection{ - // ID: to.Ptr("/subscriptions/subid1/resourceGroups/dedharcktinit/providers/Microsoft.Network/expressRouteCircuits/ExpressRouteARMCircuitA/peerings/AzurePrivatePeering/connections/circuitConnectionUSAUS"), - // Name: to.Ptr("circuitConnectionUSAUS"), - // Type: to.Ptr("Microsoft.Network/expressRouteCircuits/peerings/connections"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.ExpressRouteCircuitConnectionPropertiesFormat{ - // AddressPrefix: to.Ptr("10.0.0.0/24"), - // AuthorizationKey: to.Ptr("946a1918-b7a2-4917-b43c-8c4cdaee006a"), - // CircuitConnectionStatus: to.Ptr(armnetwork.CircuitConnectionStatusConnected), - // ExpressRouteCircuitPeering: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid1/resourceGroups/dedharcktinit/providers/Microsoft.Network/expressRouteCircuits/dedharcktlocal/peerings/AzurePrivatePeering"), - // }, - // IPv6CircuitConnectionConfig: &armnetwork.IPv6CircuitConnectionConfig{ - // AddressPrefix: to.Ptr("aa:bb::1/125"), - // CircuitConnectionStatus: to.Ptr(armnetwork.CircuitConnectionStatusConnected), - // }, - // PeerExpressRouteCircuitPeering: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid2/resourceGroups/dedharcktpeer/providers/Microsoft.Network/expressRouteCircuits/dedharcktremote/peerings/AzurePrivatePeering"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ExpressRouteCircuitConnectionCreate.json -func ExampleExpressRouteCircuitConnectionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewExpressRouteCircuitConnectionsClient().BeginCreateOrUpdate(ctx, "rg1", "ExpressRouteARMCircuitA", "AzurePrivatePeering", "circuitConnectionUSAUS", armnetwork.ExpressRouteCircuitConnection{ - Properties: &armnetwork.ExpressRouteCircuitConnectionPropertiesFormat{ - AddressPrefix: to.Ptr("10.0.0.0/29"), - AuthorizationKey: to.Ptr("946a1918-b7a2-4917-b43c-8c4cdaee006a"), - ExpressRouteCircuitPeering: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid1/resourceGroups/dedharcktinit/providers/Microsoft.Network/expressRouteCircuits/dedharcktlocal/peerings/AzurePrivatePeering"), - }, - IPv6CircuitConnectionConfig: &armnetwork.IPv6CircuitConnectionConfig{ - AddressPrefix: to.Ptr("aa:bb::/125"), - }, - PeerExpressRouteCircuitPeering: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid2/resourceGroups/dedharcktpeer/providers/Microsoft.Network/expressRouteCircuits/dedharcktremote/peerings/AzurePrivatePeering"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ExpressRouteCircuitConnection = armnetwork.ExpressRouteCircuitConnection{ - // ID: to.Ptr("/subscriptions/subid1/resourceGroups/dedharcktinit/providers/Microsoft.Network/expressRouteCircuits/ExpressRouteARMCircuitA/peerings/AzurePrivatePeering/connections/circuitConnectionUSAUS"), - // Name: to.Ptr("circuitConnectionUSAUS"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.ExpressRouteCircuitConnectionPropertiesFormat{ - // AddressPrefix: to.Ptr("10.0.0.0/24"), - // AuthorizationKey: to.Ptr("946a1918-b7a2-4917-b43c-8c4cdaee006a"), - // CircuitConnectionStatus: to.Ptr(armnetwork.CircuitConnectionStatusConnected), - // ExpressRouteCircuitPeering: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid1/resourceGroups/dedharcktinit/providers/Microsoft.Network/expressRouteCircuits/dedharcktlocal/peerings/AzurePrivatePeering"), - // }, - // IPv6CircuitConnectionConfig: &armnetwork.IPv6CircuitConnectionConfig{ - // AddressPrefix: to.Ptr("aa:bb::1/125"), - // CircuitConnectionStatus: to.Ptr(armnetwork.CircuitConnectionStatusConnected), - // }, - // PeerExpressRouteCircuitPeering: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid2/resourceGroups/dedharcktpeer/providers/Microsoft.Network/expressRouteCircuits/dedharcktremote/peerings/AzurePrivatePeering"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ExpressRouteCircuitConnectionList.json -func ExampleExpressRouteCircuitConnectionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewExpressRouteCircuitConnectionsClient().NewListPager("rg1", "ExpressRouteARMCircuitA", "AzurePrivatePeering", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ExpressRouteCircuitConnectionListResult = armnetwork.ExpressRouteCircuitConnectionListResult{ - // Value: []*armnetwork.ExpressRouteCircuitConnection{ - // { - // ID: to.Ptr("/subscriptions/subid1/resourceGroups/dedharcktinit/providers/Microsoft.Network/expressRouteCircuits/ExpressRouteARMCircuitA/peerings/AzurePrivatePeering/connections/circuitConnectionUSAUS"), - // Name: to.Ptr("circuitConnectionUSAUS"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.ExpressRouteCircuitConnectionPropertiesFormat{ - // AddressPrefix: to.Ptr("10.0.0.0/24"), - // AuthorizationKey: to.Ptr("946a1918-b7a2-4917-b43c-8c4cdaee006a"), - // CircuitConnectionStatus: to.Ptr(armnetwork.CircuitConnectionStatusConnected), - // ExpressRouteCircuitPeering: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid1/resourceGroups/dedharcktinit/providers/Microsoft.Network/expressRouteCircuits/dedharcktlocal/peerings/AzurePrivatePeering"), - // }, - // IPv6CircuitConnectionConfig: &armnetwork.IPv6CircuitConnectionConfig{ - // AddressPrefix: to.Ptr("aa:bb::1/125"), - // CircuitConnectionStatus: to.Ptr(armnetwork.CircuitConnectionStatusConnected), - // }, - // PeerExpressRouteCircuitPeering: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid2/resourceGroups/dedharcktpeer/providers/Microsoft.Network/expressRouteCircuits/dedharcktremote/peerings/AzurePrivatePeering"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid1/resourceGroups/dedharcktinit/providers/Microsoft.Network/expressRouteCircuits/ExpressRouteARMCircuitA/peerings/AzurePrivatePeering/connections/circuitConnectionUSEUR"), - // Name: to.Ptr("circuitConnectionUSEUR"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.ExpressRouteCircuitConnectionPropertiesFormat{ - // AddressPrefix: to.Ptr("20.0.0.0/24"), - // CircuitConnectionStatus: to.Ptr(armnetwork.CircuitConnectionStatusConnected), - // ExpressRouteCircuitPeering: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid1/resourceGroups/dedharcktinit/providers/Microsoft.Network/expressRouteCircuits/dedharcktlocal/peerings/AzurePrivatePeering"), - // }, - // PeerExpressRouteCircuitPeering: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid1/resourceGroups/dedharckteurope/providers/Microsoft.Network/expressRouteCircuits/dedharcktams/peerings/AzurePrivatePeering"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/expressroutecircuitpeerings_client.go b/sdk/resourcemanager/network/armnetwork/expressroutecircuitpeerings_client.go index aafd58bb2d9a..0ead66c03fe7 100644 --- a/sdk/resourcemanager/network/armnetwork/expressroutecircuitpeerings_client.go +++ b/sdk/resourcemanager/network/armnetwork/expressroutecircuitpeerings_client.go @@ -47,7 +47,7 @@ func NewExpressRouteCircuitPeeringsClient(subscriptionID string, credential azco // BeginCreateOrUpdate - Creates or updates a peering in the specified express route circuits. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - circuitName - The name of the express route circuit. // - peeringName - The name of the peering. @@ -72,7 +72,7 @@ func (client *ExpressRouteCircuitPeeringsClient) BeginCreateOrUpdate(ctx context // CreateOrUpdate - Creates or updates a peering in the specified express route circuits. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *ExpressRouteCircuitPeeringsClient) createOrUpdate(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, peeringParameters ExpressRouteCircuitPeering, options *ExpressRouteCircuitPeeringsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ExpressRouteCircuitPeeringsClient.BeginCreateOrUpdate" @@ -118,7 +118,7 @@ func (client *ExpressRouteCircuitPeeringsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, peeringParameters); err != nil { @@ -130,7 +130,7 @@ func (client *ExpressRouteCircuitPeeringsClient) createOrUpdateCreateRequest(ctx // BeginDelete - Deletes the specified peering from the specified express route circuit. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - circuitName - The name of the express route circuit. // - peeringName - The name of the peering. @@ -154,7 +154,7 @@ func (client *ExpressRouteCircuitPeeringsClient) BeginDelete(ctx context.Context // Delete - Deletes the specified peering from the specified express route circuit. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *ExpressRouteCircuitPeeringsClient) deleteOperation(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, options *ExpressRouteCircuitPeeringsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ExpressRouteCircuitPeeringsClient.BeginDelete" @@ -200,7 +200,7 @@ func (client *ExpressRouteCircuitPeeringsClient) deleteCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -209,7 +209,7 @@ func (client *ExpressRouteCircuitPeeringsClient) deleteCreateRequest(ctx context // Get - Gets the specified peering for the express route circuit. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - circuitName - The name of the express route circuit. // - peeringName - The name of the peering. @@ -261,7 +261,7 @@ func (client *ExpressRouteCircuitPeeringsClient) getCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -278,7 +278,7 @@ func (client *ExpressRouteCircuitPeeringsClient) getHandleResponse(resp *http.Re // NewListPager - Gets all peerings in a specified express route circuit. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - circuitName - The name of the express route circuit. // - options - ExpressRouteCircuitPeeringsClientListOptions contains the optional parameters for the ExpressRouteCircuitPeeringsClient.NewListPager @@ -333,7 +333,7 @@ func (client *ExpressRouteCircuitPeeringsClient) listCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/expressroutecircuitpeerings_client_example_test.go b/sdk/resourcemanager/network/armnetwork/expressroutecircuitpeerings_client_example_test.go deleted file mode 100644 index 5aefac3ab85a..000000000000 --- a/sdk/resourcemanager/network/armnetwork/expressroutecircuitpeerings_client_example_test.go +++ /dev/null @@ -1,266 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ExpressRouteCircuitPeeringDelete.json -func ExampleExpressRouteCircuitPeeringsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewExpressRouteCircuitPeeringsClient().BeginDelete(ctx, "rg1", "circuitName", "peeringName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ExpressRouteCircuitPeeringGet.json -func ExampleExpressRouteCircuitPeeringsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewExpressRouteCircuitPeeringsClient().Get(ctx, "rg1", "circuitName", "MicrosoftPeering", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ExpressRouteCircuitPeering = armnetwork.ExpressRouteCircuitPeering{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/MicrosoftPeering"), - // Name: to.Ptr("MicrosoftPeering"), - // Type: to.Ptr("Microsoft.Network/expressRouteCircuits/peerings"), - // Etag: to.Ptr("W/\"b2a25b98-2e6d-4d46-87f2-089de5f6fdf9\""), - // Properties: &armnetwork.ExpressRouteCircuitPeeringPropertiesFormat{ - // AzureASN: to.Ptr[int32](12076), - // GatewayManagerEtag: to.Ptr("103"), - // IPv6PeeringConfig: &armnetwork.IPv6ExpressRouteCircuitPeeringConfig{ - // MicrosoftPeeringConfig: &armnetwork.ExpressRouteCircuitPeeringConfig{ - // AdvertisedCommunities: []*string{ - // }, - // AdvertisedPublicPrefixes: []*string{ - // to.Ptr("3FFE:FFFF:0:CD31::/120")}, - // AdvertisedPublicPrefixesState: to.Ptr(armnetwork.ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValidationNeeded), - // CustomerASN: to.Ptr[int32](23), - // LegacyMode: to.Ptr[int32](0), - // RoutingRegistryName: to.Ptr("ARIN"), - // }, - // PrimaryPeerAddressPrefix: to.Ptr("3FFE:FFFF:0:CD30::/126"), - // SecondaryPeerAddressPrefix: to.Ptr("3FFE:FFFF:0:CD30::4/126"), - // State: to.Ptr(armnetwork.ExpressRouteCircuitPeeringStateEnabled), - // }, - // LastModifiedBy: to.Ptr("Customer"), - // MicrosoftPeeringConfig: &armnetwork.ExpressRouteCircuitPeeringConfig{ - // AdvertisedCommunities: []*string{ - // }, - // AdvertisedPublicPrefixes: []*string{ - // to.Ptr("123.1.0.0/24")}, - // AdvertisedPublicPrefixesState: to.Ptr(armnetwork.ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValidationNeeded), - // CustomerASN: to.Ptr[int32](23), - // LegacyMode: to.Ptr[int32](0), - // RoutingRegistryName: to.Ptr("ARIN"), - // }, - // PeerASN: to.Ptr[int64](100), - // PeeringType: to.Ptr(armnetwork.ExpressRoutePeeringTypeMicrosoftPeering), - // PrimaryAzurePort: to.Ptr("A51-TEST-06GMR-CIS-1-PRI-A"), - // PrimaryPeerAddressPrefix: to.Ptr("123.0.0.0/30"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RouteFilter: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/routeFilters/filterName"), - // }, - // SecondaryAzurePort: to.Ptr("A51-TEST-06GMR-CIS-2-SEC-A"), - // SecondaryPeerAddressPrefix: to.Ptr("123.0.0.4/30"), - // State: to.Ptr(armnetwork.ExpressRoutePeeringStateEnabled), - // VlanID: to.Ptr[int32](300), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ExpressRouteCircuitPeeringCreate.json -func ExampleExpressRouteCircuitPeeringsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewExpressRouteCircuitPeeringsClient().BeginCreateOrUpdate(ctx, "rg1", "circuitName", "AzurePrivatePeering", armnetwork.ExpressRouteCircuitPeering{ - Properties: &armnetwork.ExpressRouteCircuitPeeringPropertiesFormat{ - PeerASN: to.Ptr[int64](200), - PrimaryPeerAddressPrefix: to.Ptr("192.168.16.252/30"), - SecondaryPeerAddressPrefix: to.Ptr("192.168.18.252/30"), - VlanID: to.Ptr[int32](200), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ExpressRouteCircuitPeering = armnetwork.ExpressRouteCircuitPeering{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/AzurePrivatePeering"), - // Name: to.Ptr("AzurePrivatePeering"), - // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), - // Properties: &armnetwork.ExpressRouteCircuitPeeringPropertiesFormat{ - // AzureASN: to.Ptr[int32](12076), - // ExpressRouteConnection: &armnetwork.ExpressRouteConnectionID{ - // }, - // GatewayManagerEtag: to.Ptr(""), - // IPv6PeeringConfig: &armnetwork.IPv6ExpressRouteCircuitPeeringConfig{ - // PrimaryPeerAddressPrefix: to.Ptr("3FFE:FFFF:0:CD30::/126"), - // SecondaryPeerAddressPrefix: to.Ptr("3FFE:FFFF:0:CD30::4/126"), - // State: to.Ptr(armnetwork.ExpressRouteCircuitPeeringStateEnabled), - // }, - // LastModifiedBy: to.Ptr("Customer"), - // PeerASN: to.Ptr[int64](200), - // PeeringType: to.Ptr(armnetwork.ExpressRoutePeeringTypeAzurePrivatePeering), - // PrimaryAzurePort: to.Ptr(""), - // PrimaryPeerAddressPrefix: to.Ptr("192.168.16.252/30"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SecondaryAzurePort: to.Ptr(""), - // SecondaryPeerAddressPrefix: to.Ptr("192.168.18.252/30"), - // State: to.Ptr(armnetwork.ExpressRoutePeeringStateEnabled), - // VlanID: to.Ptr[int32](200), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ExpressRouteCircuitPeeringList.json -func ExampleExpressRouteCircuitPeeringsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewExpressRouteCircuitPeeringsClient().NewListPager("rg1", "circuitName", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ExpressRouteCircuitPeeringListResult = armnetwork.ExpressRouteCircuitPeeringListResult{ - // Value: []*armnetwork.ExpressRouteCircuitPeering{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/MicrosoftPeering"), - // Name: to.Ptr("MicrosoftPeering"), - // Etag: to.Ptr("W/\"b2a25b98-2e6d-4d46-87f2-089de5f6fdf9\""), - // Properties: &armnetwork.ExpressRouteCircuitPeeringPropertiesFormat{ - // AzureASN: to.Ptr[int32](12076), - // ExpressRouteConnection: &armnetwork.ExpressRouteConnectionID{ - // }, - // GatewayManagerEtag: to.Ptr("103"), - // IPv6PeeringConfig: &armnetwork.IPv6ExpressRouteCircuitPeeringConfig{ - // MicrosoftPeeringConfig: &armnetwork.ExpressRouteCircuitPeeringConfig{ - // AdvertisedCommunities: []*string{ - // }, - // AdvertisedPublicPrefixes: []*string{ - // to.Ptr("3FFE:FFFF:0:CD31::/120")}, - // AdvertisedPublicPrefixesState: to.Ptr(armnetwork.ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValidationNeeded), - // CustomerASN: to.Ptr[int32](23), - // LegacyMode: to.Ptr[int32](0), - // RoutingRegistryName: to.Ptr("ARIN"), - // }, - // PrimaryPeerAddressPrefix: to.Ptr("3FFE:FFFF:0:CD30::/126"), - // SecondaryPeerAddressPrefix: to.Ptr("3FFE:FFFF:0:CD30::4/126"), - // State: to.Ptr(armnetwork.ExpressRouteCircuitPeeringStateEnabled), - // }, - // LastModifiedBy: to.Ptr("Customer"), - // MicrosoftPeeringConfig: &armnetwork.ExpressRouteCircuitPeeringConfig{ - // AdvertisedCommunities: []*string{ - // }, - // AdvertisedPublicPrefixes: []*string{ - // to.Ptr("123.1.0.0/24")}, - // AdvertisedPublicPrefixesState: to.Ptr(armnetwork.ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValidationNeeded), - // CustomerASN: to.Ptr[int32](23), - // LegacyMode: to.Ptr[int32](0), - // RoutingRegistryName: to.Ptr("ARIN"), - // }, - // PeerASN: to.Ptr[int64](100), - // PeeringType: to.Ptr(armnetwork.ExpressRoutePeeringTypeMicrosoftPeering), - // PrimaryAzurePort: to.Ptr("A51-TEST-06GMR-CIS-1-PRI-A"), - // PrimaryPeerAddressPrefix: to.Ptr("123.0.0.0/30"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SecondaryAzurePort: to.Ptr("A51-TEST-06GMR-CIS-2-SEC-A"), - // SecondaryPeerAddressPrefix: to.Ptr("123.0.0.4/30"), - // State: to.Ptr(armnetwork.ExpressRoutePeeringStateEnabled), - // VlanID: to.Ptr[int32](300), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/AzurePrivatePeering"), - // Name: to.Ptr("AzurePrivatePeering"), - // Etag: to.Ptr("W/\"b2a25b98-2e6d-4d46-87f2-089de5f6fdf9\""), - // Properties: &armnetwork.ExpressRouteCircuitPeeringPropertiesFormat{ - // AzureASN: to.Ptr[int32](12076), - // ExpressRouteConnection: &armnetwork.ExpressRouteConnectionID{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName/expressRouteConnections/connectionName"), - // }, - // GatewayManagerEtag: to.Ptr("103"), - // IPv6PeeringConfig: &armnetwork.IPv6ExpressRouteCircuitPeeringConfig{ - // PrimaryPeerAddressPrefix: to.Ptr("3FFE:FFFF:0:CD30::/126"), - // SecondaryPeerAddressPrefix: to.Ptr("3FFE:FFFF:0:CD30::4/126"), - // State: to.Ptr(armnetwork.ExpressRouteCircuitPeeringStateEnabled), - // }, - // LastModifiedBy: to.Ptr("Customer"), - // PeerASN: to.Ptr[int64](100), - // PeeringType: to.Ptr(armnetwork.ExpressRoutePeeringTypeAzurePrivatePeering), - // PrimaryAzurePort: to.Ptr("A51-TEST-06GMR-CIS-1-PRI-A"), - // PrimaryPeerAddressPrefix: to.Ptr("10.0.0.0/30"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SecondaryAzurePort: to.Ptr("A51-TEST-06GMR-CIS-2-SEC-A"), - // SecondaryPeerAddressPrefix: to.Ptr("10.0.0.4/30"), - // State: to.Ptr(armnetwork.ExpressRoutePeeringStateEnabled), - // VlanID: to.Ptr[int32](200), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/expressroutecircuits_client.go b/sdk/resourcemanager/network/armnetwork/expressroutecircuits_client.go index d28672e3549c..8fa0802797eb 100644 --- a/sdk/resourcemanager/network/armnetwork/expressroutecircuits_client.go +++ b/sdk/resourcemanager/network/armnetwork/expressroutecircuits_client.go @@ -47,7 +47,7 @@ func NewExpressRouteCircuitsClient(subscriptionID string, credential azcore.Toke // BeginCreateOrUpdate - Creates or updates an express route circuit. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - circuitName - The name of the circuit. // - parameters - Parameters supplied to the create or update express route circuit operation. @@ -71,7 +71,7 @@ func (client *ExpressRouteCircuitsClient) BeginCreateOrUpdate(ctx context.Contex // CreateOrUpdate - Creates or updates an express route circuit. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *ExpressRouteCircuitsClient) createOrUpdate(ctx context.Context, resourceGroupName string, circuitName string, parameters ExpressRouteCircuit, options *ExpressRouteCircuitsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ExpressRouteCircuitsClient.BeginCreateOrUpdate" @@ -113,7 +113,7 @@ func (client *ExpressRouteCircuitsClient) createOrUpdateCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -125,7 +125,7 @@ func (client *ExpressRouteCircuitsClient) createOrUpdateCreateRequest(ctx contex // BeginDelete - Deletes the specified express route circuit. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - circuitName - The name of the express route circuit. // - options - ExpressRouteCircuitsClientBeginDeleteOptions contains the optional parameters for the ExpressRouteCircuitsClient.BeginDelete @@ -148,7 +148,7 @@ func (client *ExpressRouteCircuitsClient) BeginDelete(ctx context.Context, resou // Delete - Deletes the specified express route circuit. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *ExpressRouteCircuitsClient) deleteOperation(ctx context.Context, resourceGroupName string, circuitName string, options *ExpressRouteCircuitsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ExpressRouteCircuitsClient.BeginDelete" @@ -190,7 +190,7 @@ func (client *ExpressRouteCircuitsClient) deleteCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -199,7 +199,7 @@ func (client *ExpressRouteCircuitsClient) deleteCreateRequest(ctx context.Contex // Get - Gets information about the specified express route circuit. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - circuitName - The name of express route circuit. // - options - ExpressRouteCircuitsClientGetOptions contains the optional parameters for the ExpressRouteCircuitsClient.Get @@ -246,7 +246,7 @@ func (client *ExpressRouteCircuitsClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -264,7 +264,7 @@ func (client *ExpressRouteCircuitsClient) getHandleResponse(resp *http.Response) // GetPeeringStats - Gets all stats from an express route circuit in a resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - circuitName - The name of the express route circuit. // - peeringName - The name of the peering. @@ -316,7 +316,7 @@ func (client *ExpressRouteCircuitsClient) getPeeringStatsCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -334,7 +334,7 @@ func (client *ExpressRouteCircuitsClient) getPeeringStatsHandleResponse(resp *ht // GetStats - Gets all the stats from an express route circuit in a resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - circuitName - The name of the express route circuit. // - options - ExpressRouteCircuitsClientGetStatsOptions contains the optional parameters for the ExpressRouteCircuitsClient.GetStats @@ -381,7 +381,7 @@ func (client *ExpressRouteCircuitsClient) getStatsCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -398,7 +398,7 @@ func (client *ExpressRouteCircuitsClient) getStatsHandleResponse(resp *http.Resp // NewListPager - Gets all the express route circuits in a resource group. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - options - ExpressRouteCircuitsClientListOptions contains the optional parameters for the ExpressRouteCircuitsClient.NewListPager // method. @@ -448,7 +448,7 @@ func (client *ExpressRouteCircuitsClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -465,7 +465,7 @@ func (client *ExpressRouteCircuitsClient) listHandleResponse(resp *http.Response // NewListAllPager - Gets all the express route circuits in a subscription. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - options - ExpressRouteCircuitsClientListAllOptions contains the optional parameters for the ExpressRouteCircuitsClient.NewListAllPager // method. func (client *ExpressRouteCircuitsClient) NewListAllPager(options *ExpressRouteCircuitsClientListAllOptions) *runtime.Pager[ExpressRouteCircuitsClientListAllResponse] { @@ -510,7 +510,7 @@ func (client *ExpressRouteCircuitsClient) listAllCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -528,7 +528,7 @@ func (client *ExpressRouteCircuitsClient) listAllHandleResponse(resp *http.Respo // BeginListArpTable - Gets the currently advertised ARP table associated with the express route circuit in a resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - circuitName - The name of the express route circuit. // - peeringName - The name of the peering. @@ -553,7 +553,7 @@ func (client *ExpressRouteCircuitsClient) BeginListArpTable(ctx context.Context, // ListArpTable - Gets the currently advertised ARP table associated with the express route circuit in a resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *ExpressRouteCircuitsClient) listArpTable(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, devicePath string, options *ExpressRouteCircuitsClientBeginListArpTableOptions) (*http.Response, error) { var err error const operationName = "ExpressRouteCircuitsClient.BeginListArpTable" @@ -603,7 +603,7 @@ func (client *ExpressRouteCircuitsClient) listArpTableCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -613,7 +613,7 @@ func (client *ExpressRouteCircuitsClient) listArpTableCreateRequest(ctx context. // group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - circuitName - The name of the express route circuit. // - peeringName - The name of the peering. @@ -638,7 +638,7 @@ func (client *ExpressRouteCircuitsClient) BeginListRoutesTable(ctx context.Conte // ListRoutesTable - Gets the currently advertised routes table associated with the express route circuit in a resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *ExpressRouteCircuitsClient) listRoutesTable(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, devicePath string, options *ExpressRouteCircuitsClientBeginListRoutesTableOptions) (*http.Response, error) { var err error const operationName = "ExpressRouteCircuitsClient.BeginListRoutesTable" @@ -688,7 +688,7 @@ func (client *ExpressRouteCircuitsClient) listRoutesTableCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -698,7 +698,7 @@ func (client *ExpressRouteCircuitsClient) listRoutesTableCreateRequest(ctx conte // in a resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - circuitName - The name of the express route circuit. // - peeringName - The name of the peering. @@ -724,7 +724,7 @@ func (client *ExpressRouteCircuitsClient) BeginListRoutesTableSummary(ctx contex // a resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *ExpressRouteCircuitsClient) listRoutesTableSummary(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, devicePath string, options *ExpressRouteCircuitsClientBeginListRoutesTableSummaryOptions) (*http.Response, error) { var err error const operationName = "ExpressRouteCircuitsClient.BeginListRoutesTableSummary" @@ -774,7 +774,7 @@ func (client *ExpressRouteCircuitsClient) listRoutesTableSummaryCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -783,7 +783,7 @@ func (client *ExpressRouteCircuitsClient) listRoutesTableSummaryCreateRequest(ct // UpdateTags - Updates an express route circuit tags. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - circuitName - The name of the circuit. // - parameters - Parameters supplied to update express route circuit tags. @@ -831,7 +831,7 @@ func (client *ExpressRouteCircuitsClient) updateTagsCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/expressroutecircuits_client_example_test.go b/sdk/resourcemanager/network/armnetwork/expressroutecircuits_client_example_test.go deleted file mode 100644 index a166ca4e8600..000000000000 --- a/sdk/resourcemanager/network/armnetwork/expressroutecircuits_client_example_test.go +++ /dev/null @@ -1,642 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ExpressRouteCircuitDelete.json -func ExampleExpressRouteCircuitsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewExpressRouteCircuitsClient().BeginDelete(ctx, "rg1", "circuitName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ExpressRouteCircuitGet.json -func ExampleExpressRouteCircuitsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewExpressRouteCircuitsClient().Get(ctx, "rg1", "circuitName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ExpressRouteCircuit = armnetwork.ExpressRouteCircuit{ - // Name: to.Ptr("circuitName"), - // Type: to.Ptr("Microsoft.Network/expressRouteCircuits"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.ExpressRouteCircuitPropertiesFormat{ - // AllowClassicOperations: to.Ptr(false), - // Authorizations: []*armnetwork.ExpressRouteCircuitAuthorization{ - // }, - // CircuitProvisioningState: to.Ptr("Enabled"), - // Peerings: []*armnetwork.ExpressRouteCircuitPeering{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ServiceKey: to.Ptr("a1410692-0000-4ceb-b94a-b90b94d398d1"), - // ServiceProviderProperties: &armnetwork.ExpressRouteCircuitServiceProviderProperties{ - // BandwidthInMbps: to.Ptr[int32](200), - // PeeringLocation: to.Ptr("peeringLocation"), - // ServiceProviderName: to.Ptr("providerName"), - // }, - // ServiceProviderProvisioningState: to.Ptr(armnetwork.ServiceProviderProvisioningStateNotProvisioned), - // }, - // SKU: &armnetwork.ExpressRouteCircuitSKU{ - // Name: to.Ptr("Standard_MeteredData"), - // Family: to.Ptr(armnetwork.ExpressRouteCircuitSKUFamilyMeteredData), - // Tier: to.Ptr(armnetwork.ExpressRouteCircuitSKUTierStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ExpressRouteCircuitCreate.json -func ExampleExpressRouteCircuitsClient_BeginCreateOrUpdate_createExpressRouteCircuit() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewExpressRouteCircuitsClient().BeginCreateOrUpdate(ctx, "rg1", "circuitName", armnetwork.ExpressRouteCircuit{ - Location: to.Ptr("Brazil South"), - Properties: &armnetwork.ExpressRouteCircuitPropertiesFormat{ - AllowClassicOperations: to.Ptr(false), - Authorizations: []*armnetwork.ExpressRouteCircuitAuthorization{}, - Peerings: []*armnetwork.ExpressRouteCircuitPeering{}, - ServiceProviderProperties: &armnetwork.ExpressRouteCircuitServiceProviderProperties{ - BandwidthInMbps: to.Ptr[int32](200), - PeeringLocation: to.Ptr("Silicon Valley"), - ServiceProviderName: to.Ptr("Equinix"), - }, - }, - SKU: &armnetwork.ExpressRouteCircuitSKU{ - Name: to.Ptr("Standard_MeteredData"), - Family: to.Ptr(armnetwork.ExpressRouteCircuitSKUFamilyMeteredData), - Tier: to.Ptr(armnetwork.ExpressRouteCircuitSKUTierStandard), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ExpressRouteCircuit = armnetwork.ExpressRouteCircuit{ - // Name: to.Ptr("circuitName"), - // Type: to.Ptr("Microsoft.Network/expressRouteCircuits"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName"), - // Location: to.Ptr("Brazil South"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.ExpressRouteCircuitPropertiesFormat{ - // AllowClassicOperations: to.Ptr(false), - // Authorizations: []*armnetwork.ExpressRouteCircuitAuthorization{ - // }, - // CircuitProvisioningState: to.Ptr("Enabled"), - // Peerings: []*armnetwork.ExpressRouteCircuitPeering{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ServiceKey: to.Ptr("a1410692-0000-4ceb-b94a-b90b94d398d1"), - // ServiceProviderProperties: &armnetwork.ExpressRouteCircuitServiceProviderProperties{ - // BandwidthInMbps: to.Ptr[int32](200), - // PeeringLocation: to.Ptr("Silicon Valley"), - // ServiceProviderName: to.Ptr("Equinix"), - // }, - // ServiceProviderProvisioningState: to.Ptr(armnetwork.ServiceProviderProvisioningStateNotProvisioned), - // }, - // SKU: &armnetwork.ExpressRouteCircuitSKU{ - // Name: to.Ptr("Standard_MeteredData"), - // Family: to.Ptr(armnetwork.ExpressRouteCircuitSKUFamilyMeteredData), - // Tier: to.Ptr(armnetwork.ExpressRouteCircuitSKUTierStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ExpressRouteCircuitCreateOnExpressRoutePort.json -func ExampleExpressRouteCircuitsClient_BeginCreateOrUpdate_createExpressRouteCircuitOnExpressRoutePort() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewExpressRouteCircuitsClient().BeginCreateOrUpdate(ctx, "rg1", "expressRouteCircuit1", armnetwork.ExpressRouteCircuit{ - Location: to.Ptr("westus"), - Properties: &armnetwork.ExpressRouteCircuitPropertiesFormat{ - AuthorizationKey: to.Ptr("b0be57f5-1fba-463b-adec-ffe767354cdd"), - BandwidthInGbps: to.Ptr[float32](10), - ExpressRoutePort: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName"), - }, - }, - SKU: &armnetwork.ExpressRouteCircuitSKU{ - Name: to.Ptr("Premium_MeteredData"), - Family: to.Ptr(armnetwork.ExpressRouteCircuitSKUFamilyMeteredData), - Tier: to.Ptr(armnetwork.ExpressRouteCircuitSKUTierPremium), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ExpressRouteCircuit = armnetwork.ExpressRouteCircuit{ - // Name: to.Ptr("expressRouteCircuit1"), - // Type: to.Ptr("Microsoft.Network/expressRouteCircuits"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuit1"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.ExpressRouteCircuitPropertiesFormat{ - // AllowClassicOperations: to.Ptr(false), - // AuthorizationKey: to.Ptr("b0be57f5-1fba-463b-adec-ffe767354cdd"), - // AuthorizationStatus: to.Ptr("Enabled"), - // Authorizations: []*armnetwork.ExpressRouteCircuitAuthorization{ - // }, - // BandwidthInGbps: to.Ptr[float32](10), - // CircuitProvisioningState: to.Ptr("Enabled"), - // ExpressRoutePort: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName"), - // }, - // GatewayManagerEtag: to.Ptr("20"), - // Peerings: []*armnetwork.ExpressRouteCircuitPeering{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ServiceKey: to.Ptr("d281f746-ee01-4d00-8b0a-edec4833772b"), - // ServiceProviderProvisioningState: to.Ptr(armnetwork.ServiceProviderProvisioningStateProvisioned), - // }, - // SKU: &armnetwork.ExpressRouteCircuitSKU{ - // Name: to.Ptr("Premium_MeteredData"), - // Family: to.Ptr(armnetwork.ExpressRouteCircuitSKUFamilyMeteredData), - // Tier: to.Ptr(armnetwork.ExpressRouteCircuitSKUTierPremium), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ExpressRouteCircuitUpdateTags.json -func ExampleExpressRouteCircuitsClient_UpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewExpressRouteCircuitsClient().UpdateTags(ctx, "ertest", "er1", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ExpressRouteCircuit = armnetwork.ExpressRouteCircuit{ - // Name: to.Ptr("er1"), - // Type: to.Ptr("Microsoft.Network/expressRouteCircuits"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/ertest/providers/Microsoft.Network/expressRouteCircuits/er1"), - // Location: to.Ptr("brazilsouth"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armnetwork.ExpressRouteCircuitPropertiesFormat{ - // AllowClassicOperations: to.Ptr(false), - // Authorizations: []*armnetwork.ExpressRouteCircuitAuthorization{ - // }, - // CircuitProvisioningState: to.Ptr("Enabled"), - // GatewayManagerEtag: to.Ptr(""), - // Peerings: []*armnetwork.ExpressRouteCircuitPeering{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ServiceKey: to.Ptr("0b392c2e-1e9d-46d7-b5e0-9ce90ca6b60c"), - // ServiceProviderProperties: &armnetwork.ExpressRouteCircuitServiceProviderProperties{ - // BandwidthInMbps: to.Ptr[int32](1000), - // PeeringLocation: to.Ptr("Silicon Valley"), - // ServiceProviderName: to.Ptr("Equinix"), - // }, - // ServiceProviderProvisioningState: to.Ptr(armnetwork.ServiceProviderProvisioningStateNotProvisioned), - // }, - // SKU: &armnetwork.ExpressRouteCircuitSKU{ - // Name: to.Ptr("Standard_MeteredData"), - // Family: to.Ptr(armnetwork.ExpressRouteCircuitSKUFamilyMeteredData), - // Tier: to.Ptr(armnetwork.ExpressRouteCircuitSKUTierStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ExpressRouteCircuitARPTableList.json -func ExampleExpressRouteCircuitsClient_BeginListArpTable() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewExpressRouteCircuitsClient().BeginListArpTable(ctx, "rg1", "circuitName", "peeringName", "devicePath", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ExpressRouteCircuitsArpTableListResult = armnetwork.ExpressRouteCircuitsArpTableListResult{ - // Value: []*armnetwork.ExpressRouteCircuitArpTable{ - // { - // Age: to.Ptr[int32](0), - // Interface: to.Ptr("Microsoft"), - // IPAddress: to.Ptr("IPAddress"), - // MacAddress: to.Ptr("macAddress"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ExpressRouteCircuitRouteTableList.json -func ExampleExpressRouteCircuitsClient_BeginListRoutesTable() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewExpressRouteCircuitsClient().BeginListRoutesTable(ctx, "rg1", "circuitName", "peeringName", "devicePath", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ExpressRouteCircuitsRoutesTableListResult = armnetwork.ExpressRouteCircuitsRoutesTableListResult{ - // Value: []*armnetwork.ExpressRouteCircuitRoutesTable{ - // { - // Path: to.Ptr(""), - // LocPrf: to.Ptr(""), - // Network: to.Ptr(""), - // NextHop: to.Ptr(""), - // Weight: to.Ptr[int32](0), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ExpressRouteCircuitRouteTableSummaryList.json -func ExampleExpressRouteCircuitsClient_BeginListRoutesTableSummary() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewExpressRouteCircuitsClient().BeginListRoutesTableSummary(ctx, "rg1", "circuitName", "peeringName", "devicePath", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ExpressRouteCircuitsRoutesTableSummaryListResult = armnetwork.ExpressRouteCircuitsRoutesTableSummaryListResult{ - // Value: []*armnetwork.ExpressRouteCircuitRoutesTableSummary{ - // { - // As: to.Ptr[int32](9583), - // Neighbor: to.Ptr("100.65.171.1"), - // StatePfxRcd: to.Ptr("Idle"), - // UpDown: to.Ptr("never"), - // V: to.Ptr[int32](4), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ExpressRouteCircuitStats.json -func ExampleExpressRouteCircuitsClient_GetStats() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewExpressRouteCircuitsClient().GetStats(ctx, "rg1", "circuitName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ExpressRouteCircuitStats = armnetwork.ExpressRouteCircuitStats{ - // PrimarybytesIn: to.Ptr[int64](537408), - // PrimarybytesOut: to.Ptr[int64](44032550), - // SecondarybytesIn: to.Ptr[int64](0), - // SecondarybytesOut: to.Ptr[int64](39002500), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ExpressRouteCircuitPeeringStats.json -func ExampleExpressRouteCircuitsClient_GetPeeringStats() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewExpressRouteCircuitsClient().GetPeeringStats(ctx, "rg1", "circuitName", "peeringName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ExpressRouteCircuitStats = armnetwork.ExpressRouteCircuitStats{ - // PrimarybytesIn: to.Ptr[int64](537408), - // PrimarybytesOut: to.Ptr[int64](44032550), - // SecondarybytesIn: to.Ptr[int64](0), - // SecondarybytesOut: to.Ptr[int64](39002500), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ExpressRouteCircuitListByResourceGroup.json -func ExampleExpressRouteCircuitsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewExpressRouteCircuitsClient().NewListPager("rg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ExpressRouteCircuitListResult = armnetwork.ExpressRouteCircuitListResult{ - // Value: []*armnetwork.ExpressRouteCircuit{ - // { - // Name: to.Ptr("circuitName1"), - // Type: to.Ptr("Microsoft.Network/expressRouteCircuits"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName1"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("W/\"832b28c3-f5fd-4d2a-a2cb-6e4a2fe452b3\""), - // Properties: &armnetwork.ExpressRouteCircuitPropertiesFormat{ - // AllowClassicOperations: to.Ptr(false), - // Authorizations: []*armnetwork.ExpressRouteCircuitAuthorization{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName/authorizations/MyAuthorization1"), - // Name: to.Ptr("MyAuthorization1"), - // Etag: to.Ptr("W/\"832b28c3-f5fd-4d2a-a2cb-6e4a2fe452b3\""), - // Properties: &armnetwork.AuthorizationPropertiesFormat{ - // AuthorizationKey: to.Ptr("authkey"), - // AuthorizationUseStatus: to.Ptr(armnetwork.AuthorizationUseStatusAvailable), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // CircuitProvisioningState: to.Ptr("Enabled"), - // GatewayManagerEtag: to.Ptr("113"), - // Peerings: []*armnetwork.ExpressRouteCircuitPeering{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ServiceKey: to.Ptr("a1410692-ed3b-4ceb-b94a-b90b95d398d1"), - // ServiceProviderProperties: &armnetwork.ExpressRouteCircuitServiceProviderProperties{ - // BandwidthInMbps: to.Ptr[int32](200), - // PeeringLocation: to.Ptr("peeringLocation"), - // ServiceProviderName: to.Ptr("providerName"), - // }, - // ServiceProviderProvisioningState: to.Ptr(armnetwork.ServiceProviderProvisioningStateProvisioned), - // }, - // SKU: &armnetwork.ExpressRouteCircuitSKU{ - // Name: to.Ptr("Standard_MeteredData"), - // Family: to.Ptr(armnetwork.ExpressRouteCircuitSKUFamilyMeteredData), - // Tier: to.Ptr(armnetwork.ExpressRouteCircuitSKUTierStandard), - // }, - // }, - // { - // Name: to.Ptr("circuitName2"), - // Type: to.Ptr("Microsoft.Network/expressRouteCircuits"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName2"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("W/\"e33c875f-48df-4a91-b7d3-eb95b5ddbb89\""), - // Properties: &armnetwork.ExpressRouteCircuitPropertiesFormat{ - // AllowClassicOperations: to.Ptr(false), - // Authorizations: []*armnetwork.ExpressRouteCircuitAuthorization{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName2/authorizations/MyAuthorization2"), - // Name: to.Ptr("MyAuthorization2"), - // Etag: to.Ptr("W/\"e33c875f-48df-4a91-b7d3-eb95b5ddbb89\""), - // Properties: &armnetwork.AuthorizationPropertiesFormat{ - // AuthorizationKey: to.Ptr("authkey"), - // AuthorizationUseStatus: to.Ptr(armnetwork.AuthorizationUseStatusAvailable), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // CircuitProvisioningState: to.Ptr("Enabled"), - // GatewayManagerEtag: to.Ptr(""), - // Peerings: []*armnetwork.ExpressRouteCircuitPeering{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ServiceKey: to.Ptr("6569625a-9ba4-498b-9719-14d778eef609"), - // ServiceProviderProperties: &armnetwork.ExpressRouteCircuitServiceProviderProperties{ - // BandwidthInMbps: to.Ptr[int32](200), - // PeeringLocation: to.Ptr("peeringLocation"), - // ServiceProviderName: to.Ptr("providerName"), - // }, - // ServiceProviderProvisioningState: to.Ptr(armnetwork.ServiceProviderProvisioningStateNotProvisioned), - // }, - // SKU: &armnetwork.ExpressRouteCircuitSKU{ - // Name: to.Ptr("Standard_MeteredData"), - // Family: to.Ptr(armnetwork.ExpressRouteCircuitSKUFamilyMeteredData), - // Tier: to.Ptr(armnetwork.ExpressRouteCircuitSKUTierStandard), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ExpressRouteCircuitListBySubscription.json -func ExampleExpressRouteCircuitsClient_NewListAllPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewExpressRouteCircuitsClient().NewListAllPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ExpressRouteCircuitListResult = armnetwork.ExpressRouteCircuitListResult{ - // Value: []*armnetwork.ExpressRouteCircuit{ - // { - // Name: to.Ptr("circuitName1"), - // Type: to.Ptr("Microsoft.Network/expressRouteCircuits"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName1"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("W/\"832b28c3-f5fd-4d2a-a2cb-6e4a2fe452b3\""), - // Properties: &armnetwork.ExpressRouteCircuitPropertiesFormat{ - // AllowClassicOperations: to.Ptr(false), - // Authorizations: []*armnetwork.ExpressRouteCircuitAuthorization{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName/authorizations/MyAuthorization1"), - // Name: to.Ptr("MyAuthorization1"), - // Etag: to.Ptr("W/\"832b28c3-f5fd-4d2a-a2cb-6e4a2fe452b3\""), - // Properties: &armnetwork.AuthorizationPropertiesFormat{ - // AuthorizationKey: to.Ptr("authkey"), - // AuthorizationUseStatus: to.Ptr(armnetwork.AuthorizationUseStatusAvailable), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // CircuitProvisioningState: to.Ptr("Enabled"), - // GatewayManagerEtag: to.Ptr("113"), - // Peerings: []*armnetwork.ExpressRouteCircuitPeering{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ServiceKey: to.Ptr("a1410692-ed3b-4ceb-b94a-b90b95d398d1"), - // ServiceProviderProperties: &armnetwork.ExpressRouteCircuitServiceProviderProperties{ - // BandwidthInMbps: to.Ptr[int32](200), - // PeeringLocation: to.Ptr("peeringLocation"), - // ServiceProviderName: to.Ptr("providerName"), - // }, - // ServiceProviderProvisioningState: to.Ptr(armnetwork.ServiceProviderProvisioningStateProvisioned), - // }, - // SKU: &armnetwork.ExpressRouteCircuitSKU{ - // Name: to.Ptr("Standard_MeteredData"), - // Family: to.Ptr(armnetwork.ExpressRouteCircuitSKUFamilyMeteredData), - // Tier: to.Ptr(armnetwork.ExpressRouteCircuitSKUTierStandard), - // }, - // }, - // { - // Name: to.Ptr("circuitName2"), - // Type: to.Ptr("Microsoft.Network/expressRouteCircuits"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName2"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("W/\"e33c875f-48df-4a91-b7d3-eb95b5ddbb89\""), - // Properties: &armnetwork.ExpressRouteCircuitPropertiesFormat{ - // AllowClassicOperations: to.Ptr(false), - // Authorizations: []*armnetwork.ExpressRouteCircuitAuthorization{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName2/authorizations/MyAuthorization2"), - // Name: to.Ptr("MyAuthorization2"), - // Etag: to.Ptr("W/\"e33c875f-48df-4a91-b7d3-eb95b5ddbb89\""), - // Properties: &armnetwork.AuthorizationPropertiesFormat{ - // AuthorizationKey: to.Ptr("authkey"), - // AuthorizationUseStatus: to.Ptr(armnetwork.AuthorizationUseStatusAvailable), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // CircuitProvisioningState: to.Ptr("Enabled"), - // GatewayManagerEtag: to.Ptr(""), - // Peerings: []*armnetwork.ExpressRouteCircuitPeering{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ServiceKey: to.Ptr("6569625a-9ba4-498b-9719-14d778eef609"), - // ServiceProviderProperties: &armnetwork.ExpressRouteCircuitServiceProviderProperties{ - // BandwidthInMbps: to.Ptr[int32](200), - // PeeringLocation: to.Ptr("peeringLocation"), - // ServiceProviderName: to.Ptr("providerName"), - // }, - // ServiceProviderProvisioningState: to.Ptr(armnetwork.ServiceProviderProvisioningStateNotProvisioned), - // }, - // SKU: &armnetwork.ExpressRouteCircuitSKU{ - // Name: to.Ptr("Standard_MeteredData"), - // Family: to.Ptr(armnetwork.ExpressRouteCircuitSKUFamilyMeteredData), - // Tier: to.Ptr(armnetwork.ExpressRouteCircuitSKUTierStandard), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/expressrouteconnections_client.go b/sdk/resourcemanager/network/armnetwork/expressrouteconnections_client.go index 490cd128a57b..76b8283db96a 100644 --- a/sdk/resourcemanager/network/armnetwork/expressrouteconnections_client.go +++ b/sdk/resourcemanager/network/armnetwork/expressrouteconnections_client.go @@ -47,7 +47,7 @@ func NewExpressRouteConnectionsClient(subscriptionID string, credential azcore.T // BeginCreateOrUpdate - Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - expressRouteGatewayName - The name of the ExpressRoute gateway. // - connectionName - The name of the connection subresource. @@ -72,7 +72,7 @@ func (client *ExpressRouteConnectionsClient) BeginCreateOrUpdate(ctx context.Con // CreateOrUpdate - Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *ExpressRouteConnectionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, connectionName string, putExpressRouteConnectionParameters ExpressRouteConnection, options *ExpressRouteConnectionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ExpressRouteConnectionsClient.BeginCreateOrUpdate" @@ -118,7 +118,7 @@ func (client *ExpressRouteConnectionsClient) createOrUpdateCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, putExpressRouteConnectionParameters); err != nil { @@ -130,7 +130,7 @@ func (client *ExpressRouteConnectionsClient) createOrUpdateCreateRequest(ctx con // BeginDelete - Deletes a connection to a ExpressRoute circuit. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - expressRouteGatewayName - The name of the ExpressRoute gateway. // - connectionName - The name of the connection subresource. @@ -154,7 +154,7 @@ func (client *ExpressRouteConnectionsClient) BeginDelete(ctx context.Context, re // Delete - Deletes a connection to a ExpressRoute circuit. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *ExpressRouteConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, connectionName string, options *ExpressRouteConnectionsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ExpressRouteConnectionsClient.BeginDelete" @@ -200,7 +200,7 @@ func (client *ExpressRouteConnectionsClient) deleteCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -209,7 +209,7 @@ func (client *ExpressRouteConnectionsClient) deleteCreateRequest(ctx context.Con // Get - Gets the specified ExpressRouteConnection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - expressRouteGatewayName - The name of the ExpressRoute gateway. // - connectionName - The name of the ExpressRoute connection. @@ -261,7 +261,7 @@ func (client *ExpressRouteConnectionsClient) getCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -279,7 +279,7 @@ func (client *ExpressRouteConnectionsClient) getHandleResponse(resp *http.Respon // List - Lists ExpressRouteConnections. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - expressRouteGatewayName - The name of the ExpressRoute gateway. // - options - ExpressRouteConnectionsClientListOptions contains the optional parameters for the ExpressRouteConnectionsClient.List @@ -326,7 +326,7 @@ func (client *ExpressRouteConnectionsClient) listCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/expressrouteconnections_client_example_test.go b/sdk/resourcemanager/network/armnetwork/expressrouteconnections_client_example_test.go deleted file mode 100644 index 11144ebc2fab..000000000000 --- a/sdk/resourcemanager/network/armnetwork/expressrouteconnections_client_example_test.go +++ /dev/null @@ -1,266 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ExpressRouteConnectionCreate.json -func ExampleExpressRouteConnectionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewExpressRouteConnectionsClient().BeginCreateOrUpdate(ctx, "resourceGroupName", "gateway-2", "connectionName", armnetwork.ExpressRouteConnection{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteGateways/gateway-2/expressRouteConnections/connectionName"), - Name: to.Ptr("connectionName"), - Properties: &armnetwork.ExpressRouteConnectionProperties{ - AuthorizationKey: to.Ptr("authorizationKey"), - ExpressRouteCircuitPeering: &armnetwork.ExpressRouteCircuitPeeringID{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/AzurePrivatePeering"), - }, - RoutingConfiguration: &armnetwork.RoutingConfiguration{ - AssociatedRouteTable: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable1"), - }, - InboundRouteMap: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1"), - }, - OutboundRouteMap: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap2"), - }, - PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ - IDs: []*armnetwork.SubResource{ - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable1"), - }, - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable2"), - }, - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable3"), - }}, - Labels: []*string{ - to.Ptr("label1"), - to.Ptr("label2")}, - }, - }, - RoutingWeight: to.Ptr[int32](2), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ExpressRouteConnection = armnetwork.ExpressRouteConnection{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteGateways/gateway-2/expressRouteConnections/connectionName"), - // Name: to.Ptr("connectionName"), - // Properties: &armnetwork.ExpressRouteConnectionProperties{ - // AuthorizationKey: to.Ptr("authorizationKey"), - // EnableInternetSecurity: to.Ptr(false), - // EnablePrivateLinkFastPath: to.Ptr(false), - // ExpressRouteCircuitPeering: &armnetwork.ExpressRouteCircuitPeeringID{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/AzurePrivatePeering"), - // }, - // ExpressRouteGatewayBypass: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RoutingConfiguration: &armnetwork.RoutingConfiguration{ - // AssociatedRouteTable: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable1"), - // }, - // InboundRouteMap: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1"), - // }, - // OutboundRouteMap: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap2"), - // }, - // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ - // IDs: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable2"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable3"), - // }}, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, - // }, - // }, - // RoutingWeight: to.Ptr[int32](2), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ExpressRouteConnectionGet.json -func ExampleExpressRouteConnectionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewExpressRouteConnectionsClient().Get(ctx, "resourceGroupName", "expressRouteGatewayName", "connectionName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ExpressRouteConnection = armnetwork.ExpressRouteConnection{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName/expressRouteConnections/connectionName"), - // Name: to.Ptr("connectionName"), - // Properties: &armnetwork.ExpressRouteConnectionProperties{ - // AuthorizationKey: to.Ptr("authorizationKey"), - // EnableInternetSecurity: to.Ptr(false), - // EnablePrivateLinkFastPath: to.Ptr(false), - // ExpressRouteCircuitPeering: &armnetwork.ExpressRouteCircuitPeeringID{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/AzurePrivatePeering"), - // }, - // ExpressRouteGatewayBypass: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RoutingConfiguration: &armnetwork.RoutingConfiguration{ - // AssociatedRouteTable: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable1"), - // }, - // InboundRouteMap: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1"), - // }, - // OutboundRouteMap: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap2"), - // }, - // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ - // IDs: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable2"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable3"), - // }}, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, - // }, - // }, - // RoutingWeight: to.Ptr[int32](1), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ExpressRouteConnectionDelete.json -func ExampleExpressRouteConnectionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewExpressRouteConnectionsClient().BeginDelete(ctx, "resourceGroupName", "expressRouteGatewayName", "connectionName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ExpressRouteConnectionList.json -func ExampleExpressRouteConnectionsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewExpressRouteConnectionsClient().List(ctx, "resourceGroupName", "expressRouteGatewayName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ExpressRouteConnectionList = armnetwork.ExpressRouteConnectionList{ - // Value: []*armnetwork.ExpressRouteConnection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName/expressRouteConnections/connectionName"), - // Name: to.Ptr("connectionName"), - // Properties: &armnetwork.ExpressRouteConnectionProperties{ - // AuthorizationKey: to.Ptr("authorizationKey"), - // EnableInternetSecurity: to.Ptr(false), - // EnablePrivateLinkFastPath: to.Ptr(false), - // ExpressRouteCircuitPeering: &armnetwork.ExpressRouteCircuitPeeringID{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/AzurePrivatePeering"), - // }, - // ExpressRouteGatewayBypass: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RoutingConfiguration: &armnetwork.RoutingConfiguration{ - // AssociatedRouteTable: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable1"), - // }, - // InboundRouteMap: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1"), - // }, - // OutboundRouteMap: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap2"), - // }, - // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ - // IDs: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable2"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable3"), - // }}, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, - // }, - // }, - // RoutingWeight: to.Ptr[int32](1), - // }, - // }}, - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/expressroutecrossconnectionpeerings_client.go b/sdk/resourcemanager/network/armnetwork/expressroutecrossconnectionpeerings_client.go index 4723fc87fcd6..e3b53ba2c944 100644 --- a/sdk/resourcemanager/network/armnetwork/expressroutecrossconnectionpeerings_client.go +++ b/sdk/resourcemanager/network/armnetwork/expressroutecrossconnectionpeerings_client.go @@ -47,7 +47,7 @@ func NewExpressRouteCrossConnectionPeeringsClient(subscriptionID string, credent // BeginCreateOrUpdate - Creates or updates a peering in the specified ExpressRouteCrossConnection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - crossConnectionName - The name of the ExpressRouteCrossConnection. // - peeringName - The name of the peering. @@ -72,7 +72,7 @@ func (client *ExpressRouteCrossConnectionPeeringsClient) BeginCreateOrUpdate(ctx // CreateOrUpdate - Creates or updates a peering in the specified ExpressRouteCrossConnection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *ExpressRouteCrossConnectionPeeringsClient) createOrUpdate(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, peeringParameters ExpressRouteCrossConnectionPeering, options *ExpressRouteCrossConnectionPeeringsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ExpressRouteCrossConnectionPeeringsClient.BeginCreateOrUpdate" @@ -118,7 +118,7 @@ func (client *ExpressRouteCrossConnectionPeeringsClient) createOrUpdateCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, peeringParameters); err != nil { @@ -130,7 +130,7 @@ func (client *ExpressRouteCrossConnectionPeeringsClient) createOrUpdateCreateReq // BeginDelete - Deletes the specified peering from the ExpressRouteCrossConnection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - crossConnectionName - The name of the ExpressRouteCrossConnection. // - peeringName - The name of the peering. @@ -154,7 +154,7 @@ func (client *ExpressRouteCrossConnectionPeeringsClient) BeginDelete(ctx context // Delete - Deletes the specified peering from the ExpressRouteCrossConnection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *ExpressRouteCrossConnectionPeeringsClient) deleteOperation(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, options *ExpressRouteCrossConnectionPeeringsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ExpressRouteCrossConnectionPeeringsClient.BeginDelete" @@ -200,7 +200,7 @@ func (client *ExpressRouteCrossConnectionPeeringsClient) deleteCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -209,7 +209,7 @@ func (client *ExpressRouteCrossConnectionPeeringsClient) deleteCreateRequest(ctx // Get - Gets the specified peering for the ExpressRouteCrossConnection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - crossConnectionName - The name of the ExpressRouteCrossConnection. // - peeringName - The name of the peering. @@ -261,7 +261,7 @@ func (client *ExpressRouteCrossConnectionPeeringsClient) getCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -278,7 +278,7 @@ func (client *ExpressRouteCrossConnectionPeeringsClient) getHandleResponse(resp // NewListPager - Gets all peerings in a specified ExpressRouteCrossConnection. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - crossConnectionName - The name of the ExpressRouteCrossConnection. // - options - ExpressRouteCrossConnectionPeeringsClientListOptions contains the optional parameters for the ExpressRouteCrossConnectionPeeringsClient.NewListPager @@ -333,7 +333,7 @@ func (client *ExpressRouteCrossConnectionPeeringsClient) listCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/expressroutecrossconnectionpeerings_client_example_test.go b/sdk/resourcemanager/network/armnetwork/expressroutecrossconnectionpeerings_client_example_test.go deleted file mode 100644 index b29df0abf0d3..000000000000 --- a/sdk/resourcemanager/network/armnetwork/expressroutecrossconnectionpeerings_client_example_test.go +++ /dev/null @@ -1,195 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ExpressRouteCrossConnectionBgpPeeringList.json -func ExampleExpressRouteCrossConnectionPeeringsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewExpressRouteCrossConnectionPeeringsClient().NewListPager("CrossConnection-SiliconValley", "", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ExpressRouteCrossConnectionPeeringList = armnetwork.ExpressRouteCrossConnectionPeeringList{ - // Value: []*armnetwork.ExpressRouteCrossConnectionPeering{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/CrossConnection-SiliconValley/providers/Microsoft.Network/expressRouteCrossConnections//peerings/AzurePrivatePeering"), - // Name: to.Ptr("AzurePrivatePeering"), - // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), - // Properties: &armnetwork.ExpressRouteCrossConnectionPeeringProperties{ - // AzureASN: to.Ptr[int32](12076), - // GatewayManagerEtag: to.Ptr(""), - // IPv6PeeringConfig: &armnetwork.IPv6ExpressRouteCircuitPeeringConfig{ - // PrimaryPeerAddressPrefix: to.Ptr("3FFE:FFFF:0:CD30::/126"), - // SecondaryPeerAddressPrefix: to.Ptr("3FFE:FFFF:0:CD30::4/126"), - // State: to.Ptr(armnetwork.ExpressRouteCircuitPeeringStateEnabled), - // }, - // LastModifiedBy: to.Ptr("Customer"), - // PeerASN: to.Ptr[int64](200), - // PeeringType: to.Ptr(armnetwork.ExpressRoutePeeringTypeAzurePrivatePeering), - // PrimaryAzurePort: to.Ptr(""), - // PrimaryPeerAddressPrefix: to.Ptr("192.168.16.252/30"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SecondaryAzurePort: to.Ptr(""), - // SecondaryPeerAddressPrefix: to.Ptr("192.168.18.252/30"), - // State: to.Ptr(armnetwork.ExpressRoutePeeringStateEnabled), - // VlanID: to.Ptr[int32](200), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ExpressRouteCrossConnectionBgpPeeringDelete.json -func ExampleExpressRouteCrossConnectionPeeringsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewExpressRouteCrossConnectionPeeringsClient().BeginDelete(ctx, "CrossConnection-SiliconValley", "", "AzurePrivatePeering", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ExpressRouteCrossConnectionBgpPeeringGet.json -func ExampleExpressRouteCrossConnectionPeeringsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewExpressRouteCrossConnectionPeeringsClient().Get(ctx, "CrossConnection-SiliconValley", "", "AzurePrivatePeering", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ExpressRouteCrossConnectionPeering = armnetwork.ExpressRouteCrossConnectionPeering{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/CrossConnection-Boydton1DC/providers/Microsoft.Network/expressRouteCrossConnections//peerings/AzurePrivatePeering"), - // Name: to.Ptr("AzurePrivatePeering"), - // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), - // Properties: &armnetwork.ExpressRouteCrossConnectionPeeringProperties{ - // AzureASN: to.Ptr[int32](12076), - // GatewayManagerEtag: to.Ptr(""), - // IPv6PeeringConfig: &armnetwork.IPv6ExpressRouteCircuitPeeringConfig{ - // PrimaryPeerAddressPrefix: to.Ptr("3FFE:FFFF:0:CD30::/126"), - // SecondaryPeerAddressPrefix: to.Ptr("3FFE:FFFF:0:CD30::4/126"), - // State: to.Ptr(armnetwork.ExpressRouteCircuitPeeringStateEnabled), - // }, - // LastModifiedBy: to.Ptr("Customer"), - // PeerASN: to.Ptr[int64](200), - // PeeringType: to.Ptr(armnetwork.ExpressRoutePeeringTypeAzurePrivatePeering), - // PrimaryAzurePort: to.Ptr(""), - // PrimaryPeerAddressPrefix: to.Ptr("192.168.16.252/30"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SecondaryAzurePort: to.Ptr(""), - // SecondaryPeerAddressPrefix: to.Ptr("192.168.18.252/30"), - // State: to.Ptr(armnetwork.ExpressRoutePeeringStateEnabled), - // VlanID: to.Ptr[int32](200), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ExpressRouteCrossConnectionBgpPeeringCreate.json -func ExampleExpressRouteCrossConnectionPeeringsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewExpressRouteCrossConnectionPeeringsClient().BeginCreateOrUpdate(ctx, "CrossConnection-SiliconValley", "", "AzurePrivatePeering", armnetwork.ExpressRouteCrossConnectionPeering{ - Properties: &armnetwork.ExpressRouteCrossConnectionPeeringProperties{ - IPv6PeeringConfig: &armnetwork.IPv6ExpressRouteCircuitPeeringConfig{ - PrimaryPeerAddressPrefix: to.Ptr("3FFE:FFFF:0:CD30::/126"), - SecondaryPeerAddressPrefix: to.Ptr("3FFE:FFFF:0:CD30::4/126"), - }, - PeerASN: to.Ptr[int64](200), - PrimaryPeerAddressPrefix: to.Ptr("192.168.16.252/30"), - SecondaryPeerAddressPrefix: to.Ptr("192.168.18.252/30"), - VlanID: to.Ptr[int32](200), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ExpressRouteCrossConnectionPeering = armnetwork.ExpressRouteCrossConnectionPeering{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/CrossConnection-Boydton1DC/providers/Microsoft.Network/expressRouteCrossConnections//peerings/AzurePrivatePeering"), - // Name: to.Ptr("AzurePrivatePeering"), - // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), - // Properties: &armnetwork.ExpressRouteCrossConnectionPeeringProperties{ - // AzureASN: to.Ptr[int32](12076), - // GatewayManagerEtag: to.Ptr(""), - // IPv6PeeringConfig: &armnetwork.IPv6ExpressRouteCircuitPeeringConfig{ - // PrimaryPeerAddressPrefix: to.Ptr("3FFE:FFFF:0:CD30::/126"), - // SecondaryPeerAddressPrefix: to.Ptr("3FFE:FFFF:0:CD30::4/126"), - // State: to.Ptr(armnetwork.ExpressRouteCircuitPeeringStateEnabled), - // }, - // LastModifiedBy: to.Ptr("Customer"), - // PeerASN: to.Ptr[int64](200), - // PeeringType: to.Ptr(armnetwork.ExpressRoutePeeringTypeAzurePrivatePeering), - // PrimaryAzurePort: to.Ptr(""), - // PrimaryPeerAddressPrefix: to.Ptr("192.168.16.252/30"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SecondaryAzurePort: to.Ptr(""), - // SecondaryPeerAddressPrefix: to.Ptr("192.168.18.252/30"), - // State: to.Ptr(armnetwork.ExpressRoutePeeringStateEnabled), - // VlanID: to.Ptr[int32](200), - // }, - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/expressroutecrossconnections_client.go b/sdk/resourcemanager/network/armnetwork/expressroutecrossconnections_client.go index 43cf6abe7958..8a3a8c21adc6 100644 --- a/sdk/resourcemanager/network/armnetwork/expressroutecrossconnections_client.go +++ b/sdk/resourcemanager/network/armnetwork/expressroutecrossconnections_client.go @@ -47,7 +47,7 @@ func NewExpressRouteCrossConnectionsClient(subscriptionID string, credential azc // BeginCreateOrUpdate - Update the specified ExpressRouteCrossConnection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - crossConnectionName - The name of the ExpressRouteCrossConnection. // - parameters - Parameters supplied to the update express route crossConnection operation. @@ -71,7 +71,7 @@ func (client *ExpressRouteCrossConnectionsClient) BeginCreateOrUpdate(ctx contex // CreateOrUpdate - Update the specified ExpressRouteCrossConnection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *ExpressRouteCrossConnectionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, crossConnectionName string, parameters ExpressRouteCrossConnection, options *ExpressRouteCrossConnectionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ExpressRouteCrossConnectionsClient.BeginCreateOrUpdate" @@ -113,7 +113,7 @@ func (client *ExpressRouteCrossConnectionsClient) createOrUpdateCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -125,7 +125,7 @@ func (client *ExpressRouteCrossConnectionsClient) createOrUpdateCreateRequest(ct // Get - Gets details about the specified ExpressRouteCrossConnection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group (peering location of the circuit). // - crossConnectionName - The name of the ExpressRouteCrossConnection (service key of the circuit). // - options - ExpressRouteCrossConnectionsClientGetOptions contains the optional parameters for the ExpressRouteCrossConnectionsClient.Get @@ -172,7 +172,7 @@ func (client *ExpressRouteCrossConnectionsClient) getCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -189,7 +189,7 @@ func (client *ExpressRouteCrossConnectionsClient) getHandleResponse(resp *http.R // NewListPager - Retrieves all the ExpressRouteCrossConnections in a subscription. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - options - ExpressRouteCrossConnectionsClientListOptions contains the optional parameters for the ExpressRouteCrossConnectionsClient.NewListPager // method. func (client *ExpressRouteCrossConnectionsClient) NewListPager(options *ExpressRouteCrossConnectionsClientListOptions) *runtime.Pager[ExpressRouteCrossConnectionsClientListResponse] { @@ -234,7 +234,7 @@ func (client *ExpressRouteCrossConnectionsClient) listCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -253,7 +253,7 @@ func (client *ExpressRouteCrossConnectionsClient) listHandleResponse(resp *http. // group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - crossConnectionName - The name of the ExpressRouteCrossConnection. // - peeringName - The name of the peering. @@ -279,7 +279,7 @@ func (client *ExpressRouteCrossConnectionsClient) BeginListArpTable(ctx context. // group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *ExpressRouteCrossConnectionsClient) listArpTable(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, devicePath string, options *ExpressRouteCrossConnectionsClientBeginListArpTableOptions) (*http.Response, error) { var err error const operationName = "ExpressRouteCrossConnectionsClient.BeginListArpTable" @@ -329,7 +329,7 @@ func (client *ExpressRouteCrossConnectionsClient) listArpTableCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -337,7 +337,7 @@ func (client *ExpressRouteCrossConnectionsClient) listArpTableCreateRequest(ctx // NewListByResourceGroupPager - Retrieves all the ExpressRouteCrossConnections in a resource group. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - options - ExpressRouteCrossConnectionsClientListByResourceGroupOptions contains the optional parameters for the ExpressRouteCrossConnectionsClient.NewListByResourceGroupPager // method. @@ -387,7 +387,7 @@ func (client *ExpressRouteCrossConnectionsClient) listByResourceGroupCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -406,7 +406,7 @@ func (client *ExpressRouteCrossConnectionsClient) listByResourceGroupHandleRespo // a resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - crossConnectionName - The name of the ExpressRouteCrossConnection. // - peeringName - The name of the peering. @@ -432,7 +432,7 @@ func (client *ExpressRouteCrossConnectionsClient) BeginListRoutesTable(ctx conte // group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *ExpressRouteCrossConnectionsClient) listRoutesTable(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, devicePath string, options *ExpressRouteCrossConnectionsClientBeginListRoutesTableOptions) (*http.Response, error) { var err error const operationName = "ExpressRouteCrossConnectionsClient.BeginListRoutesTable" @@ -482,7 +482,7 @@ func (client *ExpressRouteCrossConnectionsClient) listRoutesTableCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -492,7 +492,7 @@ func (client *ExpressRouteCrossConnectionsClient) listRoutesTableCreateRequest(c // group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - crossConnectionName - The name of the ExpressRouteCrossConnection. // - peeringName - The name of the peering. @@ -518,7 +518,7 @@ func (client *ExpressRouteCrossConnectionsClient) BeginListRoutesTableSummary(ct // group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *ExpressRouteCrossConnectionsClient) listRoutesTableSummary(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, devicePath string, options *ExpressRouteCrossConnectionsClientBeginListRoutesTableSummaryOptions) (*http.Response, error) { var err error const operationName = "ExpressRouteCrossConnectionsClient.BeginListRoutesTableSummary" @@ -568,7 +568,7 @@ func (client *ExpressRouteCrossConnectionsClient) listRoutesTableSummaryCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -577,7 +577,7 @@ func (client *ExpressRouteCrossConnectionsClient) listRoutesTableSummaryCreateRe // UpdateTags - Updates an express route cross connection tags. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - crossConnectionName - The name of the cross connection. // - crossConnectionParameters - Parameters supplied to update express route cross connection tags. @@ -625,7 +625,7 @@ func (client *ExpressRouteCrossConnectionsClient) updateTagsCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, crossConnectionParameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/expressroutecrossconnections_client_example_test.go b/sdk/resourcemanager/network/armnetwork/expressroutecrossconnections_client_example_test.go deleted file mode 100644 index 24474f415af5..000000000000 --- a/sdk/resourcemanager/network/armnetwork/expressroutecrossconnections_client_example_test.go +++ /dev/null @@ -1,366 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ExpressRouteCrossConnectionList.json -func ExampleExpressRouteCrossConnectionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewExpressRouteCrossConnectionsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ExpressRouteCrossConnectionListResult = armnetwork.ExpressRouteCrossConnectionListResult{ - // Value: []*armnetwork.ExpressRouteCrossConnection{ - // { - // Name: to.Ptr(""), - // Type: to.Ptr("Microsoft.Network/expressRouteCrossConnections"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/CrossConnectionSiliconValley/providers/Microsoft.Network/expressRouteCrossConnections/"), - // Location: to.Ptr("brazilsouth"), - // Properties: &armnetwork.ExpressRouteCrossConnectionProperties{ - // BandwidthInMbps: to.Ptr[int32](1000), - // ExpressRouteCircuit: &armnetwork.ExpressRouteCircuitReference{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/ertest/providers/Microsoft.Network/expressRouteCircuits/er1"), - // }, - // PeeringLocation: to.Ptr("SiliconValley"), - // Peerings: []*armnetwork.ExpressRouteCrossConnectionPeering{ - // }, - // PrimaryAzurePort: to.Ptr("bvtazureixp01"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // STag: to.Ptr[int32](2), - // SecondaryAzurePort: to.Ptr("bvtazureixp01"), - // ServiceProviderProvisioningState: to.Ptr(armnetwork.ServiceProviderProvisioningStateNotProvisioned), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ExpressRouteCrossConnectionListByResourceGroup.json -func ExampleExpressRouteCrossConnectionsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewExpressRouteCrossConnectionsClient().NewListByResourceGroupPager("CrossConnection-SiliconValley", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ExpressRouteCrossConnectionListResult = armnetwork.ExpressRouteCrossConnectionListResult{ - // Value: []*armnetwork.ExpressRouteCrossConnection{ - // { - // Name: to.Ptr(""), - // Type: to.Ptr("Microsoft.Network/expressRouteCrossConnections"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/CrossConnectionSilicon-Valley/providers/Microsoft.Network/expressRouteCrossConnections/"), - // Location: to.Ptr("brazilsouth"), - // Properties: &armnetwork.ExpressRouteCrossConnectionProperties{ - // BandwidthInMbps: to.Ptr[int32](1000), - // ExpressRouteCircuit: &armnetwork.ExpressRouteCircuitReference{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/ertest/providers/Microsoft.Network/expressRouteCircuits/er1"), - // }, - // PeeringLocation: to.Ptr("SiliconValley"), - // Peerings: []*armnetwork.ExpressRouteCrossConnectionPeering{ - // }, - // PrimaryAzurePort: to.Ptr("bvtazureixp01"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // STag: to.Ptr[int32](2), - // SecondaryAzurePort: to.Ptr("bvtazureixp01"), - // ServiceProviderProvisioningState: to.Ptr(armnetwork.ServiceProviderProvisioningStateNotProvisioned), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ExpressRouteCrossConnectionGet.json -func ExampleExpressRouteCrossConnectionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewExpressRouteCrossConnectionsClient().Get(ctx, "CrossConnection-SiliconValley", "", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ExpressRouteCrossConnection = armnetwork.ExpressRouteCrossConnection{ - // Name: to.Ptr(""), - // Type: to.Ptr("Microsoft.Network/expressRouteCrossConnections"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/CrossConnection-SiliconValley/providers/Microsoft.Network/expressRouteCrossConnections/"), - // Location: to.Ptr("brazilsouth"), - // Etag: to.Ptr("W/\"c0e6477e-8150-4d4f-9bf6-bb10e6acb63a\""), - // Properties: &armnetwork.ExpressRouteCrossConnectionProperties{ - // BandwidthInMbps: to.Ptr[int32](1000), - // ExpressRouteCircuit: &armnetwork.ExpressRouteCircuitReference{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/ertest/providers/Microsoft.Network/expressRouteCircuits/er1"), - // }, - // PeeringLocation: to.Ptr("SiliconValley"), - // Peerings: []*armnetwork.ExpressRouteCrossConnectionPeering{ - // }, - // PrimaryAzurePort: to.Ptr("bvtazureixp01"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // STag: to.Ptr[int32](2), - // SecondaryAzurePort: to.Ptr("bvtazureixp01"), - // ServiceProviderProvisioningState: to.Ptr(armnetwork.ServiceProviderProvisioningStateNotProvisioned), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ExpressRouteCrossConnectionUpdate.json -func ExampleExpressRouteCrossConnectionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewExpressRouteCrossConnectionsClient().BeginCreateOrUpdate(ctx, "CrossConnection-SiliconValley", "", armnetwork.ExpressRouteCrossConnection{ - Properties: &armnetwork.ExpressRouteCrossConnectionProperties{ - ServiceProviderProvisioningState: to.Ptr(armnetwork.ServiceProviderProvisioningStateNotProvisioned), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ExpressRouteCrossConnection = armnetwork.ExpressRouteCrossConnection{ - // Name: to.Ptr(""), - // Type: to.Ptr("Microsoft.Network/expressRouteCrossConnections"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/CrossConnectionSiliconValley/providers/Microsoft.Network/expressRouteCrossConnections/"), - // Location: to.Ptr("brazilsouth"), - // Properties: &armnetwork.ExpressRouteCrossConnectionProperties{ - // BandwidthInMbps: to.Ptr[int32](1000), - // ExpressRouteCircuit: &armnetwork.ExpressRouteCircuitReference{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/ertest/providers/Microsoft.Network/expressRouteCircuits/er1"), - // }, - // PeeringLocation: to.Ptr("SiliconValley"), - // Peerings: []*armnetwork.ExpressRouteCrossConnectionPeering{ - // }, - // PrimaryAzurePort: to.Ptr("bvtazureixp01"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // STag: to.Ptr[int32](2), - // SecondaryAzurePort: to.Ptr("bvtazureixp01"), - // ServiceProviderProvisioningState: to.Ptr(armnetwork.ServiceProviderProvisioningStateNotProvisioned), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ExpressRouteCrossConnectionUpdateTags.json -func ExampleExpressRouteCrossConnectionsClient_UpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewExpressRouteCrossConnectionsClient().UpdateTags(ctx, "CrossConnection-SiliconValley", "", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ExpressRouteCrossConnection = armnetwork.ExpressRouteCrossConnection{ - // Name: to.Ptr("er1"), - // Type: to.Ptr("Microsoft.Network/expressRouteCrossConnections"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/CrossConnectionSiliconValley/providers/Microsoft.Network/expressRouteCrossConnections/"), - // Location: to.Ptr("brazilsouth"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armnetwork.ExpressRouteCrossConnectionProperties{ - // BandwidthInMbps: to.Ptr[int32](1000), - // ExpressRouteCircuit: &armnetwork.ExpressRouteCircuitReference{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/ertest/providers/Microsoft.Network/expressRouteCircuits/er1"), - // }, - // PeeringLocation: to.Ptr("SiliconValley"), - // Peerings: []*armnetwork.ExpressRouteCrossConnectionPeering{ - // }, - // PrimaryAzurePort: to.Ptr("bvtazureixp01"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // STag: to.Ptr[int32](2), - // SecondaryAzurePort: to.Ptr("bvtazureixp01"), - // ServiceProviderProvisioningState: to.Ptr(armnetwork.ServiceProviderProvisioningStateNotProvisioned), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ExpressRouteCrossConnectionsArpTable.json -func ExampleExpressRouteCrossConnectionsClient_BeginListArpTable() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewExpressRouteCrossConnectionsClient().BeginListArpTable(ctx, "CrossConnection-SiliconValley", "", "AzurePrivatePeering", "primary", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ExpressRouteCircuitsArpTableListResult = armnetwork.ExpressRouteCircuitsArpTableListResult{ - // Value: []*armnetwork.ExpressRouteCircuitArpTable{ - // { - // Age: to.Ptr[int32](0), - // Interface: to.Ptr("Microsoft"), - // IPAddress: to.Ptr("192.116.14.254"), - // MacAddress: to.Ptr("885a.9269.9110"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ExpressRouteCrossConnectionsRouteTableSummary.json -func ExampleExpressRouteCrossConnectionsClient_BeginListRoutesTableSummary() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewExpressRouteCrossConnectionsClient().BeginListRoutesTableSummary(ctx, "CrossConnection-SiliconValley", "", "AzurePrivatePeering", "primary", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ExpressRouteCrossConnectionsRoutesTableSummaryListResult = armnetwork.ExpressRouteCrossConnectionsRoutesTableSummaryListResult{ - // Value: []*armnetwork.ExpressRouteCrossConnectionRoutesTableSummary{ - // { - // Asn: to.Ptr[int32](65514), - // Neighbor: to.Ptr("10.6.1.112"), - // StateOrPrefixesReceived: to.Ptr("Active"), - // UpDown: to.Ptr("1d14h"), - // }, - // { - // Asn: to.Ptr[int32](65514), - // Neighbor: to.Ptr("10.6.1.113"), - // StateOrPrefixesReceived: to.Ptr("1"), - // UpDown: to.Ptr("1d14h"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ExpressRouteCrossConnectionsRouteTable.json -func ExampleExpressRouteCrossConnectionsClient_BeginListRoutesTable() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewExpressRouteCrossConnectionsClient().BeginListRoutesTable(ctx, "CrossConnection-SiliconValley", "", "AzurePrivatePeering", "primary", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ExpressRouteCircuitsRoutesTableListResult = armnetwork.ExpressRouteCircuitsRoutesTableListResult{ - // Value: []*armnetwork.ExpressRouteCircuitRoutesTable{ - // { - // Path: to.Ptr("65514"), - // LocPrf: to.Ptr(""), - // Network: to.Ptr("10.6.0.0/16"), - // NextHop: to.Ptr("10.6.1.12"), - // Weight: to.Ptr[int32](0), - // }, - // { - // Path: to.Ptr("65514"), - // LocPrf: to.Ptr(""), - // Network: to.Ptr("10.7.0.0/16"), - // NextHop: to.Ptr("10.7.1.13"), - // Weight: to.Ptr[int32](0), - // }}, - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/expressroutegateways_client.go b/sdk/resourcemanager/network/armnetwork/expressroutegateways_client.go index 28bec4265e9c..f0b026399efc 100644 --- a/sdk/resourcemanager/network/armnetwork/expressroutegateways_client.go +++ b/sdk/resourcemanager/network/armnetwork/expressroutegateways_client.go @@ -47,7 +47,7 @@ func NewExpressRouteGatewaysClient(subscriptionID string, credential azcore.Toke // BeginCreateOrUpdate - Creates or updates a ExpressRoute gateway in a specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - expressRouteGatewayName - The name of the ExpressRoute gateway. // - putExpressRouteGatewayParameters - Parameters required in an ExpressRoute gateway PUT operation. @@ -71,7 +71,7 @@ func (client *ExpressRouteGatewaysClient) BeginCreateOrUpdate(ctx context.Contex // CreateOrUpdate - Creates or updates a ExpressRoute gateway in a specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *ExpressRouteGatewaysClient) createOrUpdate(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, putExpressRouteGatewayParameters ExpressRouteGateway, options *ExpressRouteGatewaysClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ExpressRouteGatewaysClient.BeginCreateOrUpdate" @@ -113,7 +113,7 @@ func (client *ExpressRouteGatewaysClient) createOrUpdateCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, putExpressRouteGatewayParameters); err != nil { @@ -126,7 +126,7 @@ func (client *ExpressRouteGatewaysClient) createOrUpdateCreateRequest(ctx contex // be deleted when there are no connection subresources. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - expressRouteGatewayName - The name of the ExpressRoute gateway. // - options - ExpressRouteGatewaysClientBeginDeleteOptions contains the optional parameters for the ExpressRouteGatewaysClient.BeginDelete @@ -150,7 +150,7 @@ func (client *ExpressRouteGatewaysClient) BeginDelete(ctx context.Context, resou // when there are no connection subresources. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *ExpressRouteGatewaysClient) deleteOperation(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, options *ExpressRouteGatewaysClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ExpressRouteGatewaysClient.BeginDelete" @@ -192,7 +192,7 @@ func (client *ExpressRouteGatewaysClient) deleteCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -201,7 +201,7 @@ func (client *ExpressRouteGatewaysClient) deleteCreateRequest(ctx context.Contex // Get - Fetches the details of a ExpressRoute gateway in a resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - expressRouteGatewayName - The name of the ExpressRoute gateway. // - options - ExpressRouteGatewaysClientGetOptions contains the optional parameters for the ExpressRouteGatewaysClient.Get @@ -248,7 +248,7 @@ func (client *ExpressRouteGatewaysClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -266,7 +266,7 @@ func (client *ExpressRouteGatewaysClient) getHandleResponse(resp *http.Response) // ListByResourceGroup - Lists ExpressRoute gateways in a given resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - options - ExpressRouteGatewaysClientListByResourceGroupOptions contains the optional parameters for the ExpressRouteGatewaysClient.ListByResourceGroup // method. @@ -308,7 +308,7 @@ func (client *ExpressRouteGatewaysClient) listByResourceGroupCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -326,7 +326,7 @@ func (client *ExpressRouteGatewaysClient) listByResourceGroupHandleResponse(resp // ListBySubscription - Lists ExpressRoute gateways under a given subscription. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - options - ExpressRouteGatewaysClientListBySubscriptionOptions contains the optional parameters for the ExpressRouteGatewaysClient.ListBySubscription // method. func (client *ExpressRouteGatewaysClient) ListBySubscription(ctx context.Context, options *ExpressRouteGatewaysClientListBySubscriptionOptions) (ExpressRouteGatewaysClientListBySubscriptionResponse, error) { @@ -363,7 +363,7 @@ func (client *ExpressRouteGatewaysClient) listBySubscriptionCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -381,7 +381,7 @@ func (client *ExpressRouteGatewaysClient) listBySubscriptionHandleResponse(resp // BeginUpdateTags - Updates express route gateway tags. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the ExpressRouteGateway. // - expressRouteGatewayName - The name of the gateway. // - expressRouteGatewayParameters - Parameters supplied to update a virtual wan express route gateway tags. @@ -405,7 +405,7 @@ func (client *ExpressRouteGatewaysClient) BeginUpdateTags(ctx context.Context, r // UpdateTags - Updates express route gateway tags. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *ExpressRouteGatewaysClient) updateTags(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, expressRouteGatewayParameters TagsObject, options *ExpressRouteGatewaysClientBeginUpdateTagsOptions) (*http.Response, error) { var err error const operationName = "ExpressRouteGatewaysClient.BeginUpdateTags" @@ -447,7 +447,7 @@ func (client *ExpressRouteGatewaysClient) updateTagsCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, expressRouteGatewayParameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/expressroutegateways_client_example_test.go b/sdk/resourcemanager/network/armnetwork/expressroutegateways_client_example_test.go deleted file mode 100644 index da830ea78f07..000000000000 --- a/sdk/resourcemanager/network/armnetwork/expressroutegateways_client_example_test.go +++ /dev/null @@ -1,337 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ExpressRouteGatewayListBySubscription.json -func ExampleExpressRouteGatewaysClient_ListBySubscription() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewExpressRouteGatewaysClient().ListBySubscription(ctx, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ExpressRouteGatewayList = armnetwork.ExpressRouteGatewayList{ - // Value: []*armnetwork.ExpressRouteGateway{ - // { - // Name: to.Ptr("expressRouteGatewayName"), - // Type: to.Ptr("Microsoft.Network/expressRouteGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.ExpressRouteGatewayProperties{ - // AllowNonVirtualWanTraffic: to.Ptr(false), - // AutoScaleConfiguration: &armnetwork.ExpressRouteGatewayPropertiesAutoScaleConfiguration{ - // Bounds: &armnetwork.ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds{ - // Min: to.Ptr[int32](2), - // }, - // }, - // ExpressRouteConnections: []*armnetwork.ExpressRouteConnection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName/expressRouteConnections/connectionName"), - // Name: to.Ptr("connectionName"), - // Properties: &armnetwork.ExpressRouteConnectionProperties{ - // AuthorizationKey: to.Ptr("f28e9c99-78d8-4248-a855-c54cf6beb99d"), - // EnableInternetSecurity: to.Ptr(false), - // ExpressRouteCircuitPeering: &armnetwork.ExpressRouteCircuitPeeringID{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/AzurePrivatePeering"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RoutingConfiguration: &armnetwork.RoutingConfiguration{ - // AssociatedRouteTable: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/virtualHubName/hubRouteTables/hubRouteTable1"), - // }, - // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ - // IDs: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/virtualHubName/hubRouteTables/hubRouteTable1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/virtualHubName/hubRouteTables/hubRouteTable2"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/hvirtualHubNameub1/hubRouteTables/hubRouteTable3"), - // }}, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, - // }, - // VnetRoutes: &armnetwork.VnetRoute{ - // StaticRoutes: []*armnetwork.StaticRoute{ - // }, - // }, - // }, - // RoutingWeight: to.Ptr[int32](1), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualHub: &armnetwork.VirtualHubID{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/virtualHubName"), - // }, - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ExpressRouteGatewayListByResourceGroup.json -func ExampleExpressRouteGatewaysClient_ListByResourceGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewExpressRouteGatewaysClient().ListByResourceGroup(ctx, "resourceGroupName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ExpressRouteGatewayList = armnetwork.ExpressRouteGatewayList{ - // Value: []*armnetwork.ExpressRouteGateway{ - // { - // Name: to.Ptr("expressRouteGatewayName"), - // Type: to.Ptr("Microsoft.Network/expressRouteGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.ExpressRouteGatewayProperties{ - // AllowNonVirtualWanTraffic: to.Ptr(false), - // AutoScaleConfiguration: &armnetwork.ExpressRouteGatewayPropertiesAutoScaleConfiguration{ - // Bounds: &armnetwork.ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds{ - // Min: to.Ptr[int32](2), - // }, - // }, - // ExpressRouteConnections: []*armnetwork.ExpressRouteConnection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName/expressRouteConnections/connectionName"), - // Name: to.Ptr("connectionName"), - // Properties: &armnetwork.ExpressRouteConnectionProperties{ - // AuthorizationKey: to.Ptr("f28e9c99-78d8-4248-a855-c54cf6beb99d"), - // EnableInternetSecurity: to.Ptr(false), - // ExpressRouteCircuitPeering: &armnetwork.ExpressRouteCircuitPeeringID{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/AzurePrivatePeering"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RoutingConfiguration: &armnetwork.RoutingConfiguration{ - // AssociatedRouteTable: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/virtualHubName/hubRouteTables/hubRouteTable1"), - // }, - // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ - // IDs: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/virtualHubName/hubRouteTables/hubRouteTable1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/virtualHubName/hubRouteTables/hubRouteTable2"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/hvirtualHubNameub1/hubRouteTables/hubRouteTable3"), - // }}, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, - // }, - // VnetRoutes: &armnetwork.VnetRoute{ - // StaticRoutes: []*armnetwork.StaticRoute{ - // }, - // }, - // }, - // RoutingWeight: to.Ptr[int32](1), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualHub: &armnetwork.VirtualHubID{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/virtualHubName"), - // }, - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ExpressRouteGatewayCreate.json -func ExampleExpressRouteGatewaysClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewExpressRouteGatewaysClient().BeginCreateOrUpdate(ctx, "resourceGroupName", "gateway-2", armnetwork.ExpressRouteGateway{ - Location: to.Ptr("westus"), - Properties: &armnetwork.ExpressRouteGatewayProperties{ - AllowNonVirtualWanTraffic: to.Ptr(false), - AutoScaleConfiguration: &armnetwork.ExpressRouteGatewayPropertiesAutoScaleConfiguration{ - Bounds: &armnetwork.ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds{ - Min: to.Ptr[int32](3), - }, - }, - VirtualHub: &armnetwork.VirtualHubID{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupId/providers/Microsoft.Network/virtualHubs/virtualHubName"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ExpressRouteGateway = armnetwork.ExpressRouteGateway{ - // Name: to.Ptr("gateway-2"), - // Type: to.Ptr("Microsoft.Network/expressRouteGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteGateways/gateway-2"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.ExpressRouteGatewayProperties{ - // AllowNonVirtualWanTraffic: to.Ptr(false), - // AutoScaleConfiguration: &armnetwork.ExpressRouteGatewayPropertiesAutoScaleConfiguration{ - // Bounds: &armnetwork.ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds{ - // Min: to.Ptr[int32](3), - // }, - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualHub: &armnetwork.VirtualHubID{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/virtualHubName"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ExpressRouteGatewayUpdateTags.json -func ExampleExpressRouteGatewaysClient_BeginUpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewExpressRouteGatewaysClient().BeginUpdateTags(ctx, "resourceGroupName", "expressRouteGatewayName", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ExpressRouteGateway = armnetwork.ExpressRouteGateway{ - // Name: to.Ptr("expressRouteGatewayName"), - // Type: to.Ptr("Microsoft.Network/expressRouteGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.ExpressRouteGatewayProperties{ - // AllowNonVirtualWanTraffic: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualHub: &armnetwork.VirtualHubID{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/virtualHubName"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ExpressRouteGatewayGet.json -func ExampleExpressRouteGatewaysClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewExpressRouteGatewaysClient().Get(ctx, "resourceGroupName", "expressRouteGatewayName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ExpressRouteGateway = armnetwork.ExpressRouteGateway{ - // Name: to.Ptr("expressRouteGatewayName"), - // Type: to.Ptr("Microsoft.Network/expressRouteGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.ExpressRouteGatewayProperties{ - // AllowNonVirtualWanTraffic: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualHub: &armnetwork.VirtualHubID{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/virtualHubName"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ExpressRouteGatewayDelete.json -func ExampleExpressRouteGatewaysClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewExpressRouteGatewaysClient().BeginDelete(ctx, "resourceGroupName", "expressRouteGatewayName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/network/armnetwork/expressroutelinks_client.go b/sdk/resourcemanager/network/armnetwork/expressroutelinks_client.go index 4b04c1fc19ce..0c15bc80244b 100644 --- a/sdk/resourcemanager/network/armnetwork/expressroutelinks_client.go +++ b/sdk/resourcemanager/network/armnetwork/expressroutelinks_client.go @@ -47,7 +47,7 @@ func NewExpressRouteLinksClient(subscriptionID string, credential azcore.TokenCr // Get - Retrieves the specified ExpressRouteLink resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - expressRoutePortName - The name of the ExpressRoutePort resource. // - linkName - The name of the ExpressRouteLink resource. @@ -98,7 +98,7 @@ func (client *ExpressRouteLinksClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -115,7 +115,7 @@ func (client *ExpressRouteLinksClient) getHandleResponse(resp *http.Response) (E // NewListPager - Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - expressRoutePortName - The name of the ExpressRoutePort resource. // - options - ExpressRouteLinksClientListOptions contains the optional parameters for the ExpressRouteLinksClient.NewListPager @@ -170,7 +170,7 @@ func (client *ExpressRouteLinksClient) listCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/expressroutelinks_client_example_test.go b/sdk/resourcemanager/network/armnetwork/expressroutelinks_client_example_test.go deleted file mode 100644 index f6718f2f6032..000000000000 --- a/sdk/resourcemanager/network/armnetwork/expressroutelinks_client_example_test.go +++ /dev/null @@ -1,108 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ExpressRouteLinkGet.json -func ExampleExpressRouteLinksClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewExpressRouteLinksClient().Get(ctx, "rg1", "portName", "linkName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ExpressRouteLink = armnetwork.ExpressRouteLink{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName/links/linkName"), - // Name: to.Ptr("linkName"), - // Properties: &armnetwork.ExpressRouteLinkPropertiesFormat{ - // AdminState: to.Ptr(armnetwork.ExpressRouteLinkAdminStateDisabled), - // ColoLocation: to.Ptr("coloLocationName"), - // ConnectorType: to.Ptr(armnetwork.ExpressRouteLinkConnectorTypeLC), - // InterfaceName: to.Ptr("Ethernet 0/0"), - // PatchPanelID: to.Ptr("patchPanelId1"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RackID: to.Ptr("rackId1"), - // RouterName: to.Ptr("router1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ExpressRouteLinkList.json -func ExampleExpressRouteLinksClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewExpressRouteLinksClient().NewListPager("rg1", "portName", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ExpressRouteLinkListResult = armnetwork.ExpressRouteLinkListResult{ - // Value: []*armnetwork.ExpressRouteLink{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName/links/link1"), - // Name: to.Ptr("link1"), - // Properties: &armnetwork.ExpressRouteLinkPropertiesFormat{ - // AdminState: to.Ptr(armnetwork.ExpressRouteLinkAdminStateDisabled), - // ColoLocation: to.Ptr("coloLocation1"), - // ConnectorType: to.Ptr(armnetwork.ExpressRouteLinkConnectorTypeLC), - // InterfaceName: to.Ptr("Ethernet 0/0"), - // PatchPanelID: to.Ptr("patchPanelId1"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RackID: to.Ptr("rackId1"), - // RouterName: to.Ptr("router1"), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName/links/link2"), - // Name: to.Ptr("link2"), - // Properties: &armnetwork.ExpressRouteLinkPropertiesFormat{ - // AdminState: to.Ptr(armnetwork.ExpressRouteLinkAdminStateDisabled), - // ColoLocation: to.Ptr("coloLocation2"), - // ConnectorType: to.Ptr(armnetwork.ExpressRouteLinkConnectorTypeLC), - // InterfaceName: to.Ptr("Ethernet 0/0"), - // PatchPanelID: to.Ptr("patchPanelId2"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RackID: to.Ptr("rackId2"), - // RouterName: to.Ptr("router2"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/expressrouteportauthorizations_client.go b/sdk/resourcemanager/network/armnetwork/expressrouteportauthorizations_client.go index 08d59a726230..30c3bff055b1 100644 --- a/sdk/resourcemanager/network/armnetwork/expressrouteportauthorizations_client.go +++ b/sdk/resourcemanager/network/armnetwork/expressrouteportauthorizations_client.go @@ -47,7 +47,7 @@ func NewExpressRoutePortAuthorizationsClient(subscriptionID string, credential a // BeginCreateOrUpdate - Creates or updates an authorization in the specified express route port. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - expressRoutePortName - The name of the express route port. // - authorizationName - The name of the authorization. @@ -72,7 +72,7 @@ func (client *ExpressRoutePortAuthorizationsClient) BeginCreateOrUpdate(ctx cont // CreateOrUpdate - Creates or updates an authorization in the specified express route port. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *ExpressRoutePortAuthorizationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, expressRoutePortName string, authorizationName string, authorizationParameters ExpressRoutePortAuthorization, options *ExpressRoutePortAuthorizationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ExpressRoutePortAuthorizationsClient.BeginCreateOrUpdate" @@ -118,7 +118,7 @@ func (client *ExpressRoutePortAuthorizationsClient) createOrUpdateCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, authorizationParameters); err != nil { @@ -130,7 +130,7 @@ func (client *ExpressRoutePortAuthorizationsClient) createOrUpdateCreateRequest( // BeginDelete - Deletes the specified authorization from the specified express route port. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - expressRoutePortName - The name of the express route port. // - authorizationName - The name of the authorization. @@ -154,7 +154,7 @@ func (client *ExpressRoutePortAuthorizationsClient) BeginDelete(ctx context.Cont // Delete - Deletes the specified authorization from the specified express route port. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *ExpressRoutePortAuthorizationsClient) deleteOperation(ctx context.Context, resourceGroupName string, expressRoutePortName string, authorizationName string, options *ExpressRoutePortAuthorizationsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ExpressRoutePortAuthorizationsClient.BeginDelete" @@ -200,7 +200,7 @@ func (client *ExpressRoutePortAuthorizationsClient) deleteCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -209,7 +209,7 @@ func (client *ExpressRoutePortAuthorizationsClient) deleteCreateRequest(ctx cont // Get - Gets the specified authorization from the specified express route port. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - expressRoutePortName - The name of the express route port. // - authorizationName - The name of the authorization. @@ -261,7 +261,7 @@ func (client *ExpressRoutePortAuthorizationsClient) getCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -278,7 +278,7 @@ func (client *ExpressRoutePortAuthorizationsClient) getHandleResponse(resp *http // NewListPager - Gets all authorizations in an express route port. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - expressRoutePortName - The name of the express route port. // - options - ExpressRoutePortAuthorizationsClientListOptions contains the optional parameters for the ExpressRoutePortAuthorizationsClient.NewListPager @@ -333,7 +333,7 @@ func (client *ExpressRoutePortAuthorizationsClient) listCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/expressrouteportauthorizations_client_example_test.go b/sdk/resourcemanager/network/armnetwork/expressrouteportauthorizations_client_example_test.go deleted file mode 100644 index c4b0e676101d..000000000000 --- a/sdk/resourcemanager/network/armnetwork/expressrouteportauthorizations_client_example_test.go +++ /dev/null @@ -1,148 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ExpressRoutePortAuthorizationDelete.json -func ExampleExpressRoutePortAuthorizationsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewExpressRoutePortAuthorizationsClient().BeginDelete(ctx, "rg1", "expressRoutePortName", "authorizationName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ExpressRoutePortAuthorizationGet.json -func ExampleExpressRoutePortAuthorizationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewExpressRoutePortAuthorizationsClient().Get(ctx, "rg1", "expressRoutePortName", "authorizationName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ExpressRoutePortAuthorization = armnetwork.ExpressRoutePortAuthorization{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/ExpressRoutePorts/expressRoutePortName/authorizations/authorizationName"), - // Name: to.Ptr("authorizationName"), - // Type: to.Ptr("Microsoft.Network/expressRoutePorts/authorizations"), - // Etag: to.Ptr("W/\"e33c875f-48df-4a91-b7d3-eb95b5ddbb89\""), - // Properties: &armnetwork.ExpressRoutePortAuthorizationPropertiesFormat{ - // AuthorizationKey: to.Ptr("authKey"), - // AuthorizationUseStatus: to.Ptr(armnetwork.ExpressRoutePortAuthorizationUseStatusAvailable), - // CircuitResourceURI: to.Ptr(""), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ExpressRoutePortAuthorizationCreate.json -func ExampleExpressRoutePortAuthorizationsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewExpressRoutePortAuthorizationsClient().BeginCreateOrUpdate(ctx, "rg1", "expressRoutePortName", "authorizatinName", armnetwork.ExpressRoutePortAuthorization{ - Properties: &armnetwork.ExpressRoutePortAuthorizationPropertiesFormat{}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ExpressRoutePortAuthorization = armnetwork.ExpressRoutePortAuthorization{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/ExpressRoutePorts/expressRoutePortName/authorizations/authorizationName"), - // Name: to.Ptr("authorizationName"), - // Type: to.Ptr("Microsoft.Network/expressRoutePorts/authorizations"), - // Etag: to.Ptr("W/\"e22dd4b2-4c24-44cf-b702-70a472b62914\""), - // Properties: &armnetwork.ExpressRoutePortAuthorizationPropertiesFormat{ - // AuthorizationUseStatus: to.Ptr(armnetwork.ExpressRoutePortAuthorizationUseStatusAvailable), - // CircuitResourceURI: to.Ptr(""), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ExpressRoutePortAuthorizationList.json -func ExampleExpressRoutePortAuthorizationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewExpressRoutePortAuthorizationsClient().NewListPager("rg1", "expressRoutePortName", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ExpressRoutePortAuthorizationListResult = armnetwork.ExpressRoutePortAuthorizationListResult{ - // Value: []*armnetwork.ExpressRoutePortAuthorization{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/ExpressRoutePorts/expressRoutePortName/authorizations/authorizationName"), - // Name: to.Ptr("authorizationName"), - // Type: to.Ptr("Microsoft.Network/expressRoutePorts/authorizations"), - // Etag: to.Ptr("W/\"e33c875f-48df-4a91-b7d3-eb95b5ddbb89\""), - // Properties: &armnetwork.ExpressRoutePortAuthorizationPropertiesFormat{ - // AuthorizationKey: to.Ptr("authKey"), - // AuthorizationUseStatus: to.Ptr(armnetwork.ExpressRoutePortAuthorizationUseStatusAvailable), - // CircuitResourceURI: to.Ptr(""), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/expressrouteports_client.go b/sdk/resourcemanager/network/armnetwork/expressrouteports_client.go index 8bdcc10f3232..3bfe45204e2b 100644 --- a/sdk/resourcemanager/network/armnetwork/expressrouteports_client.go +++ b/sdk/resourcemanager/network/armnetwork/expressrouteports_client.go @@ -47,7 +47,7 @@ func NewExpressRoutePortsClient(subscriptionID string, credential azcore.TokenCr // BeginCreateOrUpdate - Creates or updates the specified ExpressRoutePort resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - expressRoutePortName - The name of the ExpressRoutePort resource. // - parameters - Parameters supplied to the create ExpressRoutePort operation. @@ -71,7 +71,7 @@ func (client *ExpressRoutePortsClient) BeginCreateOrUpdate(ctx context.Context, // CreateOrUpdate - Creates or updates the specified ExpressRoutePort resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *ExpressRoutePortsClient) createOrUpdate(ctx context.Context, resourceGroupName string, expressRoutePortName string, parameters ExpressRoutePort, options *ExpressRoutePortsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ExpressRoutePortsClient.BeginCreateOrUpdate" @@ -113,7 +113,7 @@ func (client *ExpressRoutePortsClient) createOrUpdateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -125,7 +125,7 @@ func (client *ExpressRoutePortsClient) createOrUpdateCreateRequest(ctx context.C // BeginDelete - Deletes the specified ExpressRoutePort resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - expressRoutePortName - The name of the ExpressRoutePort resource. // - options - ExpressRoutePortsClientBeginDeleteOptions contains the optional parameters for the ExpressRoutePortsClient.BeginDelete @@ -148,7 +148,7 @@ func (client *ExpressRoutePortsClient) BeginDelete(ctx context.Context, resource // Delete - Deletes the specified ExpressRoutePort resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *ExpressRoutePortsClient) deleteOperation(ctx context.Context, resourceGroupName string, expressRoutePortName string, options *ExpressRoutePortsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ExpressRoutePortsClient.BeginDelete" @@ -190,7 +190,7 @@ func (client *ExpressRoutePortsClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -199,7 +199,7 @@ func (client *ExpressRoutePortsClient) deleteCreateRequest(ctx context.Context, // GenerateLOA - Generate a letter of authorization for the requested ExpressRoutePort resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - expressRoutePortName - The name of ExpressRoutePort. // - request - Request parameters supplied to generate a letter of authorization. @@ -247,7 +247,7 @@ func (client *ExpressRoutePortsClient) generateLOACreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, request); err != nil { @@ -268,7 +268,7 @@ func (client *ExpressRoutePortsClient) generateLOAHandleResponse(resp *http.Resp // Get - Retrieves the requested ExpressRoutePort resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - expressRoutePortName - The name of ExpressRoutePort. // - options - ExpressRoutePortsClientGetOptions contains the optional parameters for the ExpressRoutePortsClient.Get method. @@ -314,7 +314,7 @@ func (client *ExpressRoutePortsClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -331,7 +331,7 @@ func (client *ExpressRoutePortsClient) getHandleResponse(resp *http.Response) (E // NewListPager - List all the ExpressRoutePort resources in the specified subscription. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - options - ExpressRoutePortsClientListOptions contains the optional parameters for the ExpressRoutePortsClient.NewListPager // method. func (client *ExpressRoutePortsClient) NewListPager(options *ExpressRoutePortsClientListOptions) *runtime.Pager[ExpressRoutePortsClientListResponse] { @@ -376,7 +376,7 @@ func (client *ExpressRoutePortsClient) listCreateRequest(ctx context.Context, op return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -393,7 +393,7 @@ func (client *ExpressRoutePortsClient) listHandleResponse(resp *http.Response) ( // NewListByResourceGroupPager - List all the ExpressRoutePort resources in the specified resource group. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - options - ExpressRoutePortsClientListByResourceGroupOptions contains the optional parameters for the ExpressRoutePortsClient.NewListByResourceGroupPager // method. @@ -443,7 +443,7 @@ func (client *ExpressRoutePortsClient) listByResourceGroupCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -461,7 +461,7 @@ func (client *ExpressRoutePortsClient) listByResourceGroupHandleResponse(resp *h // UpdateTags - Update ExpressRoutePort tags. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - expressRoutePortName - The name of the ExpressRoutePort resource. // - parameters - Parameters supplied to update ExpressRoutePort resource tags. @@ -509,7 +509,7 @@ func (client *ExpressRoutePortsClient) updateTagsCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/expressrouteports_client_example_test.go b/sdk/resourcemanager/network/armnetwork/expressrouteports_client_example_test.go deleted file mode 100644 index 8a430aea90cd..000000000000 --- a/sdk/resourcemanager/network/armnetwork/expressrouteports_client_example_test.go +++ /dev/null @@ -1,519 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ExpressRoutePortDelete.json -func ExampleExpressRoutePortsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewExpressRoutePortsClient().BeginDelete(ctx, "rg1", "portName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ExpressRoutePortGet.json -func ExampleExpressRoutePortsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewExpressRoutePortsClient().Get(ctx, "rg1", "portName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ExpressRoutePort = armnetwork.ExpressRoutePort{ - // Name: to.Ptr("portName"), - // Type: to.Ptr("Microsoft.Network/expressRoutePorts"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.ExpressRoutePortPropertiesFormat{ - // AllocationDate: to.Ptr("Friday, July 1, 2018"), - // BandwidthInGbps: to.Ptr[int32](100), - // BillingType: to.Ptr(armnetwork.ExpressRoutePortsBillingTypeUnlimitedData), - // Circuits: []*armnetwork.SubResource{ - // }, - // Encapsulation: to.Ptr(armnetwork.ExpressRoutePortsEncapsulationQinQ), - // EtherType: to.Ptr("0x8100"), - // Links: []*armnetwork.ExpressRouteLink{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName/links/link1"), - // Name: to.Ptr("link1"), - // Properties: &armnetwork.ExpressRouteLinkPropertiesFormat{ - // AdminState: to.Ptr(armnetwork.ExpressRouteLinkAdminStateDisabled), - // ColoLocation: to.Ptr("coloLocation1"), - // ConnectorType: to.Ptr(armnetwork.ExpressRouteLinkConnectorTypeLC), - // InterfaceName: to.Ptr("Ethernet 0/0"), - // PatchPanelID: to.Ptr("patchPanelId1"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RackID: to.Ptr("rackId1"), - // RouterName: to.Ptr("router1"), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName/links/link2"), - // Name: to.Ptr("link2"), - // Properties: &armnetwork.ExpressRouteLinkPropertiesFormat{ - // AdminState: to.Ptr(armnetwork.ExpressRouteLinkAdminStateDisabled), - // ColoLocation: to.Ptr("coloLocation2"), - // ConnectorType: to.Ptr(armnetwork.ExpressRouteLinkConnectorTypeLC), - // InterfaceName: to.Ptr("Ethernet 0/0"), - // PatchPanelID: to.Ptr("patchPanelId2"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RackID: to.Ptr("rackId2"), - // RouterName: to.Ptr("router2"), - // }, - // }}, - // Mtu: to.Ptr("1500"), - // PeeringLocation: to.Ptr("peeringLocationName"), - // ProvisionedBandwidthInGbps: to.Ptr[float32](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ExpressRoutePortCreate.json -func ExampleExpressRoutePortsClient_BeginCreateOrUpdate_expressRoutePortCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewExpressRoutePortsClient().BeginCreateOrUpdate(ctx, "rg1", "portName", armnetwork.ExpressRoutePort{ - Location: to.Ptr("westus"), - Properties: &armnetwork.ExpressRoutePortPropertiesFormat{ - BandwidthInGbps: to.Ptr[int32](100), - BillingType: to.Ptr(armnetwork.ExpressRoutePortsBillingTypeUnlimitedData), - Encapsulation: to.Ptr(armnetwork.ExpressRoutePortsEncapsulationQinQ), - PeeringLocation: to.Ptr("peeringLocationName"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ExpressRoutePort = armnetwork.ExpressRoutePort{ - // Name: to.Ptr("portName"), - // Type: to.Ptr("Microsoft.Network/expressRoutePorts"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.ExpressRoutePortPropertiesFormat{ - // AllocationDate: to.Ptr("Friday, July 1, 2018"), - // BandwidthInGbps: to.Ptr[int32](100), - // BillingType: to.Ptr(armnetwork.ExpressRoutePortsBillingTypeUnlimitedData), - // Circuits: []*armnetwork.SubResource{ - // }, - // Encapsulation: to.Ptr(armnetwork.ExpressRoutePortsEncapsulationQinQ), - // EtherType: to.Ptr("0x8100"), - // Links: []*armnetwork.ExpressRouteLink{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName/links/link1"), - // Name: to.Ptr("link1"), - // Properties: &armnetwork.ExpressRouteLinkPropertiesFormat{ - // AdminState: to.Ptr(armnetwork.ExpressRouteLinkAdminStateDisabled), - // ConnectorType: to.Ptr(armnetwork.ExpressRouteLinkConnectorTypeLC), - // InterfaceName: to.Ptr("Ethernet 0/0"), - // PatchPanelID: to.Ptr("patchPanelId1"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RackID: to.Ptr("rackId1"), - // RouterName: to.Ptr("router1"), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName/links/link2"), - // Name: to.Ptr("link2"), - // Properties: &armnetwork.ExpressRouteLinkPropertiesFormat{ - // AdminState: to.Ptr(armnetwork.ExpressRouteLinkAdminStateDisabled), - // ConnectorType: to.Ptr(armnetwork.ExpressRouteLinkConnectorTypeLC), - // InterfaceName: to.Ptr("Ethernet 0/0"), - // PatchPanelID: to.Ptr("patchPanelId2"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RackID: to.Ptr("rackId2"), - // RouterName: to.Ptr("router2"), - // }, - // }}, - // Mtu: to.Ptr("1500"), - // PeeringLocation: to.Ptr("peeringLocationName"), - // ProvisionedBandwidthInGbps: to.Ptr[float32](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ExpressRoutePortUpdateLink.json -func ExampleExpressRoutePortsClient_BeginCreateOrUpdate_expressRoutePortUpdateLink() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewExpressRoutePortsClient().BeginCreateOrUpdate(ctx, "rg1", "portName", armnetwork.ExpressRoutePort{ - Location: to.Ptr("westus"), - Properties: &armnetwork.ExpressRoutePortPropertiesFormat{ - BandwidthInGbps: to.Ptr[int32](100), - BillingType: to.Ptr(armnetwork.ExpressRoutePortsBillingTypeUnlimitedData), - Encapsulation: to.Ptr(armnetwork.ExpressRoutePortsEncapsulationQinQ), - Links: []*armnetwork.ExpressRouteLink{ - { - Name: to.Ptr("link1"), - Properties: &armnetwork.ExpressRouteLinkPropertiesFormat{ - AdminState: to.Ptr(armnetwork.ExpressRouteLinkAdminStateEnabled), - }, - }}, - PeeringLocation: to.Ptr("peeringLocationName"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ExpressRoutePort = armnetwork.ExpressRoutePort{ - // Name: to.Ptr("portName"), - // Type: to.Ptr("Microsoft.Network/expressRoutePorts"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.ExpressRoutePortPropertiesFormat{ - // AllocationDate: to.Ptr("Friday, July 1, 2018"), - // BandwidthInGbps: to.Ptr[int32](100), - // BillingType: to.Ptr(armnetwork.ExpressRoutePortsBillingTypeUnlimitedData), - // Circuits: []*armnetwork.SubResource{ - // }, - // Encapsulation: to.Ptr(armnetwork.ExpressRoutePortsEncapsulationQinQ), - // EtherType: to.Ptr("0x8100"), - // Links: []*armnetwork.ExpressRouteLink{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName/links/link1"), - // Name: to.Ptr("link1"), - // Properties: &armnetwork.ExpressRouteLinkPropertiesFormat{ - // AdminState: to.Ptr(armnetwork.ExpressRouteLinkAdminStateEnabled), - // ConnectorType: to.Ptr(armnetwork.ExpressRouteLinkConnectorTypeLC), - // InterfaceName: to.Ptr("Ethernet 0/0"), - // PatchPanelID: to.Ptr("patchPanelId1"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RackID: to.Ptr("rackId1"), - // RouterName: to.Ptr("router1"), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName/links/link2"), - // Name: to.Ptr("link2"), - // Properties: &armnetwork.ExpressRouteLinkPropertiesFormat{ - // AdminState: to.Ptr(armnetwork.ExpressRouteLinkAdminStateDisabled), - // ConnectorType: to.Ptr(armnetwork.ExpressRouteLinkConnectorTypeLC), - // InterfaceName: to.Ptr("Ethernet 0/0"), - // PatchPanelID: to.Ptr("patchPanelId2"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RackID: to.Ptr("rackId2"), - // RouterName: to.Ptr("router2"), - // }, - // }}, - // Mtu: to.Ptr("1500"), - // PeeringLocation: to.Ptr("peeringLocationName"), - // ProvisionedBandwidthInGbps: to.Ptr[float32](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ExpressRoutePortUpdateTags.json -func ExampleExpressRoutePortsClient_UpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewExpressRoutePortsClient().UpdateTags(ctx, "rg1", "portName", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ExpressRoutePort = armnetwork.ExpressRoutePort{ - // Name: to.Ptr("portName"), - // Type: to.Ptr("Microsoft.Network/expressRoutePorts"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.ExpressRoutePortPropertiesFormat{ - // AllocationDate: to.Ptr("Friday, July 1, 2018"), - // BandwidthInGbps: to.Ptr[int32](100), - // BillingType: to.Ptr(armnetwork.ExpressRoutePortsBillingTypeUnlimitedData), - // Circuits: []*armnetwork.SubResource{ - // }, - // Encapsulation: to.Ptr(armnetwork.ExpressRoutePortsEncapsulationQinQ), - // EtherType: to.Ptr("0x8100"), - // Links: []*armnetwork.ExpressRouteLink{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName/links/link1"), - // Name: to.Ptr("link1"), - // Properties: &armnetwork.ExpressRouteLinkPropertiesFormat{ - // AdminState: to.Ptr(armnetwork.ExpressRouteLinkAdminStateDisabled), - // ConnectorType: to.Ptr(armnetwork.ExpressRouteLinkConnectorTypeLC), - // InterfaceName: to.Ptr("Ethernet 0/0"), - // PatchPanelID: to.Ptr("patchPanelId1"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RackID: to.Ptr("rackId1"), - // RouterName: to.Ptr("router1"), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName/links/link2"), - // Name: to.Ptr("link2"), - // Properties: &armnetwork.ExpressRouteLinkPropertiesFormat{ - // AdminState: to.Ptr(armnetwork.ExpressRouteLinkAdminStateDisabled), - // ConnectorType: to.Ptr(armnetwork.ExpressRouteLinkConnectorTypeLC), - // InterfaceName: to.Ptr("Ethernet 0/0"), - // PatchPanelID: to.Ptr("patchPanelId2"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RackID: to.Ptr("rackId2"), - // RouterName: to.Ptr("router2"), - // }, - // }}, - // Mtu: to.Ptr("1500"), - // PeeringLocation: to.Ptr("peeringLocationName"), - // ProvisionedBandwidthInGbps: to.Ptr[float32](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ExpressRoutePortListByResourceGroup.json -func ExampleExpressRoutePortsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewExpressRoutePortsClient().NewListByResourceGroupPager("rg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ExpressRoutePortListResult = armnetwork.ExpressRoutePortListResult{ - // Value: []*armnetwork.ExpressRoutePort{ - // { - // Name: to.Ptr("portName"), - // Type: to.Ptr("Microsoft.Network/expressRoutePorts"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.ExpressRoutePortPropertiesFormat{ - // AllocationDate: to.Ptr("Friday, July 1, 2018"), - // BandwidthInGbps: to.Ptr[int32](100), - // BillingType: to.Ptr(armnetwork.ExpressRoutePortsBillingTypeUnlimitedData), - // Circuits: []*armnetwork.SubResource{ - // }, - // Encapsulation: to.Ptr(armnetwork.ExpressRoutePortsEncapsulationQinQ), - // EtherType: to.Ptr("0x8100"), - // Links: []*armnetwork.ExpressRouteLink{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName/links/link1"), - // Name: to.Ptr("link1"), - // Properties: &armnetwork.ExpressRouteLinkPropertiesFormat{ - // AdminState: to.Ptr(armnetwork.ExpressRouteLinkAdminStateDisabled), - // ColoLocation: to.Ptr("coloLocation1"), - // ConnectorType: to.Ptr(armnetwork.ExpressRouteLinkConnectorTypeLC), - // InterfaceName: to.Ptr("Ethernet 0/0"), - // PatchPanelID: to.Ptr("patchPanelId1"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RackID: to.Ptr("rackId1"), - // RouterName: to.Ptr("router1"), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName/links/link2"), - // Name: to.Ptr("link2"), - // Properties: &armnetwork.ExpressRouteLinkPropertiesFormat{ - // AdminState: to.Ptr(armnetwork.ExpressRouteLinkAdminStateDisabled), - // ColoLocation: to.Ptr("coloLocation2"), - // ConnectorType: to.Ptr(armnetwork.ExpressRouteLinkConnectorTypeLC), - // InterfaceName: to.Ptr("Ethernet 0/0"), - // PatchPanelID: to.Ptr("patchPanelId2"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RackID: to.Ptr("rackId2"), - // RouterName: to.Ptr("router2"), - // }, - // }}, - // Mtu: to.Ptr("1500"), - // PeeringLocation: to.Ptr("peeringLocationName"), - // ProvisionedBandwidthInGbps: to.Ptr[float32](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ExpressRoutePortList.json -func ExampleExpressRoutePortsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewExpressRoutePortsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ExpressRoutePortListResult = armnetwork.ExpressRoutePortListResult{ - // Value: []*armnetwork.ExpressRoutePort{ - // { - // Name: to.Ptr("portName"), - // Type: to.Ptr("Microsoft.Network/expressRoutePorts"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.ExpressRoutePortPropertiesFormat{ - // AllocationDate: to.Ptr("Friday, July 1, 2018"), - // BandwidthInGbps: to.Ptr[int32](100), - // BillingType: to.Ptr(armnetwork.ExpressRoutePortsBillingTypeUnlimitedData), - // Circuits: []*armnetwork.SubResource{ - // }, - // Encapsulation: to.Ptr(armnetwork.ExpressRoutePortsEncapsulationQinQ), - // EtherType: to.Ptr("0x8100"), - // Links: []*armnetwork.ExpressRouteLink{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName/links/link1"), - // Name: to.Ptr("link1"), - // Properties: &armnetwork.ExpressRouteLinkPropertiesFormat{ - // AdminState: to.Ptr(armnetwork.ExpressRouteLinkAdminStateDisabled), - // ColoLocation: to.Ptr("coloLocation1"), - // ConnectorType: to.Ptr(armnetwork.ExpressRouteLinkConnectorTypeLC), - // InterfaceName: to.Ptr("Ethernet 0/0"), - // PatchPanelID: to.Ptr("patchPanelId1"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RackID: to.Ptr("rackId1"), - // RouterName: to.Ptr("router1"), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName/links/link2"), - // Name: to.Ptr("link2"), - // Properties: &armnetwork.ExpressRouteLinkPropertiesFormat{ - // AdminState: to.Ptr(armnetwork.ExpressRouteLinkAdminStateDisabled), - // ColoLocation: to.Ptr("coloLocation2"), - // ConnectorType: to.Ptr(armnetwork.ExpressRouteLinkConnectorTypeLC), - // InterfaceName: to.Ptr("Ethernet 0/0"), - // PatchPanelID: to.Ptr("patchPanelId2"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RackID: to.Ptr("rackId2"), - // RouterName: to.Ptr("router2"), - // }, - // }}, - // Mtu: to.Ptr("1500"), - // PeeringLocation: to.Ptr("peeringLocationName"), - // ProvisionedBandwidthInGbps: to.Ptr[float32](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/GenerateExpressRoutePortsLOA.json -func ExampleExpressRoutePortsClient_GenerateLOA() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewExpressRoutePortsClient().GenerateLOA(ctx, "rg1", "portName", armnetwork.GenerateExpressRoutePortsLOARequest{ - CustomerName: to.Ptr("customerName"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GenerateExpressRoutePortsLOAResult = armnetwork.GenerateExpressRoutePortsLOAResult{ - // EncodedContent: to.Ptr("TWFuIGlzIGRpc3"), - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/expressrouteportslocations_client.go b/sdk/resourcemanager/network/armnetwork/expressrouteportslocations_client.go index 16fc81461e60..0f1988241041 100644 --- a/sdk/resourcemanager/network/armnetwork/expressrouteportslocations_client.go +++ b/sdk/resourcemanager/network/armnetwork/expressrouteportslocations_client.go @@ -48,7 +48,7 @@ func NewExpressRoutePortsLocationsClient(subscriptionID string, credential azcor // peering location. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - locationName - Name of the requested ExpressRoutePort peering location. // - options - ExpressRoutePortsLocationsClientGetOptions contains the optional parameters for the ExpressRoutePortsLocationsClient.Get // method. @@ -90,7 +90,7 @@ func (client *ExpressRoutePortsLocationsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -108,7 +108,7 @@ func (client *ExpressRoutePortsLocationsClient) getHandleResponse(resp *http.Res // NewListPager - Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. // Available bandwidths can only be obtained when retrieving a specific peering location. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - options - ExpressRoutePortsLocationsClientListOptions contains the optional parameters for the ExpressRoutePortsLocationsClient.NewListPager // method. func (client *ExpressRoutePortsLocationsClient) NewListPager(options *ExpressRoutePortsLocationsClientListOptions) *runtime.Pager[ExpressRoutePortsLocationsClientListResponse] { @@ -153,7 +153,7 @@ func (client *ExpressRoutePortsLocationsClient) listCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/expressrouteportslocations_client_example_test.go b/sdk/resourcemanager/network/armnetwork/expressrouteportslocations_client_example_test.go deleted file mode 100644 index ed9a596f8dd1..000000000000 --- a/sdk/resourcemanager/network/armnetwork/expressrouteportslocations_client_example_test.go +++ /dev/null @@ -1,95 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ExpressRoutePortsLocationList.json -func ExampleExpressRoutePortsLocationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewExpressRoutePortsLocationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ExpressRoutePortsLocationListResult = armnetwork.ExpressRoutePortsLocationListResult{ - // Value: []*armnetwork.ExpressRoutePortsLocation{ - // { - // Name: to.Ptr("locationName"), - // Type: to.Ptr("Microsoft.Network/expressRoutePortsLocations"), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/expressRoutePortsLocations/locationName"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.ExpressRoutePortsLocationPropertiesFormat{ - // Address: to.Ptr("123 Main Street, City, State, Zip"), - // AvailableBandwidths: []*armnetwork.ExpressRoutePortsLocationBandwidths{ - // }, - // Contact: to.Ptr("email@address.com"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ExpressRoutePortsLocationGet.json -func ExampleExpressRoutePortsLocationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewExpressRoutePortsLocationsClient().Get(ctx, "locationName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ExpressRoutePortsLocation = armnetwork.ExpressRoutePortsLocation{ - // Name: to.Ptr("locationName"), - // Type: to.Ptr("Microsoft.Network/expressRoutePortsLocations"), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/expressRoutePortsLocations/locationName"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.ExpressRoutePortsLocationPropertiesFormat{ - // Address: to.Ptr("123 Main Street, City, State, Zip"), - // AvailableBandwidths: []*armnetwork.ExpressRoutePortsLocationBandwidths{ - // { - // OfferName: to.Ptr("100 Gbps"), - // ValueInGbps: to.Ptr[int32](100), - // }}, - // Contact: to.Ptr("email@address.com"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/expressrouteproviderportslocation_client.go b/sdk/resourcemanager/network/armnetwork/expressrouteproviderportslocation_client.go index 834b8129955e..c1e3a6d2d486 100644 --- a/sdk/resourcemanager/network/armnetwork/expressrouteproviderportslocation_client.go +++ b/sdk/resourcemanager/network/armnetwork/expressrouteproviderportslocation_client.go @@ -47,7 +47,7 @@ func NewExpressRouteProviderPortsLocationClient(subscriptionID string, credentia // List - Retrieves all the ExpressRouteProviderPorts in a subscription. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - options - ExpressRouteProviderPortsLocationClientListOptions contains the optional parameters for the ExpressRouteProviderPortsLocationClient.List // method. func (client *ExpressRouteProviderPortsLocationClient) List(ctx context.Context, options *ExpressRouteProviderPortsLocationClientListOptions) (ExpressRouteProviderPortsLocationClientListResponse, error) { @@ -84,7 +84,7 @@ func (client *ExpressRouteProviderPortsLocationClient) listCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } diff --git a/sdk/resourcemanager/network/armnetwork/expressrouteproviderportslocation_client_example_test.go b/sdk/resourcemanager/network/armnetwork/expressrouteproviderportslocation_client_example_test.go deleted file mode 100644 index 846d763305b6..000000000000 --- a/sdk/resourcemanager/network/armnetwork/expressrouteproviderportslocation_client_example_test.go +++ /dev/null @@ -1,73 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/expressRouteProviderPortList.json -func ExampleExpressRouteProviderPortsLocationClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewExpressRouteProviderPortsLocationClient().List(ctx, &armnetwork.ExpressRouteProviderPortsLocationClientListOptions{Filter: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ExpressRouteProviderPortListResult = armnetwork.ExpressRouteProviderPortListResult{ - // Value: []*armnetwork.ExpressRouteProviderPort{ - // { - // Type: to.Ptr("Microsoft.Network/expressRouteProviderPort"), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/ExpressRoutePortsLocations/SiliconValley/bvtazureixpportpair1"), - // Location: to.Ptr("uswest"), - // Etag: to.Ptr("W/\"c0e6477e-8150-4d4f-9bf6-bb10e6acb63a\""), - // Properties: &armnetwork.ExpressRouteProviderPortProperties{ - // OverprovisionFactor: to.Ptr[int32](4), - // PeeringLocation: to.Ptr("SiliconValley"), - // PortBandwidthInMbps: to.Ptr[int32](4000), - // PortPairDescriptor: to.Ptr("bvtazureixpportpair1"), - // PrimaryAzurePort: to.Ptr("bvtazureixp01"), - // RemainingBandwidthInMbps: to.Ptr[int32](1500), - // SecondaryAzurePort: to.Ptr("bvtazureixp01"), - // UsedBandwidthInMbps: to.Ptr[int32](2500), - // }, - // }, - // { - // Type: to.Ptr("Microsoft.Network/expressRouteProviderPort"), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/ExpressRoutePortsLocations/SiliconValley/bvtazureixpportpair2"), - // Location: to.Ptr("uswest"), - // Etag: to.Ptr("W/\"c0e6477e-8150-4d4f-9bf6-bb10e6acb63a\""), - // Properties: &armnetwork.ExpressRouteProviderPortProperties{ - // OverprovisionFactor: to.Ptr[int32](4), - // PeeringLocation: to.Ptr("seattle"), - // PortBandwidthInMbps: to.Ptr[int32](4000), - // PortPairDescriptor: to.Ptr("bvtazureixpportpair2"), - // PrimaryAzurePort: to.Ptr("bvtazureixp02"), - // RemainingBandwidthInMbps: to.Ptr[int32](1800), - // SecondaryAzurePort: to.Ptr("bvtazureixp02"), - // UsedBandwidthInMbps: to.Ptr[int32](1200), - // }, - // }}, - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/expressrouteserviceproviders_client.go b/sdk/resourcemanager/network/armnetwork/expressrouteserviceproviders_client.go index 12384d9c4cf5..3c5b5703e879 100644 --- a/sdk/resourcemanager/network/armnetwork/expressrouteserviceproviders_client.go +++ b/sdk/resourcemanager/network/armnetwork/expressrouteserviceproviders_client.go @@ -46,7 +46,7 @@ func NewExpressRouteServiceProvidersClient(subscriptionID string, credential azc // NewListPager - Gets all the available express route service providers. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - options - ExpressRouteServiceProvidersClientListOptions contains the optional parameters for the ExpressRouteServiceProvidersClient.NewListPager // method. func (client *ExpressRouteServiceProvidersClient) NewListPager(options *ExpressRouteServiceProvidersClientListOptions) *runtime.Pager[ExpressRouteServiceProvidersClientListResponse] { @@ -91,7 +91,7 @@ func (client *ExpressRouteServiceProvidersClient) listCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/expressrouteserviceproviders_client_example_test.go b/sdk/resourcemanager/network/armnetwork/expressrouteserviceproviders_client_example_test.go deleted file mode 100644 index 9111c23bde3f..000000000000 --- a/sdk/resourcemanager/network/armnetwork/expressrouteserviceproviders_client_example_test.go +++ /dev/null @@ -1,90 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ExpressRouteProviderList.json -func ExampleExpressRouteServiceProvidersClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewExpressRouteServiceProvidersClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ExpressRouteServiceProviderListResult = armnetwork.ExpressRouteServiceProviderListResult{ - // Value: []*armnetwork.ExpressRouteServiceProvider{ - // { - // Name: to.Ptr("providerName"), - // Type: to.Ptr("Microsoft.Network/expressRouteServiceProviders"), - // ID: to.Ptr("/subscriptions//resourceGroups//providers/Microsoft.Network/expressRouteServiceProviders/"), - // Properties: &armnetwork.ExpressRouteServiceProviderPropertiesFormat{ - // BandwidthsOffered: []*armnetwork.ExpressRouteServiceProviderBandwidthsOffered{ - // { - // OfferName: to.Ptr("50Mbps"), - // ValueInMbps: to.Ptr[int32](50), - // }, - // { - // OfferName: to.Ptr("100Mbps"), - // ValueInMbps: to.Ptr[int32](100), - // }, - // { - // OfferName: to.Ptr("200Mbps"), - // ValueInMbps: to.Ptr[int32](200), - // }, - // { - // OfferName: to.Ptr("500Mbps"), - // ValueInMbps: to.Ptr[int32](500), - // }, - // { - // OfferName: to.Ptr("1Gbps"), - // ValueInMbps: to.Ptr[int32](1000), - // }, - // { - // OfferName: to.Ptr("2Gbps"), - // ValueInMbps: to.Ptr[int32](2000), - // }, - // { - // OfferName: to.Ptr("5Gbps"), - // ValueInMbps: to.Ptr[int32](5000), - // }, - // { - // OfferName: to.Ptr("10Gbps"), - // ValueInMbps: to.Ptr[int32](10000), - // }}, - // PeeringLocations: []*string{ - // to.Ptr("peeringLocation1"), - // to.Ptr("peeringLocation2")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/fake/loadbalancers_server.go b/sdk/resourcemanager/network/armnetwork/fake/loadbalancers_server.go index 4664e3cb4687..01e4d2eb5876 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/loadbalancers_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/loadbalancers_server.go @@ -19,6 +19,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" "net/http" "net/url" + "reflect" "regexp" ) @@ -48,6 +49,10 @@ type LoadBalancersServer struct { // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted BeginListInboundNatRulePortMappings func(ctx context.Context, groupName string, loadBalancerName string, backendPoolName string, parameters armnetwork.QueryInboundNatRulePortMappingRequest, options *armnetwork.LoadBalancersClientBeginListInboundNatRulePortMappingsOptions) (resp azfake.PollerResponder[armnetwork.LoadBalancersClientListInboundNatRulePortMappingsResponse], errResp azfake.ErrorResponder) + // MigrateToIPBased is the fake for method LoadBalancersClient.MigrateToIPBased + // HTTP status codes to indicate success: http.StatusOK + MigrateToIPBased func(ctx context.Context, groupName string, loadBalancerName string, options *armnetwork.LoadBalancersClientMigrateToIPBasedOptions) (resp azfake.Responder[armnetwork.LoadBalancersClientMigrateToIPBasedResponse], errResp azfake.ErrorResponder) + // BeginSwapPublicIPAddresses is the fake for method LoadBalancersClient.BeginSwapPublicIPAddresses // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted BeginSwapPublicIPAddresses func(ctx context.Context, location string, parameters armnetwork.LoadBalancerVipSwapRequest, options *armnetwork.LoadBalancersClientBeginSwapPublicIPAddressesOptions) (resp azfake.PollerResponder[armnetwork.LoadBalancersClientSwapPublicIPAddressesResponse], errResp azfake.ErrorResponder) @@ -108,6 +113,8 @@ func (l *LoadBalancersServerTransport) Do(req *http.Request) (*http.Response, er resp, err = l.dispatchNewListAllPager(req) case "LoadBalancersClient.BeginListInboundNatRulePortMappings": resp, err = l.dispatchBeginListInboundNatRulePortMappings(req) + case "LoadBalancersClient.MigrateToIPBased": + resp, err = l.dispatchMigrateToIPBased(req) case "LoadBalancersClient.BeginSwapPublicIPAddresses": resp, err = l.dispatchBeginSwapPublicIPAddresses(req) case "LoadBalancersClient.UpdateTags": @@ -382,6 +389,49 @@ func (l *LoadBalancersServerTransport) dispatchBeginListInboundNatRulePortMappin return resp, nil } +func (l *LoadBalancersServerTransport) dispatchMigrateToIPBased(req *http.Request) (*http.Response, error) { + if l.srv.MigrateToIPBased == nil { + return nil, &nonRetriableError{errors.New("fake for method MigrateToIPBased not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Network/loadBalancers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/migrateToIpBased` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armnetwork.MigrateLoadBalancerToIPBasedRequest](req) + if err != nil { + return nil, err + } + groupNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("groupName")]) + if err != nil { + return nil, err + } + loadBalancerNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("loadBalancerName")]) + if err != nil { + return nil, err + } + var options *armnetwork.LoadBalancersClientMigrateToIPBasedOptions + if !reflect.ValueOf(body).IsZero() { + options = &armnetwork.LoadBalancersClientMigrateToIPBasedOptions{ + Parameters: &body, + } + } + respr, errRespr := l.srv.MigrateToIPBased(req.Context(), groupNameUnescaped, loadBalancerNameUnescaped, options) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).MigratedPools, req) + if err != nil { + return nil, err + } + return resp, nil +} + func (l *LoadBalancersServerTransport) dispatchBeginSwapPublicIPAddresses(req *http.Request) (*http.Response, error) { if l.srv.BeginSwapPublicIPAddresses == nil { return nil, &nonRetriableError{errors.New("fake for method BeginSwapPublicIPAddresses not implemented")} diff --git a/sdk/resourcemanager/network/armnetwork/firewallpolicies_client.go b/sdk/resourcemanager/network/armnetwork/firewallpolicies_client.go index d1b61b3e1d92..764b6bc6124f 100644 --- a/sdk/resourcemanager/network/armnetwork/firewallpolicies_client.go +++ b/sdk/resourcemanager/network/armnetwork/firewallpolicies_client.go @@ -47,7 +47,7 @@ func NewFirewallPoliciesClient(subscriptionID string, credential azcore.TokenCre // BeginCreateOrUpdate - Creates or updates the specified Firewall Policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - firewallPolicyName - The name of the Firewall Policy. // - parameters - Parameters supplied to the create or update Firewall Policy operation. @@ -71,7 +71,7 @@ func (client *FirewallPoliciesClient) BeginCreateOrUpdate(ctx context.Context, r // CreateOrUpdate - Creates or updates the specified Firewall Policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *FirewallPoliciesClient) createOrUpdate(ctx context.Context, resourceGroupName string, firewallPolicyName string, parameters FirewallPolicy, options *FirewallPoliciesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "FirewallPoliciesClient.BeginCreateOrUpdate" @@ -113,7 +113,7 @@ func (client *FirewallPoliciesClient) createOrUpdateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -125,7 +125,7 @@ func (client *FirewallPoliciesClient) createOrUpdateCreateRequest(ctx context.Co // BeginDelete - Deletes the specified Firewall Policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - firewallPolicyName - The name of the Firewall Policy. // - options - FirewallPoliciesClientBeginDeleteOptions contains the optional parameters for the FirewallPoliciesClient.BeginDelete @@ -148,7 +148,7 @@ func (client *FirewallPoliciesClient) BeginDelete(ctx context.Context, resourceG // Delete - Deletes the specified Firewall Policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *FirewallPoliciesClient) deleteOperation(ctx context.Context, resourceGroupName string, firewallPolicyName string, options *FirewallPoliciesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "FirewallPoliciesClient.BeginDelete" @@ -190,7 +190,7 @@ func (client *FirewallPoliciesClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -199,7 +199,7 @@ func (client *FirewallPoliciesClient) deleteCreateRequest(ctx context.Context, r // Get - Gets the specified Firewall Policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - firewallPolicyName - The name of the Firewall Policy. // - options - FirewallPoliciesClientGetOptions contains the optional parameters for the FirewallPoliciesClient.Get method. @@ -245,7 +245,7 @@ func (client *FirewallPoliciesClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } @@ -265,7 +265,7 @@ func (client *FirewallPoliciesClient) getHandleResponse(resp *http.Response) (Fi // NewListPager - Lists all Firewall Policies in a resource group. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - options - FirewallPoliciesClientListOptions contains the optional parameters for the FirewallPoliciesClient.NewListPager // method. @@ -315,7 +315,7 @@ func (client *FirewallPoliciesClient) listCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -332,7 +332,7 @@ func (client *FirewallPoliciesClient) listHandleResponse(resp *http.Response) (F // NewListAllPager - Gets all the Firewall Policies in a subscription. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - options - FirewallPoliciesClientListAllOptions contains the optional parameters for the FirewallPoliciesClient.NewListAllPager // method. func (client *FirewallPoliciesClient) NewListAllPager(options *FirewallPoliciesClientListAllOptions) *runtime.Pager[FirewallPoliciesClientListAllResponse] { @@ -377,7 +377,7 @@ func (client *FirewallPoliciesClient) listAllCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -395,7 +395,7 @@ func (client *FirewallPoliciesClient) listAllHandleResponse(resp *http.Response) // UpdateTags - Updates tags of a Azure Firewall Policy resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - firewallPolicyName - The name of the Firewall Policy. // - parameters - Parameters supplied to update Azure Firewall Policy tags. @@ -443,7 +443,7 @@ func (client *FirewallPoliciesClient) updateTagsCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/firewallpolicies_client_example_test.go b/sdk/resourcemanager/network/armnetwork/firewallpolicies_client_example_test.go deleted file mode 100644 index d49660a99f23..000000000000 --- a/sdk/resourcemanager/network/armnetwork/firewallpolicies_client_example_test.go +++ /dev/null @@ -1,597 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/FirewallPolicyDelete.json -func ExampleFirewallPoliciesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFirewallPoliciesClient().BeginDelete(ctx, "rg1", "firewallPolicy", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/FirewallPolicyGet.json -func ExampleFirewallPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFirewallPoliciesClient().Get(ctx, "rg1", "firewallPolicy", &armnetwork.FirewallPoliciesClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.FirewallPolicy = armnetwork.FirewallPolicy{ - // Name: to.Ptr("firewallPolicy"), - // Type: to.Ptr("Microsoft.Network/firewallPolicies"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.FirewallPolicyPropertiesFormat{ - // DNSSettings: &armnetwork.DNSSettings{ - // EnableProxy: to.Ptr(true), - // RequireProxyForNetworkRules: to.Ptr(false), - // Servers: []*string{ - // to.Ptr("30.3.4.5")}, - // }, - // Firewalls: []*armnetwork.SubResource{ - // }, - // Insights: &armnetwork.FirewallPolicyInsights{ - // IsEnabled: to.Ptr(true), - // LogAnalyticsResources: &armnetwork.FirewallPolicyLogAnalyticsResources{ - // DefaultWorkspaceID: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/defaultWorkspace"), - // }, - // Workspaces: []*armnetwork.FirewallPolicyLogAnalyticsWorkspace{ - // { - // Region: to.Ptr("westus"), - // WorkspaceID: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/workspace1"), - // }, - // }, - // { - // Region: to.Ptr("eastus"), - // WorkspaceID: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/workspace2"), - // }, - // }}, - // }, - // RetentionDays: to.Ptr[int32](100), - // }, - // IntrusionDetection: &armnetwork.FirewallPolicyIntrusionDetection{ - // Configuration: &armnetwork.FirewallPolicyIntrusionDetectionConfiguration{ - // BypassTrafficSettings: []*armnetwork.FirewallPolicyIntrusionDetectionBypassTrafficSpecifications{ - // { - // Name: to.Ptr("bypassRule1"), - // Description: to.Ptr("Rule 1"), - // DestinationAddresses: []*string{ - // to.Ptr("5.6.7.8")}, - // DestinationPorts: []*string{ - // to.Ptr("*")}, - // SourceAddresses: []*string{ - // to.Ptr("1.2.3.4")}, - // Protocol: to.Ptr(armnetwork.FirewallPolicyIntrusionDetectionProtocolTCP), - // }}, - // SignatureOverrides: []*armnetwork.FirewallPolicyIntrusionDetectionSignatureSpecification{ - // { - // ID: to.Ptr("2525004"), - // Mode: to.Ptr(armnetwork.FirewallPolicyIntrusionDetectionStateTypeDeny), - // }}, - // }, - // Mode: to.Ptr(armnetwork.FirewallPolicyIntrusionDetectionStateTypeAlert), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RuleCollectionGroups: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1"), - // }}, - // SKU: &armnetwork.FirewallPolicySKU{ - // Tier: to.Ptr(armnetwork.FirewallPolicySKUTierPremium), - // }, - // Snat: &armnetwork.FirewallPolicySNAT{ - // PrivateRanges: []*string{ - // to.Ptr("IANAPrivateRanges")}, - // }, - // SQL: &armnetwork.FirewallPolicySQL{ - // AllowSQLRedirect: to.Ptr(true), - // }, - // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), - // ThreatIntelWhitelist: &armnetwork.FirewallPolicyThreatIntelWhitelist{ - // Fqdns: []*string{ - // to.Ptr("*.microsoft.com")}, - // IPAddresses: []*string{ - // to.Ptr("20.3.4.5")}, - // }, - // TransportSecurity: &armnetwork.FirewallPolicyTransportSecurity{ - // CertificateAuthority: &armnetwork.FirewallPolicyCertificateAuthority{ - // Name: to.Ptr("clientcert"), - // KeyVaultSecretID: to.Ptr("https://kv/secret"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/FirewallPolicyPut.json -func ExampleFirewallPoliciesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFirewallPoliciesClient().BeginCreateOrUpdate(ctx, "rg1", "firewallPolicy", armnetwork.FirewallPolicy{ - Location: to.Ptr("West US"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, - Properties: &armnetwork.FirewallPolicyPropertiesFormat{ - DNSSettings: &armnetwork.DNSSettings{ - EnableProxy: to.Ptr(true), - RequireProxyForNetworkRules: to.Ptr(false), - Servers: []*string{ - to.Ptr("30.3.4.5")}, - }, - Insights: &armnetwork.FirewallPolicyInsights{ - IsEnabled: to.Ptr(true), - LogAnalyticsResources: &armnetwork.FirewallPolicyLogAnalyticsResources{ - DefaultWorkspaceID: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/defaultWorkspace"), - }, - Workspaces: []*armnetwork.FirewallPolicyLogAnalyticsWorkspace{ - { - Region: to.Ptr("westus"), - WorkspaceID: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/workspace1"), - }, - }, - { - Region: to.Ptr("eastus"), - WorkspaceID: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/workspace2"), - }, - }}, - }, - RetentionDays: to.Ptr[int32](100), - }, - IntrusionDetection: &armnetwork.FirewallPolicyIntrusionDetection{ - Configuration: &armnetwork.FirewallPolicyIntrusionDetectionConfiguration{ - BypassTrafficSettings: []*armnetwork.FirewallPolicyIntrusionDetectionBypassTrafficSpecifications{ - { - Name: to.Ptr("bypassRule1"), - Description: to.Ptr("Rule 1"), - DestinationAddresses: []*string{ - to.Ptr("5.6.7.8")}, - DestinationPorts: []*string{ - to.Ptr("*")}, - SourceAddresses: []*string{ - to.Ptr("1.2.3.4")}, - Protocol: to.Ptr(armnetwork.FirewallPolicyIntrusionDetectionProtocolTCP), - }}, - SignatureOverrides: []*armnetwork.FirewallPolicyIntrusionDetectionSignatureSpecification{ - { - ID: to.Ptr("2525004"), - Mode: to.Ptr(armnetwork.FirewallPolicyIntrusionDetectionStateTypeDeny), - }}, - }, - Mode: to.Ptr(armnetwork.FirewallPolicyIntrusionDetectionStateTypeAlert), - }, - SKU: &armnetwork.FirewallPolicySKU{ - Tier: to.Ptr(armnetwork.FirewallPolicySKUTierPremium), - }, - Snat: &armnetwork.FirewallPolicySNAT{ - PrivateRanges: []*string{ - to.Ptr("IANAPrivateRanges")}, - }, - SQL: &armnetwork.FirewallPolicySQL{ - AllowSQLRedirect: to.Ptr(true), - }, - ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), - ThreatIntelWhitelist: &armnetwork.FirewallPolicyThreatIntelWhitelist{ - Fqdns: []*string{ - to.Ptr("*.microsoft.com")}, - IPAddresses: []*string{ - to.Ptr("20.3.4.5")}, - }, - TransportSecurity: &armnetwork.FirewallPolicyTransportSecurity{ - CertificateAuthority: &armnetwork.FirewallPolicyCertificateAuthority{ - Name: to.Ptr("clientcert"), - KeyVaultSecretID: to.Ptr("https://kv/secret"), - }, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.FirewallPolicy = armnetwork.FirewallPolicy{ - // Name: to.Ptr("firewallPolicy"), - // Type: to.Ptr("Microsoft.Network/firewallPolicies"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.FirewallPolicyPropertiesFormat{ - // DNSSettings: &armnetwork.DNSSettings{ - // EnableProxy: to.Ptr(true), - // RequireProxyForNetworkRules: to.Ptr(false), - // Servers: []*string{ - // to.Ptr("30.3.4.5")}, - // }, - // Firewalls: []*armnetwork.SubResource{ - // }, - // Insights: &armnetwork.FirewallPolicyInsights{ - // IsEnabled: to.Ptr(true), - // LogAnalyticsResources: &armnetwork.FirewallPolicyLogAnalyticsResources{ - // DefaultWorkspaceID: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/defaultWorkspace"), - // }, - // Workspaces: []*armnetwork.FirewallPolicyLogAnalyticsWorkspace{ - // { - // Region: to.Ptr("westus"), - // WorkspaceID: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/workspace1"), - // }, - // }, - // { - // Region: to.Ptr("eastus"), - // WorkspaceID: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/workspace2"), - // }, - // }}, - // }, - // RetentionDays: to.Ptr[int32](100), - // }, - // IntrusionDetection: &armnetwork.FirewallPolicyIntrusionDetection{ - // Configuration: &armnetwork.FirewallPolicyIntrusionDetectionConfiguration{ - // BypassTrafficSettings: []*armnetwork.FirewallPolicyIntrusionDetectionBypassTrafficSpecifications{ - // { - // Name: to.Ptr("bypassRule1"), - // Description: to.Ptr("Rule 1"), - // DestinationAddresses: []*string{ - // to.Ptr("5.6.7.8")}, - // DestinationPorts: []*string{ - // to.Ptr("*")}, - // SourceAddresses: []*string{ - // to.Ptr("1.2.3.4")}, - // Protocol: to.Ptr(armnetwork.FirewallPolicyIntrusionDetectionProtocolTCP), - // }}, - // SignatureOverrides: []*armnetwork.FirewallPolicyIntrusionDetectionSignatureSpecification{ - // { - // ID: to.Ptr("2525004"), - // Mode: to.Ptr(armnetwork.FirewallPolicyIntrusionDetectionStateTypeDeny), - // }}, - // }, - // Mode: to.Ptr(armnetwork.FirewallPolicyIntrusionDetectionStateTypeAlert), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RuleCollectionGroups: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup2"), - // }}, - // SKU: &armnetwork.FirewallPolicySKU{ - // Tier: to.Ptr(armnetwork.FirewallPolicySKUTierPremium), - // }, - // Snat: &armnetwork.FirewallPolicySNAT{ - // PrivateRanges: []*string{ - // to.Ptr("IANAPrivateRanges")}, - // }, - // SQL: &armnetwork.FirewallPolicySQL{ - // AllowSQLRedirect: to.Ptr(true), - // }, - // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), - // ThreatIntelWhitelist: &armnetwork.FirewallPolicyThreatIntelWhitelist{ - // Fqdns: []*string{ - // to.Ptr("*.microsoft.com")}, - // IPAddresses: []*string{ - // to.Ptr("20.3.4.5")}, - // }, - // TransportSecurity: &armnetwork.FirewallPolicyTransportSecurity{ - // CertificateAuthority: &armnetwork.FirewallPolicyCertificateAuthority{ - // Name: to.Ptr("clientcert"), - // KeyVaultSecretID: to.Ptr("https://kv/secret"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/FirewallPolicyPatch.json -func ExampleFirewallPoliciesClient_UpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFirewallPoliciesClient().UpdateTags(ctx, "myResourceGroup", "firewallPolicy", armnetwork.TagsObject{ - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - "key2": to.Ptr("value2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.FirewallPolicy = armnetwork.FirewallPolicy{ - // Name: to.Ptr("firewallPolicy"), - // Type: to.Ptr("Microsoft.Network/firewallPolicies"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/myResourceGroup/providers/Microsoft.Network/firewallPolicies/firewallPolicy"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.FirewallPolicyPropertiesFormat{ - // DNSSettings: &armnetwork.DNSSettings{ - // EnableProxy: to.Ptr(true), - // RequireProxyForNetworkRules: to.Ptr(false), - // Servers: []*string{ - // to.Ptr("30.3.4.5")}, - // }, - // Firewalls: []*armnetwork.SubResource{ - // }, - // Insights: &armnetwork.FirewallPolicyInsights{ - // IsEnabled: to.Ptr(true), - // LogAnalyticsResources: &armnetwork.FirewallPolicyLogAnalyticsResources{ - // DefaultWorkspaceID: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/defaultWorkspace"), - // }, - // Workspaces: []*armnetwork.FirewallPolicyLogAnalyticsWorkspace{ - // { - // Region: to.Ptr("westus"), - // WorkspaceID: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/workspace1"), - // }, - // }, - // { - // Region: to.Ptr("eastus"), - // WorkspaceID: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/workspace2"), - // }, - // }}, - // }, - // RetentionDays: to.Ptr[int32](100), - // }, - // IntrusionDetection: &armnetwork.FirewallPolicyIntrusionDetection{ - // Configuration: &armnetwork.FirewallPolicyIntrusionDetectionConfiguration{ - // BypassTrafficSettings: []*armnetwork.FirewallPolicyIntrusionDetectionBypassTrafficSpecifications{ - // { - // Name: to.Ptr("bypassRule1"), - // Description: to.Ptr("Rule 1"), - // DestinationAddresses: []*string{ - // to.Ptr("5.6.7.8")}, - // DestinationPorts: []*string{ - // to.Ptr("*")}, - // SourceAddresses: []*string{ - // to.Ptr("1.2.3.4")}, - // Protocol: to.Ptr(armnetwork.FirewallPolicyIntrusionDetectionProtocolTCP), - // }}, - // SignatureOverrides: []*armnetwork.FirewallPolicyIntrusionDetectionSignatureSpecification{ - // { - // ID: to.Ptr("2525004"), - // Mode: to.Ptr(armnetwork.FirewallPolicyIntrusionDetectionStateTypeDeny), - // }}, - // }, - // Mode: to.Ptr(armnetwork.FirewallPolicyIntrusionDetectionStateTypeAlert), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RuleCollectionGroups: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1"), - // }}, - // SKU: &armnetwork.FirewallPolicySKU{ - // Tier: to.Ptr(armnetwork.FirewallPolicySKUTierPremium), - // }, - // Snat: &armnetwork.FirewallPolicySNAT{ - // PrivateRanges: []*string{ - // to.Ptr("IANAPrivateRanges")}, - // }, - // SQL: &armnetwork.FirewallPolicySQL{ - // AllowSQLRedirect: to.Ptr(true), - // }, - // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), - // ThreatIntelWhitelist: &armnetwork.FirewallPolicyThreatIntelWhitelist{ - // Fqdns: []*string{ - // to.Ptr("*.microsoft.com")}, - // IPAddresses: []*string{ - // to.Ptr("20.3.4.5")}, - // }, - // TransportSecurity: &armnetwork.FirewallPolicyTransportSecurity{ - // CertificateAuthority: &armnetwork.FirewallPolicyCertificateAuthority{ - // Name: to.Ptr("clientcert"), - // KeyVaultSecretID: to.Ptr("https://kv/secret"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/FirewallPolicyListByResourceGroup.json -func ExampleFirewallPoliciesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewFirewallPoliciesClient().NewListPager("rg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.FirewallPolicyListResult = armnetwork.FirewallPolicyListResult{ - // Value: []*armnetwork.FirewallPolicy{ - // { - // Name: to.Ptr("firewallPolicy"), - // Type: to.Ptr("Microsoft.Network/firewallPolicies"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.FirewallPolicyPropertiesFormat{ - // DNSSettings: &armnetwork.DNSSettings{ - // EnableProxy: to.Ptr(true), - // RequireProxyForNetworkRules: to.Ptr(false), - // Servers: []*string{ - // to.Ptr("30.3.4.5")}, - // }, - // Firewalls: []*armnetwork.SubResource{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RuleCollectionGroups: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1"), - // }}, - // SKU: &armnetwork.FirewallPolicySKU{ - // Tier: to.Ptr(armnetwork.FirewallPolicySKUTierStandard), - // }, - // Snat: &armnetwork.FirewallPolicySNAT{ - // PrivateRanges: []*string{ - // to.Ptr("IANAPrivateRanges")}, - // }, - // SQL: &armnetwork.FirewallPolicySQL{ - // AllowSQLRedirect: to.Ptr(true), - // }, - // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/FirewallPolicyListBySubscription.json -func ExampleFirewallPoliciesClient_NewListAllPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewFirewallPoliciesClient().NewListAllPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.FirewallPolicyListResult = armnetwork.FirewallPolicyListResult{ - // Value: []*armnetwork.FirewallPolicy{ - // { - // Name: to.Ptr("firewallPolicy"), - // Type: to.Ptr("Microsoft.Network/firewallPolicies"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.FirewallPolicyPropertiesFormat{ - // DNSSettings: &armnetwork.DNSSettings{ - // EnableProxy: to.Ptr(true), - // RequireProxyForNetworkRules: to.Ptr(false), - // Servers: []*string{ - // to.Ptr("30.3.4.5")}, - // }, - // Firewalls: []*armnetwork.SubResource{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RuleCollectionGroups: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1"), - // }}, - // SKU: &armnetwork.FirewallPolicySKU{ - // Tier: to.Ptr(armnetwork.FirewallPolicySKUTierStandard), - // }, - // Snat: &armnetwork.FirewallPolicySNAT{ - // PrivateRanges: []*string{ - // to.Ptr("IANAPrivateRanges")}, - // }, - // SQL: &armnetwork.FirewallPolicySQL{ - // AllowSQLRedirect: to.Ptr(true), - // }, - // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignatures_client.go b/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignatures_client.go index 8e7fdda12a15..5e43850d0b8b 100644 --- a/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignatures_client.go +++ b/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignatures_client.go @@ -47,7 +47,7 @@ func NewFirewallPolicyIdpsSignaturesClient(subscriptionID string, credential azc // List - Retrieves the current status of IDPS signatures for the relevant policy // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - firewallPolicyName - The name of the Firewall Policy. // - options - FirewallPolicyIdpsSignaturesClientListOptions contains the optional parameters for the FirewallPolicyIdpsSignaturesClient.List @@ -94,7 +94,7 @@ func (client *FirewallPolicyIdpsSignaturesClient) listCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignatures_client_example_test.go b/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignatures_client_example_test.go deleted file mode 100644 index b014a6cbf2c8..000000000000 --- a/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignatures_client_example_test.go +++ /dev/null @@ -1,87 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/FirewallPolicyQuerySignatureOverrides.json -func ExampleFirewallPolicyIdpsSignaturesClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFirewallPolicyIdpsSignaturesClient().List(ctx, "rg1", "firewallPolicy", armnetwork.IDPSQueryObject{ - Filters: []*armnetwork.FilterItems{ - { - Field: to.Ptr("Mode"), - Values: []*string{ - to.Ptr("Deny")}, - }}, - OrderBy: &armnetwork.OrderBy{ - Field: to.Ptr("severity"), - Order: to.Ptr(armnetwork.FirewallPolicyIDPSQuerySortOrderAscending), - }, - ResultsPerPage: to.Ptr[int32](20), - Search: to.Ptr(""), - Skip: to.Ptr[int32](0), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.QueryResults = armnetwork.QueryResults{ - // MatchingRecordsCount: to.Ptr[int64](2), - // Signatures: []*armnetwork.SingleQueryResult{ - // { - // Description: to.Ptr("P2P Phatbot Control Connection"), - // DestinationPorts: []*string{ - // to.Ptr("any")}, - // Direction: to.Ptr(armnetwork.FirewallPolicyIDPSSignatureDirectionTwo), - // Group: to.Ptr("A Network Trojan was detected"), - // InheritedFromParentPolicy: to.Ptr(false), - // LastUpdated: to.Ptr("2010-07-30T00:00:00"), - // Mode: to.Ptr(armnetwork.FirewallPolicyIDPSSignatureModeTwo), - // Severity: to.Ptr(armnetwork.FirewallPolicyIDPSSignatureSeverityOne), - // SignatureID: to.Ptr[int32](2000015), - // SourcePorts: []*string{ - // to.Ptr("any")}, - // Protocol: to.Ptr("tcp"), - // }, - // { - // Description: to.Ptr("WEB_SERVER SQL sp_delete_alert attempt"), - // DestinationPorts: []*string{ - // to.Ptr("any")}, - // Direction: to.Ptr(armnetwork.FirewallPolicyIDPSSignatureDirectionOne), - // Group: to.Ptr("Attempted User Privilege Gain"), - // InheritedFromParentPolicy: to.Ptr(false), - // LastUpdated: to.Ptr("2019-09-27T00:00:00"), - // Mode: to.Ptr(armnetwork.FirewallPolicyIDPSSignatureModeTwo), - // Severity: to.Ptr(armnetwork.FirewallPolicyIDPSSignatureSeverityOne), - // SignatureID: to.Ptr[int32](2000106), - // SourcePorts: []*string{ - // to.Ptr("any")}, - // Protocol: to.Ptr("http"), - // }}, - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignaturesfiltervalues_client.go b/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignaturesfiltervalues_client.go index 9a7f8fbddfc1..b719721a9fac 100644 --- a/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignaturesfiltervalues_client.go +++ b/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignaturesfiltervalues_client.go @@ -47,7 +47,7 @@ func NewFirewallPolicyIdpsSignaturesFilterValuesClient(subscriptionID string, cr // List - Retrieves the current filter values for the signatures overrides // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - firewallPolicyName - The name of the Firewall Policy. // - options - FirewallPolicyIdpsSignaturesFilterValuesClientListOptions contains the optional parameters for the FirewallPolicyIdpsSignaturesFilterValuesClient.List @@ -94,7 +94,7 @@ func (client *FirewallPolicyIdpsSignaturesFilterValuesClient) listCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignaturesfiltervalues_client_example_test.go b/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignaturesfiltervalues_client_example_test.go deleted file mode 100644 index 6ccc572f8d79..000000000000 --- a/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignaturesfiltervalues_client_example_test.go +++ /dev/null @@ -1,47 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/FirewallPolicyQuerySignatureOverridesFilterValues.json -func ExampleFirewallPolicyIdpsSignaturesFilterValuesClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFirewallPolicyIdpsSignaturesFilterValuesClient().List(ctx, "rg1", "firewallPolicy", armnetwork.SignatureOverridesFilterValuesQuery{ - FilterName: to.Ptr("severity"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SignatureOverridesFilterValuesResponse = armnetwork.SignatureOverridesFilterValuesResponse{ - // FilterValues: []*string{ - // to.Ptr("low"), - // to.Ptr("medium"), - // to.Ptr("high")}, - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignaturesoverrides_client.go b/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignaturesoverrides_client.go index 0cdeb5b18a4e..11189433f764 100644 --- a/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignaturesoverrides_client.go +++ b/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignaturesoverrides_client.go @@ -47,7 +47,7 @@ func NewFirewallPolicyIdpsSignaturesOverridesClient(subscriptionID string, crede // Get - Returns all signatures overrides for a specific policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - firewallPolicyName - The name of the Firewall Policy. // - options - FirewallPolicyIdpsSignaturesOverridesClientGetOptions contains the optional parameters for the FirewallPolicyIdpsSignaturesOverridesClient.Get @@ -94,7 +94,7 @@ func (client *FirewallPolicyIdpsSignaturesOverridesClient) getCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -112,7 +112,7 @@ func (client *FirewallPolicyIdpsSignaturesOverridesClient) getHandleResponse(res // List - Returns all signatures overrides objects for a specific policy as a list containing a single value. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - firewallPolicyName - The name of the Firewall Policy. // - options - FirewallPolicyIdpsSignaturesOverridesClientListOptions contains the optional parameters for the FirewallPolicyIdpsSignaturesOverridesClient.List @@ -159,7 +159,7 @@ func (client *FirewallPolicyIdpsSignaturesOverridesClient) listCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -177,7 +177,7 @@ func (client *FirewallPolicyIdpsSignaturesOverridesClient) listHandleResponse(re // Patch - Will update the status of policy's signature overrides for IDPS // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - firewallPolicyName - The name of the Firewall Policy. // - parameters - Will contain all properties of the object to put @@ -225,7 +225,7 @@ func (client *FirewallPolicyIdpsSignaturesOverridesClient) patchCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -246,7 +246,7 @@ func (client *FirewallPolicyIdpsSignaturesOverridesClient) patchHandleResponse(r // Put - Will override/create a new signature overrides for the policy's IDPS // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - firewallPolicyName - The name of the Firewall Policy. // - parameters - Will contain all properties of the object to put @@ -294,7 +294,7 @@ func (client *FirewallPolicyIdpsSignaturesOverridesClient) putCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignaturesoverrides_client_example_test.go b/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignaturesoverrides_client_example_test.go deleted file mode 100644 index cfe6148a71ef..000000000000 --- a/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignaturesoverrides_client_example_test.go +++ /dev/null @@ -1,166 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/FirewallPolicySignatureOverridesPatch.json -func ExampleFirewallPolicyIdpsSignaturesOverridesClient_Patch() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFirewallPolicyIdpsSignaturesOverridesClient().Patch(ctx, "rg1", "firewallPolicy", armnetwork.SignaturesOverrides{ - Name: to.Ptr("default"), - Type: to.Ptr("Microsoft.Network/firewallPolicies/signatureOverrides"), - ID: to.Ptr("/subscriptions/e747cc13-97d4-4a79-b463-42d7f4e558f2/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/signatureOverrides/default"), - Properties: &armnetwork.SignaturesOverridesProperties{ - Signatures: map[string]*string{ - "2000105": to.Ptr("Off"), - "2000106": to.Ptr("Deny"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SignaturesOverrides = armnetwork.SignaturesOverrides{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Network/firewallPolicies/signatureOverrides"), - // ID: to.Ptr("/subscriptions/e747cc13-97d4-4a79-b463-42d7f4e558f2/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/signatureOverrides/default"), - // Properties: &armnetwork.SignaturesOverridesProperties{ - // Signatures: map[string]*string{ - // "2000105": to.Ptr("Off"), - // "2000106": to.Ptr("Deny"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/FirewallPolicySignatureOverridesPut.json -func ExampleFirewallPolicyIdpsSignaturesOverridesClient_Put() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFirewallPolicyIdpsSignaturesOverridesClient().Put(ctx, "rg1", "firewallPolicy", armnetwork.SignaturesOverrides{ - Name: to.Ptr("default"), - Type: to.Ptr("Microsoft.Network/firewallPolicies/signatureOverrides"), - ID: to.Ptr("/subscriptions/e747cc13-97d4-4a79-b463-42d7f4e558f2/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/signatureOverrides/default"), - Properties: &armnetwork.SignaturesOverridesProperties{ - Signatures: map[string]*string{ - "2000105": to.Ptr("Off"), - "2000106": to.Ptr("Deny"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SignaturesOverrides = armnetwork.SignaturesOverrides{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Network/firewallPolicies/signatureOverrides"), - // ID: to.Ptr("/subscriptions/e747cc13-97d4-4a79-b463-42d7f4e558f2/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/signatureOverrides/default"), - // Properties: &armnetwork.SignaturesOverridesProperties{ - // Signatures: map[string]*string{ - // "2000105": to.Ptr("Off"), - // "2000106": to.Ptr("Deny"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/FirewallPolicySignatureOverridesGet.json -func ExampleFirewallPolicyIdpsSignaturesOverridesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFirewallPolicyIdpsSignaturesOverridesClient().Get(ctx, "rg1", "firewallPolicy", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SignaturesOverrides = armnetwork.SignaturesOverrides{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Network/firewallPolicies/signatureOverrides"), - // ID: to.Ptr("/subscriptions/e747cc13-97d4-4a79-b463-42d7f4e558f2/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/signatureOverrides/default"), - // Properties: &armnetwork.SignaturesOverridesProperties{ - // Signatures: map[string]*string{ - // "2000105": to.Ptr("Off"), - // "2000106": to.Ptr("Deny"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/FirewallPolicySignatureOverridesList.json -func ExampleFirewallPolicyIdpsSignaturesOverridesClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFirewallPolicyIdpsSignaturesOverridesClient().List(ctx, "rg1", "firewallPolicy", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SignaturesOverridesList = armnetwork.SignaturesOverridesList{ - // Value: []*armnetwork.SignaturesOverrides{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Network/firewallPolicies/signatureOverrides"), - // ID: to.Ptr("/subscriptions/e747cc13-97d4-4a79-b463-42d7f4e558f2/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/signatureOverrides/default"), - // Properties: &armnetwork.SignaturesOverridesProperties{ - // Signatures: map[string]*string{ - // "2000105": to.Ptr("Off"), - // "2000106": to.Ptr("Deny"), - // }, - // }, - // }}, - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/firewallpolicyrulecollectiongroups_client.go b/sdk/resourcemanager/network/armnetwork/firewallpolicyrulecollectiongroups_client.go index a074befe6dd6..6e08ea33faf8 100644 --- a/sdk/resourcemanager/network/armnetwork/firewallpolicyrulecollectiongroups_client.go +++ b/sdk/resourcemanager/network/armnetwork/firewallpolicyrulecollectiongroups_client.go @@ -47,7 +47,7 @@ func NewFirewallPolicyRuleCollectionGroupsClient(subscriptionID string, credenti // BeginCreateOrUpdate - Creates or updates the specified FirewallPolicyRuleCollectionGroup. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - firewallPolicyName - The name of the Firewall Policy. // - ruleCollectionGroupName - The name of the FirewallPolicyRuleCollectionGroup. @@ -72,7 +72,7 @@ func (client *FirewallPolicyRuleCollectionGroupsClient) BeginCreateOrUpdate(ctx // CreateOrUpdate - Creates or updates the specified FirewallPolicyRuleCollectionGroup. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *FirewallPolicyRuleCollectionGroupsClient) createOrUpdate(ctx context.Context, resourceGroupName string, firewallPolicyName string, ruleCollectionGroupName string, parameters FirewallPolicyRuleCollectionGroup, options *FirewallPolicyRuleCollectionGroupsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "FirewallPolicyRuleCollectionGroupsClient.BeginCreateOrUpdate" @@ -118,7 +118,7 @@ func (client *FirewallPolicyRuleCollectionGroupsClient) createOrUpdateCreateRequ return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -130,7 +130,7 @@ func (client *FirewallPolicyRuleCollectionGroupsClient) createOrUpdateCreateRequ // BeginDelete - Deletes the specified FirewallPolicyRuleCollectionGroup. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - firewallPolicyName - The name of the Firewall Policy. // - ruleCollectionGroupName - The name of the FirewallPolicyRuleCollectionGroup. @@ -154,7 +154,7 @@ func (client *FirewallPolicyRuleCollectionGroupsClient) BeginDelete(ctx context. // Delete - Deletes the specified FirewallPolicyRuleCollectionGroup. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *FirewallPolicyRuleCollectionGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, firewallPolicyName string, ruleCollectionGroupName string, options *FirewallPolicyRuleCollectionGroupsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "FirewallPolicyRuleCollectionGroupsClient.BeginDelete" @@ -200,7 +200,7 @@ func (client *FirewallPolicyRuleCollectionGroupsClient) deleteCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -209,7 +209,7 @@ func (client *FirewallPolicyRuleCollectionGroupsClient) deleteCreateRequest(ctx // Get - Gets the specified FirewallPolicyRuleCollectionGroup. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - firewallPolicyName - The name of the Firewall Policy. // - ruleCollectionGroupName - The name of the FirewallPolicyRuleCollectionGroup. @@ -261,7 +261,7 @@ func (client *FirewallPolicyRuleCollectionGroupsClient) getCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -278,7 +278,7 @@ func (client *FirewallPolicyRuleCollectionGroupsClient) getHandleResponse(resp * // NewListPager - Lists all FirewallPolicyRuleCollectionGroups in a FirewallPolicy resource. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - firewallPolicyName - The name of the Firewall Policy. // - options - FirewallPolicyRuleCollectionGroupsClientListOptions contains the optional parameters for the FirewallPolicyRuleCollectionGroupsClient.NewListPager @@ -333,7 +333,7 @@ func (client *FirewallPolicyRuleCollectionGroupsClient) listCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/firewallpolicyrulecollectiongroups_client_example_test.go b/sdk/resourcemanager/network/armnetwork/firewallpolicyrulecollectiongroups_client_example_test.go deleted file mode 100644 index d6bf18077dc5..000000000000 --- a/sdk/resourcemanager/network/armnetwork/firewallpolicyrulecollectiongroups_client_example_test.go +++ /dev/null @@ -1,859 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/FirewallPolicyRuleCollectionGroupDelete.json -func ExampleFirewallPolicyRuleCollectionGroupsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFirewallPolicyRuleCollectionGroupsClient().BeginDelete(ctx, "rg1", "firewallPolicy", "ruleCollectionGroup1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/FirewallPolicyNatRuleCollectionGroupGet.json -func ExampleFirewallPolicyRuleCollectionGroupsClient_Get_getFirewallPolicyNatRuleCollectionGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFirewallPolicyRuleCollectionGroupsClient().Get(ctx, "rg1", "firewallPolicy", "ruleCollectionGroup1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.FirewallPolicyRuleCollectionGroup = armnetwork.FirewallPolicyRuleCollectionGroup{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1"), - // Name: to.Ptr("ruleCollectionGroup1"), - // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), - // Properties: &armnetwork.FirewallPolicyRuleCollectionGroupProperties{ - // Priority: to.Ptr[int32](100), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RuleCollections: []armnetwork.FirewallPolicyRuleCollectionClassification{ - // &armnetwork.FirewallPolicyNatRuleCollection{ - // Name: to.Ptr("NatRC"), - // Priority: to.Ptr[int32](100), - // RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyNatRuleCollection), - // Action: &armnetwork.FirewallPolicyNatRuleCollectionAction{ - // Type: to.Ptr(armnetwork.FirewallPolicyNatRuleCollectionActionTypeDNAT), - // }, - // Rules: []armnetwork.FirewallPolicyRuleClassification{ - // &armnetwork.NatRule{ - // Name: to.Ptr("NatRule1"), - // RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeNatRule), - // DestinationAddresses: []*string{ - // to.Ptr("152.23.32.23")}, - // DestinationPorts: []*string{ - // to.Ptr("8080")}, - // IPProtocols: []*armnetwork.FirewallPolicyRuleNetworkProtocol{ - // to.Ptr(armnetwork.FirewallPolicyRuleNetworkProtocolTCP), - // to.Ptr(armnetwork.FirewallPolicyRuleNetworkProtocolUDP)}, - // SourceAddresses: []*string{ - // to.Ptr("2.2.2.2")}, - // SourceIPGroups: []*string{ - // }, - // TranslatedFqdn: to.Ptr("internalhttpserver"), - // TranslatedPort: to.Ptr("8080"), - // }}, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/FirewallPolicyRuleCollectionGroupGet.json -func ExampleFirewallPolicyRuleCollectionGroupsClient_Get_getFirewallPolicyRuleCollectionGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFirewallPolicyRuleCollectionGroupsClient().Get(ctx, "rg1", "firewallPolicy", "ruleCollectionGroup1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.FirewallPolicyRuleCollectionGroup = armnetwork.FirewallPolicyRuleCollectionGroup{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1"), - // Name: to.Ptr("ruleCollectionGroup1"), - // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), - // Properties: &armnetwork.FirewallPolicyRuleCollectionGroupProperties{ - // Priority: to.Ptr[int32](110), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RuleCollections: []armnetwork.FirewallPolicyRuleCollectionClassification{ - // &armnetwork.FirewallPolicyFilterRuleCollection{ - // Name: to.Ptr("Example-Filter-Rule-Collection"), - // Priority: to.Ptr[int32](200), - // RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection), - // Action: &armnetwork.FirewallPolicyFilterRuleCollectionAction{ - // Type: to.Ptr(armnetwork.FirewallPolicyFilterRuleCollectionActionTypeDeny), - // }, - // Rules: []armnetwork.FirewallPolicyRuleClassification{ - // &armnetwork.Rule{ - // Name: to.Ptr("network-rule1"), - // RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeNetworkRule), - // DestinationAddresses: []*string{ - // to.Ptr("*")}, - // DestinationPorts: []*string{ - // to.Ptr("*")}, - // IPProtocols: []*armnetwork.FirewallPolicyRuleNetworkProtocol{ - // to.Ptr(armnetwork.FirewallPolicyRuleNetworkProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("10.1.25.0/24")}, - // }}, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/FirewallPolicyRuleCollectionGroupWithIpGroupsGet.json -func ExampleFirewallPolicyRuleCollectionGroupsClient_Get_getFirewallPolicyRuleCollectionGroupWithIpGroups() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFirewallPolicyRuleCollectionGroupsClient().Get(ctx, "rg1", "firewallPolicy", "ruleGroup1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.FirewallPolicyRuleCollectionGroup = armnetwork.FirewallPolicyRuleCollectionGroup{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleGroups/ruleGroup1"), - // Name: to.Ptr("ruleGroup1"), - // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), - // Properties: &armnetwork.FirewallPolicyRuleCollectionGroupProperties{ - // Priority: to.Ptr[int32](110), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RuleCollections: []armnetwork.FirewallPolicyRuleCollectionClassification{ - // &armnetwork.FirewallPolicyFilterRuleCollection{ - // Name: to.Ptr("Example-Filter-Rule-Collection"), - // Priority: to.Ptr[int32](200), - // RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection), - // Action: &armnetwork.FirewallPolicyFilterRuleCollectionAction{ - // Type: to.Ptr(armnetwork.FirewallPolicyFilterRuleCollectionActionTypeDeny), - // }, - // Rules: []armnetwork.FirewallPolicyRuleClassification{ - // &armnetwork.Rule{ - // Name: to.Ptr("network-rule1"), - // RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeNetworkRule), - // DestinationIPGroups: []*string{ - // to.Ptr("/subscriptions/subid/providers/Microsoft.Network/resourceGroup/rg1/ipGroups/ipGroups2")}, - // DestinationPorts: []*string{ - // to.Ptr("*")}, - // IPProtocols: []*armnetwork.FirewallPolicyRuleNetworkProtocol{ - // to.Ptr(armnetwork.FirewallPolicyRuleNetworkProtocolTCP)}, - // SourceIPGroups: []*string{ - // to.Ptr("/subscriptions/subid/providers/Microsoft.Network/resourceGroup/rg1/ipGroups/ipGroups1")}, - // }}, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/FirewallPolicyRuleCollectionGroupWithWebCategoriesGet.json -func ExampleFirewallPolicyRuleCollectionGroupsClient_Get_getFirewallPolicyRuleCollectionGroupWithWebCategories() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFirewallPolicyRuleCollectionGroupsClient().Get(ctx, "rg1", "firewallPolicy", "ruleCollectionGroup1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.FirewallPolicyRuleCollectionGroup = armnetwork.FirewallPolicyRuleCollectionGroup{ - // ID: to.Ptr("/subscriptions/e747cc13-97d4-4a79-b463-42d7f4e558f2/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1"), - // Name: to.Ptr("ruleCollectionGroup1"), - // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), - // Properties: &armnetwork.FirewallPolicyRuleCollectionGroupProperties{ - // Priority: to.Ptr[int32](110), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RuleCollections: []armnetwork.FirewallPolicyRuleCollectionClassification{ - // &armnetwork.FirewallPolicyFilterRuleCollection{ - // Name: to.Ptr("Example-Filter-Rule-Collection"), - // Priority: to.Ptr[int32](200), - // RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection), - // Action: &armnetwork.FirewallPolicyFilterRuleCollectionAction{ - // Type: to.Ptr(armnetwork.FirewallPolicyFilterRuleCollectionActionTypeDeny), - // }, - // Rules: []armnetwork.FirewallPolicyRuleClassification{ - // &armnetwork.ApplicationRule{ - // Name: to.Ptr("rule1"), - // Description: to.Ptr("Deny inbound rule"), - // RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeApplicationRule), - // Protocols: []*armnetwork.FirewallPolicyRuleApplicationProtocol{ - // { - // Port: to.Ptr[int32](443), - // ProtocolType: to.Ptr(armnetwork.FirewallPolicyRuleApplicationProtocolTypeHTTPS), - // }}, - // SourceAddresses: []*string{ - // to.Ptr("216.58.216.164"), - // to.Ptr("10.0.0.0/24")}, - // WebCategories: []*string{ - // to.Ptr("Hacking")}, - // }}, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/FirewallPolicyNatRuleCollectionGroupPut.json -func ExampleFirewallPolicyRuleCollectionGroupsClient_BeginCreateOrUpdate_createFirewallPolicyNatRuleCollectionGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFirewallPolicyRuleCollectionGroupsClient().BeginCreateOrUpdate(ctx, "rg1", "firewallPolicy", "ruleCollectionGroup1", armnetwork.FirewallPolicyRuleCollectionGroup{ - Properties: &armnetwork.FirewallPolicyRuleCollectionGroupProperties{ - Priority: to.Ptr[int32](100), - RuleCollections: []armnetwork.FirewallPolicyRuleCollectionClassification{ - &armnetwork.FirewallPolicyNatRuleCollection{ - Name: to.Ptr("Example-Nat-Rule-Collection"), - Priority: to.Ptr[int32](100), - RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyNatRuleCollection), - Action: &armnetwork.FirewallPolicyNatRuleCollectionAction{ - Type: to.Ptr(armnetwork.FirewallPolicyNatRuleCollectionActionTypeDNAT), - }, - Rules: []armnetwork.FirewallPolicyRuleClassification{ - &armnetwork.NatRule{ - Name: to.Ptr("nat-rule1"), - RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeNatRule), - DestinationAddresses: []*string{ - to.Ptr("152.23.32.23")}, - DestinationPorts: []*string{ - to.Ptr("8080")}, - IPProtocols: []*armnetwork.FirewallPolicyRuleNetworkProtocol{ - to.Ptr(armnetwork.FirewallPolicyRuleNetworkProtocolTCP), - to.Ptr(armnetwork.FirewallPolicyRuleNetworkProtocolUDP)}, - SourceAddresses: []*string{ - to.Ptr("2.2.2.2")}, - SourceIPGroups: []*string{}, - TranslatedFqdn: to.Ptr("internalhttp.server.net"), - TranslatedPort: to.Ptr("8080"), - }}, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.FirewallPolicyRuleCollectionGroup = armnetwork.FirewallPolicyRuleCollectionGroup{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1"), - // Name: to.Ptr("ruleCollectionGroup1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.FirewallPolicyRuleCollectionGroupProperties{ - // Priority: to.Ptr[int32](100), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RuleCollections: []armnetwork.FirewallPolicyRuleCollectionClassification{ - // &armnetwork.FirewallPolicyNatRuleCollection{ - // Name: to.Ptr("Example-Nat-Rule-Collection"), - // Priority: to.Ptr[int32](100), - // RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyNatRuleCollection), - // Action: &armnetwork.FirewallPolicyNatRuleCollectionAction{ - // Type: to.Ptr(armnetwork.FirewallPolicyNatRuleCollectionActionTypeDNAT), - // }, - // Rules: []armnetwork.FirewallPolicyRuleClassification{ - // &armnetwork.NatRule{ - // Name: to.Ptr("nat-rule1"), - // RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeNatRule), - // DestinationAddresses: []*string{ - // to.Ptr("152.23.32.23")}, - // DestinationPorts: []*string{ - // to.Ptr("8080")}, - // IPProtocols: []*armnetwork.FirewallPolicyRuleNetworkProtocol{ - // to.Ptr(armnetwork.FirewallPolicyRuleNetworkProtocolTCP), - // to.Ptr(armnetwork.FirewallPolicyRuleNetworkProtocolUDP)}, - // SourceAddresses: []*string{ - // to.Ptr("2.2.2.2")}, - // SourceIPGroups: []*string{ - // }, - // TranslatedFqdn: to.Ptr("internalhttp.server.net"), - // TranslatedPort: to.Ptr("8080"), - // }}, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/FirewallPolicyRuleCollectionGroupPut.json -func ExampleFirewallPolicyRuleCollectionGroupsClient_BeginCreateOrUpdate_createFirewallPolicyRuleCollectionGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFirewallPolicyRuleCollectionGroupsClient().BeginCreateOrUpdate(ctx, "rg1", "firewallPolicy", "ruleCollectionGroup1", armnetwork.FirewallPolicyRuleCollectionGroup{ - Properties: &armnetwork.FirewallPolicyRuleCollectionGroupProperties{ - Priority: to.Ptr[int32](100), - RuleCollections: []armnetwork.FirewallPolicyRuleCollectionClassification{ - &armnetwork.FirewallPolicyFilterRuleCollection{ - Name: to.Ptr("Example-Filter-Rule-Collection"), - Priority: to.Ptr[int32](100), - RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection), - Action: &armnetwork.FirewallPolicyFilterRuleCollectionAction{ - Type: to.Ptr(armnetwork.FirewallPolicyFilterRuleCollectionActionTypeDeny), - }, - Rules: []armnetwork.FirewallPolicyRuleClassification{ - &armnetwork.Rule{ - Name: to.Ptr("network-rule1"), - RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeNetworkRule), - DestinationAddresses: []*string{ - to.Ptr("*")}, - DestinationPorts: []*string{ - to.Ptr("*")}, - IPProtocols: []*armnetwork.FirewallPolicyRuleNetworkProtocol{ - to.Ptr(armnetwork.FirewallPolicyRuleNetworkProtocolTCP)}, - SourceAddresses: []*string{ - to.Ptr("10.1.25.0/24")}, - }}, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.FirewallPolicyRuleCollectionGroup = armnetwork.FirewallPolicyRuleCollectionGroup{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1"), - // Name: to.Ptr("ruleCollectionGroup1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.FirewallPolicyRuleCollectionGroupProperties{ - // Priority: to.Ptr[int32](100), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RuleCollections: []armnetwork.FirewallPolicyRuleCollectionClassification{ - // &armnetwork.FirewallPolicyFilterRuleCollection{ - // Name: to.Ptr("Example-Filter-Rule-Collection"), - // Priority: to.Ptr[int32](100), - // RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection), - // Action: &armnetwork.FirewallPolicyFilterRuleCollectionAction{ - // Type: to.Ptr(armnetwork.FirewallPolicyFilterRuleCollectionActionTypeDeny), - // }, - // Rules: []armnetwork.FirewallPolicyRuleClassification{ - // &armnetwork.Rule{ - // Name: to.Ptr("network-rule1"), - // RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeNetworkRule), - // DestinationAddresses: []*string{ - // to.Ptr("*")}, - // DestinationPorts: []*string{ - // to.Ptr("*")}, - // IPProtocols: []*armnetwork.FirewallPolicyRuleNetworkProtocol{ - // to.Ptr(armnetwork.FirewallPolicyRuleNetworkProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("10.1.25.0/24")}, - // }}, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/FirewallPolicyRuleCollectionGroupWithIpGroupsPut.json -func ExampleFirewallPolicyRuleCollectionGroupsClient_BeginCreateOrUpdate_createFirewallPolicyRuleCollectionGroupWithIpGroups() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFirewallPolicyRuleCollectionGroupsClient().BeginCreateOrUpdate(ctx, "rg1", "firewallPolicy", "ruleCollectionGroup1", armnetwork.FirewallPolicyRuleCollectionGroup{ - Properties: &armnetwork.FirewallPolicyRuleCollectionGroupProperties{ - Priority: to.Ptr[int32](110), - RuleCollections: []armnetwork.FirewallPolicyRuleCollectionClassification{ - &armnetwork.FirewallPolicyFilterRuleCollection{ - Name: to.Ptr("Example-Filter-Rule-Collection"), - RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection), - Action: &armnetwork.FirewallPolicyFilterRuleCollectionAction{ - Type: to.Ptr(armnetwork.FirewallPolicyFilterRuleCollectionActionTypeDeny), - }, - Rules: []armnetwork.FirewallPolicyRuleClassification{ - &armnetwork.Rule{ - Name: to.Ptr("network-1"), - RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeNetworkRule), - DestinationIPGroups: []*string{ - to.Ptr("/subscriptions/subid/providers/Microsoft.Network/resourceGroup/rg1/ipGroups/ipGroups2")}, - DestinationPorts: []*string{ - to.Ptr("*")}, - IPProtocols: []*armnetwork.FirewallPolicyRuleNetworkProtocol{ - to.Ptr(armnetwork.FirewallPolicyRuleNetworkProtocolTCP)}, - SourceIPGroups: []*string{ - to.Ptr("/subscriptions/subid/providers/Microsoft.Network/resourceGroup/rg1/ipGroups/ipGroups1")}, - }}, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.FirewallPolicyRuleCollectionGroup = armnetwork.FirewallPolicyRuleCollectionGroup{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1"), - // Name: to.Ptr("ruleCollectionGroup1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.FirewallPolicyRuleCollectionGroupProperties{ - // Priority: to.Ptr[int32](110), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RuleCollections: []armnetwork.FirewallPolicyRuleCollectionClassification{ - // &armnetwork.FirewallPolicyFilterRuleCollection{ - // Name: to.Ptr("Example-Filter-Rule-Collection"), - // RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection), - // Action: &armnetwork.FirewallPolicyFilterRuleCollectionAction{ - // Type: to.Ptr(armnetwork.FirewallPolicyFilterRuleCollectionActionTypeDeny), - // }, - // Rules: []armnetwork.FirewallPolicyRuleClassification{ - // &armnetwork.Rule{ - // Name: to.Ptr("network-1"), - // RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeNetworkRule), - // DestinationIPGroups: []*string{ - // to.Ptr("/subscriptions/subid/providers/Microsoft.Network/resourceGroup/rg1/ipGroups/ipGroups2")}, - // DestinationPorts: []*string{ - // to.Ptr("*")}, - // IPProtocols: []*armnetwork.FirewallPolicyRuleNetworkProtocol{ - // to.Ptr(armnetwork.FirewallPolicyRuleNetworkProtocolTCP)}, - // SourceIPGroups: []*string{ - // to.Ptr("/subscriptions/subid/providers/Microsoft.Network/resourceGroup/rg1/ipGroups/ipGroups1")}, - // }}, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/FirewallPolicyRuleCollectionGroupWithWebCategoriesPut.json -func ExampleFirewallPolicyRuleCollectionGroupsClient_BeginCreateOrUpdate_createFirewallPolicyRuleCollectionGroupWithWebCategories() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFirewallPolicyRuleCollectionGroupsClient().BeginCreateOrUpdate(ctx, "rg1", "firewallPolicy", "ruleCollectionGroup1", armnetwork.FirewallPolicyRuleCollectionGroup{ - Properties: &armnetwork.FirewallPolicyRuleCollectionGroupProperties{ - Priority: to.Ptr[int32](110), - RuleCollections: []armnetwork.FirewallPolicyRuleCollectionClassification{ - &armnetwork.FirewallPolicyFilterRuleCollection{ - Name: to.Ptr("Example-Filter-Rule-Collection"), - RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection), - Action: &armnetwork.FirewallPolicyFilterRuleCollectionAction{ - Type: to.Ptr(armnetwork.FirewallPolicyFilterRuleCollectionActionTypeDeny), - }, - Rules: []armnetwork.FirewallPolicyRuleClassification{ - &armnetwork.ApplicationRule{ - Name: to.Ptr("rule1"), - Description: to.Ptr("Deny inbound rule"), - RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeApplicationRule), - Protocols: []*armnetwork.FirewallPolicyRuleApplicationProtocol{ - { - Port: to.Ptr[int32](443), - ProtocolType: to.Ptr(armnetwork.FirewallPolicyRuleApplicationProtocolTypeHTTPS), - }}, - SourceAddresses: []*string{ - to.Ptr("216.58.216.164"), - to.Ptr("10.0.0.0/24")}, - WebCategories: []*string{ - to.Ptr("Hacking")}, - }}, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.FirewallPolicyRuleCollectionGroup = armnetwork.FirewallPolicyRuleCollectionGroup{ - // ID: to.Ptr("/subscriptions/e747cc13-97d4-4a79-b463-42d7f4e558f2/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1"), - // Name: to.Ptr("ruleCollectionGroup1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.FirewallPolicyRuleCollectionGroupProperties{ - // Priority: to.Ptr[int32](110), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RuleCollections: []armnetwork.FirewallPolicyRuleCollectionClassification{ - // &armnetwork.FirewallPolicyFilterRuleCollection{ - // Name: to.Ptr("Example-Filter-Rule-Collection"), - // RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection), - // Action: &armnetwork.FirewallPolicyFilterRuleCollectionAction{ - // Type: to.Ptr(armnetwork.FirewallPolicyFilterRuleCollectionActionTypeDeny), - // }, - // Rules: []armnetwork.FirewallPolicyRuleClassification{ - // &armnetwork.ApplicationRule{ - // Name: to.Ptr("rule1"), - // Description: to.Ptr("Deny inbound rule"), - // RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeApplicationRule), - // Protocols: []*armnetwork.FirewallPolicyRuleApplicationProtocol{ - // { - // Port: to.Ptr[int32](443), - // ProtocolType: to.Ptr(armnetwork.FirewallPolicyRuleApplicationProtocolTypeHTTPS), - // }}, - // SourceAddresses: []*string{ - // to.Ptr("216.58.216.164"), - // to.Ptr("10.0.0.0/24")}, - // WebCategories: []*string{ - // to.Ptr("Hacking")}, - // }}, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/FirewallPolicyRuleCollectionGroupWithHttpHeadersToInsert.json -func ExampleFirewallPolicyRuleCollectionGroupsClient_BeginCreateOrUpdate_createFirewallPolicyRuleCollectionGroupWithHttpHeaderToInsert() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFirewallPolicyRuleCollectionGroupsClient().BeginCreateOrUpdate(ctx, "rg1", "firewallPolicy", "ruleCollectionGroup1", armnetwork.FirewallPolicyRuleCollectionGroup{ - Properties: &armnetwork.FirewallPolicyRuleCollectionGroupProperties{ - Priority: to.Ptr[int32](110), - RuleCollections: []armnetwork.FirewallPolicyRuleCollectionClassification{ - &armnetwork.FirewallPolicyFilterRuleCollection{ - Name: to.Ptr("Example-Filter-Rule-Collection"), - RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection), - Action: &armnetwork.FirewallPolicyFilterRuleCollectionAction{ - Type: to.Ptr(armnetwork.FirewallPolicyFilterRuleCollectionActionTypeAllow), - }, - Rules: []armnetwork.FirewallPolicyRuleClassification{ - &armnetwork.ApplicationRule{ - Name: to.Ptr("rule1"), - Description: to.Ptr("Insert HTTP header rule"), - RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeApplicationRule), - FqdnTags: []*string{ - to.Ptr("WindowsVirtualDesktop")}, - HTTPHeadersToInsert: []*armnetwork.FirewallPolicyHTTPHeaderToInsert{ - { - HeaderName: to.Ptr("Restrict-Access-To-Tenants"), - HeaderValue: to.Ptr("contoso.com,fabrikam.onmicrosoft.com"), - }}, - Protocols: []*armnetwork.FirewallPolicyRuleApplicationProtocol{ - { - Port: to.Ptr[int32](80), - ProtocolType: to.Ptr(armnetwork.FirewallPolicyRuleApplicationProtocolTypeHTTP), - }}, - SourceAddresses: []*string{ - to.Ptr("216.58.216.164"), - to.Ptr("10.0.0.0/24")}, - }}, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.FirewallPolicyRuleCollectionGroup = armnetwork.FirewallPolicyRuleCollectionGroup{ - // ID: to.Ptr("/subscriptions/e747cc13-97d4-4a79-b463-42d7f4e558f2/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1"), - // Name: to.Ptr("ruleCollectionGroup1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.FirewallPolicyRuleCollectionGroupProperties{ - // Priority: to.Ptr[int32](110), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RuleCollections: []armnetwork.FirewallPolicyRuleCollectionClassification{ - // &armnetwork.FirewallPolicyFilterRuleCollection{ - // Name: to.Ptr("Example-Filter-Rule-Collection"), - // RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection), - // Action: &armnetwork.FirewallPolicyFilterRuleCollectionAction{ - // Type: to.Ptr(armnetwork.FirewallPolicyFilterRuleCollectionActionTypeDeny), - // }, - // Rules: []armnetwork.FirewallPolicyRuleClassification{ - // &armnetwork.ApplicationRule{ - // Name: to.Ptr("rule1"), - // Description: to.Ptr("Deny inbound rule"), - // RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeApplicationRule), - // Protocols: []*armnetwork.FirewallPolicyRuleApplicationProtocol{ - // { - // Port: to.Ptr[int32](443), - // ProtocolType: to.Ptr(armnetwork.FirewallPolicyRuleApplicationProtocolTypeHTTPS), - // }}, - // SourceAddresses: []*string{ - // to.Ptr("216.58.216.164"), - // to.Ptr("10.0.0.0/24")}, - // WebCategories: []*string{ - // to.Ptr("Hacking")}, - // }}, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/FirewallPolicyRuleCollectionGroupWithWebCategoriesList.json -func ExampleFirewallPolicyRuleCollectionGroupsClient_NewListPager_listAllFirewallPolicyRuleCollectionGroupWithWebCategories() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewFirewallPolicyRuleCollectionGroupsClient().NewListPager("rg1", "firewallPolicy", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.FirewallPolicyRuleCollectionGroupListResult = armnetwork.FirewallPolicyRuleCollectionGroupListResult{ - // Value: []*armnetwork.FirewallPolicyRuleCollectionGroup{ - // { - // ID: to.Ptr("/subscriptions/e747cc13-97d4-4a79-b463-42d7f4e558f2/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1"), - // Name: to.Ptr("ruleCollectionGroup1"), - // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), - // Properties: &armnetwork.FirewallPolicyRuleCollectionGroupProperties{ - // Priority: to.Ptr[int32](110), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RuleCollections: []armnetwork.FirewallPolicyRuleCollectionClassification{ - // &armnetwork.FirewallPolicyFilterRuleCollection{ - // Name: to.Ptr("Example-Filter-Rule-Collection"), - // Priority: to.Ptr[int32](120), - // RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection), - // Action: &armnetwork.FirewallPolicyFilterRuleCollectionAction{ - // Type: to.Ptr(armnetwork.FirewallPolicyFilterRuleCollectionActionTypeDeny), - // }, - // Rules: []armnetwork.FirewallPolicyRuleClassification{ - // &armnetwork.ApplicationRule{ - // Name: to.Ptr("rule1"), - // Description: to.Ptr("Deny inbound rule"), - // RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeApplicationRule), - // Protocols: []*armnetwork.FirewallPolicyRuleApplicationProtocol{ - // { - // Port: to.Ptr[int32](443), - // ProtocolType: to.Ptr(armnetwork.FirewallPolicyRuleApplicationProtocolTypeHTTPS), - // }}, - // SourceAddresses: []*string{ - // to.Ptr("216.58.216.164"), - // to.Ptr("10.0.0.0/24")}, - // WebCategories: []*string{ - // to.Ptr("Hacking")}, - // }}, - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/FirewallPolicyRuleCollectionGroupList.json -func ExampleFirewallPolicyRuleCollectionGroupsClient_NewListPager_listAllFirewallPolicyRuleCollectionGroupsForAGivenFirewallPolicy() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewFirewallPolicyRuleCollectionGroupsClient().NewListPager("rg1", "firewallPolicy", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.FirewallPolicyRuleCollectionGroupListResult = armnetwork.FirewallPolicyRuleCollectionGroupListResult{ - // Value: []*armnetwork.FirewallPolicyRuleCollectionGroup{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1"), - // Name: to.Ptr("ruleCollectionGroup1"), - // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), - // Properties: &armnetwork.FirewallPolicyRuleCollectionGroupProperties{ - // Priority: to.Ptr[int32](110), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RuleCollections: []armnetwork.FirewallPolicyRuleCollectionClassification{ - // &armnetwork.FirewallPolicyFilterRuleCollection{ - // Name: to.Ptr("Example-Filter-Rule-Collection"), - // Priority: to.Ptr[int32](120), - // RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection), - // Action: &armnetwork.FirewallPolicyFilterRuleCollectionAction{ - // Type: to.Ptr(armnetwork.FirewallPolicyFilterRuleCollectionActionTypeDeny), - // }, - // Rules: []armnetwork.FirewallPolicyRuleClassification{ - // &armnetwork.Rule{ - // Name: to.Ptr("network-rule-1"), - // Description: to.Ptr("Network rule"), - // RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeNetworkRule), - // DestinationAddresses: []*string{ - // to.Ptr("*")}, - // DestinationPorts: []*string{ - // to.Ptr("*")}, - // IPProtocols: []*armnetwork.FirewallPolicyRuleNetworkProtocol{ - // to.Ptr(armnetwork.FirewallPolicyRuleNetworkProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("10.1.25.0/24")}, - // }}, - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/FirewallPolicyRuleCollectionGroupWithIpGroupsList.json -func ExampleFirewallPolicyRuleCollectionGroupsClient_NewListPager_listAllFirewallPolicyRuleCollectionGroupsWithIpGroupsForAGivenFirewallPolicy() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewFirewallPolicyRuleCollectionGroupsClient().NewListPager("rg1", "firewallPolicy", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.FirewallPolicyRuleCollectionGroupListResult = armnetwork.FirewallPolicyRuleCollectionGroupListResult{ - // Value: []*armnetwork.FirewallPolicyRuleCollectionGroup{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1"), - // Name: to.Ptr("ruleCollectionGroup1"), - // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), - // Properties: &armnetwork.FirewallPolicyRuleCollectionGroupProperties{ - // Priority: to.Ptr[int32](110), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RuleCollections: []armnetwork.FirewallPolicyRuleCollectionClassification{ - // &armnetwork.FirewallPolicyFilterRuleCollection{ - // Name: to.Ptr("Example-Filter-Rule-Collection"), - // Priority: to.Ptr[int32](120), - // RuleCollectionType: to.Ptr(armnetwork.FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection), - // Action: &armnetwork.FirewallPolicyFilterRuleCollectionAction{ - // Type: to.Ptr(armnetwork.FirewallPolicyFilterRuleCollectionActionTypeDeny), - // }, - // Rules: []armnetwork.FirewallPolicyRuleClassification{ - // &armnetwork.Rule{ - // Name: to.Ptr("network-rule-1"), - // Description: to.Ptr("Network rule"), - // RuleType: to.Ptr(armnetwork.FirewallPolicyRuleTypeNetworkRule), - // DestinationIPGroups: []*string{ - // to.Ptr("/subscriptions/subid/providers/Microsoft.Network/resourceGroup/rg1/ipGroups/ipGroups2")}, - // DestinationPorts: []*string{ - // to.Ptr("*")}, - // IPProtocols: []*armnetwork.FirewallPolicyRuleNetworkProtocol{ - // to.Ptr(armnetwork.FirewallPolicyRuleNetworkProtocolTCP)}, - // SourceIPGroups: []*string{ - // to.Ptr("/subscriptions/subid/providers/Microsoft.Network/resourceGroup/rg1/ipGroups/ipGroups1")}, - // }}, - // }}, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/flowlogs_client.go b/sdk/resourcemanager/network/armnetwork/flowlogs_client.go index 107e309ce8e2..12202b7ef7f6 100644 --- a/sdk/resourcemanager/network/armnetwork/flowlogs_client.go +++ b/sdk/resourcemanager/network/armnetwork/flowlogs_client.go @@ -47,7 +47,7 @@ func NewFlowLogsClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreateOrUpdate - Create or update a flow log for the specified network security group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkWatcherName - The name of the network watcher. // - flowLogName - The name of the flow log. @@ -72,7 +72,7 @@ func (client *FlowLogsClient) BeginCreateOrUpdate(ctx context.Context, resourceG // CreateOrUpdate - Create or update a flow log for the specified network security group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *FlowLogsClient) createOrUpdate(ctx context.Context, resourceGroupName string, networkWatcherName string, flowLogName string, parameters FlowLog, options *FlowLogsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "FlowLogsClient.BeginCreateOrUpdate" @@ -118,7 +118,7 @@ func (client *FlowLogsClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -130,7 +130,7 @@ func (client *FlowLogsClient) createOrUpdateCreateRequest(ctx context.Context, r // BeginDelete - Deletes the specified flow log resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkWatcherName - The name of the network watcher. // - flowLogName - The name of the flow log resource. @@ -153,7 +153,7 @@ func (client *FlowLogsClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Deletes the specified flow log resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *FlowLogsClient) deleteOperation(ctx context.Context, resourceGroupName string, networkWatcherName string, flowLogName string, options *FlowLogsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "FlowLogsClient.BeginDelete" @@ -199,7 +199,7 @@ func (client *FlowLogsClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -208,7 +208,7 @@ func (client *FlowLogsClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Gets a flow log resource by name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkWatcherName - The name of the network watcher. // - flowLogName - The name of the flow log resource. @@ -259,7 +259,7 @@ func (client *FlowLogsClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -276,7 +276,7 @@ func (client *FlowLogsClient) getHandleResponse(resp *http.Response) (FlowLogsCl // NewListPager - Lists all flow log resources for the specified Network Watcher. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group containing Network Watcher. // - networkWatcherName - The name of the Network Watcher resource. // - options - FlowLogsClientListOptions contains the optional parameters for the FlowLogsClient.NewListPager method. @@ -330,7 +330,7 @@ func (client *FlowLogsClient) listCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -348,7 +348,7 @@ func (client *FlowLogsClient) listHandleResponse(resp *http.Response) (FlowLogsC // UpdateTags - Update tags of the specified flow log. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkWatcherName - The name of the network watcher. // - flowLogName - The name of the flow log. @@ -400,7 +400,7 @@ func (client *FlowLogsClient) updateTagsCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/flowlogs_client_example_test.go b/sdk/resourcemanager/network/armnetwork/flowlogs_client_example_test.go deleted file mode 100644 index 7ca4e887671b..000000000000 --- a/sdk/resourcemanager/network/armnetwork/flowlogs_client_example_test.go +++ /dev/null @@ -1,284 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkWatcherFlowLogCreate.json -func ExampleFlowLogsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFlowLogsClient().BeginCreateOrUpdate(ctx, "rg1", "nw1", "fl", armnetwork.FlowLog{ - Location: to.Ptr("centraluseuap"), - Properties: &armnetwork.FlowLogPropertiesFormat{ - Format: &armnetwork.FlowLogFormatParameters{ - Type: to.Ptr(armnetwork.FlowLogFormatTypeJSON), - Version: to.Ptr[int32](1), - }, - Enabled: to.Ptr(true), - StorageID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/nwtest1mgvbfmqsigdxe"), - TargetResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/desmondcentral-nsg"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.FlowLog = armnetwork.FlowLog{ - // Name: to.Ptr("Microsoft.Networkdesmond-rgdesmondcentral-nsg"), - // Type: to.Ptr("Microsoft.Network/networkWatchers/FlowLogs"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw/FlowLogs/fl"), - // Location: to.Ptr("centraluseuap"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.FlowLogPropertiesFormat{ - // Format: &armnetwork.FlowLogFormatParameters{ - // Type: to.Ptr(armnetwork.FlowLogFormatTypeJSON), - // Version: to.Ptr[int32](1), - // }, - // Enabled: to.Ptr(true), - // FlowAnalyticsConfiguration: &armnetwork.TrafficAnalyticsProperties{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RetentionPolicy: &armnetwork.RetentionPolicyParameters{ - // Days: to.Ptr[int32](0), - // Enabled: to.Ptr(false), - // }, - // StorageID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/nwtest1mgvbfmqsigdxe"), - // TargetResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TargetResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/desmondcentral-nsg"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkWatcherFlowLogUpdateTags.json -func ExampleFlowLogsClient_UpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFlowLogsClient().UpdateTags(ctx, "rg1", "nw", "fl", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.FlowLog = armnetwork.FlowLog{ - // Name: to.Ptr("Microsoft.Networkdesmond-rgdesmondcentral-nsg"), - // Type: to.Ptr("Microsoft.Network/networkWatchers/FlowLogs"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw/FlowLogs/fl"), - // Location: to.Ptr("centralus"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.FlowLogPropertiesFormat{ - // Format: &armnetwork.FlowLogFormatParameters{ - // Type: to.Ptr(armnetwork.FlowLogFormatTypeJSON), - // Version: to.Ptr[int32](1), - // }, - // Enabled: to.Ptr(true), - // FlowAnalyticsConfiguration: &armnetwork.TrafficAnalyticsProperties{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RetentionPolicy: &armnetwork.RetentionPolicyParameters{ - // Days: to.Ptr[int32](0), - // Enabled: to.Ptr(false), - // }, - // StorageID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/nwtest1mgvbfmqsigdxe"), - // TargetResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TargetResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/desmondcentral-nsg"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkWatcherFlowLogGet.json -func ExampleFlowLogsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFlowLogsClient().Get(ctx, "rg1", "nw1", "flowLog1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.FlowLog = armnetwork.FlowLog{ - // Name: to.Ptr("flowLog1"), - // Type: to.Ptr("Microsoft.Network/networkWatchers/FlowLogs"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/тц1/FlowLogs/flowLog1"), - // Location: to.Ptr("centraluseuap"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.FlowLogPropertiesFormat{ - // Format: &armnetwork.FlowLogFormatParameters{ - // Type: to.Ptr(armnetwork.FlowLogFormatTypeJSON), - // Version: to.Ptr[int32](2), - // }, - // Enabled: to.Ptr(true), - // FlowAnalyticsConfiguration: &armnetwork.TrafficAnalyticsProperties{ - // NetworkWatcherFlowAnalyticsConfiguration: &armnetwork.TrafficAnalyticsConfigurationProperties{ - // Enabled: to.Ptr(false), - // TrafficAnalyticsInterval: to.Ptr[int32](60), - // WorkspaceID: to.Ptr("-"), - // WorkspaceRegion: to.Ptr("-"), - // }, - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RetentionPolicy: &armnetwork.RetentionPolicyParameters{ - // Days: to.Ptr[int32](0), - // Enabled: to.Ptr(false), - // }, - // StorageID: to.Ptr("/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Storage/storageAccounts/wzstorage002"), - // TargetResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TargetResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Network/networkSecurityGroups/vm5-nsg"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkWatcherFlowLogDelete.json -func ExampleFlowLogsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFlowLogsClient().BeginDelete(ctx, "rg1", "nw1", "fl", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkWatcherFlowLogList.json -func ExampleFlowLogsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewFlowLogsClient().NewListPager("rg1", "nw1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.FlowLogListResult = armnetwork.FlowLogListResult{ - // Value: []*armnetwork.FlowLog{ - // { - // Name: to.Ptr("flowLog1"), - // Type: to.Ptr("Microsoft.Network/networkWatchers/FlowLogs"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/тц1/FlowLogs/flowLog1"), - // Location: to.Ptr("centraluseuap"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.FlowLogPropertiesFormat{ - // Format: &armnetwork.FlowLogFormatParameters{ - // Type: to.Ptr(armnetwork.FlowLogFormatTypeJSON), - // Version: to.Ptr[int32](2), - // }, - // Enabled: to.Ptr(true), - // FlowAnalyticsConfiguration: &armnetwork.TrafficAnalyticsProperties{ - // NetworkWatcherFlowAnalyticsConfiguration: &armnetwork.TrafficAnalyticsConfigurationProperties{ - // Enabled: to.Ptr(false), - // TrafficAnalyticsInterval: to.Ptr[int32](60), - // WorkspaceID: to.Ptr("-"), - // WorkspaceRegion: to.Ptr("-"), - // }, - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RetentionPolicy: &armnetwork.RetentionPolicyParameters{ - // Days: to.Ptr[int32](0), - // Enabled: to.Ptr(false), - // }, - // StorageID: to.Ptr("/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Storage/storageAccounts/wzstorage002"), - // TargetResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TargetResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Network/networkSecurityGroups/vm5-nsg"), - // }, - // }, - // { - // Name: to.Ptr("flowLog2"), - // Type: to.Ptr("Microsoft.Network/networkWatchers/FlowLogs"), - // ID: to.Ptr("/subscriptions/96e68903-0a56-4819-9987-8d08ad6a1f99/resourceGroups/NetworkWatcherRG/providers/Microsoft.Network/networkWatchers/NetworkWatcher_centraluseuap/FlowLogs/flowLog2"), - // Location: to.Ptr("centraluseuap"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.FlowLogPropertiesFormat{ - // Format: &armnetwork.FlowLogFormatParameters{ - // Type: to.Ptr(armnetwork.FlowLogFormatTypeJSON), - // Version: to.Ptr[int32](2), - // }, - // Enabled: to.Ptr(true), - // FlowAnalyticsConfiguration: &armnetwork.TrafficAnalyticsProperties{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RetentionPolicy: &armnetwork.RetentionPolicyParameters{ - // Days: to.Ptr[int32](0), - // Enabled: to.Ptr(false), - // }, - // StorageID: to.Ptr("/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Storage/storageAccounts/iraflowlogtest2diag"), - // TargetResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TargetResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Network/networkSecurityGroups/DSCP-test-vm1-nsg"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/groups_client.go b/sdk/resourcemanager/network/armnetwork/groups_client.go index 0118df33402a..63d526843249 100644 --- a/sdk/resourcemanager/network/armnetwork/groups_client.go +++ b/sdk/resourcemanager/network/armnetwork/groups_client.go @@ -48,7 +48,7 @@ func NewGroupsClient(subscriptionID string, credential azcore.TokenCredential, o // CreateOrUpdate - Creates or updates a network group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - networkGroupName - The name of the network group. @@ -100,7 +100,7 @@ func (client *GroupsClient) createOrUpdateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -127,7 +127,7 @@ func (client *GroupsClient) createOrUpdateHandleResponse(resp *http.Response) (G // BeginDelete - Deletes a network group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - networkGroupName - The name of the network group. @@ -150,7 +150,7 @@ func (client *GroupsClient) BeginDelete(ctx context.Context, resourceGroupName s // Delete - Deletes a network group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *GroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, networkManagerName string, networkGroupName string, options *GroupsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "GroupsClient.BeginDelete" @@ -196,7 +196,7 @@ func (client *GroupsClient) deleteCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } @@ -208,7 +208,7 @@ func (client *GroupsClient) deleteCreateRequest(ctx context.Context, resourceGro // Get - Gets the specified network group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - networkGroupName - The name of the network group. @@ -259,7 +259,7 @@ func (client *GroupsClient) getCreateRequest(ctx context.Context, resourceGroupN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -276,7 +276,7 @@ func (client *GroupsClient) getHandleResponse(resp *http.Response) (GroupsClient // NewListPager - Lists the specified network group. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - options - GroupsClientListOptions contains the optional parameters for the GroupsClient.NewListPager method. @@ -330,7 +330,7 @@ func (client *GroupsClient) listCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } diff --git a/sdk/resourcemanager/network/armnetwork/groups_client_example_test.go b/sdk/resourcemanager/network/armnetwork/groups_client_example_test.go deleted file mode 100644 index eaf602c738bf..000000000000 --- a/sdk/resourcemanager/network/armnetwork/groups_client_example_test.go +++ /dev/null @@ -1,168 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkManagerGroupGet.json -func ExampleGroupsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGroupsClient().Get(ctx, "rg1", "testNetworkManager", "testNetworkGroup", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Group = armnetwork.Group{ - // Name: to.Ptr("testNetworkGroup"), - // Type: to.Ptr("Microsoft.Network/networkManagers/networkGroups"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroup/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/testNetworkGroup"), - // Properties: &armnetwork.GroupProperties{ - // Description: to.Ptr("A sample group"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkManagerGroupPut.json -func ExampleGroupsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGroupsClient().CreateOrUpdate(ctx, "rg1", "testNetworkManager", "testNetworkGroup", armnetwork.Group{ - Properties: &armnetwork.GroupProperties{ - Description: to.Ptr("A sample group"), - }, - }, &armnetwork.GroupsClientCreateOrUpdateOptions{IfMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Group = armnetwork.Group{ - // Name: to.Ptr("testNetworkGroup"), - // Type: to.Ptr("Microsoft.Network/networkManagers/networkGroups"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroup/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/testNetworkGroup"), - // Properties: &armnetwork.GroupProperties{ - // Description: to.Ptr("A sample group"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkManagerGroupDelete.json -func ExampleGroupsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGroupsClient().BeginDelete(ctx, "rg1", "testNetworkManager", "testNetworkGroup", &armnetwork.GroupsClientBeginDeleteOptions{Force: to.Ptr(false)}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkManagerGroupList.json -func ExampleGroupsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewGroupsClient().NewListPager("rg1", "testNetworkManager", &armnetwork.GroupsClientListOptions{Top: nil, - SkipToken: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.GroupListResult = armnetwork.GroupListResult{ - // Value: []*armnetwork.Group{ - // { - // Name: to.Ptr("testNetworkGroup"), - // Type: to.Ptr("Microsoft.Network/networkManagers/networkGroups"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroup/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/testNetworkGroup"), - // Properties: &armnetwork.GroupProperties{ - // Description: to.Ptr("A sample group"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/hubroutetables_client.go b/sdk/resourcemanager/network/armnetwork/hubroutetables_client.go index a0913e8ce7fd..00add1e37bd3 100644 --- a/sdk/resourcemanager/network/armnetwork/hubroutetables_client.go +++ b/sdk/resourcemanager/network/armnetwork/hubroutetables_client.go @@ -47,7 +47,7 @@ func NewHubRouteTablesClient(subscriptionID string, credential azcore.TokenCrede // BeginCreateOrUpdate - Creates a RouteTable resource if it doesn't exist else updates the existing RouteTable. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the VirtualHub. // - virtualHubName - The name of the VirtualHub. // - routeTableName - The name of the RouteTable. @@ -72,7 +72,7 @@ func (client *HubRouteTablesClient) BeginCreateOrUpdate(ctx context.Context, res // CreateOrUpdate - Creates a RouteTable resource if it doesn't exist else updates the existing RouteTable. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *HubRouteTablesClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string, routeTableParameters HubRouteTable, options *HubRouteTablesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "HubRouteTablesClient.BeginCreateOrUpdate" @@ -118,7 +118,7 @@ func (client *HubRouteTablesClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, routeTableParameters); err != nil { @@ -130,7 +130,7 @@ func (client *HubRouteTablesClient) createOrUpdateCreateRequest(ctx context.Cont // BeginDelete - Deletes a RouteTable. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the RouteTable. // - virtualHubName - The name of the VirtualHub. // - routeTableName - The name of the RouteTable. @@ -154,7 +154,7 @@ func (client *HubRouteTablesClient) BeginDelete(ctx context.Context, resourceGro // Delete - Deletes a RouteTable. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *HubRouteTablesClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string, options *HubRouteTablesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "HubRouteTablesClient.BeginDelete" @@ -200,7 +200,7 @@ func (client *HubRouteTablesClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -209,7 +209,7 @@ func (client *HubRouteTablesClient) deleteCreateRequest(ctx context.Context, res // Get - Retrieves the details of a RouteTable. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the VirtualHub. // - virtualHubName - The name of the VirtualHub. // - routeTableName - The name of the RouteTable. @@ -260,7 +260,7 @@ func (client *HubRouteTablesClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -277,7 +277,7 @@ func (client *HubRouteTablesClient) getHandleResponse(resp *http.Response) (HubR // NewListPager - Retrieves the details of all RouteTables. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the VirtualHub. // - virtualHubName - The name of the VirtualHub. // - options - HubRouteTablesClientListOptions contains the optional parameters for the HubRouteTablesClient.NewListPager method. @@ -331,7 +331,7 @@ func (client *HubRouteTablesClient) listCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/hubroutetables_client_example_test.go b/sdk/resourcemanager/network/armnetwork/hubroutetables_client_example_test.go deleted file mode 100644 index 64e34ded98e4..000000000000 --- a/sdk/resourcemanager/network/armnetwork/hubroutetables_client_example_test.go +++ /dev/null @@ -1,186 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/HubRouteTablePut.json -func ExampleHubRouteTablesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewHubRouteTablesClient().BeginCreateOrUpdate(ctx, "rg1", "virtualHub1", "hubRouteTable1", armnetwork.HubRouteTable{ - Properties: &armnetwork.HubRouteTableProperties{ - Labels: []*string{ - to.Ptr("label1"), - to.Ptr("label2")}, - Routes: []*armnetwork.HubRoute{ - { - Name: to.Ptr("route1"), - DestinationType: to.Ptr("CIDR"), - Destinations: []*string{ - to.Ptr("10.0.0.0/8"), - to.Ptr("20.0.0.0/8"), - to.Ptr("30.0.0.0/8")}, - NextHop: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azureFirewall1"), - NextHopType: to.Ptr("ResourceId"), - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.HubRouteTable = armnetwork.HubRouteTable{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - // Name: to.Ptr("hubRouteTable1"), - // Type: to.Ptr("Microsoft.Network/virtualHubs/hubRouteTables"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.HubRouteTableProperties{ - // AssociatedConnections: []*string{ - // to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubVirtualNetworkConnections/vnetConnn1"), - // to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubVirtualNetworkConnections/vnetConnn2")}, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, - // PropagatingConnections: []*string{ - // to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteGateways/erg1/expressRouteConnections/erConn1"), - // to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/vpngw1/vpnConnections/vpnConn2")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Routes: []*armnetwork.HubRoute{ - // { - // Name: to.Ptr("route1"), - // DestinationType: to.Ptr("CIDR"), - // Destinations: []*string{ - // to.Ptr("10.0.0.0/8"), - // to.Ptr("20.0.0.0/8"), - // to.Ptr("30.0.0.0/8")}, - // NextHop: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azureFirewall1"), - // NextHopType: to.Ptr("ResourceId"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/HubRouteTableGet.json -func ExampleHubRouteTablesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewHubRouteTablesClient().Get(ctx, "rg1", "virtualHub1", "hubRouteTable1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.HubRouteTable = armnetwork.HubRouteTable{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - // Name: to.Ptr("hubRouteTable1"), - // Type: to.Ptr("Microsoft.Network/virtualHubs/hubRouteTables"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.HubRouteTableProperties{ - // AssociatedConnections: []*string{ - // to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubVirtualNetworkConnections/vnetConnn1"), - // to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubVirtualNetworkConnections/vnetConnn2")}, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, - // PropagatingConnections: []*string{ - // to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteGateways/erg1/expressRouteConnections/erConn1"), - // to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/vpngw1/vpnConnections/vpnConn2")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Routes: []*armnetwork.HubRoute{ - // { - // Name: to.Ptr("route1"), - // DestinationType: to.Ptr("CIDR"), - // Destinations: []*string{ - // to.Ptr("10.0.0.0/8"), - // to.Ptr("20.0.0.0/8"), - // to.Ptr("30.0.0.0/8")}, - // NextHop: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azureFirewall1"), - // NextHopType: to.Ptr("ResourceId"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/HubRouteTableDelete.json -func ExampleHubRouteTablesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewHubRouteTablesClient().BeginDelete(ctx, "rg1", "virtualHub1", "hubRouteTable1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/HubRouteTableList.json -func ExampleHubRouteTablesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewHubRouteTablesClient().NewListPager("rg1", "virtualHub1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ListHubRouteTablesResult = armnetwork.ListHubRouteTablesResult{ - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/hubvirtualnetworkconnections_client.go b/sdk/resourcemanager/network/armnetwork/hubvirtualnetworkconnections_client.go index b35f02add3c8..4b4a873681ab 100644 --- a/sdk/resourcemanager/network/armnetwork/hubvirtualnetworkconnections_client.go +++ b/sdk/resourcemanager/network/armnetwork/hubvirtualnetworkconnections_client.go @@ -47,7 +47,7 @@ func NewHubVirtualNetworkConnectionsClient(subscriptionID string, credential azc // BeginCreateOrUpdate - Creates a hub virtual network connection if it doesn't exist else updates the existing one. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the HubVirtualNetworkConnection. // - virtualHubName - The name of the VirtualHub. // - connectionName - The name of the HubVirtualNetworkConnection. @@ -72,7 +72,7 @@ func (client *HubVirtualNetworkConnectionsClient) BeginCreateOrUpdate(ctx contex // CreateOrUpdate - Creates a hub virtual network connection if it doesn't exist else updates the existing one. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *HubVirtualNetworkConnectionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string, hubVirtualNetworkConnectionParameters HubVirtualNetworkConnection, options *HubVirtualNetworkConnectionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "HubVirtualNetworkConnectionsClient.BeginCreateOrUpdate" @@ -118,7 +118,7 @@ func (client *HubVirtualNetworkConnectionsClient) createOrUpdateCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, hubVirtualNetworkConnectionParameters); err != nil { @@ -130,7 +130,7 @@ func (client *HubVirtualNetworkConnectionsClient) createOrUpdateCreateRequest(ct // BeginDelete - Deletes a HubVirtualNetworkConnection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the VirtualHub. // - virtualHubName - The name of the VirtualHub. // - connectionName - The name of the HubVirtualNetworkConnection. @@ -154,7 +154,7 @@ func (client *HubVirtualNetworkConnectionsClient) BeginDelete(ctx context.Contex // Delete - Deletes a HubVirtualNetworkConnection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *HubVirtualNetworkConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string, options *HubVirtualNetworkConnectionsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "HubVirtualNetworkConnectionsClient.BeginDelete" @@ -200,7 +200,7 @@ func (client *HubVirtualNetworkConnectionsClient) deleteCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -209,7 +209,7 @@ func (client *HubVirtualNetworkConnectionsClient) deleteCreateRequest(ctx contex // Get - Retrieves the details of a HubVirtualNetworkConnection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the VirtualHub. // - virtualHubName - The name of the VirtualHub. // - connectionName - The name of the vpn connection. @@ -261,7 +261,7 @@ func (client *HubVirtualNetworkConnectionsClient) getCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -278,7 +278,7 @@ func (client *HubVirtualNetworkConnectionsClient) getHandleResponse(resp *http.R // NewListPager - Retrieves the details of all HubVirtualNetworkConnections. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the VirtualHub. // - virtualHubName - The name of the VirtualHub. // - options - HubVirtualNetworkConnectionsClientListOptions contains the optional parameters for the HubVirtualNetworkConnectionsClient.NewListPager @@ -333,7 +333,7 @@ func (client *HubVirtualNetworkConnectionsClient) listCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/hubvirtualnetworkconnections_client_example_test.go b/sdk/resourcemanager/network/armnetwork/hubvirtualnetworkconnections_client_example_test.go deleted file mode 100644 index df7d89d48d6a..000000000000 --- a/sdk/resourcemanager/network/armnetwork/hubvirtualnetworkconnections_client_example_test.go +++ /dev/null @@ -1,278 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/HubVirtualNetworkConnectionPut.json -func ExampleHubVirtualNetworkConnectionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewHubVirtualNetworkConnectionsClient().BeginCreateOrUpdate(ctx, "rg1", "virtualHub1", "connection1", armnetwork.HubVirtualNetworkConnection{ - Properties: &armnetwork.HubVirtualNetworkConnectionProperties{ - EnableInternetSecurity: to.Ptr(false), - RemoteVirtualNetwork: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/SpokeVnet1"), - }, - RoutingConfiguration: &armnetwork.RoutingConfiguration{ - AssociatedRouteTable: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - }, - InboundRouteMap: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1"), - }, - OutboundRouteMap: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap2"), - }, - PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ - IDs: []*armnetwork.SubResource{ - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - }}, - Labels: []*string{ - to.Ptr("label1"), - to.Ptr("label2")}, - }, - VnetRoutes: &armnetwork.VnetRoute{ - StaticRoutes: []*armnetwork.StaticRoute{ - { - Name: to.Ptr("route1"), - AddressPrefixes: []*string{ - to.Ptr("10.1.0.0/16"), - to.Ptr("10.2.0.0/16")}, - NextHopIPAddress: to.Ptr("10.0.0.68"), - }, - { - Name: to.Ptr("route2"), - AddressPrefixes: []*string{ - to.Ptr("10.3.0.0/16"), - to.Ptr("10.4.0.0/16")}, - NextHopIPAddress: to.Ptr("10.0.0.65"), - }}, - StaticRoutesConfig: &armnetwork.StaticRoutesConfig{ - VnetLocalRouteOverrideCriteria: to.Ptr(armnetwork.VnetLocalRouteOverrideCriteriaEqual), - }, - }, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.HubVirtualNetworkConnection = armnetwork.HubVirtualNetworkConnection{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubVirtualNetworkConnections/connection1"), - // Name: to.Ptr("connection1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.HubVirtualNetworkConnectionProperties{ - // EnableInternetSecurity: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RemoteVirtualNetwork: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/SpokeVnet1"), - // }, - // RoutingConfiguration: &armnetwork.RoutingConfiguration{ - // AssociatedRouteTable: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - // }, - // InboundRouteMap: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1"), - // }, - // OutboundRouteMap: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap2"), - // }, - // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ - // IDs: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - // }}, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, - // }, - // VnetRoutes: &armnetwork.VnetRoute{ - // BgpConnections: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/bgpConnections/bgpConn1"), - // }}, - // StaticRoutes: []*armnetwork.StaticRoute{ - // { - // Name: to.Ptr("route1"), - // AddressPrefixes: []*string{ - // to.Ptr("10.1.0.0/16"), - // to.Ptr("10.2.0.0/16")}, - // NextHopIPAddress: to.Ptr("10.0.0.68"), - // }, - // { - // Name: to.Ptr("route2"), - // AddressPrefixes: []*string{ - // to.Ptr("10.3.0.0/16"), - // to.Ptr("10.4.0.0/16")}, - // NextHopIPAddress: to.Ptr("10.0.0.65"), - // }}, - // StaticRoutesConfig: &armnetwork.StaticRoutesConfig{ - // PropagateStaticRoutes: to.Ptr(true), - // VnetLocalRouteOverrideCriteria: to.Ptr(armnetwork.VnetLocalRouteOverrideCriteriaEqual), - // }, - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/HubVirtualNetworkConnectionDelete.json -func ExampleHubVirtualNetworkConnectionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewHubVirtualNetworkConnectionsClient().BeginDelete(ctx, "rg1", "virtualHub1", "connection1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/HubVirtualNetworkConnectionGet.json -func ExampleHubVirtualNetworkConnectionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewHubVirtualNetworkConnectionsClient().Get(ctx, "rg1", "virtualHub1", "connection1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.HubVirtualNetworkConnection = armnetwork.HubVirtualNetworkConnection{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/virtualHubVnetConnections/connection1"), - // Name: to.Ptr("connection1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.HubVirtualNetworkConnectionProperties{ - // EnableInternetSecurity: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RemoteVirtualNetwork: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1"), - // }, - // RoutingConfiguration: &armnetwork.RoutingConfiguration{ - // AssociatedRouteTable: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - // }, - // InboundRouteMap: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1"), - // }, - // OutboundRouteMap: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap2"), - // }, - // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ - // IDs: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable2"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable3"), - // }}, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, - // }, - // VnetRoutes: &armnetwork.VnetRoute{ - // BgpConnections: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/bgpConnections/bgpConn1"), - // }}, - // StaticRoutes: []*armnetwork.StaticRoute{ - // { - // Name: to.Ptr("route1"), - // AddressPrefixes: []*string{ - // to.Ptr("10.1.0.0/16"), - // to.Ptr("10.2.0.0/16")}, - // NextHopIPAddress: to.Ptr("10.0.0.68"), - // }, - // { - // Name: to.Ptr("route2"), - // AddressPrefixes: []*string{ - // to.Ptr("10.3.0.0/16"), - // to.Ptr("10.4.0.0/16")}, - // NextHopIPAddress: to.Ptr("10.0.0.65"), - // }}, - // StaticRoutesConfig: &armnetwork.StaticRoutesConfig{ - // PropagateStaticRoutes: to.Ptr(true), - // VnetLocalRouteOverrideCriteria: to.Ptr(armnetwork.VnetLocalRouteOverrideCriteriaEqual), - // }, - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/HubVirtualNetworkConnectionList.json -func ExampleHubVirtualNetworkConnectionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewHubVirtualNetworkConnectionsClient().NewListPager("rg1", "virtualHub1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ListHubVirtualNetworkConnectionsResult = armnetwork.ListHubVirtualNetworkConnectionsResult{ - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/inboundnatrules_client.go b/sdk/resourcemanager/network/armnetwork/inboundnatrules_client.go index a49dd9880a4a..3f01df8285f5 100644 --- a/sdk/resourcemanager/network/armnetwork/inboundnatrules_client.go +++ b/sdk/resourcemanager/network/armnetwork/inboundnatrules_client.go @@ -47,7 +47,7 @@ func NewInboundNatRulesClient(subscriptionID string, credential azcore.TokenCred // BeginCreateOrUpdate - Creates or updates a load balancer inbound NAT rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - loadBalancerName - The name of the load balancer. // - inboundNatRuleName - The name of the inbound NAT rule. @@ -72,7 +72,7 @@ func (client *InboundNatRulesClient) BeginCreateOrUpdate(ctx context.Context, re // CreateOrUpdate - Creates or updates a load balancer inbound NAT rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *InboundNatRulesClient) createOrUpdate(ctx context.Context, resourceGroupName string, loadBalancerName string, inboundNatRuleName string, inboundNatRuleParameters InboundNatRule, options *InboundNatRulesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "InboundNatRulesClient.BeginCreateOrUpdate" @@ -118,7 +118,7 @@ func (client *InboundNatRulesClient) createOrUpdateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, inboundNatRuleParameters); err != nil { @@ -130,7 +130,7 @@ func (client *InboundNatRulesClient) createOrUpdateCreateRequest(ctx context.Con // BeginDelete - Deletes the specified load balancer inbound NAT rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - loadBalancerName - The name of the load balancer. // - inboundNatRuleName - The name of the inbound NAT rule. @@ -154,7 +154,7 @@ func (client *InboundNatRulesClient) BeginDelete(ctx context.Context, resourceGr // Delete - Deletes the specified load balancer inbound NAT rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *InboundNatRulesClient) deleteOperation(ctx context.Context, resourceGroupName string, loadBalancerName string, inboundNatRuleName string, options *InboundNatRulesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "InboundNatRulesClient.BeginDelete" @@ -200,7 +200,7 @@ func (client *InboundNatRulesClient) deleteCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -209,7 +209,7 @@ func (client *InboundNatRulesClient) deleteCreateRequest(ctx context.Context, re // Get - Gets the specified load balancer inbound NAT rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - loadBalancerName - The name of the load balancer. // - inboundNatRuleName - The name of the inbound NAT rule. @@ -260,7 +260,7 @@ func (client *InboundNatRulesClient) getCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } @@ -280,7 +280,7 @@ func (client *InboundNatRulesClient) getHandleResponse(resp *http.Response) (Inb // NewListPager - Gets all the inbound NAT rules in a load balancer. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - loadBalancerName - The name of the load balancer. // - options - InboundNatRulesClientListOptions contains the optional parameters for the InboundNatRulesClient.NewListPager @@ -335,7 +335,7 @@ func (client *InboundNatRulesClient) listCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/inboundnatrules_client_example_test.go b/sdk/resourcemanager/network/armnetwork/inboundnatrules_client_example_test.go deleted file mode 100644 index 3f6c395a57da..000000000000 --- a/sdk/resourcemanager/network/armnetwork/inboundnatrules_client_example_test.go +++ /dev/null @@ -1,200 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/InboundNatRuleList.json -func ExampleInboundNatRulesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewInboundNatRulesClient().NewListPager("testrg", "lb1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.InboundNatRuleListResult = armnetwork.InboundNatRuleListResult{ - // Value: []*armnetwork.InboundNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/inboundNatRules/natRule1.1"), - // Name: to.Ptr("natRule1.1"), - // Properties: &armnetwork.InboundNatRulePropertiesFormat{ - // BackendIPConfiguration: &armnetwork.InterfaceIPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/1/networkInterfaces/nic1/ipConfigurations/ip1"), - // }, - // BackendPort: to.Ptr[int32](3389), - // EnableFloatingIP: to.Ptr(false), - // EnableTCPReset: to.Ptr(true), - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/ip1"), - // }, - // FrontendPort: to.Ptr[int32](3390), - // IdleTimeoutInMinutes: to.Ptr[int32](4), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/inboundNatRules/natRule1.3"), - // Name: to.Ptr("natRule1.3"), - // Properties: &armnetwork.InboundNatRulePropertiesFormat{ - // BackendIPConfiguration: &armnetwork.InterfaceIPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/3/networkInterfaces/nic1/ipConfigurations/ip1"), - // }, - // BackendPort: to.Ptr[int32](3389), - // EnableFloatingIP: to.Ptr(false), - // EnableTCPReset: to.Ptr(true), - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/ip1"), - // }, - // FrontendPort: to.Ptr[int32](3392), - // IdleTimeoutInMinutes: to.Ptr[int32](4), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/InboundNatRuleDelete.json -func ExampleInboundNatRulesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewInboundNatRulesClient().BeginDelete(ctx, "testrg", "lb1", "natRule1.1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/InboundNatRuleGet.json -func ExampleInboundNatRulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewInboundNatRulesClient().Get(ctx, "testrg", "lb1", "natRule1.1", &armnetwork.InboundNatRulesClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.InboundNatRule = armnetwork.InboundNatRule{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/inboundNatRules/natRule1.1"), - // Name: to.Ptr("natRule1.1"), - // Properties: &armnetwork.InboundNatRulePropertiesFormat{ - // BackendIPConfiguration: &armnetwork.InterfaceIPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/1/networkInterfaces/nic1/ipConfigurations/ip1"), - // }, - // BackendPort: to.Ptr[int32](3389), - // EnableFloatingIP: to.Ptr(false), - // EnableTCPReset: to.Ptr(true), - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/ip1"), - // }, - // FrontendPort: to.Ptr[int32](3390), - // IdleTimeoutInMinutes: to.Ptr[int32](4), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/InboundNatRuleCreate.json -func ExampleInboundNatRulesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewInboundNatRulesClient().BeginCreateOrUpdate(ctx, "testrg", "lb1", "natRule1.1", armnetwork.InboundNatRule{ - Properties: &armnetwork.InboundNatRulePropertiesFormat{ - BackendPort: to.Ptr[int32](3389), - EnableFloatingIP: to.Ptr(false), - EnableTCPReset: to.Ptr(false), - FrontendIPConfiguration: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/ip1"), - }, - FrontendPort: to.Ptr[int32](3390), - IdleTimeoutInMinutes: to.Ptr[int32](4), - Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.InboundNatRule = armnetwork.InboundNatRule{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/inboundNatRules/natRule1.1"), - // Name: to.Ptr("natRule1.1"), - // Properties: &armnetwork.InboundNatRulePropertiesFormat{ - // BackendIPConfiguration: &armnetwork.InterfaceIPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/1/networkInterfaces/nic1/ipConfigurations/ip1"), - // }, - // BackendPort: to.Ptr[int32](3389), - // EnableFloatingIP: to.Ptr(false), - // EnableTCPReset: to.Ptr(false), - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/ip1"), - // }, - // FrontendPort: to.Ptr[int32](3390), - // IdleTimeoutInMinutes: to.Ptr[int32](4), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - // }, - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/inboundsecurityrule_client.go b/sdk/resourcemanager/network/armnetwork/inboundsecurityrule_client.go index c248109701de..72e1c7f184fa 100644 --- a/sdk/resourcemanager/network/armnetwork/inboundsecurityrule_client.go +++ b/sdk/resourcemanager/network/armnetwork/inboundsecurityrule_client.go @@ -47,7 +47,7 @@ func NewInboundSecurityRuleClient(subscriptionID string, credential azcore.Token // BeginCreateOrUpdate - Creates or updates the specified Network Virtual Appliance Inbound Security Rules. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkVirtualApplianceName - The name of the Network Virtual Appliance. // - ruleCollectionName - The name of security rule collection. @@ -72,7 +72,7 @@ func (client *InboundSecurityRuleClient) BeginCreateOrUpdate(ctx context.Context // CreateOrUpdate - Creates or updates the specified Network Virtual Appliance Inbound Security Rules. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *InboundSecurityRuleClient) createOrUpdate(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, ruleCollectionName string, parameters InboundSecurityRule, options *InboundSecurityRuleClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "InboundSecurityRuleClient.BeginCreateOrUpdate" @@ -118,7 +118,7 @@ func (client *InboundSecurityRuleClient) createOrUpdateCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/inboundsecurityrule_client_example_test.go b/sdk/resourcemanager/network/armnetwork/inboundsecurityrule_client_example_test.go deleted file mode 100644 index 12f27a0c875b..000000000000 --- a/sdk/resourcemanager/network/armnetwork/inboundsecurityrule_client_example_test.go +++ /dev/null @@ -1,66 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/InboundSecurityRulePut.json -func ExampleInboundSecurityRuleClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewInboundSecurityRuleClient().BeginCreateOrUpdate(ctx, "rg1", "nva", "rule1", armnetwork.InboundSecurityRule{ - Properties: &armnetwork.InboundSecurityRuleProperties{ - Rules: []*armnetwork.InboundSecurityRules{ - { - DestinationPortRange: to.Ptr[int32](22), - SourceAddressPrefix: to.Ptr("50.20.121.5/32"), - Protocol: to.Ptr(armnetwork.InboundSecurityRulesProtocolTCP), - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.InboundSecurityRule = armnetwork.InboundSecurityRule{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva/InboundSecurityRules/rule1"), - // Name: to.Ptr("rule1"), - // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), - // Properties: &armnetwork.InboundSecurityRuleProperties{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Rules: []*armnetwork.InboundSecurityRules{ - // { - // DestinationPortRange: to.Ptr[int32](22), - // SourceAddressPrefix: to.Ptr("50.20.121.5/32"), - // Protocol: to.Ptr(armnetwork.InboundSecurityRulesProtocolTCP), - // }}, - // }, - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/interfaceipconfigurations_client.go b/sdk/resourcemanager/network/armnetwork/interfaceipconfigurations_client.go index a1654a004cfb..d24e7676332b 100644 --- a/sdk/resourcemanager/network/armnetwork/interfaceipconfigurations_client.go +++ b/sdk/resourcemanager/network/armnetwork/interfaceipconfigurations_client.go @@ -47,7 +47,7 @@ func NewInterfaceIPConfigurationsClient(subscriptionID string, credential azcore // Get - Gets the specified network interface ip configuration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkInterfaceName - The name of the network interface. // - ipConfigurationName - The name of the ip configuration name. @@ -99,7 +99,7 @@ func (client *InterfaceIPConfigurationsClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -116,7 +116,7 @@ func (client *InterfaceIPConfigurationsClient) getHandleResponse(resp *http.Resp // NewListPager - Get all ip configurations in a network interface. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkInterfaceName - The name of the network interface. // - options - InterfaceIPConfigurationsClientListOptions contains the optional parameters for the InterfaceIPConfigurationsClient.NewListPager @@ -171,7 +171,7 @@ func (client *InterfaceIPConfigurationsClient) listCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/interfaceipconfigurations_client_example_test.go b/sdk/resourcemanager/network/armnetwork/interfaceipconfigurations_client_example_test.go deleted file mode 100644 index 52d13c51e1b4..000000000000 --- a/sdk/resourcemanager/network/armnetwork/interfaceipconfigurations_client_example_test.go +++ /dev/null @@ -1,110 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkInterfaceIPConfigurationList.json -func ExampleInterfaceIPConfigurationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewInterfaceIPConfigurationsClient().NewListPager("testrg", "nic1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.InterfaceIPConfigurationListResult = armnetwork.InterfaceIPConfigurationListResult{ - // Value: []*armnetwork.InterfaceIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/networkInterfaces/nic1/ipConfigurations/ipconfig1"), - // Name: to.Ptr("ipconfig1"), - // Etag: to.Ptr("W/\\\"00000000-0000-0000-0000-000000000000\\\""), - // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ - // Primary: to.Ptr(true), - // PrivateIPAddress: to.Ptr("10.0.0.4"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet12/subnets/subnet12"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkInterfaceIPConfigurationGet.json -func ExampleInterfaceIPConfigurationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewInterfaceIPConfigurationsClient().Get(ctx, "testrg", "mynic", "ipconfig1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.InterfaceIPConfiguration = armnetwork.InterfaceIPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/networkInterfaces/mynic/ipConfigurations/ipconfig1"), - // Name: to.Ptr("ipconfig1"), - // Etag: to.Ptr("W/\\\"00000000-0000-0000-0000-000000000000\\\""), - // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ - // LoadBalancerBackendAddressPools: []*armnetwork.BackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lbname1/backendAddressPools/bepool1"), - // }}, - // LoadBalancerInboundNatRules: []*armnetwork.InboundNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lbname1/inboundNatRules/inbound1"), - // }}, - // PrivateIPAddress: to.Ptr("10.0.1.4"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/myVirtualNetwork/subnets/frontendSubnet"), - // }, - // VirtualNetworkTaps: []*armnetwork.VirtualNetworkTap{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworkTaps/vTAP1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworkTaps/vTAP2"), - // }}, - // }, - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/interfaceloadbalancers_client.go b/sdk/resourcemanager/network/armnetwork/interfaceloadbalancers_client.go index 248e01841239..1b9f55ab3079 100644 --- a/sdk/resourcemanager/network/armnetwork/interfaceloadbalancers_client.go +++ b/sdk/resourcemanager/network/armnetwork/interfaceloadbalancers_client.go @@ -46,7 +46,7 @@ func NewInterfaceLoadBalancersClient(subscriptionID string, credential azcore.To // NewListPager - List all load balancers in a network interface. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkInterfaceName - The name of the network interface. // - options - InterfaceLoadBalancersClientListOptions contains the optional parameters for the InterfaceLoadBalancersClient.NewListPager @@ -101,7 +101,7 @@ func (client *InterfaceLoadBalancersClient) listCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/interfaceloadbalancers_client_example_test.go b/sdk/resourcemanager/network/armnetwork/interfaceloadbalancers_client_example_test.go deleted file mode 100644 index d464b5ba9f92..000000000000 --- a/sdk/resourcemanager/network/armnetwork/interfaceloadbalancers_client_example_test.go +++ /dev/null @@ -1,162 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkInterfaceLoadBalancerList.json -func ExampleInterfaceLoadBalancersClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewInterfaceLoadBalancersClient().NewListPager("testrg", "nic1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.InterfaceLoadBalancerListResult = armnetwork.InterfaceLoadBalancerListResult{ - // Value: []*armnetwork.LoadBalancer{ - // { - // Name: to.Ptr("lbname1"), - // Type: to.Ptr("Microsoft.Network/loadBalancers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lbname1"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("W/\\\"00000000-0000-0000-0000-000000000000\\\""), - // Properties: &armnetwork.LoadBalancerPropertiesFormat{ - // BackendAddressPools: []*armnetwork.BackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lbname1/backendAddressPools/bepool1"), - // Name: to.Ptr("bepool1"), - // Etag: to.Ptr("W/\\\"00000000-0000-0000-0000-000000000000\\\""), - // Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ - // BackendIPConfigurations: []*armnetwork.InterfaceIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/networkInterfaces/nic1/ipConfigurations/ipconfig1"), - // }}, - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lbname1/loadBalancingRules/rule1"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lbname1/frontendIPConfigurations/lbfrontend"), - // Name: to.Ptr("lbfrontend"), - // Etag: to.Ptr("W/\\\"00000000-0000-0000-0000-000000000000\\\""), - // Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ - // InboundNatRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lbname1/inboundNatRules/inbound1"), - // }}, - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lbname1/loadBalancingRules/rule1"), - // }}, - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.PublicIPAddress{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/publicIPAddresses/myDynamicPublicIP"), - // }, - // }, - // }}, - // InboundNatPools: []*armnetwork.InboundNatPool{ - // }, - // InboundNatRules: []*armnetwork.InboundNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lbname1/inboundNatRules/inbound1"), - // Name: to.Ptr("inbound1"), - // Etag: to.Ptr("W/\\\"00000000-0000-0000-0000-000000000000\\\""), - // Properties: &armnetwork.InboundNatRulePropertiesFormat{ - // BackendIPConfiguration: &armnetwork.InterfaceIPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/networkInterfaces/nic1/ipConfigurations/ipconfig1"), - // }, - // BackendPort: to.Ptr[int32](3389), - // EnableFloatingIP: to.Ptr(false), - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lbname1/frontendIPConfigurations/lbfrontend"), - // }, - // FrontendPort: to.Ptr[int32](3389), - // IdleTimeoutInMinutes: to.Ptr[int32](15), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - // }, - // }}, - // LoadBalancingRules: []*armnetwork.LoadBalancingRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lbname1/loadBalancingRules/rule1"), - // Name: to.Ptr("rule1"), - // Etag: to.Ptr("W/\\\"00000000-0000-0000-0000-000000000000\\\""), - // Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ - // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lbname1/backendAddressPools/bepool1"), - // }, - // BackendPort: to.Ptr[int32](80), - // EnableFloatingIP: to.Ptr(false), - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lbname1/frontendIPConfigurations/lbfrontend"), - // }, - // FrontendPort: to.Ptr[int32](80), - // IdleTimeoutInMinutes: to.Ptr[int32](15), - // LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), - // Probe: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lbname1/probes/probe1"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - // }, - // }}, - // OutboundRules: []*armnetwork.OutboundRule{ - // }, - // Probes: []*armnetwork.Probe{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lbname1/probes/probe1"), - // Name: to.Ptr("probe1"), - // Etag: to.Ptr("W/\\\"00000000-0000-0000-0000-000000000000\\\""), - // Properties: &armnetwork.ProbePropertiesFormat{ - // IntervalInSeconds: to.Ptr[int32](15), - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lbname1/loadBalancingRules/rule1"), - // }}, - // NumberOfProbes: to.Ptr[int32](2), - // Port: to.Ptr[int32](80), - // ProbeThreshold: to.Ptr[int32](1), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RequestPath: to.Ptr("healthcheck.aspx"), - // Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/interfaces_client.go b/sdk/resourcemanager/network/armnetwork/interfaces_client.go index 4f5397a38ae4..1d1d7822750a 100644 --- a/sdk/resourcemanager/network/armnetwork/interfaces_client.go +++ b/sdk/resourcemanager/network/armnetwork/interfaces_client.go @@ -47,7 +47,7 @@ func NewInterfacesClient(subscriptionID string, credential azcore.TokenCredentia // BeginCreateOrUpdate - Creates or updates a network interface. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkInterfaceName - The name of the network interface. // - parameters - Parameters supplied to the create or update network interface operation. @@ -71,7 +71,7 @@ func (client *InterfacesClient) BeginCreateOrUpdate(ctx context.Context, resourc // CreateOrUpdate - Creates or updates a network interface. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *InterfacesClient) createOrUpdate(ctx context.Context, resourceGroupName string, networkInterfaceName string, parameters Interface, options *InterfacesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "InterfacesClient.BeginCreateOrUpdate" @@ -113,7 +113,7 @@ func (client *InterfacesClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -125,7 +125,7 @@ func (client *InterfacesClient) createOrUpdateCreateRequest(ctx context.Context, // BeginDelete - Deletes the specified network interface. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkInterfaceName - The name of the network interface. // - options - InterfacesClientBeginDeleteOptions contains the optional parameters for the InterfacesClient.BeginDelete method. @@ -147,7 +147,7 @@ func (client *InterfacesClient) BeginDelete(ctx context.Context, resourceGroupNa // Delete - Deletes the specified network interface. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *InterfacesClient) deleteOperation(ctx context.Context, resourceGroupName string, networkInterfaceName string, options *InterfacesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "InterfacesClient.BeginDelete" @@ -189,7 +189,7 @@ func (client *InterfacesClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -198,7 +198,7 @@ func (client *InterfacesClient) deleteCreateRequest(ctx context.Context, resourc // Get - Gets information about the specified network interface. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkInterfaceName - The name of the network interface. // - options - InterfacesClientGetOptions contains the optional parameters for the InterfacesClient.Get method. @@ -244,7 +244,7 @@ func (client *InterfacesClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } @@ -265,7 +265,7 @@ func (client *InterfacesClient) getHandleResponse(resp *http.Response) (Interfac // GetCloudServiceNetworkInterface - Get the specified network interface in a cloud service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - cloudServiceName - The name of the cloud service. // - roleInstanceName - The name of role instance. @@ -322,7 +322,7 @@ func (client *InterfacesClient) getCloudServiceNetworkInterfaceCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } @@ -343,7 +343,7 @@ func (client *InterfacesClient) getCloudServiceNetworkInterfaceHandleResponse(re // BeginGetEffectiveRouteTable - Gets all route tables applied to a network interface. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkInterfaceName - The name of the network interface. // - options - InterfacesClientBeginGetEffectiveRouteTableOptions contains the optional parameters for the InterfacesClient.BeginGetEffectiveRouteTable @@ -366,7 +366,7 @@ func (client *InterfacesClient) BeginGetEffectiveRouteTable(ctx context.Context, // GetEffectiveRouteTable - Gets all route tables applied to a network interface. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *InterfacesClient) getEffectiveRouteTable(ctx context.Context, resourceGroupName string, networkInterfaceName string, options *InterfacesClientBeginGetEffectiveRouteTableOptions) (*http.Response, error) { var err error const operationName = "InterfacesClient.BeginGetEffectiveRouteTable" @@ -408,7 +408,7 @@ func (client *InterfacesClient) getEffectiveRouteTableCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -578,7 +578,7 @@ func (client *InterfacesClient) getVirtualMachineScaleSetNetworkInterfaceHandleR // NewListPager - Gets all network interfaces in a resource group. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - options - InterfacesClientListOptions contains the optional parameters for the InterfacesClient.NewListPager method. func (client *InterfacesClient) NewListPager(resourceGroupName string, options *InterfacesClientListOptions) *runtime.Pager[InterfacesClientListResponse] { @@ -627,7 +627,7 @@ func (client *InterfacesClient) listCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -644,7 +644,7 @@ func (client *InterfacesClient) listHandleResponse(resp *http.Response) (Interfa // NewListAllPager - Gets all network interfaces in a subscription. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - options - InterfacesClientListAllOptions contains the optional parameters for the InterfacesClient.NewListAllPager method. func (client *InterfacesClient) NewListAllPager(options *InterfacesClientListAllOptions) *runtime.Pager[InterfacesClientListAllResponse] { return runtime.NewPager(runtime.PagingHandler[InterfacesClientListAllResponse]{ @@ -688,7 +688,7 @@ func (client *InterfacesClient) listAllCreateRequest(ctx context.Context, option return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -705,7 +705,7 @@ func (client *InterfacesClient) listAllHandleResponse(resp *http.Response) (Inte // NewListCloudServiceNetworkInterfacesPager - Gets all network interfaces in a cloud service. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - cloudServiceName - The name of the cloud service. // - options - InterfacesClientListCloudServiceNetworkInterfacesOptions contains the optional parameters for the InterfacesClient.NewListCloudServiceNetworkInterfacesPager @@ -760,7 +760,7 @@ func (client *InterfacesClient) listCloudServiceNetworkInterfacesCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -778,7 +778,7 @@ func (client *InterfacesClient) listCloudServiceNetworkInterfacesHandleResponse( // NewListCloudServiceRoleInstanceNetworkInterfacesPager - Gets information about all network interfaces in a role instance // in a cloud service. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - cloudServiceName - The name of the cloud service. // - roleInstanceName - The name of role instance. @@ -838,7 +838,7 @@ func (client *InterfacesClient) listCloudServiceRoleInstanceNetworkInterfacesCre return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -856,7 +856,7 @@ func (client *InterfacesClient) listCloudServiceRoleInstanceNetworkInterfacesHan // BeginListEffectiveNetworkSecurityGroups - Gets all network security groups applied to a network interface. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkInterfaceName - The name of the network interface. // - options - InterfacesClientBeginListEffectiveNetworkSecurityGroupsOptions contains the optional parameters for the InterfacesClient.BeginListEffectiveNetworkSecurityGroups @@ -879,7 +879,7 @@ func (client *InterfacesClient) BeginListEffectiveNetworkSecurityGroups(ctx cont // ListEffectiveNetworkSecurityGroups - Gets all network security groups applied to a network interface. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *InterfacesClient) listEffectiveNetworkSecurityGroups(ctx context.Context, resourceGroupName string, networkInterfaceName string, options *InterfacesClientBeginListEffectiveNetworkSecurityGroupsOptions) (*http.Response, error) { var err error const operationName = "InterfacesClient.BeginListEffectiveNetworkSecurityGroups" @@ -921,7 +921,7 @@ func (client *InterfacesClient) listEffectiveNetworkSecurityGroupsCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1166,7 +1166,7 @@ func (client *InterfacesClient) listVirtualMachineScaleSetVMNetworkInterfacesHan // UpdateTags - Updates a network interface tags. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkInterfaceName - The name of the network interface. // - parameters - Parameters supplied to update network interface tags. @@ -1213,7 +1213,7 @@ func (client *InterfacesClient) updateTagsCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/interfaces_client_example_test.go b/sdk/resourcemanager/network/armnetwork/interfaces_client_example_test.go deleted file mode 100644 index d8b9e98826f6..000000000000 --- a/sdk/resourcemanager/network/armnetwork/interfaces_client_example_test.go +++ /dev/null @@ -1,1352 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/CloudServiceRoleInstanceNetworkInterfaceList.json -func ExampleInterfacesClient_NewListCloudServiceRoleInstanceNetworkInterfacesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewInterfacesClient().NewListCloudServiceRoleInstanceNetworkInterfacesPager("rg1", "cs1", "TestVMRole_IN_0", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.InterfaceListResult = armnetwork.InterfaceListResult{ - // Value: []*armnetwork.Interface{ - // { - // Name: to.Ptr("nic1"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/cloudServices/cs1/roleInstances/TestVMRole_IN_0/networkInterfaces/nic1"), - // Properties: &armnetwork.InterfacePropertiesFormat{ - // DNSSettings: &armnetwork.InterfaceDNSSettings{ - // AppliedDNSServers: []*string{ - // }, - // DNSServers: []*string{ - // }, - // InternalDomainNameSuffix: to.Ptr("ruw4wz3grewudjsyzrxj44pxod.cdmx.internal.cloudapp.net"), - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(false), - // IPConfigurations: []*armnetwork.InterfaceIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/cloudServices/cs1/roleInstances/TestVMRole_IN_0/networkInterfaces/nic1/ipConfigurations/ip1"), - // Name: to.Ptr("ip1"), - // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ - // LoadBalancerBackendAddressPools: []*armnetwork.BackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb1/backendAddressPools/addressPool1"), - // }}, - // LoadBalancerInboundNatRules: []*armnetwork.InboundNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb1/inboundNatRules/natPool1.1"), - // }}, - // Primary: to.Ptr(true), - // PrivateIPAddress: to.Ptr("10.0.0.5"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.PublicIPAddress{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/cloudServices/cs1/roleInstances/TestVMRole_IN_0/networkInterfaces/nic1/ipConfigurations/ip1/publicIPAddresses/pub1"), - // }, - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // }, - // }, - // }}, - // MacAddress: to.Ptr("00-00-00-00-00-00"), - // NetworkSecurityGroup: &armnetwork.SecurityGroup{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1"), - // }, - // Primary: to.Ptr(true), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/CloudServiceNetworkInterfaceList.json -func ExampleInterfacesClient_NewListCloudServiceNetworkInterfacesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewInterfacesClient().NewListCloudServiceNetworkInterfacesPager("rg1", "cs1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.InterfaceListResult = armnetwork.InterfaceListResult{ - // Value: []*armnetwork.Interface{ - // { - // Name: to.Ptr("nic1"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/cloudServices/cs1/roleInstances/TestVMRole_IN_0/networkInterfaces/nic1"), - // Properties: &armnetwork.InterfacePropertiesFormat{ - // DNSSettings: &armnetwork.InterfaceDNSSettings{ - // AppliedDNSServers: []*string{ - // }, - // DNSServers: []*string{ - // }, - // InternalDomainNameSuffix: to.Ptr("ruw4wz3grewudjsyzrxj44pxod.cdmx.internal.cloudapp.net"), - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(false), - // IPConfigurations: []*armnetwork.InterfaceIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/cloudServices/cs1/roleInstances/TestVMRole_IN_0/networkInterfaces/nic1/ipConfigurations/ip1"), - // Name: to.Ptr("ip1"), - // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ - // LoadBalancerBackendAddressPools: []*armnetwork.BackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb1/backendAddressPools/addressPool1"), - // }}, - // LoadBalancerInboundNatRules: []*armnetwork.InboundNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb1/inboundNatRules/natPool1.0"), - // }}, - // Primary: to.Ptr(true), - // PrivateIPAddress: to.Ptr("10.0.0.4"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.PublicIPAddress{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/cloudServices/cs1/roleInstances/TestVMRole_IN_0/networkInterfaces/nic1/ipConfigurations/ip1/publicIPAddresses/pub1"), - // }, - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // }, - // }, - // }}, - // MacAddress: to.Ptr("00-00-00-00-00-00"), - // NetworkSecurityGroup: &armnetwork.SecurityGroup{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1"), - // }, - // Primary: to.Ptr(true), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }, - // { - // Name: to.Ptr("nic1"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/cloudServices/cs1/roleInstances/TestVMRole_IN_1/networkInterfaces/nic1"), - // Properties: &armnetwork.InterfacePropertiesFormat{ - // DNSSettings: &armnetwork.InterfaceDNSSettings{ - // AppliedDNSServers: []*string{ - // }, - // DNSServers: []*string{ - // }, - // InternalDomainNameSuffix: to.Ptr("ruw4wz3grewudjsyzrxj44pxod.cdmx.internal.cloudapp.net"), - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(false), - // IPConfigurations: []*armnetwork.InterfaceIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/cloudServices/cs1/roleInstances/TestVMRole_IN_1/networkInterfaces/nic1/ipConfigurations/ip1"), - // Name: to.Ptr("ip1"), - // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ - // LoadBalancerBackendAddressPools: []*armnetwork.BackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb1/backendAddressPools/addressPool1"), - // }}, - // LoadBalancerInboundNatRules: []*armnetwork.InboundNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb1/inboundNatRules/natPool1.1"), - // }}, - // Primary: to.Ptr(true), - // PrivateIPAddress: to.Ptr("10.0.0.5"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.PublicIPAddress{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/cloudServices/cs1/roleInstances/TestVMRole_IN_1/networkInterfaces/nic1/ipConfigurations/ip1/publicIPAddresses/pub1"), - // }, - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // }, - // }, - // }}, - // MacAddress: to.Ptr("00-00-00-00-00-00"), - // NetworkSecurityGroup: &armnetwork.SecurityGroup{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1"), - // }, - // Primary: to.Ptr(true), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/CloudServiceNetworkInterfaceGet.json -func ExampleInterfacesClient_GetCloudServiceNetworkInterface() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewInterfacesClient().GetCloudServiceNetworkInterface(ctx, "rg1", "cs1", "TestVMRole_IN_0", "nic1", &armnetwork.InterfacesClientGetCloudServiceNetworkInterfaceOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Interface = armnetwork.Interface{ - // Name: to.Ptr("nic1"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/cloudServices/cs1/roleInstances/TestVMRole_IN_0/networkInterfaces/nic1"), - // Properties: &armnetwork.InterfacePropertiesFormat{ - // DNSSettings: &armnetwork.InterfaceDNSSettings{ - // AppliedDNSServers: []*string{ - // }, - // DNSServers: []*string{ - // }, - // InternalDomainNameSuffix: to.Ptr("dns.cdmx.internal.cloudapp.net"), - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(false), - // IPConfigurations: []*armnetwork.InterfaceIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/cloudServices/cs1/roleInstances/TestVMRole_IN_0/networkInterfaces/nic1/ipConfigurations/ip1"), - // Name: to.Ptr("ip1"), - // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ - // LoadBalancerBackendAddressPools: []*armnetwork.BackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb1/backendAddressPools/addressPool1"), - // }}, - // LoadBalancerInboundNatRules: []*armnetwork.InboundNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb1/inboundNatRules/natPool1.1"), - // }}, - // Primary: to.Ptr(true), - // PrivateIPAddress: to.Ptr("10.0.0.5"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.PublicIPAddress{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/cloudServices/cs1/roleInstances/TestVMRole_IN_0/networkInterfaces/nic1/ipConfigurations/ip1/publicIPAddresses/pub1"), - // }, - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // }, - // }, - // }}, - // MacAddress: to.Ptr("00-00-00-00-00-00"), - // NetworkSecurityGroup: &armnetwork.SecurityGroup{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1"), - // }, - // Primary: to.Ptr(true), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkInterfaceDelete.json -func ExampleInterfacesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewInterfacesClient().BeginDelete(ctx, "rg1", "test-nic", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkInterfaceGet.json -func ExampleInterfacesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewInterfacesClient().Get(ctx, "rg1", "test-nic", &armnetwork.InterfacesClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Interface = armnetwork.Interface{ - // Name: to.Ptr("test-nic"), - // Type: to.Ptr("Microsoft.Network/networkInterfaces"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.InterfacePropertiesFormat{ - // DisableTCPStateTracking: to.Ptr(true), - // DNSSettings: &armnetwork.InterfaceDNSSettings{ - // AppliedDNSServers: []*string{ - // }, - // DNSServers: []*string{ - // }, - // InternalDomainNameSuffix: to.Ptr("test.bx.internal.cloudapp.net"), - // }, - // DscpConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/dscpConfiguration/mydscpconfiguration"), - // }, - // EnableAcceleratedNetworking: to.Ptr(true), - // EnableIPForwarding: to.Ptr(false), - // IPConfigurations: []*armnetwork.InterfaceIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic/ipConfigurations/ipconfig1"), - // Name: to.Ptr("ipconfig1"), - // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ - // Primary: to.Ptr(true), - // PrivateIPAddress: to.Ptr("172.20.2.4"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.PublicIPAddress{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip"), - // }, - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default"), - // }, - // }, - // }}, - // MacAddress: to.Ptr("00-0D-3A-1B-C7-21"), - // NetworkSecurityGroup: &armnetwork.SecurityGroup{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg"), - // }, - // Primary: to.Ptr(true), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualMachine: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/vm1"), - // }, - // VnetEncryptionSupported: to.Ptr(false), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkInterfaceCreate.json -func ExampleInterfacesClient_BeginCreateOrUpdate_createNetworkInterface() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewInterfacesClient().BeginCreateOrUpdate(ctx, "rg1", "test-nic", armnetwork.Interface{ - Location: to.Ptr("eastus"), - Properties: &armnetwork.InterfacePropertiesFormat{ - DisableTCPStateTracking: to.Ptr(true), - EnableAcceleratedNetworking: to.Ptr(true), - IPConfigurations: []*armnetwork.InterfaceIPConfiguration{ - { - Name: to.Ptr("ipconfig1"), - Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ - PublicIPAddress: &armnetwork.PublicIPAddress{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip"), - }, - Subnet: &armnetwork.Subnet{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default"), - }, - }, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Interface = armnetwork.Interface{ - // Name: to.Ptr("test-nic"), - // Type: to.Ptr("Microsoft.Network/networkInterfaces"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.InterfacePropertiesFormat{ - // DisableTCPStateTracking: to.Ptr(true), - // DNSSettings: &armnetwork.InterfaceDNSSettings{ - // AppliedDNSServers: []*string{ - // }, - // DNSServers: []*string{ - // }, - // }, - // EnableAcceleratedNetworking: to.Ptr(true), - // EnableIPForwarding: to.Ptr(false), - // IPConfigurations: []*armnetwork.InterfaceIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic/ipConfigurations/ipconfig1"), - // Name: to.Ptr("ipconfig1"), - // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ - // Primary: to.Ptr(true), - // PrivateIPAddress: to.Ptr("172.20.2.4"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.PublicIPAddress{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip"), - // }, - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VnetEncryptionSupported: to.Ptr(false), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkInterfaceCreateGatewayLoadBalancerConsumer.json -func ExampleInterfacesClient_BeginCreateOrUpdate_createNetworkInterfaceWithGatewayLoadBalancerConsumerConfigured() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewInterfacesClient().BeginCreateOrUpdate(ctx, "rg1", "test-nic", armnetwork.Interface{ - Location: to.Ptr("eastus"), - Properties: &armnetwork.InterfacePropertiesFormat{ - EnableAcceleratedNetworking: to.Ptr(true), - IPConfigurations: []*armnetwork.InterfaceIPConfiguration{ - { - Name: to.Ptr("ipconfig1"), - Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ - GatewayLoadBalancer: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb-provider"), - }, - PublicIPAddress: &armnetwork.PublicIPAddress{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip"), - }, - Subnet: &armnetwork.Subnet{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default"), - }, - }, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Interface = armnetwork.Interface{ - // Name: to.Ptr("test-nic"), - // Type: to.Ptr("Microsoft.Network/networkInterfaces"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.InterfacePropertiesFormat{ - // DNSSettings: &armnetwork.InterfaceDNSSettings{ - // AppliedDNSServers: []*string{ - // }, - // DNSServers: []*string{ - // }, - // }, - // EnableAcceleratedNetworking: to.Ptr(true), - // EnableIPForwarding: to.Ptr(false), - // IPConfigurations: []*armnetwork.InterfaceIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic/ipConfigurations/ipconfig1"), - // Name: to.Ptr("ipconfig1"), - // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ - // GatewayLoadBalancer: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb-provider"), - // }, - // Primary: to.Ptr(true), - // PrivateIPAddress: to.Ptr("172.20.2.4"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.PublicIPAddress{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip"), - // }, - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkInterfaceUpdateTags.json -func ExampleInterfacesClient_UpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewInterfacesClient().UpdateTags(ctx, "rg1", "test-nic", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Interface = armnetwork.Interface{ - // Name: to.Ptr("test-nic"), - // Type: to.Ptr("Microsoft.Network/networkInterfaces"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armnetwork.InterfacePropertiesFormat{ - // DisableTCPStateTracking: to.Ptr(true), - // DNSSettings: &armnetwork.InterfaceDNSSettings{ - // AppliedDNSServers: []*string{ - // }, - // DNSServers: []*string{ - // }, - // }, - // EnableAcceleratedNetworking: to.Ptr(true), - // EnableIPForwarding: to.Ptr(false), - // IPConfigurations: []*armnetwork.InterfaceIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic/ipConfigurations/ipconfig1"), - // Name: to.Ptr("ipconfig1"), - // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ - // Primary: to.Ptr(true), - // PrivateIPAddress: to.Ptr("172.20.2.4"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.PublicIPAddress{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip"), - // }, - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VnetEncryptionSupported: to.Ptr(false), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkInterfaceListAll.json -func ExampleInterfacesClient_NewListAllPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewInterfacesClient().NewListAllPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.InterfaceListResult = armnetwork.InterfaceListResult{ - // Value: []*armnetwork.Interface{ - // { - // Name: to.Ptr("test-nic"), - // Type: to.Ptr("Microsoft.Network/networkInterfaces"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.InterfacePropertiesFormat{ - // DisableTCPStateTracking: to.Ptr(true), - // DNSSettings: &armnetwork.InterfaceDNSSettings{ - // AppliedDNSServers: []*string{ - // }, - // DNSServers: []*string{ - // }, - // InternalDomainNameSuffix: to.Ptr("test.bx.internal.cloudapp.net"), - // }, - // EnableAcceleratedNetworking: to.Ptr(true), - // EnableIPForwarding: to.Ptr(false), - // IPConfigurations: []*armnetwork.InterfaceIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic/ipConfigurations/ipconfig1"), - // Name: to.Ptr("ipconfig1"), - // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ - // Primary: to.Ptr(true), - // PrivateIPAddress: to.Ptr("172.20.2.4"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.PublicIPAddress{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip"), - // }, - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default"), - // }, - // }, - // }}, - // MacAddress: to.Ptr("00-0D-3A-1B-C7-21"), - // NetworkSecurityGroup: &armnetwork.SecurityGroup{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg"), - // }, - // Primary: to.Ptr(true), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualMachine: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/vm1"), - // }, - // VnetEncryptionSupported: to.Ptr(false), - // }, - // }, - // { - // Name: to.Ptr("test-nic2"), - // Type: to.Ptr("Microsoft.Network/networkInterfaces"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rgnew/providers/Microsoft.Network/networkInterfaces/test-nic2"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.InterfacePropertiesFormat{ - // DisableTCPStateTracking: to.Ptr(true), - // DNSSettings: &armnetwork.InterfaceDNSSettings{ - // AppliedDNSServers: []*string{ - // }, - // DNSServers: []*string{ - // }, - // }, - // EnableAcceleratedNetworking: to.Ptr(true), - // EnableIPForwarding: to.Ptr(false), - // IPConfigurations: []*armnetwork.InterfaceIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rgnew/providers/Microsoft.Network/networkInterfaces/test-nic2/ipConfigurations/ipconfig1"), - // Name: to.Ptr("ipconfig1"), - // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ - // Primary: to.Ptr(true), - // PrivateIPAddress: to.Ptr("172.20.2.4"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.PublicIPAddress{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rgnew/providers/Microsoft.Network/publicIPAddresses/test-ip2"), - // }, - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rgnew/providers/Microsoft.Network/virtualNetworks/rgnew-vnet2/subnets/default"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VnetEncryptionSupported: to.Ptr(false), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkInterfaceList.json -func ExampleInterfacesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewInterfacesClient().NewListPager("rg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.InterfaceListResult = armnetwork.InterfaceListResult{ - // Value: []*armnetwork.Interface{ - // { - // Name: to.Ptr("test-nic"), - // Type: to.Ptr("Microsoft.Network/networkInterfaces"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.InterfacePropertiesFormat{ - // DisableTCPStateTracking: to.Ptr(true), - // DNSSettings: &armnetwork.InterfaceDNSSettings{ - // AppliedDNSServers: []*string{ - // }, - // DNSServers: []*string{ - // }, - // InternalDomainNameSuffix: to.Ptr("test.bx.internal.cloudapp.net"), - // }, - // EnableAcceleratedNetworking: to.Ptr(true), - // EnableIPForwarding: to.Ptr(false), - // IPConfigurations: []*armnetwork.InterfaceIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic/ipConfigurations/ipconfig1"), - // Name: to.Ptr("ipconfig1"), - // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ - // Primary: to.Ptr(true), - // PrivateIPAddress: to.Ptr("172.20.2.4"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.PublicIPAddress{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip"), - // }, - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default"), - // }, - // }, - // }}, - // MacAddress: to.Ptr("00-0D-3A-1B-C7-21"), - // NetworkSecurityGroup: &armnetwork.SecurityGroup{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg"), - // }, - // Primary: to.Ptr(true), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualMachine: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/vm1"), - // }, - // VnetEncryptionSupported: to.Ptr(false), - // }, - // }, - // { - // Name: to.Ptr("test-nic2"), - // Type: to.Ptr("Microsoft.Network/networkInterfaces"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic2"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.InterfacePropertiesFormat{ - // DNSSettings: &armnetwork.InterfaceDNSSettings{ - // AppliedDNSServers: []*string{ - // }, - // DNSServers: []*string{ - // }, - // }, - // EnableAcceleratedNetworking: to.Ptr(true), - // EnableIPForwarding: to.Ptr(false), - // IPConfigurations: []*armnetwork.InterfaceIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic2/ipConfigurations/ipconfig1"), - // Name: to.Ptr("ipconfig1"), - // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ - // Primary: to.Ptr(true), - // PrivateIPAddress: to.Ptr("172.20.2.4"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.PublicIPAddress{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip2"), - // }, - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet2/subnets/default"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VnetEncryptionSupported: to.Ptr(false), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkInterfaceEffectiveRouteTableList.json -func ExampleInterfacesClient_BeginGetEffectiveRouteTable() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewInterfacesClient().BeginGetEffectiveRouteTable(ctx, "rg1", "nic1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.EffectiveRouteListResult = armnetwork.EffectiveRouteListResult{ - // Value: []*armnetwork.EffectiveRoute{ - // { - // AddressPrefix: []*string{ - // to.Ptr("172.20.2.0/24")}, - // NextHopIPAddress: []*string{ - // }, - // NextHopType: to.Ptr(armnetwork.RouteNextHopTypeVnetLocal), - // Source: to.Ptr(armnetwork.EffectiveRouteSourceDefault), - // State: to.Ptr(armnetwork.EffectiveRouteStateActive), - // }, - // { - // AddressPrefix: []*string{ - // to.Ptr("0.0.0.0/0")}, - // NextHopIPAddress: []*string{ - // }, - // NextHopType: to.Ptr(armnetwork.RouteNextHopTypeInternet), - // Source: to.Ptr(armnetwork.EffectiveRouteSourceDefault), - // State: to.Ptr(armnetwork.EffectiveRouteStateActive), - // }, - // { - // AddressPrefix: []*string{ - // to.Ptr("10.0.0.0/8")}, - // NextHopIPAddress: []*string{ - // }, - // NextHopType: to.Ptr(armnetwork.RouteNextHopTypeNone), - // Source: to.Ptr(armnetwork.EffectiveRouteSourceDefault), - // State: to.Ptr(armnetwork.EffectiveRouteStateActive), - // }, - // { - // AddressPrefix: []*string{ - // to.Ptr("100.64.0.0/10")}, - // NextHopIPAddress: []*string{ - // }, - // NextHopType: to.Ptr(armnetwork.RouteNextHopTypeNone), - // Source: to.Ptr(armnetwork.EffectiveRouteSourceDefault), - // State: to.Ptr(armnetwork.EffectiveRouteStateActive), - // }, - // { - // AddressPrefix: []*string{ - // to.Ptr("172.16.0.0/12")}, - // NextHopIPAddress: []*string{ - // }, - // NextHopType: to.Ptr(armnetwork.RouteNextHopTypeNone), - // Source: to.Ptr(armnetwork.EffectiveRouteSourceDefault), - // State: to.Ptr(armnetwork.EffectiveRouteStateActive), - // }, - // { - // AddressPrefix: []*string{ - // to.Ptr("192.168.0.0/16")}, - // NextHopIPAddress: []*string{ - // }, - // NextHopType: to.Ptr(armnetwork.RouteNextHopTypeNone), - // Source: to.Ptr(armnetwork.EffectiveRouteSourceDefault), - // State: to.Ptr(armnetwork.EffectiveRouteStateActive), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkInterfaceEffectiveNSGList.json -func ExampleInterfacesClient_BeginListEffectiveNetworkSecurityGroups() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewInterfacesClient().BeginListEffectiveNetworkSecurityGroups(ctx, "rg1", "nic1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.EffectiveNetworkSecurityGroupListResult = armnetwork.EffectiveNetworkSecurityGroupListResult{ - // Value: []*armnetwork.EffectiveNetworkSecurityGroup{ - // { - // Association: &armnetwork.EffectiveNetworkSecurityGroupAssociation{ - // NetworkInterface: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/nic1"), - // }, - // NetworkManager: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/nm1"), - // }, - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default"), - // }, - // }, - // EffectiveSecurityRules: []*armnetwork.EffectiveNetworkSecurityRule{ - // { - // Name: to.Ptr("securityRules/rule1"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("0.0.0.0/32"), - // DestinationPortRange: to.Ptr("6579-6579"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](234), - // SourceAddressPrefix: to.Ptr("0.0.0.0/32"), - // SourcePortRange: to.Ptr("456-456"), - // Protocol: to.Ptr(armnetwork.EffectiveSecurityRuleProtocolTCP), - // }, - // { - // Name: to.Ptr("securityRules/default-allow-rdp"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("0.0.0.0/0"), - // DestinationPortRange: to.Ptr("3389-3389"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](1000), - // SourceAddressPrefix: to.Ptr("1.1.1.1/32"), - // SourcePortRange: to.Ptr("0-65535"), - // Protocol: to.Ptr(armnetwork.EffectiveSecurityRuleProtocolTCP), - // }, - // { - // Name: to.Ptr("defaultSecurityRules/AllowInternetOutBound"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("Internet"), - // DestinationPortRange: to.Ptr("0-65535"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), - // ExpandedDestinationAddressPrefix: []*string{ - // to.Ptr("32.0.0.0/3"), - // to.Ptr("4.0.0.0/6"), - // to.Ptr("2.0.0.0/7"), - // to.Ptr("1.0.0.0/8")}, - // Priority: to.Ptr[int32](65001), - // SourceAddressPrefix: to.Ptr("0.0.0.0/0"), - // SourcePortRange: to.Ptr("0-65535"), - // Protocol: to.Ptr(armnetwork.EffectiveSecurityRuleProtocolAll), - // }}, - // NetworkSecurityGroup: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/test-nsg"), - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VmssVmNetworkInterfaceList.json -func ExampleInterfacesClient_NewListVirtualMachineScaleSetVMNetworkInterfacesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewInterfacesClient().NewListVirtualMachineScaleSetVMNetworkInterfacesPager("rg1", "vmss1", "1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.InterfaceListResult = armnetwork.InterfaceListResult{ - // Value: []*armnetwork.Interface{ - // { - // Name: to.Ptr("nic1"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/1/networkInterfaces/nic1"), - // Properties: &armnetwork.InterfacePropertiesFormat{ - // DNSSettings: &armnetwork.InterfaceDNSSettings{ - // AppliedDNSServers: []*string{ - // }, - // DNSServers: []*string{ - // }, - // InternalDomainNameSuffix: to.Ptr("ruw4wz3grewudjsyzrxj44pxod.cdmx.internal.cloudapp.net"), - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(false), - // IPConfigurations: []*armnetwork.InterfaceIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/1/networkInterfaces/nic1/ipConfigurations/ip1"), - // Name: to.Ptr("ip1"), - // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ - // LoadBalancerBackendAddressPools: []*armnetwork.BackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb1/backendAddressPools/addressPool1"), - // }}, - // LoadBalancerInboundNatRules: []*armnetwork.InboundNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb1/inboundNatRules/natPool1.1"), - // }}, - // Primary: to.Ptr(true), - // PrivateIPAddress: to.Ptr("10.0.0.5"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.PublicIPAddress{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/1/networkInterfaces/nic1/ipConfigurations/ip1/publicIPAddresses/pub1"), - // }, - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // }, - // }, - // }}, - // MacAddress: to.Ptr("00-00-00-00-00-00"), - // NetworkSecurityGroup: &armnetwork.SecurityGroup{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1"), - // }, - // Primary: to.Ptr(true), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualMachine: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/1"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VmssNetworkInterfaceList.json -func ExampleInterfacesClient_NewListVirtualMachineScaleSetNetworkInterfacesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewInterfacesClient().NewListVirtualMachineScaleSetNetworkInterfacesPager("rg1", "vmss1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.InterfaceListResult = armnetwork.InterfaceListResult{ - // Value: []*armnetwork.Interface{ - // { - // Name: to.Ptr("nic1"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/0/networkInterfaces/nic1"), - // Properties: &armnetwork.InterfacePropertiesFormat{ - // DNSSettings: &armnetwork.InterfaceDNSSettings{ - // AppliedDNSServers: []*string{ - // }, - // DNSServers: []*string{ - // }, - // InternalDomainNameSuffix: to.Ptr("ruw4wz3grewudjsyzrxj44pxod.cdmx.internal.cloudapp.net"), - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(false), - // IPConfigurations: []*armnetwork.InterfaceIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/0/networkInterfaces/nic1/ipConfigurations/ip1"), - // Name: to.Ptr("ip1"), - // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ - // LoadBalancerBackendAddressPools: []*armnetwork.BackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb1/backendAddressPools/addressPool1"), - // }}, - // LoadBalancerInboundNatRules: []*armnetwork.InboundNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb1/inboundNatRules/natPool1.0"), - // }}, - // Primary: to.Ptr(true), - // PrivateIPAddress: to.Ptr("10.0.0.4"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.PublicIPAddress{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/0/networkInterfaces/nic1/ipConfigurations/ip1/publicIPAddresses/pub1"), - // }, - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // }, - // }, - // }}, - // MacAddress: to.Ptr("00-00-00-00-00-00"), - // NetworkSecurityGroup: &armnetwork.SecurityGroup{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1"), - // }, - // Primary: to.Ptr(true), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualMachine: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/0"), - // }, - // }, - // }, - // { - // Name: to.Ptr("nic1"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/1/networkInterfaces/nic1"), - // Properties: &armnetwork.InterfacePropertiesFormat{ - // DNSSettings: &armnetwork.InterfaceDNSSettings{ - // AppliedDNSServers: []*string{ - // }, - // DNSServers: []*string{ - // }, - // InternalDomainNameSuffix: to.Ptr("ruw4wz3grewudjsyzrxj44pxod.cdmx.internal.cloudapp.net"), - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(false), - // IPConfigurations: []*armnetwork.InterfaceIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/1/networkInterfaces/nic1/ipConfigurations/ip1"), - // Name: to.Ptr("ip1"), - // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ - // LoadBalancerBackendAddressPools: []*armnetwork.BackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb1/backendAddressPools/addressPool1"), - // }}, - // LoadBalancerInboundNatRules: []*armnetwork.InboundNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb1/inboundNatRules/natPool1.1"), - // }}, - // Primary: to.Ptr(true), - // PrivateIPAddress: to.Ptr("10.0.0.5"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.PublicIPAddress{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/1/networkInterfaces/nic1/ipConfigurations/ip1/publicIPAddresses/pub1"), - // }, - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // }, - // }, - // }}, - // MacAddress: to.Ptr("00-00-00-00-00-00"), - // NetworkSecurityGroup: &armnetwork.SecurityGroup{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1"), - // }, - // Primary: to.Ptr(true), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualMachine: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/1"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VmssNetworkInterfaceGet.json -func ExampleInterfacesClient_GetVirtualMachineScaleSetNetworkInterface() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewInterfacesClient().GetVirtualMachineScaleSetNetworkInterface(ctx, "rg1", "vmss1", "1", "nic1", &armnetwork.InterfacesClientGetVirtualMachineScaleSetNetworkInterfaceOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Interface = armnetwork.Interface{ - // Name: to.Ptr("nic1"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/1/networkInterfaces/nic1"), - // Properties: &armnetwork.InterfacePropertiesFormat{ - // DNSSettings: &armnetwork.InterfaceDNSSettings{ - // AppliedDNSServers: []*string{ - // }, - // DNSServers: []*string{ - // }, - // InternalDomainNameSuffix: to.Ptr("dns.cdmx.internal.cloudapp.net"), - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(false), - // IPConfigurations: []*armnetwork.InterfaceIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/1/networkInterfaces/nic1/ipConfigurations/ip1"), - // Name: to.Ptr("ip1"), - // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ - // LoadBalancerBackendAddressPools: []*armnetwork.BackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb1/backendAddressPools/addressPool1"), - // }}, - // LoadBalancerInboundNatRules: []*armnetwork.InboundNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb1/inboundNatRules/natPool1.1"), - // }}, - // Primary: to.Ptr(true), - // PrivateIPAddress: to.Ptr("10.0.0.5"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.PublicIPAddress{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/1/networkInterfaces/nic1/ipConfigurations/ip1/publicIPAddresses/pub1"), - // }, - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // }, - // }, - // }}, - // MacAddress: to.Ptr("00-00-00-00-00-00"), - // NetworkSecurityGroup: &armnetwork.SecurityGroup{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1"), - // }, - // Primary: to.Ptr(true), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualMachine: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/1"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VmssNetworkInterfaceIpConfigList.json -func ExampleInterfacesClient_NewListVirtualMachineScaleSetIPConfigurationsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewInterfacesClient().NewListVirtualMachineScaleSetIPConfigurationsPager("rg1", "vmss1", "2", "nic1", &armnetwork.InterfacesClientListVirtualMachineScaleSetIPConfigurationsOptions{Expand: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.InterfaceIPConfigurationListResult = armnetwork.InterfaceIPConfigurationListResult{ - // Value: []*armnetwork.InterfaceIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/2/networkInterfaces/nic1/ipConfigurations/ip1"), - // Name: to.Ptr("ip1"), - // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ - // LoadBalancerBackendAddressPools: []*armnetwork.BackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb1/backendAddressPools/addressPool1"), - // }}, - // LoadBalancerInboundNatRules: []*armnetwork.InboundNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb1/inboundNatRules/natPool1.2"), - // }}, - // Primary: to.Ptr(true), - // PrivateIPAddress: to.Ptr("10.0.0.6"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VmssNetworkInterfaceIpConfigGet.json -func ExampleInterfacesClient_GetVirtualMachineScaleSetIPConfiguration() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewInterfacesClient().GetVirtualMachineScaleSetIPConfiguration(ctx, "rg1", "vmss1", "2", "nic1", "ip1", &armnetwork.InterfacesClientGetVirtualMachineScaleSetIPConfigurationOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.InterfaceIPConfiguration = armnetwork.InterfaceIPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/2/networkInterfaces/nic1/ipConfigurations/ip1"), - // Name: to.Ptr("ip1"), - // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ - // LoadBalancerBackendAddressPools: []*armnetwork.BackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb1/backendAddressPools/addressPool1"), - // }}, - // LoadBalancerInboundNatRules: []*armnetwork.InboundNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb1/inboundNatRules/natPool1.2"), - // }}, - // Primary: to.Ptr(true), - // PrivateIPAddress: to.Ptr("10.0.0.6"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // }, - // }, - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/interfacetapconfigurations_client.go b/sdk/resourcemanager/network/armnetwork/interfacetapconfigurations_client.go index d8c5a67f6b48..b2092c5a8745 100644 --- a/sdk/resourcemanager/network/armnetwork/interfacetapconfigurations_client.go +++ b/sdk/resourcemanager/network/armnetwork/interfacetapconfigurations_client.go @@ -47,7 +47,7 @@ func NewInterfaceTapConfigurationsClient(subscriptionID string, credential azcor // BeginCreateOrUpdate - Creates or updates a Tap configuration in the specified NetworkInterface. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkInterfaceName - The name of the network interface. // - tapConfigurationName - The name of the tap configuration. @@ -72,7 +72,7 @@ func (client *InterfaceTapConfigurationsClient) BeginCreateOrUpdate(ctx context. // CreateOrUpdate - Creates or updates a Tap configuration in the specified NetworkInterface. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *InterfaceTapConfigurationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, networkInterfaceName string, tapConfigurationName string, tapConfigurationParameters InterfaceTapConfiguration, options *InterfaceTapConfigurationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "InterfaceTapConfigurationsClient.BeginCreateOrUpdate" @@ -118,7 +118,7 @@ func (client *InterfaceTapConfigurationsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, tapConfigurationParameters); err != nil { @@ -130,7 +130,7 @@ func (client *InterfaceTapConfigurationsClient) createOrUpdateCreateRequest(ctx // BeginDelete - Deletes the specified tap configuration from the NetworkInterface. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkInterfaceName - The name of the network interface. // - tapConfigurationName - The name of the tap configuration. @@ -154,7 +154,7 @@ func (client *InterfaceTapConfigurationsClient) BeginDelete(ctx context.Context, // Delete - Deletes the specified tap configuration from the NetworkInterface. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *InterfaceTapConfigurationsClient) deleteOperation(ctx context.Context, resourceGroupName string, networkInterfaceName string, tapConfigurationName string, options *InterfaceTapConfigurationsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "InterfaceTapConfigurationsClient.BeginDelete" @@ -200,7 +200,7 @@ func (client *InterfaceTapConfigurationsClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -209,7 +209,7 @@ func (client *InterfaceTapConfigurationsClient) deleteCreateRequest(ctx context. // Get - Get the specified tap configuration on a network interface. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkInterfaceName - The name of the network interface. // - tapConfigurationName - The name of the tap configuration. @@ -261,7 +261,7 @@ func (client *InterfaceTapConfigurationsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -278,7 +278,7 @@ func (client *InterfaceTapConfigurationsClient) getHandleResponse(resp *http.Res // NewListPager - Get all Tap configurations in a network interface. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkInterfaceName - The name of the network interface. // - options - InterfaceTapConfigurationsClientListOptions contains the optional parameters for the InterfaceTapConfigurationsClient.NewListPager @@ -333,7 +333,7 @@ func (client *InterfaceTapConfigurationsClient) listCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/interfacetapconfigurations_client_example_test.go b/sdk/resourcemanager/network/armnetwork/interfacetapconfigurations_client_example_test.go deleted file mode 100644 index 4f23c0c0872a..000000000000 --- a/sdk/resourcemanager/network/armnetwork/interfacetapconfigurations_client_example_test.go +++ /dev/null @@ -1,154 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkInterfaceTapConfigurationDelete.json -func ExampleInterfaceTapConfigurationsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewInterfaceTapConfigurationsClient().BeginDelete(ctx, "rg1", "test-networkinterface", "test-tapconfiguration", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkInterfaceTapConfigurationGet.json -func ExampleInterfaceTapConfigurationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewInterfaceTapConfigurationsClient().Get(ctx, "testrg", "mynic", "tapconfiguration1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.InterfaceTapConfiguration = armnetwork.InterfaceTapConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/networkInterfaces/mynic/tapConfigurations/tapConfiguration1"), - // Name: to.Ptr("tapConfiguration1"), - // Type: to.Ptr("Microsoft.Network/networkInterfaces/tapConfigurations"), - // Etag: to.Ptr("etag"), - // Properties: &armnetwork.InterfaceTapConfigurationPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualNetworkTap: &armnetwork.VirtualNetworkTap{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworkTaps/testvtap"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkInterfaceTapConfigurationCreate.json -func ExampleInterfaceTapConfigurationsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewInterfaceTapConfigurationsClient().BeginCreateOrUpdate(ctx, "testrg", "mynic", "tapconfiguration1", armnetwork.InterfaceTapConfiguration{ - Properties: &armnetwork.InterfaceTapConfigurationPropertiesFormat{ - VirtualNetworkTap: &armnetwork.VirtualNetworkTap{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworkTaps/testvtap"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.InterfaceTapConfiguration = armnetwork.InterfaceTapConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/networkInterfaces/mynic/tapConfigurations/tapConfiguration1"), - // Name: to.Ptr("tapConfiguration1"), - // Type: to.Ptr("Microsoft.Network/networkInterfaces/tapConfigurations"), - // Etag: to.Ptr("etag"), - // Properties: &armnetwork.InterfaceTapConfigurationPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualNetworkTap: &armnetwork.VirtualNetworkTap{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworkTaps/testvtap"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkInterfaceTapConfigurationList.json -func ExampleInterfaceTapConfigurationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewInterfaceTapConfigurationsClient().NewListPager("rg1", "mynic", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.InterfaceTapConfigurationListResult = armnetwork.InterfaceTapConfigurationListResult{ - // Value: []*armnetwork.InterfaceTapConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/networkInterfaces/mynic/tapConfigurations/tapConfiguration1"), - // Name: to.Ptr("tapConfiguration1"), - // Type: to.Ptr("Microsoft.Network/networkInterfaces/tapConfigurations"), - // Etag: to.Ptr("etag"), - // Properties: &armnetwork.InterfaceTapConfigurationPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualNetworkTap: &armnetwork.VirtualNetworkTap{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworkTaps/testvtap"), - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/ipallocations_client.go b/sdk/resourcemanager/network/armnetwork/ipallocations_client.go index 28aeff80ac31..c3f9c061f3c8 100644 --- a/sdk/resourcemanager/network/armnetwork/ipallocations_client.go +++ b/sdk/resourcemanager/network/armnetwork/ipallocations_client.go @@ -47,7 +47,7 @@ func NewIPAllocationsClient(subscriptionID string, credential azcore.TokenCreden // BeginCreateOrUpdate - Creates or updates an IpAllocation in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - ipAllocationName - The name of the IpAllocation. // - parameters - Parameters supplied to the create or update virtual network operation. @@ -71,7 +71,7 @@ func (client *IPAllocationsClient) BeginCreateOrUpdate(ctx context.Context, reso // CreateOrUpdate - Creates or updates an IpAllocation in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *IPAllocationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, ipAllocationName string, parameters IPAllocation, options *IPAllocationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "IPAllocationsClient.BeginCreateOrUpdate" @@ -113,7 +113,7 @@ func (client *IPAllocationsClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -125,7 +125,7 @@ func (client *IPAllocationsClient) createOrUpdateCreateRequest(ctx context.Conte // BeginDelete - Deletes the specified IpAllocation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - ipAllocationName - The name of the IpAllocation. // - options - IPAllocationsClientBeginDeleteOptions contains the optional parameters for the IPAllocationsClient.BeginDelete @@ -148,7 +148,7 @@ func (client *IPAllocationsClient) BeginDelete(ctx context.Context, resourceGrou // Delete - Deletes the specified IpAllocation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *IPAllocationsClient) deleteOperation(ctx context.Context, resourceGroupName string, ipAllocationName string, options *IPAllocationsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "IPAllocationsClient.BeginDelete" @@ -190,7 +190,7 @@ func (client *IPAllocationsClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -199,7 +199,7 @@ func (client *IPAllocationsClient) deleteCreateRequest(ctx context.Context, reso // Get - Gets the specified IpAllocation by resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - ipAllocationName - The name of the IpAllocation. // - options - IPAllocationsClientGetOptions contains the optional parameters for the IPAllocationsClient.Get method. @@ -245,7 +245,7 @@ func (client *IPAllocationsClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } @@ -265,7 +265,7 @@ func (client *IPAllocationsClient) getHandleResponse(resp *http.Response) (IPAll // NewListPager - Gets all IpAllocations in a subscription. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - options - IPAllocationsClientListOptions contains the optional parameters for the IPAllocationsClient.NewListPager method. func (client *IPAllocationsClient) NewListPager(options *IPAllocationsClientListOptions) *runtime.Pager[IPAllocationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[IPAllocationsClientListResponse]{ @@ -309,7 +309,7 @@ func (client *IPAllocationsClient) listCreateRequest(ctx context.Context, option return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -326,7 +326,7 @@ func (client *IPAllocationsClient) listHandleResponse(resp *http.Response) (IPAl // NewListByResourceGroupPager - Gets all IpAllocations in a resource group. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - options - IPAllocationsClientListByResourceGroupOptions contains the optional parameters for the IPAllocationsClient.NewListByResourceGroupPager // method. @@ -376,7 +376,7 @@ func (client *IPAllocationsClient) listByResourceGroupCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -394,7 +394,7 @@ func (client *IPAllocationsClient) listByResourceGroupHandleResponse(resp *http. // UpdateTags - Updates a IpAllocation tags. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - ipAllocationName - The name of the IpAllocation. // - parameters - Parameters supplied to update IpAllocation tags. @@ -442,7 +442,7 @@ func (client *IPAllocationsClient) updateTagsCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/ipallocations_client_example_test.go b/sdk/resourcemanager/network/armnetwork/ipallocations_client_example_test.go deleted file mode 100644 index 5751713edd26..000000000000 --- a/sdk/resourcemanager/network/armnetwork/ipallocations_client_example_test.go +++ /dev/null @@ -1,276 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/IpAllocationDelete.json -func ExampleIPAllocationsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewIPAllocationsClient().BeginDelete(ctx, "rg1", "test-ipallocation", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/IpAllocationGet.json -func ExampleIPAllocationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewIPAllocationsClient().Get(ctx, "rg1", "test-ipallocation", &armnetwork.IPAllocationsClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.IPAllocation = armnetwork.IPAllocation{ - // Name: to.Ptr("test-ipallocation"), - // Type: to.Ptr("Microsoft.Network/IpAllocations"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/IpAllocations/test-ipallocation"), - // Location: to.Ptr("centraluseuap"), - // Properties: &armnetwork.IPAllocationPropertiesFormat{ - // Type: to.Ptr(armnetwork.IPAllocationTypeHypernet), - // AllocationTags: map[string]*string{ - // "VNetID": to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/HypernetVnet1"), - // }, - // IpamAllocationID: to.Ptr("916d3b28-663f-448b-9abc-1bea9d5fed8f"), - // Prefix: to.Ptr("3.2.5.0/24"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/IpAllocationCreate.json -func ExampleIPAllocationsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewIPAllocationsClient().BeginCreateOrUpdate(ctx, "rg1", "test-ipallocation", armnetwork.IPAllocation{ - Location: to.Ptr("centraluseuap"), - Properties: &armnetwork.IPAllocationPropertiesFormat{ - Type: to.Ptr(armnetwork.IPAllocationTypeHypernet), - AllocationTags: map[string]*string{ - "VNetID": to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/HypernetVnet1"), - }, - Prefix: to.Ptr("3.2.5.0/24"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.IPAllocation = armnetwork.IPAllocation{ - // Name: to.Ptr("test-ipallocation"), - // Type: to.Ptr("Microsoft.Network/IpAllocations"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/IpAllocations/test-ipallocation"), - // Location: to.Ptr("centraluseuap"), - // Properties: &armnetwork.IPAllocationPropertiesFormat{ - // Type: to.Ptr(armnetwork.IPAllocationTypeHypernet), - // AllocationTags: map[string]*string{ - // "VNetID": to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/HypernetVnet1"), - // }, - // IpamAllocationID: to.Ptr("916d3b28-663f-448b-9abc-1bea9d5fed8f"), - // Prefix: to.Ptr("3.2.5.0/24"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/IpAllocationUpdateTags.json -func ExampleIPAllocationsClient_UpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewIPAllocationsClient().UpdateTags(ctx, "rg1", "test-ipallocation", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.IPAllocation = armnetwork.IPAllocation{ - // Name: to.Ptr("test-ipallocation"), - // Type: to.Ptr("Microsoft.Network/IpAllocations"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/IpAllocations/test-ipallocation"), - // Location: to.Ptr("centraluseuap"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armnetwork.IPAllocationPropertiesFormat{ - // Type: to.Ptr(armnetwork.IPAllocationTypeHypernet), - // AllocationTags: map[string]*string{ - // "VNetID": to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/HypernetVnet1"), - // }, - // IpamAllocationID: to.Ptr("916d3b28-663f-448b-9abc-1bea9d5fed8f"), - // Prefix: to.Ptr("3.2.5.0/24"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/IpAllocationList.json -func ExampleIPAllocationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewIPAllocationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.IPAllocationListResult = armnetwork.IPAllocationListResult{ - // Value: []*armnetwork.IPAllocation{ - // { - // Name: to.Ptr("test-ipallocation1"), - // Type: to.Ptr("Microsoft.Network/IpAllocations"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/IpAllocations/test-ipallocation1"), - // Location: to.Ptr("centraluseuap"), - // Properties: &armnetwork.IPAllocationPropertiesFormat{ - // Type: to.Ptr(armnetwork.IPAllocationTypeHypernet), - // AllocationTags: map[string]*string{ - // "VNetID": to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/HypernetVnet1"), - // }, - // IpamAllocationID: to.Ptr("916d3b28-663f-448b-9abc-1bea9d5fed8f"), - // Prefix: to.Ptr("3.2.5.0/24"), - // }, - // }, - // { - // Name: to.Ptr("test-ipallocation2"), - // Type: to.Ptr("Microsoft.Network/IpAllocations"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/IpAllocations/test-ipallocation2"), - // Location: to.Ptr("centraluseuap"), - // Properties: &armnetwork.IPAllocationPropertiesFormat{ - // Type: to.Ptr(armnetwork.IPAllocationTypeHypernet), - // AllocationTags: map[string]*string{ - // "VNetID": to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/HypernetVnet2"), - // }, - // IpamAllocationID: to.Ptr("57dc7256-2ff7-43f2-b9c8-85a70b5c6408"), - // Prefix: to.Ptr("3.2.6.0/24"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/IpAllocationListByResourceGroup.json -func ExampleIPAllocationsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewIPAllocationsClient().NewListByResourceGroupPager("rg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.IPAllocationListResult = armnetwork.IPAllocationListResult{ - // Value: []*armnetwork.IPAllocation{ - // { - // Name: to.Ptr("test-ipallocation1"), - // Type: to.Ptr("Microsoft.Network/IpAllocations"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/IpAllocations/test-ipallocation1"), - // Location: to.Ptr("centraluseuap"), - // Properties: &armnetwork.IPAllocationPropertiesFormat{ - // Type: to.Ptr(armnetwork.IPAllocationTypeHypernet), - // AllocationTags: map[string]*string{ - // "VNetID": to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/HypernetVnet1"), - // }, - // IpamAllocationID: to.Ptr("916d3b28-663f-448b-9abc-1bea9d5fed8f"), - // Prefix: to.Ptr("3.2.5.0/24"), - // }, - // }, - // { - // Name: to.Ptr("test-ipallocation2"), - // Type: to.Ptr("Microsoft.Network/IpAllocations"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/IpAllocations/test-ipallocation2"), - // Location: to.Ptr("centraluseuap"), - // Properties: &armnetwork.IPAllocationPropertiesFormat{ - // Type: to.Ptr(armnetwork.IPAllocationTypeHypernet), - // AllocationTags: map[string]*string{ - // "VNetID": to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/HypernetVnet2"), - // }, - // IpamAllocationID: to.Ptr("57dc7256-2ff7-43f2-b9c8-85a70b5c6408"), - // Prefix: to.Ptr("3.2.6.0/24"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/ipgroups_client.go b/sdk/resourcemanager/network/armnetwork/ipgroups_client.go index 9a04f6c7cbff..6cae47005ff3 100644 --- a/sdk/resourcemanager/network/armnetwork/ipgroups_client.go +++ b/sdk/resourcemanager/network/armnetwork/ipgroups_client.go @@ -47,7 +47,7 @@ func NewIPGroupsClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreateOrUpdate - Creates or updates an ipGroups in a specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - ipGroupsName - The name of the ipGroups. // - parameters - Parameters supplied to the create or update IpGroups operation. @@ -71,7 +71,7 @@ func (client *IPGroupsClient) BeginCreateOrUpdate(ctx context.Context, resourceG // CreateOrUpdate - Creates or updates an ipGroups in a specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *IPGroupsClient) createOrUpdate(ctx context.Context, resourceGroupName string, ipGroupsName string, parameters IPGroup, options *IPGroupsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "IPGroupsClient.BeginCreateOrUpdate" @@ -113,7 +113,7 @@ func (client *IPGroupsClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -125,7 +125,7 @@ func (client *IPGroupsClient) createOrUpdateCreateRequest(ctx context.Context, r // BeginDelete - Deletes the specified ipGroups. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - ipGroupsName - The name of the ipGroups. // - options - IPGroupsClientBeginDeleteOptions contains the optional parameters for the IPGroupsClient.BeginDelete method. @@ -147,7 +147,7 @@ func (client *IPGroupsClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Deletes the specified ipGroups. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *IPGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, ipGroupsName string, options *IPGroupsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "IPGroupsClient.BeginDelete" @@ -189,7 +189,7 @@ func (client *IPGroupsClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -198,7 +198,7 @@ func (client *IPGroupsClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Gets the specified ipGroups. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - ipGroupsName - The name of the ipGroups. // - options - IPGroupsClientGetOptions contains the optional parameters for the IPGroupsClient.Get method. @@ -244,7 +244,7 @@ func (client *IPGroupsClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } @@ -264,7 +264,7 @@ func (client *IPGroupsClient) getHandleResponse(resp *http.Response) (IPGroupsCl // NewListPager - Gets all IpGroups in a subscription. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - options - IPGroupsClientListOptions contains the optional parameters for the IPGroupsClient.NewListPager method. func (client *IPGroupsClient) NewListPager(options *IPGroupsClientListOptions) *runtime.Pager[IPGroupsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[IPGroupsClientListResponse]{ @@ -308,7 +308,7 @@ func (client *IPGroupsClient) listCreateRequest(ctx context.Context, options *IP return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -325,7 +325,7 @@ func (client *IPGroupsClient) listHandleResponse(resp *http.Response) (IPGroupsC // NewListByResourceGroupPager - Gets all IpGroups in a resource group. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - options - IPGroupsClientListByResourceGroupOptions contains the optional parameters for the IPGroupsClient.NewListByResourceGroupPager // method. @@ -375,7 +375,7 @@ func (client *IPGroupsClient) listByResourceGroupCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -393,7 +393,7 @@ func (client *IPGroupsClient) listByResourceGroupHandleResponse(resp *http.Respo // UpdateGroups - Updates tags of an IpGroups resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - ipGroupsName - The name of the ipGroups. // - parameters - Parameters supplied to the update ipGroups operation. @@ -440,7 +440,7 @@ func (client *IPGroupsClient) updateGroupsCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/ipgroups_client_example_test.go b/sdk/resourcemanager/network/armnetwork/ipgroups_client_example_test.go deleted file mode 100644 index 595a51cee660..000000000000 --- a/sdk/resourcemanager/network/armnetwork/ipgroups_client_example_test.go +++ /dev/null @@ -1,320 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/IpGroupsGet.json -func ExampleIPGroupsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewIPGroupsClient().Get(ctx, "myResourceGroup", "ipGroups1", &armnetwork.IPGroupsClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.IPGroup = armnetwork.IPGroup{ - // Name: to.Ptr("ipGroups1"), - // Type: to.Ptr("Microsoft.Network/ipGroups"), - // ID: to.Ptr("/subscriptions/subId/providers/Microsoft.Network/resourceGroup/myResourceGroup/ipGroups/ipGroups1"), - // Location: to.Ptr("westcentralus"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.IPGroupPropertiesFormat{ - // FirewallPolicies: []*armnetwork.SubResource{ - // }, - // Firewalls: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall"), - // }}, - // IPAddresses: []*string{ - // to.Ptr("13.64.39.16/32"), - // to.Ptr("40.74.146.80/31"), - // to.Ptr("40.74.147.32/28")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/IpGroupsCreate.json -func ExampleIPGroupsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewIPGroupsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "ipGroups1", armnetwork.IPGroup{ - Location: to.Ptr("West US"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, - Properties: &armnetwork.IPGroupPropertiesFormat{ - IPAddresses: []*string{ - to.Ptr("13.64.39.16/32"), - to.Ptr("40.74.146.80/31"), - to.Ptr("40.74.147.32/28")}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.IPGroup = armnetwork.IPGroup{ - // Name: to.Ptr("ipGroups1"), - // Type: to.Ptr("Microsoft.Network/ipGroups"), - // ID: to.Ptr("/subscriptions/subId/providers/Microsoft.Network/resourceGroup/myResourceGroup/ipGroups/ipGroups1"), - // Location: to.Ptr("westcentralus"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.IPGroupPropertiesFormat{ - // FirewallPolicies: []*armnetwork.SubResource{ - // }, - // Firewalls: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall"), - // }}, - // IPAddresses: []*string{ - // to.Ptr("13.64.39.16/32"), - // to.Ptr("40.74.146.80/31"), - // to.Ptr("40.74.147.32/28")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/IpGroupsUpdateTags.json -func ExampleIPGroupsClient_UpdateGroups() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewIPGroupsClient().UpdateGroups(ctx, "myResourceGroup", "ipGroups1", armnetwork.TagsObject{ - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - "key2": to.Ptr("value2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.IPGroup = armnetwork.IPGroup{ - // Name: to.Ptr("ipGroups1"), - // Type: to.Ptr("Microsoft.Network/ipGroups"), - // ID: to.Ptr("/subscriptions/subId/providers/Microsoft.Network/resourceGroup/myResourceGroup/ipGroups/ipGroups1"), - // Location: to.Ptr("westcentralus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.IPGroupPropertiesFormat{ - // FirewallPolicies: []*armnetwork.SubResource{ - // }, - // Firewalls: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall"), - // }}, - // IPAddresses: []*string{ - // to.Ptr("13.64.39.16/32"), - // to.Ptr("40.74.146.80/31"), - // to.Ptr("40.74.147.32/28")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/IpGroupsDelete.json -func ExampleIPGroupsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewIPGroupsClient().BeginDelete(ctx, "myResourceGroup", "ipGroups1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/IpGroupsListByResourceGroup.json -func ExampleIPGroupsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewIPGroupsClient().NewListByResourceGroupPager("myResourceGroup", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.IPGroupListResult = armnetwork.IPGroupListResult{ - // Value: []*armnetwork.IPGroup{ - // { - // Name: to.Ptr("ipGroups1"), - // Type: to.Ptr("Microsoft.Network/ipGroups"), - // ID: to.Ptr("/subscriptions/subId/providers/Microsoft.Network/resourceGroup/myResourceGroup/ipGroups"), - // Location: to.Ptr("westcentralus"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.IPGroupPropertiesFormat{ - // FirewallPolicies: []*armnetwork.SubResource{ - // }, - // Firewalls: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall"), - // }}, - // IPAddresses: []*string{ - // to.Ptr("13.64.39.16/32"), - // to.Ptr("40.74.146.80/31"), - // to.Ptr("40.74.147.32/28")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }, - // { - // Name: to.Ptr("ipGroups2"), - // Type: to.Ptr("Microsoft.Network/ipGroups"), - // ID: to.Ptr("/subscriptions/subId/providers/Microsoft.Network/resourceGroup/myResourceGroup/ipGroups"), - // Location: to.Ptr("centralus"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.IPGroupPropertiesFormat{ - // FirewallPolicies: []*armnetwork.SubResource{ - // }, - // Firewalls: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall"), - // }}, - // IPAddresses: []*string{ - // to.Ptr("14.64.39.16/32"), - // to.Ptr("41.74.146.80/31"), - // to.Ptr("42.74.147.32/28")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/IpGroupsListBySubscription.json -func ExampleIPGroupsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewIPGroupsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.IPGroupListResult = armnetwork.IPGroupListResult{ - // Value: []*armnetwork.IPGroup{ - // { - // Name: to.Ptr("iptag1"), - // Type: to.Ptr("Microsoft.Network/ipGroups"), - // ID: to.Ptr("/subscriptions/subId/providers/Microsoft.Network/resourceGroup/myResourceGroup1/ipGroups"), - // Location: to.Ptr("westcentralus"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.IPGroupPropertiesFormat{ - // FirewallPolicies: []*armnetwork.SubResource{ - // }, - // Firewalls: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall"), - // }}, - // IPAddresses: []*string{ - // to.Ptr("13.64.39.16/32"), - // to.Ptr("40.74.146.80/31"), - // to.Ptr("40.74.147.32/28")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }, - // { - // Name: to.Ptr("iptag2"), - // Type: to.Ptr("Microsoft.Network/ipGroups"), - // ID: to.Ptr("/subscriptions/subId/providers/Microsoft.Network/resourceGroup/myResourceGroup2/ipGroups"), - // Location: to.Ptr("centralus"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.IPGroupPropertiesFormat{ - // FirewallPolicies: []*armnetwork.SubResource{ - // }, - // Firewalls: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall"), - // }}, - // IPAddresses: []*string{ - // to.Ptr("14.64.39.16/32"), - // to.Ptr("41.74.146.80/31"), - // to.Ptr("42.74.147.32/28")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/loadbalancerbackendaddresspools_client.go b/sdk/resourcemanager/network/armnetwork/loadbalancerbackendaddresspools_client.go index 971c89bc3e58..4ed5ac551668 100644 --- a/sdk/resourcemanager/network/armnetwork/loadbalancerbackendaddresspools_client.go +++ b/sdk/resourcemanager/network/armnetwork/loadbalancerbackendaddresspools_client.go @@ -47,7 +47,7 @@ func NewLoadBalancerBackendAddressPoolsClient(subscriptionID string, credential // BeginCreateOrUpdate - Creates or updates a load balancer backend address pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - loadBalancerName - The name of the load balancer. // - backendAddressPoolName - The name of the backend address pool. @@ -72,7 +72,7 @@ func (client *LoadBalancerBackendAddressPoolsClient) BeginCreateOrUpdate(ctx con // CreateOrUpdate - Creates or updates a load balancer backend address pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *LoadBalancerBackendAddressPoolsClient) createOrUpdate(ctx context.Context, resourceGroupName string, loadBalancerName string, backendAddressPoolName string, parameters BackendAddressPool, options *LoadBalancerBackendAddressPoolsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "LoadBalancerBackendAddressPoolsClient.BeginCreateOrUpdate" @@ -118,7 +118,7 @@ func (client *LoadBalancerBackendAddressPoolsClient) createOrUpdateCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -130,7 +130,7 @@ func (client *LoadBalancerBackendAddressPoolsClient) createOrUpdateCreateRequest // BeginDelete - Deletes the specified load balancer backend address pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - loadBalancerName - The name of the load balancer. // - backendAddressPoolName - The name of the backend address pool. @@ -154,7 +154,7 @@ func (client *LoadBalancerBackendAddressPoolsClient) BeginDelete(ctx context.Con // Delete - Deletes the specified load balancer backend address pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *LoadBalancerBackendAddressPoolsClient) deleteOperation(ctx context.Context, resourceGroupName string, loadBalancerName string, backendAddressPoolName string, options *LoadBalancerBackendAddressPoolsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "LoadBalancerBackendAddressPoolsClient.BeginDelete" @@ -200,7 +200,7 @@ func (client *LoadBalancerBackendAddressPoolsClient) deleteCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -209,7 +209,7 @@ func (client *LoadBalancerBackendAddressPoolsClient) deleteCreateRequest(ctx con // Get - Gets load balancer backend address pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - loadBalancerName - The name of the load balancer. // - backendAddressPoolName - The name of the backend address pool. @@ -261,7 +261,7 @@ func (client *LoadBalancerBackendAddressPoolsClient) getCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -278,7 +278,7 @@ func (client *LoadBalancerBackendAddressPoolsClient) getHandleResponse(resp *htt // NewListPager - Gets all the load balancer backed address pools. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - loadBalancerName - The name of the load balancer. // - options - LoadBalancerBackendAddressPoolsClientListOptions contains the optional parameters for the LoadBalancerBackendAddressPoolsClient.NewListPager @@ -333,7 +333,7 @@ func (client *LoadBalancerBackendAddressPoolsClient) listCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/loadbalancerbackendaddresspools_client_example_test.go b/sdk/resourcemanager/network/armnetwork/loadbalancerbackendaddresspools_client_example_test.go deleted file mode 100644 index e0433414fe69..000000000000 --- a/sdk/resourcemanager/network/armnetwork/loadbalancerbackendaddresspools_client_example_test.go +++ /dev/null @@ -1,312 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/LBBackendAddressPoolListWithBackendAddressesPoolType.json -func ExampleLoadBalancerBackendAddressPoolsClient_NewListPager_loadBalancerWithBackendAddressPoolContainingBackendAddresses() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLoadBalancerBackendAddressPoolsClient().NewListPager("testrg", "lb", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.LoadBalancerBackendAddressPoolListResult = armnetwork.LoadBalancerBackendAddressPoolListResult{ - // Value: []*armnetwork.BackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/backend"), - // Name: to.Ptr("backend"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ - // LoadBalancerBackendAddresses: []*armnetwork.LoadBalancerBackendAddress{ - // { - // Name: to.Ptr("address1"), - // Properties: &armnetwork.LoadBalancerBackendAddressPropertiesFormat{ - // IPAddress: to.Ptr("10.0.0.4"), - // VirtualNetwork: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb"), - // }, - // }, - // }, - // { - // Name: to.Ptr("address2"), - // Properties: &armnetwork.LoadBalancerBackendAddressPropertiesFormat{ - // IPAddress: to.Ptr("10.0.0.5"), - // VirtualNetwork: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb"), - // }, - // }, - // }}, - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/LoadBalancerBackendAddressPoolList.json -func ExampleLoadBalancerBackendAddressPoolsClient_NewListPager_loadBalancerBackendAddressPoolList() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLoadBalancerBackendAddressPoolsClient().NewListPager("testrg", "lb", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.LoadBalancerBackendAddressPoolListResult = armnetwork.LoadBalancerBackendAddressPoolListResult{ - // Value: []*armnetwork.BackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/backend"), - // Name: to.Ptr("backend"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ - // BackendIPConfigurations: []*armnetwork.InterfaceIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/networkInterfaces/nic/ipConfigurations/default-ip-config"), - // }}, - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/LBBackendAddressPoolWithBackendAddressesGet.json -func ExampleLoadBalancerBackendAddressPoolsClient_Get_loadBalancerWithBackendAddressPoolWithBackendAddresses() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLoadBalancerBackendAddressPoolsClient().Get(ctx, "testrg", "lb", "backend", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.BackendAddressPool = armnetwork.BackendAddressPool{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/backend"), - // Name: to.Ptr("backend"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ - // LoadBalancerBackendAddresses: []*armnetwork.LoadBalancerBackendAddress{ - // { - // Name: to.Ptr("address1"), - // Properties: &armnetwork.LoadBalancerBackendAddressPropertiesFormat{ - // IPAddress: to.Ptr("10.0.0.4"), - // VirtualNetwork: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb"), - // }, - // }, - // }, - // { - // Name: to.Ptr("address2"), - // Properties: &armnetwork.LoadBalancerBackendAddressPropertiesFormat{ - // IPAddress: to.Ptr("10.0.0.5"), - // VirtualNetwork: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb"), - // }, - // }, - // }}, - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/LoadBalancerBackendAddressPoolGet.json -func ExampleLoadBalancerBackendAddressPoolsClient_Get_loadBalancerBackendAddressPoolGet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLoadBalancerBackendAddressPoolsClient().Get(ctx, "testrg", "lb", "backend", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.BackendAddressPool = armnetwork.BackendAddressPool{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/backend"), - // Name: to.Ptr("backend"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ - // BackendIPConfigurations: []*armnetwork.InterfaceIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/networkInterfaces/nic/ipConfigurations/default-ip-config"), - // }}, - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/LBBackendAddressPoolWithBackendAddressesPut.json -func ExampleLoadBalancerBackendAddressPoolsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLoadBalancerBackendAddressPoolsClient().BeginCreateOrUpdate(ctx, "testrg", "lb", "backend", armnetwork.BackendAddressPool{ - Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ - LoadBalancerBackendAddresses: []*armnetwork.LoadBalancerBackendAddress{ - { - Name: to.Ptr("address1"), - Properties: &armnetwork.LoadBalancerBackendAddressPropertiesFormat{ - IPAddress: to.Ptr("10.0.0.4"), - VirtualNetwork: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb"), - }, - }, - }, - { - Name: to.Ptr("address2"), - Properties: &armnetwork.LoadBalancerBackendAddressPropertiesFormat{ - IPAddress: to.Ptr("10.0.0.5"), - VirtualNetwork: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb"), - }, - }, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.BackendAddressPool = armnetwork.BackendAddressPool{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/backend"), - // Name: to.Ptr("backend"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ - // LoadBalancerBackendAddresses: []*armnetwork.LoadBalancerBackendAddress{ - // { - // Name: to.Ptr("address1"), - // Properties: &armnetwork.LoadBalancerBackendAddressPropertiesFormat{ - // IPAddress: to.Ptr("10.0.0.4"), - // VirtualNetwork: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb"), - // }, - // }, - // }, - // { - // Name: to.Ptr("address2"), - // Properties: &armnetwork.LoadBalancerBackendAddressPropertiesFormat{ - // IPAddress: to.Ptr("10.0.0.5"), - // VirtualNetwork: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb"), - // }, - // }, - // }}, - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/LoadBalancerBackendAddressPoolDelete.json -func ExampleLoadBalancerBackendAddressPoolsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLoadBalancerBackendAddressPoolsClient().BeginDelete(ctx, "testrg", "lb", "backend", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/network/armnetwork/loadbalancerfrontendipconfigurations_client.go b/sdk/resourcemanager/network/armnetwork/loadbalancerfrontendipconfigurations_client.go index be988ca19533..8e0993f0ea81 100644 --- a/sdk/resourcemanager/network/armnetwork/loadbalancerfrontendipconfigurations_client.go +++ b/sdk/resourcemanager/network/armnetwork/loadbalancerfrontendipconfigurations_client.go @@ -47,7 +47,7 @@ func NewLoadBalancerFrontendIPConfigurationsClient(subscriptionID string, creden // Get - Gets load balancer frontend IP configuration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - loadBalancerName - The name of the load balancer. // - frontendIPConfigurationName - The name of the frontend IP configuration. @@ -99,7 +99,7 @@ func (client *LoadBalancerFrontendIPConfigurationsClient) getCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -116,7 +116,7 @@ func (client *LoadBalancerFrontendIPConfigurationsClient) getHandleResponse(resp // NewListPager - Gets all the load balancer frontend IP configurations. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - loadBalancerName - The name of the load balancer. // - options - LoadBalancerFrontendIPConfigurationsClientListOptions contains the optional parameters for the LoadBalancerFrontendIPConfigurationsClient.NewListPager @@ -171,7 +171,7 @@ func (client *LoadBalancerFrontendIPConfigurationsClient) listCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/loadbalancerfrontendipconfigurations_client_example_test.go b/sdk/resourcemanager/network/armnetwork/loadbalancerfrontendipconfigurations_client_example_test.go deleted file mode 100644 index 78e7c461d0c9..000000000000 --- a/sdk/resourcemanager/network/armnetwork/loadbalancerfrontendipconfigurations_client_example_test.go +++ /dev/null @@ -1,112 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/LoadBalancerFrontendIPConfigurationList.json -func ExampleLoadBalancerFrontendIPConfigurationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLoadBalancerFrontendIPConfigurationsClient().NewListPager("testrg", "lb", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.LoadBalancerFrontendIPConfigurationListResult = armnetwork.LoadBalancerFrontendIPConfigurationListResult{ - // Value: []*armnetwork.FrontendIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/frontend"), - // Name: to.Ptr("frontend"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/frontendIPConfigurations"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ - // InboundNatRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/inrlb"), - // }}, - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // PrivateIPAddress: to.Ptr("10.0.1.4"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/LoadBalancerFrontendIPConfigurationGet.json -func ExampleLoadBalancerFrontendIPConfigurationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLoadBalancerFrontendIPConfigurationsClient().Get(ctx, "testrg", "lb", "frontend", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.FrontendIPConfiguration = armnetwork.FrontendIPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/frontend"), - // Name: to.Ptr("frontend"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/frontendIPConfigurations"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ - // InboundNatRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/inrlb"), - // }}, - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // PrivateIPAddress: to.Ptr("10.0.1.4"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), - // }, - // }, - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/loadbalancerloadbalancingrules_client.go b/sdk/resourcemanager/network/armnetwork/loadbalancerloadbalancingrules_client.go index 281f08e298d7..139193a12b71 100644 --- a/sdk/resourcemanager/network/armnetwork/loadbalancerloadbalancingrules_client.go +++ b/sdk/resourcemanager/network/armnetwork/loadbalancerloadbalancingrules_client.go @@ -47,7 +47,7 @@ func NewLoadBalancerLoadBalancingRulesClient(subscriptionID string, credential a // Get - Gets the specified load balancer load balancing rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - loadBalancerName - The name of the load balancer. // - loadBalancingRuleName - The name of the load balancing rule. @@ -99,7 +99,7 @@ func (client *LoadBalancerLoadBalancingRulesClient) getCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -116,7 +116,7 @@ func (client *LoadBalancerLoadBalancingRulesClient) getHandleResponse(resp *http // NewListPager - Gets all the load balancing rules in a load balancer. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - loadBalancerName - The name of the load balancer. // - options - LoadBalancerLoadBalancingRulesClientListOptions contains the optional parameters for the LoadBalancerLoadBalancingRulesClient.NewListPager @@ -171,7 +171,7 @@ func (client *LoadBalancerLoadBalancingRulesClient) listCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/loadbalancerloadbalancingrules_client_example_test.go b/sdk/resourcemanager/network/armnetwork/loadbalancerloadbalancingrules_client_example_test.go deleted file mode 100644 index f0e515351662..000000000000 --- a/sdk/resourcemanager/network/armnetwork/loadbalancerloadbalancingrules_client_example_test.go +++ /dev/null @@ -1,116 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/LoadBalancerLoadBalancingRuleList.json -func ExampleLoadBalancerLoadBalancingRulesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLoadBalancerLoadBalancingRulesClient().NewListPager("testrg", "lb1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.LoadBalancerLoadBalancingRuleListResult = armnetwork.LoadBalancerLoadBalancingRuleListResult{ - // Value: []*armnetwork.LoadBalancingRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/loadBalancingRules/rule1"), - // Name: to.Ptr("rule1"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/loadBalancingRules"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ - // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/backendAddressPools/bepool1"), - // }, - // BackendPort: to.Ptr[int32](80), - // EnableFloatingIP: to.Ptr(false), - // EnableTCPReset: to.Ptr(true), - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/lbfrontend"), - // }, - // FrontendPort: to.Ptr[int32](80), - // IdleTimeoutInMinutes: to.Ptr[int32](15), - // LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), - // Probe: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/probes/probe1"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/LoadBalancerLoadBalancingRuleGet.json -func ExampleLoadBalancerLoadBalancingRulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLoadBalancerLoadBalancingRulesClient().Get(ctx, "testrg", "lb1", "rule1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LoadBalancingRule = armnetwork.LoadBalancingRule{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/loadBalancingRules/rule1"), - // Name: to.Ptr("rule1"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/loadBalancingRules"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ - // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/backendAddressPools/bepool1"), - // }, - // BackendPort: to.Ptr[int32](80), - // EnableFloatingIP: to.Ptr(false), - // EnableTCPReset: to.Ptr(true), - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/lbfrontend"), - // }, - // FrontendPort: to.Ptr[int32](80), - // IdleTimeoutInMinutes: to.Ptr[int32](15), - // LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), - // Probe: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/probes/probe1"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - // }, - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/loadbalancernetworkinterfaces_client.go b/sdk/resourcemanager/network/armnetwork/loadbalancernetworkinterfaces_client.go index c5a9db7153a6..11ae85c72a14 100644 --- a/sdk/resourcemanager/network/armnetwork/loadbalancernetworkinterfaces_client.go +++ b/sdk/resourcemanager/network/armnetwork/loadbalancernetworkinterfaces_client.go @@ -46,7 +46,7 @@ func NewLoadBalancerNetworkInterfacesClient(subscriptionID string, credential az // NewListPager - Gets associated load balancer network interfaces. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - loadBalancerName - The name of the load balancer. // - options - LoadBalancerNetworkInterfacesClientListOptions contains the optional parameters for the LoadBalancerNetworkInterfacesClient.NewListPager @@ -101,7 +101,7 @@ func (client *LoadBalancerNetworkInterfacesClient) listCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/loadbalancernetworkinterfaces_client_example_test.go b/sdk/resourcemanager/network/armnetwork/loadbalancernetworkinterfaces_client_example_test.go deleted file mode 100644 index 86f9584c1c91..000000000000 --- a/sdk/resourcemanager/network/armnetwork/loadbalancernetworkinterfaces_client_example_test.go +++ /dev/null @@ -1,210 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/LoadBalancerNetworkInterfaceListSimple.json -func ExampleLoadBalancerNetworkInterfacesClient_NewListPager_loadBalancerNetworkInterfaceListSimple() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLoadBalancerNetworkInterfacesClient().NewListPager("testrg", "lb", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.InterfaceListResult = armnetwork.InterfaceListResult{ - // Value: []*armnetwork.Interface{ - // { - // Name: to.Ptr("mynic"), - // Type: to.Ptr("Microsoft.Network/networkInterfaces"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/networkInterfaces/mynic"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("W/\\\"00000000-0000-0000-0000-000000000000\\\""), - // Properties: &armnetwork.InterfacePropertiesFormat{ - // DNSSettings: &armnetwork.InterfaceDNSSettings{ - // AppliedDNSServers: []*string{ - // }, - // DNSServers: []*string{ - // }, - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(false), - // IPConfigurations: []*armnetwork.InterfaceIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/networkInterfaces/mynic/ipConfigurations/ipconfig1"), - // Name: to.Ptr("ipconfig1"), - // Etag: to.Ptr("W/\\\"00000000-0000-0000-0000-000000000000\\\""), - // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ - // LoadBalancerBackendAddressPools: []*armnetwork.BackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/bepool1"), - // }}, - // LoadBalancerInboundNatRules: []*armnetwork.InboundNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/inbound1"), - // }}, - // PrivateIPAddress: to.Ptr("10.0.1.4"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/myVirtualNetwork/subnets/frontendSubnet"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/LoadBalancerNetworkInterfaceListVmss.json -func ExampleLoadBalancerNetworkInterfacesClient_NewListPager_loadBalancerNetworkInterfaceListVmss() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLoadBalancerNetworkInterfacesClient().NewListPager("testrg", "lb", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.InterfaceListResult = armnetwork.InterfaceListResult{ - // Value: []*armnetwork.Interface{ - // { - // Name: to.Ptr("vmss1Nic"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/0/networkInterfaces/vmss1Nic"), - // Etag: to.Ptr("W/\\\"00000000-0000-0000-0000-000000000000\\\""), - // Properties: &armnetwork.InterfacePropertiesFormat{ - // DNSSettings: &armnetwork.InterfaceDNSSettings{ - // AppliedDNSServers: []*string{ - // }, - // DNSServers: []*string{ - // }, - // InternalDomainNameSuffix: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaa.dx.internal.cloudapp.net"), - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(false), - // IPConfigurations: []*armnetwork.InterfaceIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/0/networkInterfaces/vmss1Nic/ipConfigurations/vmss1IpConfig"), - // Name: to.Ptr("vmss1IpConfig"), - // Etag: to.Ptr("W/\\\"00000000-0000-0000-0000-000000000000\\\""), - // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ - // LoadBalancerBackendAddressPools: []*armnetwork.BackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/bepool"), - // }}, - // LoadBalancerInboundNatRules: []*armnetwork.InboundNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/natpool.0"), - // }}, - // Primary: to.Ptr(true), - // PrivateIPAddress: to.Ptr("10.0.0.4"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vmss1Vnet/subnets/default"), - // }, - // }, - // }}, - // MacAddress: to.Ptr("00-00-00-00-00-00"), - // Primary: to.Ptr(true), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // VirtualMachine: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/0"), - // }, - // }, - // }, - // { - // Name: to.Ptr("vmss1Nic"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/1/networkInterfaces/vmss1Nic"), - // Etag: to.Ptr("W/\\\"00000000-0000-0000-0000-000000000000\\\""), - // Properties: &armnetwork.InterfacePropertiesFormat{ - // DNSSettings: &armnetwork.InterfaceDNSSettings{ - // AppliedDNSServers: []*string{ - // }, - // DNSServers: []*string{ - // }, - // InternalDomainNameSuffix: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaa.dx.internal.cloudapp.net"), - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(false), - // IPConfigurations: []*armnetwork.InterfaceIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/1/networkInterfaces/vmss1Nic/ipConfigurations/vmss1IpConfig"), - // Name: to.Ptr("vmss1IpConfig"), - // Etag: to.Ptr("W/\\\"00000000-0000-0000-0000-000000000000\\\""), - // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ - // LoadBalancerBackendAddressPools: []*armnetwork.BackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/bepool"), - // }}, - // LoadBalancerInboundNatRules: []*armnetwork.InboundNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/natpool.1"), - // }}, - // Primary: to.Ptr(true), - // PrivateIPAddress: to.Ptr("10.0.0.5"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vmss1Vnet/subnets/default"), - // }, - // }, - // }}, - // MacAddress: to.Ptr("00-00-00-00-00-00"), - // Primary: to.Ptr(true), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // VirtualMachine: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/1"), - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/loadbalanceroutboundrules_client.go b/sdk/resourcemanager/network/armnetwork/loadbalanceroutboundrules_client.go index 60891e546f6c..be797e9fe0f9 100644 --- a/sdk/resourcemanager/network/armnetwork/loadbalanceroutboundrules_client.go +++ b/sdk/resourcemanager/network/armnetwork/loadbalanceroutboundrules_client.go @@ -47,7 +47,7 @@ func NewLoadBalancerOutboundRulesClient(subscriptionID string, credential azcore // Get - Gets the specified load balancer outbound rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - loadBalancerName - The name of the load balancer. // - outboundRuleName - The name of the outbound rule. @@ -99,7 +99,7 @@ func (client *LoadBalancerOutboundRulesClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -116,7 +116,7 @@ func (client *LoadBalancerOutboundRulesClient) getHandleResponse(resp *http.Resp // NewListPager - Gets all the outbound rules in a load balancer. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - loadBalancerName - The name of the load balancer. // - options - LoadBalancerOutboundRulesClientListOptions contains the optional parameters for the LoadBalancerOutboundRulesClient.NewListPager @@ -171,7 +171,7 @@ func (client *LoadBalancerOutboundRulesClient) listCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/loadbalanceroutboundrules_client_example_test.go b/sdk/resourcemanager/network/armnetwork/loadbalanceroutboundrules_client_example_test.go deleted file mode 100644 index c5b45e338d87..000000000000 --- a/sdk/resourcemanager/network/armnetwork/loadbalanceroutboundrules_client_example_test.go +++ /dev/null @@ -1,106 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/LoadBalancerOutboundRuleList.json -func ExampleLoadBalancerOutboundRulesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLoadBalancerOutboundRulesClient().NewListPager("testrg", "lb1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.LoadBalancerOutboundRuleListResult = armnetwork.LoadBalancerOutboundRuleListResult{ - // Value: []*armnetwork.OutboundRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/outboundRules/rule1"), - // Name: to.Ptr("rule1"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/outboundRules"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.OutboundRulePropertiesFormat{ - // AllocatedOutboundPorts: to.Ptr[int32](64), - // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/backendAddressPools/bepool1"), - // }, - // EnableTCPReset: to.Ptr(true), - // FrontendIPConfigurations: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/lbfrontend"), - // }}, - // IdleTimeoutInMinutes: to.Ptr[int32](15), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.LoadBalancerOutboundRuleProtocolTCP), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/LoadBalancerOutboundRuleGet.json -func ExampleLoadBalancerOutboundRulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLoadBalancerOutboundRulesClient().Get(ctx, "testrg", "lb1", "rule1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OutboundRule = armnetwork.OutboundRule{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/outboundRules/rule1"), - // Name: to.Ptr("rule1"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/outboundRules"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.OutboundRulePropertiesFormat{ - // AllocatedOutboundPorts: to.Ptr[int32](64), - // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/backendAddressPools/bepool1"), - // }, - // EnableTCPReset: to.Ptr(true), - // FrontendIPConfigurations: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/lbfrontend"), - // }}, - // IdleTimeoutInMinutes: to.Ptr[int32](15), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.LoadBalancerOutboundRuleProtocolTCP), - // }, - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/loadbalancerprobes_client.go b/sdk/resourcemanager/network/armnetwork/loadbalancerprobes_client.go index f696bc031c8a..d83cf39659ad 100644 --- a/sdk/resourcemanager/network/armnetwork/loadbalancerprobes_client.go +++ b/sdk/resourcemanager/network/armnetwork/loadbalancerprobes_client.go @@ -47,7 +47,7 @@ func NewLoadBalancerProbesClient(subscriptionID string, credential azcore.TokenC // Get - Gets load balancer probe. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - loadBalancerName - The name of the load balancer. // - probeName - The name of the probe. @@ -98,7 +98,7 @@ func (client *LoadBalancerProbesClient) getCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -115,7 +115,7 @@ func (client *LoadBalancerProbesClient) getHandleResponse(resp *http.Response) ( // NewListPager - Gets all the load balancer probes. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - loadBalancerName - The name of the load balancer. // - options - LoadBalancerProbesClientListOptions contains the optional parameters for the LoadBalancerProbesClient.NewListPager @@ -170,7 +170,7 @@ func (client *LoadBalancerProbesClient) listCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/loadbalancerprobes_client_example_test.go b/sdk/resourcemanager/network/armnetwork/loadbalancerprobes_client_example_test.go deleted file mode 100644 index 7f182561e7b5..000000000000 --- a/sdk/resourcemanager/network/armnetwork/loadbalancerprobes_client_example_test.go +++ /dev/null @@ -1,104 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/LoadBalancerProbeList.json -func ExampleLoadBalancerProbesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLoadBalancerProbesClient().NewListPager("testrg", "lb", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.LoadBalancerProbeListResult = armnetwork.LoadBalancerProbeListResult{ - // Value: []*armnetwork.Probe{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/probes/prlb"), - // Name: to.Ptr("prlb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/probes"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.ProbePropertiesFormat{ - // IntervalInSeconds: to.Ptr[int32](15), - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // NumberOfProbes: to.Ptr[int32](2), - // Port: to.Ptr[int32](80), - // ProbeThreshold: to.Ptr[int32](1), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RequestPath: to.Ptr("healthcheck.aspx"), - // Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/LoadBalancerProbeGet.json -func ExampleLoadBalancerProbesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLoadBalancerProbesClient().Get(ctx, "testrg", "lb", "probe1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Probe = armnetwork.Probe{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/probes/probe1"), - // Name: to.Ptr("probe1"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/probes"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.ProbePropertiesFormat{ - // IntervalInSeconds: to.Ptr[int32](15), - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // NumberOfProbes: to.Ptr[int32](2), - // Port: to.Ptr[int32](80), - // ProbeThreshold: to.Ptr[int32](1), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RequestPath: to.Ptr("healthcheck.aspx"), - // Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), - // }, - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/loadbalancers_client.go b/sdk/resourcemanager/network/armnetwork/loadbalancers_client.go index 59619f0715de..e9af1e85f629 100644 --- a/sdk/resourcemanager/network/armnetwork/loadbalancers_client.go +++ b/sdk/resourcemanager/network/armnetwork/loadbalancers_client.go @@ -47,7 +47,7 @@ func NewLoadBalancersClient(subscriptionID string, credential azcore.TokenCreden // BeginCreateOrUpdate - Creates or updates a load balancer. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - loadBalancerName - The name of the load balancer. // - parameters - Parameters supplied to the create or update load balancer operation. @@ -71,7 +71,7 @@ func (client *LoadBalancersClient) BeginCreateOrUpdate(ctx context.Context, reso // CreateOrUpdate - Creates or updates a load balancer. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *LoadBalancersClient) createOrUpdate(ctx context.Context, resourceGroupName string, loadBalancerName string, parameters LoadBalancer, options *LoadBalancersClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "LoadBalancersClient.BeginCreateOrUpdate" @@ -113,7 +113,7 @@ func (client *LoadBalancersClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -125,7 +125,7 @@ func (client *LoadBalancersClient) createOrUpdateCreateRequest(ctx context.Conte // BeginDelete - Deletes the specified load balancer. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - loadBalancerName - The name of the load balancer. // - options - LoadBalancersClientBeginDeleteOptions contains the optional parameters for the LoadBalancersClient.BeginDelete @@ -148,7 +148,7 @@ func (client *LoadBalancersClient) BeginDelete(ctx context.Context, resourceGrou // Delete - Deletes the specified load balancer. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *LoadBalancersClient) deleteOperation(ctx context.Context, resourceGroupName string, loadBalancerName string, options *LoadBalancersClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "LoadBalancersClient.BeginDelete" @@ -190,7 +190,7 @@ func (client *LoadBalancersClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -199,7 +199,7 @@ func (client *LoadBalancersClient) deleteCreateRequest(ctx context.Context, reso // Get - Gets the specified load balancer. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - loadBalancerName - The name of the load balancer. // - options - LoadBalancersClientGetOptions contains the optional parameters for the LoadBalancersClient.Get method. @@ -245,7 +245,7 @@ func (client *LoadBalancersClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } @@ -265,7 +265,7 @@ func (client *LoadBalancersClient) getHandleResponse(resp *http.Response) (LoadB // NewListPager - Gets all the load balancers in a resource group. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - options - LoadBalancersClientListOptions contains the optional parameters for the LoadBalancersClient.NewListPager method. func (client *LoadBalancersClient) NewListPager(resourceGroupName string, options *LoadBalancersClientListOptions) *runtime.Pager[LoadBalancersClientListResponse] { @@ -314,7 +314,7 @@ func (client *LoadBalancersClient) listCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -331,7 +331,7 @@ func (client *LoadBalancersClient) listHandleResponse(resp *http.Response) (Load // NewListAllPager - Gets all the load balancers in a subscription. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - options - LoadBalancersClientListAllOptions contains the optional parameters for the LoadBalancersClient.NewListAllPager // method. func (client *LoadBalancersClient) NewListAllPager(options *LoadBalancersClientListAllOptions) *runtime.Pager[LoadBalancersClientListAllResponse] { @@ -376,7 +376,7 @@ func (client *LoadBalancersClient) listAllCreateRequest(ctx context.Context, opt return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -394,7 +394,7 @@ func (client *LoadBalancersClient) listAllHandleResponse(resp *http.Response) (L // BeginListInboundNatRulePortMappings - List of inbound NAT rule port mappings. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - groupName - The name of the resource group. // - loadBalancerName - The name of the load balancer. // - backendPoolName - The name of the load balancer backend address pool. @@ -419,7 +419,7 @@ func (client *LoadBalancersClient) BeginListInboundNatRulePortMappings(ctx conte // ListInboundNatRulePortMappings - List of inbound NAT rule port mappings. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *LoadBalancersClient) listInboundNatRulePortMappings(ctx context.Context, groupName string, loadBalancerName string, backendPoolName string, parameters QueryInboundNatRulePortMappingRequest, options *LoadBalancersClientBeginListInboundNatRulePortMappingsOptions) (*http.Response, error) { var err error const operationName = "LoadBalancersClient.BeginListInboundNatRulePortMappings" @@ -465,7 +465,7 @@ func (client *LoadBalancersClient) listInboundNatRulePortMappingsCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -474,10 +474,81 @@ func (client *LoadBalancersClient) listInboundNatRulePortMappingsCreateRequest(c return req, nil } +// MigrateToIPBased - Migrate load balancer to IP Based +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +// - groupName - The name of the resource group. +// - loadBalancerName - The name of the load balancer. +// - options - LoadBalancersClientMigrateToIPBasedOptions contains the optional parameters for the LoadBalancersClient.MigrateToIPBased +// method. +func (client *LoadBalancersClient) MigrateToIPBased(ctx context.Context, groupName string, loadBalancerName string, options *LoadBalancersClientMigrateToIPBasedOptions) (LoadBalancersClientMigrateToIPBasedResponse, error) { + var err error + const operationName = "LoadBalancersClient.MigrateToIPBased" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.migrateToIPBasedCreateRequest(ctx, groupName, loadBalancerName, options) + if err != nil { + return LoadBalancersClientMigrateToIPBasedResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return LoadBalancersClientMigrateToIPBasedResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return LoadBalancersClientMigrateToIPBasedResponse{}, err + } + resp, err := client.migrateToIPBasedHandleResponse(httpResp) + return resp, err +} + +// migrateToIPBasedCreateRequest creates the MigrateToIPBased request. +func (client *LoadBalancersClient) migrateToIPBasedCreateRequest(ctx context.Context, groupName string, loadBalancerName string, options *LoadBalancersClientMigrateToIPBasedOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/migrateToIpBased" + if groupName == "" { + return nil, errors.New("parameter groupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{groupName}", url.PathEscape(groupName)) + if loadBalancerName == "" { + return nil, errors.New("parameter loadBalancerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{loadBalancerName}", url.PathEscape(loadBalancerName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if options != nil && options.Parameters != nil { + if err := runtime.MarshalAsJSON(req, *options.Parameters); err != nil { + return nil, err + } + return req, nil + } + return req, nil +} + +// migrateToIPBasedHandleResponse handles the MigrateToIPBased response. +func (client *LoadBalancersClient) migrateToIPBasedHandleResponse(resp *http.Response) (LoadBalancersClientMigrateToIPBasedResponse, error) { + result := LoadBalancersClientMigrateToIPBasedResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.MigratedPools); err != nil { + return LoadBalancersClientMigrateToIPBasedResponse{}, err + } + return result, nil +} + // BeginSwapPublicIPAddresses - Swaps VIPs between two load balancers. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - location - The region where load balancers are located at. // - parameters - Parameters that define which VIPs should be swapped. // - options - LoadBalancersClientBeginSwapPublicIPAddressesOptions contains the optional parameters for the LoadBalancersClient.BeginSwapPublicIPAddresses @@ -500,7 +571,7 @@ func (client *LoadBalancersClient) BeginSwapPublicIPAddresses(ctx context.Contex // SwapPublicIPAddresses - Swaps VIPs between two load balancers. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *LoadBalancersClient) swapPublicIPAddresses(ctx context.Context, location string, parameters LoadBalancerVipSwapRequest, options *LoadBalancersClientBeginSwapPublicIPAddressesOptions) (*http.Response, error) { var err error const operationName = "LoadBalancersClient.BeginSwapPublicIPAddresses" @@ -538,7 +609,7 @@ func (client *LoadBalancersClient) swapPublicIPAddressesCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -550,7 +621,7 @@ func (client *LoadBalancersClient) swapPublicIPAddressesCreateRequest(ctx contex // UpdateTags - Updates a load balancer tags. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - loadBalancerName - The name of the load balancer. // - parameters - Parameters supplied to update load balancer tags. @@ -598,7 +669,7 @@ func (client *LoadBalancersClient) updateTagsCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/loadbalancers_client_example_test.go b/sdk/resourcemanager/network/armnetwork/loadbalancers_client_example_test.go deleted file mode 100644 index 95054098d764..000000000000 --- a/sdk/resourcemanager/network/armnetwork/loadbalancers_client_example_test.go +++ /dev/null @@ -1,2765 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/LoadBalancerDelete.json -func ExampleLoadBalancersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLoadBalancersClient().BeginDelete(ctx, "rg1", "lb", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/LoadBalancerGet.json -func ExampleLoadBalancersClient_Get_getLoadBalancer() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLoadBalancersClient().Get(ctx, "rg1", "lb", &armnetwork.LoadBalancersClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LoadBalancer = armnetwork.LoadBalancer{ - // Name: to.Ptr("lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.LoadBalancerPropertiesFormat{ - // BackendAddressPools: []*armnetwork.BackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), - // Name: to.Ptr("be-lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - // Name: to.Ptr("fe-lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/frontendIPConfigurations"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ - // InboundNatRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"), - // }}, - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // PrivateIPAddress: to.Ptr("10.0.1.4"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), - // }, - // }, - // }}, - // InboundNatPools: []*armnetwork.InboundNatPool{ - // }, - // InboundNatRules: []*armnetwork.InboundNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"), - // Name: to.Ptr("in-nat-rule"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/inboundNatRules"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.InboundNatRulePropertiesFormat{ - // BackendPort: to.Ptr[int32](3389), - // EnableFloatingIP: to.Ptr(true), - // EnableTCPReset: to.Ptr(true), - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - // }, - // FrontendPort: to.Ptr[int32](3389), - // IdleTimeoutInMinutes: to.Ptr[int32](15), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - // }, - // }}, - // LoadBalancingRules: []*armnetwork.LoadBalancingRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // Name: to.Ptr("rulelb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/loadBalancingRules"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ - // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), - // }, - // BackendPort: to.Ptr[int32](80), - // DisableOutboundSnat: to.Ptr(false), - // EnableFloatingIP: to.Ptr(true), - // EnableTCPReset: to.Ptr(true), - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - // }, - // FrontendPort: to.Ptr[int32](80), - // IdleTimeoutInMinutes: to.Ptr[int32](15), - // LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), - // Probe: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - // }, - // }}, - // Probes: []*armnetwork.Probe{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), - // Name: to.Ptr("probe-lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/probes"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.ProbePropertiesFormat{ - // IntervalInSeconds: to.Ptr[int32](15), - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // NumberOfProbes: to.Ptr[int32](2), - // Port: to.Ptr[int32](80), - // ProbeThreshold: to.Ptr[int32](1), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RequestPath: to.Ptr("healthcheck.aspx"), - // Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // }, - // SKU: &armnetwork.LoadBalancerSKU{ - // Name: to.Ptr(armnetwork.LoadBalancerSKUNameBasic), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/LoadBalancerGetInboundNatRulePortMapping.json -func ExampleLoadBalancersClient_Get_getLoadBalancerWithInboundNatRulePortMapping() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLoadBalancersClient().Get(ctx, "rg1", "lb", &armnetwork.LoadBalancersClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LoadBalancer = armnetwork.LoadBalancer{ - // Name: to.Ptr("lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.LoadBalancerPropertiesFormat{ - // BackendAddressPools: []*armnetwork.BackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), - // Name: to.Ptr("be-lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ - // InboundNatRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"), - // }}, - // LoadBalancerBackendAddresses: []*armnetwork.LoadBalancerBackendAddress{ - // { - // Name: to.Ptr("8bec96ef-0a6a-45b8-9860-4ffde7bf3572"), - // Properties: &armnetwork.LoadBalancerBackendAddressPropertiesFormat{ - // InboundNatRulesPortMapping: []*armnetwork.NatRulePortMapping{ - // { - // BackendPort: to.Ptr[int32](3389), - // FrontendPort: to.Ptr[int32](3389), - // InboundNatRuleName: to.Ptr("natRule"), - // }}, - // IPAddress: to.Ptr("10.0.0.4"), - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), - // }, - // }, - // }}, - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - // Name: to.Ptr("fe-lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/frontendIPConfigurations"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // PrivateIPAddress: to.Ptr("10.0.1.4"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), - // }, - // }, - // }}, - // InboundNatPools: []*armnetwork.InboundNatPool{ - // }, - // InboundNatRules: []*armnetwork.InboundNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"), - // Name: to.Ptr("in-nat-rule"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/inboundNatRules"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.InboundNatRulePropertiesFormat{ - // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), - // }, - // BackendPort: to.Ptr[int32](3389), - // EnableFloatingIP: to.Ptr(true), - // EnableTCPReset: to.Ptr(true), - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - // }, - // FrontendPort: to.Ptr[int32](0), - // FrontendPortRangeEnd: to.Ptr[int32](4000), - // FrontendPortRangeStart: to.Ptr[int32](3389), - // IdleTimeoutInMinutes: to.Ptr[int32](15), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - // }, - // }}, - // LoadBalancingRules: []*armnetwork.LoadBalancingRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // Name: to.Ptr("rulelb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/loadBalancingRules"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ - // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), - // }, - // BackendPort: to.Ptr[int32](80), - // DisableOutboundSnat: to.Ptr(false), - // EnableFloatingIP: to.Ptr(true), - // EnableTCPReset: to.Ptr(true), - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - // }, - // FrontendPort: to.Ptr[int32](80), - // IdleTimeoutInMinutes: to.Ptr[int32](15), - // LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), - // Probe: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - // }, - // }}, - // Probes: []*armnetwork.Probe{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), - // Name: to.Ptr("probe-lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/probes"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.ProbePropertiesFormat{ - // IntervalInSeconds: to.Ptr[int32](15), - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // NumberOfProbes: to.Ptr[int32](2), - // Port: to.Ptr[int32](80), - // ProbeThreshold: to.Ptr[int32](1), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RequestPath: to.Ptr("healthcheck.aspx"), - // Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // }, - // SKU: &armnetwork.LoadBalancerSKU{ - // Name: to.Ptr(armnetwork.LoadBalancerSKUNameStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/LoadBalancerCreate.json -func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancer() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLoadBalancersClient().BeginCreateOrUpdate(ctx, "rg1", "lb", armnetwork.LoadBalancer{ - Location: to.Ptr("eastus"), - Properties: &armnetwork.LoadBalancerPropertiesFormat{ - BackendAddressPools: []*armnetwork.BackendAddressPool{ - { - Name: to.Ptr("be-lb"), - Properties: &armnetwork.BackendAddressPoolPropertiesFormat{}, - }}, - FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ - { - Name: to.Ptr("fe-lb"), - Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ - Subnet: &armnetwork.Subnet{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), - }, - }, - }}, - InboundNatPools: []*armnetwork.InboundNatPool{}, - InboundNatRules: []*armnetwork.InboundNatRule{ - { - Name: to.Ptr("in-nat-rule"), - Properties: &armnetwork.InboundNatRulePropertiesFormat{ - BackendPort: to.Ptr[int32](3389), - EnableFloatingIP: to.Ptr(true), - EnableTCPReset: to.Ptr(false), - FrontendIPConfiguration: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - }, - FrontendPort: to.Ptr[int32](3389), - IdleTimeoutInMinutes: to.Ptr[int32](15), - Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - }, - }}, - LoadBalancingRules: []*armnetwork.LoadBalancingRule{ - { - Name: to.Ptr("rulelb"), - Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ - BackendAddressPool: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), - }, - BackendPort: to.Ptr[int32](80), - EnableFloatingIP: to.Ptr(true), - EnableTCPReset: to.Ptr(false), - FrontendIPConfiguration: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - }, - FrontendPort: to.Ptr[int32](80), - IdleTimeoutInMinutes: to.Ptr[int32](15), - LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), - Probe: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), - }, - Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - }, - }}, - Probes: []*armnetwork.Probe{ - { - Name: to.Ptr("probe-lb"), - Properties: &armnetwork.ProbePropertiesFormat{ - IntervalInSeconds: to.Ptr[int32](15), - NumberOfProbes: to.Ptr[int32](2), - Port: to.Ptr[int32](80), - ProbeThreshold: to.Ptr[int32](1), - RequestPath: to.Ptr("healthcheck.aspx"), - Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), - }, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LoadBalancer = armnetwork.LoadBalancer{ - // Name: to.Ptr("lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb"), - // Location: to.Ptr("eastus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.LoadBalancerPropertiesFormat{ - // BackendAddressPools: []*armnetwork.BackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), - // Name: to.Ptr("be-lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - // Name: to.Ptr("fe-lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/frontendIPConfigurations"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ - // InboundNatRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"), - // }}, - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // PrivateIPAddress: to.Ptr("10.0.1.4"), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), - // }, - // }, - // }}, - // InboundNatPools: []*armnetwork.InboundNatPool{ - // }, - // InboundNatRules: []*armnetwork.InboundNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"), - // Name: to.Ptr("in-nat-rule"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/inboundNatRules"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.InboundNatRulePropertiesFormat{ - // BackendPort: to.Ptr[int32](3389), - // EnableFloatingIP: to.Ptr(true), - // EnableTCPReset: to.Ptr(false), - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - // }, - // FrontendPort: to.Ptr[int32](3389), - // IdleTimeoutInMinutes: to.Ptr[int32](15), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - // }, - // }}, - // LoadBalancingRules: []*armnetwork.LoadBalancingRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // Name: to.Ptr("rulelb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/loadBalancingRules"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ - // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), - // }, - // BackendPort: to.Ptr[int32](80), - // DisableOutboundSnat: to.Ptr(false), - // EnableFloatingIP: to.Ptr(true), - // EnableTCPReset: to.Ptr(false), - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - // }, - // FrontendPort: to.Ptr[int32](80), - // IdleTimeoutInMinutes: to.Ptr[int32](15), - // LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), - // Probe: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - // }, - // }}, - // Probes: []*armnetwork.Probe{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), - // Name: to.Ptr("probe-lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/probes"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.ProbePropertiesFormat{ - // IntervalInSeconds: to.Ptr[int32](15), - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // NumberOfProbes: to.Ptr[int32](2), - // Port: to.Ptr[int32](80), - // ProbeThreshold: to.Ptr[int32](1), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RequestPath: to.Ptr("healthcheck.aspx"), - // Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // }, - // SKU: &armnetwork.LoadBalancerSKU{ - // Name: to.Ptr(armnetwork.LoadBalancerSKUNameBasic), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/LoadBalancerCreateWithZones.json -func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancerWithFrontendIpInZone1() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLoadBalancersClient().BeginCreateOrUpdate(ctx, "rg1", "lb", armnetwork.LoadBalancer{ - Location: to.Ptr("eastus"), - Properties: &armnetwork.LoadBalancerPropertiesFormat{ - BackendAddressPools: []*armnetwork.BackendAddressPool{ - { - Name: to.Ptr("be-lb"), - Properties: &armnetwork.BackendAddressPoolPropertiesFormat{}, - }}, - FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ - { - Name: to.Ptr("fe-lb"), - Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ - Subnet: &armnetwork.Subnet{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), - }, - }, - Zones: []*string{ - to.Ptr("1")}, - }}, - InboundNatPools: []*armnetwork.InboundNatPool{}, - InboundNatRules: []*armnetwork.InboundNatRule{ - { - Name: to.Ptr("in-nat-rule"), - Properties: &armnetwork.InboundNatRulePropertiesFormat{ - BackendPort: to.Ptr[int32](3389), - EnableFloatingIP: to.Ptr(true), - FrontendIPConfiguration: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - }, - FrontendPort: to.Ptr[int32](3389), - IdleTimeoutInMinutes: to.Ptr[int32](15), - Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - }, - }}, - LoadBalancingRules: []*armnetwork.LoadBalancingRule{ - { - Name: to.Ptr("rulelb"), - Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ - BackendAddressPool: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), - }, - BackendPort: to.Ptr[int32](80), - EnableFloatingIP: to.Ptr(true), - FrontendIPConfiguration: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - }, - FrontendPort: to.Ptr[int32](80), - IdleTimeoutInMinutes: to.Ptr[int32](15), - LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), - Probe: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), - }, - Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - }, - }}, - OutboundRules: []*armnetwork.OutboundRule{}, - Probes: []*armnetwork.Probe{ - { - Name: to.Ptr("probe-lb"), - Properties: &armnetwork.ProbePropertiesFormat{ - IntervalInSeconds: to.Ptr[int32](15), - NumberOfProbes: to.Ptr[int32](2), - Port: to.Ptr[int32](80), - ProbeThreshold: to.Ptr[int32](1), - RequestPath: to.Ptr("healthcheck.aspx"), - Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), - }, - }}, - }, - SKU: &armnetwork.LoadBalancerSKU{ - Name: to.Ptr(armnetwork.LoadBalancerSKUNameStandard), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LoadBalancer = armnetwork.LoadBalancer{ - // Name: to.Ptr("lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb"), - // Location: to.Ptr("eastus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.LoadBalancerPropertiesFormat{ - // BackendAddressPools: []*armnetwork.BackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), - // Name: to.Ptr("be-lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - // Name: to.Ptr("fe-lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/frontendIPConfigurations"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ - // InboundNatRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"), - // }}, - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // PrivateIPAddress: to.Ptr("10.0.1.4"), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), - // }, - // }, - // Zones: []*string{ - // to.Ptr("1")}, - // }}, - // InboundNatPools: []*armnetwork.InboundNatPool{ - // }, - // InboundNatRules: []*armnetwork.InboundNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"), - // Name: to.Ptr("in-nat-rule"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/inboundNatRules"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.InboundNatRulePropertiesFormat{ - // BackendPort: to.Ptr[int32](3389), - // EnableFloatingIP: to.Ptr(true), - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - // }, - // FrontendPort: to.Ptr[int32](3389), - // IdleTimeoutInMinutes: to.Ptr[int32](15), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - // }, - // }}, - // LoadBalancingRules: []*armnetwork.LoadBalancingRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // Name: to.Ptr("rulelb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/loadBalancingRules"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ - // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), - // }, - // BackendPort: to.Ptr[int32](80), - // DisableOutboundSnat: to.Ptr(false), - // EnableFloatingIP: to.Ptr(true), - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - // }, - // FrontendPort: to.Ptr[int32](80), - // IdleTimeoutInMinutes: to.Ptr[int32](15), - // LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), - // Probe: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - // }, - // }}, - // OutboundRules: []*armnetwork.OutboundRule{ - // }, - // Probes: []*armnetwork.Probe{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), - // Name: to.Ptr("probe-lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/probes"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.ProbePropertiesFormat{ - // IntervalInSeconds: to.Ptr[int32](15), - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // NumberOfProbes: to.Ptr[int32](2), - // Port: to.Ptr[int32](80), - // ProbeThreshold: to.Ptr[int32](1), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RequestPath: to.Ptr("healthcheck.aspx"), - // Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // }, - // SKU: &armnetwork.LoadBalancerSKU{ - // Name: to.Ptr(armnetwork.LoadBalancerSKUNameStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/LoadBalancerCreateGatewayLoadBalancerConsumer.json -func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancerWithGatewayLoadBalancerConsumerConfigured() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLoadBalancersClient().BeginCreateOrUpdate(ctx, "rg1", "lb", armnetwork.LoadBalancer{ - Location: to.Ptr("eastus"), - Properties: &armnetwork.LoadBalancerPropertiesFormat{ - BackendAddressPools: []*armnetwork.BackendAddressPool{ - { - Name: to.Ptr("be-lb"), - Properties: &armnetwork.BackendAddressPoolPropertiesFormat{}, - }}, - FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ - { - Name: to.Ptr("fe-lb"), - Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ - GatewayLoadBalancer: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb-provider"), - }, - Subnet: &armnetwork.Subnet{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), - }, - }, - }}, - InboundNatPools: []*armnetwork.InboundNatPool{}, - InboundNatRules: []*armnetwork.InboundNatRule{ - { - Name: to.Ptr("in-nat-rule"), - Properties: &armnetwork.InboundNatRulePropertiesFormat{ - BackendPort: to.Ptr[int32](3389), - EnableFloatingIP: to.Ptr(true), - FrontendIPConfiguration: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - }, - FrontendPort: to.Ptr[int32](3389), - IdleTimeoutInMinutes: to.Ptr[int32](15), - Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - }, - }}, - LoadBalancingRules: []*armnetwork.LoadBalancingRule{ - { - Name: to.Ptr("rulelb"), - Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ - BackendAddressPool: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), - }, - BackendPort: to.Ptr[int32](80), - EnableFloatingIP: to.Ptr(true), - FrontendIPConfiguration: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - }, - FrontendPort: to.Ptr[int32](80), - IdleTimeoutInMinutes: to.Ptr[int32](15), - LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), - Probe: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), - }, - Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - }, - }}, - OutboundRules: []*armnetwork.OutboundRule{}, - Probes: []*armnetwork.Probe{ - { - Name: to.Ptr("probe-lb"), - Properties: &armnetwork.ProbePropertiesFormat{ - IntervalInSeconds: to.Ptr[int32](15), - NumberOfProbes: to.Ptr[int32](2), - Port: to.Ptr[int32](80), - ProbeThreshold: to.Ptr[int32](1), - RequestPath: to.Ptr("healthcheck.aspx"), - Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), - }, - }}, - }, - SKU: &armnetwork.LoadBalancerSKU{ - Name: to.Ptr(armnetwork.LoadBalancerSKUNameStandard), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LoadBalancer = armnetwork.LoadBalancer{ - // Name: to.Ptr("lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb"), - // Location: to.Ptr("eastus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.LoadBalancerPropertiesFormat{ - // BackendAddressPools: []*armnetwork.BackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), - // Name: to.Ptr("be-lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - // Name: to.Ptr("fe-lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/frontendIPConfigurations"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ - // GatewayLoadBalancer: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb-provider"), - // }, - // InboundNatRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"), - // }}, - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // PrivateIPAddress: to.Ptr("10.0.1.4"), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), - // }, - // }, - // }}, - // InboundNatPools: []*armnetwork.InboundNatPool{ - // }, - // InboundNatRules: []*armnetwork.InboundNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"), - // Name: to.Ptr("in-nat-rule"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/inboundNatRules"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.InboundNatRulePropertiesFormat{ - // BackendPort: to.Ptr[int32](3389), - // EnableFloatingIP: to.Ptr(true), - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - // }, - // FrontendPort: to.Ptr[int32](3389), - // IdleTimeoutInMinutes: to.Ptr[int32](15), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - // }, - // }}, - // LoadBalancingRules: []*armnetwork.LoadBalancingRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // Name: to.Ptr("rulelb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/loadBalancingRules"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ - // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), - // }, - // BackendPort: to.Ptr[int32](80), - // DisableOutboundSnat: to.Ptr(false), - // EnableFloatingIP: to.Ptr(true), - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - // }, - // FrontendPort: to.Ptr[int32](80), - // IdleTimeoutInMinutes: to.Ptr[int32](15), - // LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), - // Probe: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - // }, - // }}, - // OutboundRules: []*armnetwork.OutboundRule{ - // }, - // Probes: []*armnetwork.Probe{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), - // Name: to.Ptr("probe-lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/probes"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.ProbePropertiesFormat{ - // IntervalInSeconds: to.Ptr[int32](15), - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // NumberOfProbes: to.Ptr[int32](2), - // Port: to.Ptr[int32](80), - // ProbeThreshold: to.Ptr[int32](1), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RequestPath: to.Ptr("healthcheck.aspx"), - // Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // }, - // SKU: &armnetwork.LoadBalancerSKU{ - // Name: to.Ptr(armnetwork.LoadBalancerSKUNameStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/LoadBalancerCreateGatewayLoadBalancerProviderWithOneBackendPool.json -func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancerWithGatewayLoadBalancerProviderConfiguredWithOneBackendPool() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLoadBalancersClient().BeginCreateOrUpdate(ctx, "rg1", "lb", armnetwork.LoadBalancer{ - Location: to.Ptr("eastus"), - Properties: &armnetwork.LoadBalancerPropertiesFormat{ - BackendAddressPools: []*armnetwork.BackendAddressPool{ - { - Name: to.Ptr("be-lb"), - Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ - TunnelInterfaces: []*armnetwork.GatewayLoadBalancerTunnelInterface{ - { - Type: to.Ptr(armnetwork.GatewayLoadBalancerTunnelInterfaceTypeInternal), - Identifier: to.Ptr[int32](900), - Port: to.Ptr[int32](15000), - Protocol: to.Ptr(armnetwork.GatewayLoadBalancerTunnelProtocolVXLAN), - }, - { - Type: to.Ptr(armnetwork.GatewayLoadBalancerTunnelInterfaceTypeInternal), - Identifier: to.Ptr[int32](901), - Port: to.Ptr[int32](15001), - Protocol: to.Ptr(armnetwork.GatewayLoadBalancerTunnelProtocolVXLAN), - }}, - }, - }}, - FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ - { - Name: to.Ptr("fe-lb"), - Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ - Subnet: &armnetwork.Subnet{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), - }, - }, - }}, - InboundNatPools: []*armnetwork.InboundNatPool{}, - LoadBalancingRules: []*armnetwork.LoadBalancingRule{ - { - Name: to.Ptr("rulelb"), - Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ - BackendAddressPools: []*armnetwork.SubResource{ - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), - }}, - BackendPort: to.Ptr[int32](0), - EnableFloatingIP: to.Ptr(true), - FrontendIPConfiguration: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - }, - FrontendPort: to.Ptr[int32](0), - IdleTimeoutInMinutes: to.Ptr[int32](15), - LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), - Probe: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), - }, - Protocol: to.Ptr(armnetwork.TransportProtocolAll), - }, - }}, - OutboundRules: []*armnetwork.OutboundRule{}, - Probes: []*armnetwork.Probe{ - { - Name: to.Ptr("probe-lb"), - Properties: &armnetwork.ProbePropertiesFormat{ - IntervalInSeconds: to.Ptr[int32](15), - NumberOfProbes: to.Ptr[int32](2), - Port: to.Ptr[int32](80), - ProbeThreshold: to.Ptr[int32](1), - RequestPath: to.Ptr("healthcheck.aspx"), - Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), - }, - }}, - }, - SKU: &armnetwork.LoadBalancerSKU{ - Name: to.Ptr(armnetwork.LoadBalancerSKUName("Premium")), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LoadBalancer = armnetwork.LoadBalancer{ - // Name: to.Ptr("lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb"), - // Location: to.Ptr("eastus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.LoadBalancerPropertiesFormat{ - // BackendAddressPools: []*armnetwork.BackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), - // Name: to.Ptr("be-lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // TunnelInterfaces: []*armnetwork.GatewayLoadBalancerTunnelInterface{ - // { - // Type: to.Ptr(armnetwork.GatewayLoadBalancerTunnelInterfaceTypeInternal), - // Identifier: to.Ptr[int32](900), - // Port: to.Ptr[int32](15000), - // Protocol: to.Ptr(armnetwork.GatewayLoadBalancerTunnelProtocolVXLAN), - // }, - // { - // Type: to.Ptr(armnetwork.GatewayLoadBalancerTunnelInterfaceTypeInternal), - // Identifier: to.Ptr[int32](901), - // Port: to.Ptr[int32](15001), - // Protocol: to.Ptr(armnetwork.GatewayLoadBalancerTunnelProtocolVXLAN), - // }}, - // }, - // }}, - // FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - // Name: to.Ptr("fe-lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/frontendIPConfigurations"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ - // InboundNatRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"), - // }}, - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // PrivateIPAddress: to.Ptr("10.0.1.4"), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), - // }, - // }, - // }}, - // InboundNatPools: []*armnetwork.InboundNatPool{ - // }, - // LoadBalancingRules: []*armnetwork.LoadBalancingRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // Name: to.Ptr("rulelb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/loadBalancingRules"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ - // BackendAddressPools: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), - // }}, - // BackendPort: to.Ptr[int32](80), - // DisableOutboundSnat: to.Ptr(false), - // EnableFloatingIP: to.Ptr(true), - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - // }, - // FrontendPort: to.Ptr[int32](80), - // IdleTimeoutInMinutes: to.Ptr[int32](15), - // LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), - // Probe: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - // }, - // }}, - // OutboundRules: []*armnetwork.OutboundRule{ - // }, - // Probes: []*armnetwork.Probe{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), - // Name: to.Ptr("probe-lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/probes"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.ProbePropertiesFormat{ - // IntervalInSeconds: to.Ptr[int32](15), - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // NumberOfProbes: to.Ptr[int32](2), - // Port: to.Ptr[int32](80), - // ProbeThreshold: to.Ptr[int32](1), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RequestPath: to.Ptr("healthcheck.aspx"), - // Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // }, - // SKU: &armnetwork.LoadBalancerSKU{ - // Name: to.Ptr(armnetwork.LoadBalancerSKUNameStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/LoadBalancerCreateGatewayLoadBalancerProviderWithTwoBackendPool.json -func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancerWithGatewayLoadBalancerProviderConfiguredWithTwoBackendPool() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLoadBalancersClient().BeginCreateOrUpdate(ctx, "rg1", "lb", armnetwork.LoadBalancer{ - Location: to.Ptr("eastus"), - Properties: &armnetwork.LoadBalancerPropertiesFormat{ - BackendAddressPools: []*armnetwork.BackendAddressPool{ - { - Name: to.Ptr("be-lb1"), - Properties: &armnetwork.BackendAddressPoolPropertiesFormat{}, - }, - { - Name: to.Ptr("be-lb2"), - Properties: &armnetwork.BackendAddressPoolPropertiesFormat{}, - }}, - FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ - { - Name: to.Ptr("fe-lb"), - Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ - Subnet: &armnetwork.Subnet{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), - }, - }, - }}, - InboundNatPools: []*armnetwork.InboundNatPool{}, - LoadBalancingRules: []*armnetwork.LoadBalancingRule{ - { - Name: to.Ptr("rulelb"), - Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ - BackendAddressPool: &armnetwork.SubResource{}, - BackendAddressPools: []*armnetwork.SubResource{ - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb1"), - }, - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb2"), - }}, - BackendPort: to.Ptr[int32](0), - EnableFloatingIP: to.Ptr(true), - FrontendIPConfiguration: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - }, - FrontendPort: to.Ptr[int32](0), - IdleTimeoutInMinutes: to.Ptr[int32](15), - LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), - Probe: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), - }, - Protocol: to.Ptr(armnetwork.TransportProtocolAll), - }, - }}, - OutboundRules: []*armnetwork.OutboundRule{}, - Probes: []*armnetwork.Probe{ - { - Name: to.Ptr("probe-lb"), - Properties: &armnetwork.ProbePropertiesFormat{ - IntervalInSeconds: to.Ptr[int32](15), - NumberOfProbes: to.Ptr[int32](2), - Port: to.Ptr[int32](80), - ProbeThreshold: to.Ptr[int32](1), - RequestPath: to.Ptr("healthcheck.aspx"), - Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), - }, - }}, - }, - SKU: &armnetwork.LoadBalancerSKU{ - Name: to.Ptr(armnetwork.LoadBalancerSKUName("Premium")), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LoadBalancer = armnetwork.LoadBalancer{ - // Name: to.Ptr("lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb"), - // Location: to.Ptr("eastus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.LoadBalancerPropertiesFormat{ - // BackendAddressPools: []*armnetwork.BackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb1"), - // Name: to.Ptr("be-lb1"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // TunnelInterfaces: []*armnetwork.GatewayLoadBalancerTunnelInterface{ - // { - // Type: to.Ptr(armnetwork.GatewayLoadBalancerTunnelInterfaceTypeInternal), - // Identifier: to.Ptr[int32](900), - // Port: to.Ptr[int32](15000), - // Protocol: to.Ptr(armnetwork.GatewayLoadBalancerTunnelProtocolVXLAN), - // }}, - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb2"), - // Name: to.Ptr("be-lb2"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // TunnelInterfaces: []*armnetwork.GatewayLoadBalancerTunnelInterface{ - // { - // Type: to.Ptr(armnetwork.GatewayLoadBalancerTunnelInterfaceTypeInternal), - // Identifier: to.Ptr[int32](901), - // Port: to.Ptr[int32](15001), - // Protocol: to.Ptr(armnetwork.GatewayLoadBalancerTunnelProtocolVXLAN), - // }}, - // }, - // }}, - // FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - // Name: to.Ptr("fe-lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/frontendIPConfigurations"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ - // InboundNatRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"), - // }}, - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // PrivateIPAddress: to.Ptr("10.0.1.4"), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), - // }, - // }, - // }}, - // InboundNatPools: []*armnetwork.InboundNatPool{ - // }, - // LoadBalancingRules: []*armnetwork.LoadBalancingRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // Name: to.Ptr("rulelb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/loadBalancingRules"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ - // BackendAddressPools: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb2"), - // }}, - // BackendPort: to.Ptr[int32](0), - // DisableOutboundSnat: to.Ptr(false), - // EnableFloatingIP: to.Ptr(true), - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - // }, - // FrontendPort: to.Ptr[int32](0), - // IdleTimeoutInMinutes: to.Ptr[int32](15), - // LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), - // Probe: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - // }, - // }}, - // OutboundRules: []*armnetwork.OutboundRule{ - // }, - // Probes: []*armnetwork.Probe{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), - // Name: to.Ptr("probe-lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/probes"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.ProbePropertiesFormat{ - // IntervalInSeconds: to.Ptr[int32](15), - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // NumberOfProbes: to.Ptr[int32](2), - // Port: to.Ptr[int32](80), - // ProbeThreshold: to.Ptr[int32](1), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RequestPath: to.Ptr("healthcheck.aspx"), - // Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // }, - // SKU: &armnetwork.LoadBalancerSKU{ - // Name: to.Ptr(armnetwork.LoadBalancerSKUNameStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/LoadBalancerCreateGlobalTier.json -func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancerWithGlobalTierAndOneRegionalLoadBalancerInItsBackendPool() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLoadBalancersClient().BeginCreateOrUpdate(ctx, "rg1", "lb", armnetwork.LoadBalancer{ - Location: to.Ptr("eastus"), - Properties: &armnetwork.LoadBalancerPropertiesFormat{ - BackendAddressPools: []*armnetwork.BackendAddressPool{ - { - Name: to.Ptr("be-lb"), - Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ - LoadBalancerBackendAddresses: []*armnetwork.LoadBalancerBackendAddress{ - { - Name: to.Ptr("regional-lb1-address"), - Properties: &armnetwork.LoadBalancerBackendAddressPropertiesFormat{ - LoadBalancerFrontendIPConfiguration: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/regional-lb-rg1/providers/Microsoft.Network/loadBalancers/regional-lb/frontendIPConfigurations/fe-rlb"), - }, - }, - }}, - }, - }}, - FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ - { - Name: to.Ptr("fe-lb"), - Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ - Subnet: &armnetwork.Subnet{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), - }, - }, - }}, - LoadBalancingRules: []*armnetwork.LoadBalancingRule{ - { - Name: to.Ptr("rulelb"), - Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ - BackendAddressPool: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), - }, - BackendPort: to.Ptr[int32](80), - EnableFloatingIP: to.Ptr(false), - FrontendIPConfiguration: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - }, - FrontendPort: to.Ptr[int32](80), - IdleTimeoutInMinutes: to.Ptr[int32](15), - LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), - Probe: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), - }, - Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - }, - }}, - Probes: []*armnetwork.Probe{ - { - Name: to.Ptr("probe-lb"), - Properties: &armnetwork.ProbePropertiesFormat{ - IntervalInSeconds: to.Ptr[int32](15), - NumberOfProbes: to.Ptr[int32](2), - Port: to.Ptr[int32](80), - ProbeThreshold: to.Ptr[int32](1), - RequestPath: to.Ptr("healthcheck.aspx"), - Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), - }, - }}, - }, - SKU: &armnetwork.LoadBalancerSKU{ - Name: to.Ptr(armnetwork.LoadBalancerSKUNameStandard), - Tier: to.Ptr(armnetwork.LoadBalancerSKUTierGlobal), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LoadBalancer = armnetwork.LoadBalancer{ - // Name: to.Ptr("lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb"), - // Location: to.Ptr("eastus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.LoadBalancerPropertiesFormat{ - // BackendAddressPools: []*armnetwork.BackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), - // Name: to.Ptr("be-lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ - // LoadBalancerBackendAddresses: []*armnetwork.LoadBalancerBackendAddress{ - // { - // Name: to.Ptr("regional-lb1-address"), - // Properties: &armnetwork.LoadBalancerBackendAddressPropertiesFormat{ - // LoadBalancerFrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/regional-lb-rg1/providers/Microsoft.Network/loadBalancers/regional-lb/frontendIPConfigurations/fe-rlb"), - // }, - // }, - // }}, - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - // Name: to.Ptr("fe-lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/frontendIPConfigurations"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ - // InboundNatRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"), - // }}, - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // PrivateIPAddress: to.Ptr("10.0.1.4"), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), - // }, - // }, - // }}, - // LoadBalancingRules: []*armnetwork.LoadBalancingRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // Name: to.Ptr("rulelb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/loadBalancingRules"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ - // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), - // }, - // BackendPort: to.Ptr[int32](80), - // DisableOutboundSnat: to.Ptr(false), - // EnableFloatingIP: to.Ptr(false), - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - // }, - // FrontendPort: to.Ptr[int32](80), - // IdleTimeoutInMinutes: to.Ptr[int32](15), - // LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), - // Probe: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - // }, - // }}, - // Probes: []*armnetwork.Probe{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), - // Name: to.Ptr("probe-lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/probes"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.ProbePropertiesFormat{ - // IntervalInSeconds: to.Ptr[int32](15), - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // NumberOfProbes: to.Ptr[int32](2), - // Port: to.Ptr[int32](80), - // ProbeThreshold: to.Ptr[int32](1), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RequestPath: to.Ptr("healthcheck.aspx"), - // Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // }, - // SKU: &armnetwork.LoadBalancerSKU{ - // Name: to.Ptr(armnetwork.LoadBalancerSKUNameStandard), - // Tier: to.Ptr(armnetwork.LoadBalancerSKUTierGlobal), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/LoadBalancerCreateStandardSku.json -func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancerWithStandardSku() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLoadBalancersClient().BeginCreateOrUpdate(ctx, "rg1", "lb", armnetwork.LoadBalancer{ - Location: to.Ptr("eastus"), - Properties: &armnetwork.LoadBalancerPropertiesFormat{ - BackendAddressPools: []*armnetwork.BackendAddressPool{ - { - Name: to.Ptr("be-lb"), - Properties: &armnetwork.BackendAddressPoolPropertiesFormat{}, - }}, - FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ - { - Name: to.Ptr("fe-lb"), - Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ - Subnet: &armnetwork.Subnet{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), - }, - }, - }}, - InboundNatPools: []*armnetwork.InboundNatPool{}, - InboundNatRules: []*armnetwork.InboundNatRule{ - { - Name: to.Ptr("in-nat-rule"), - Properties: &armnetwork.InboundNatRulePropertiesFormat{ - BackendPort: to.Ptr[int32](3389), - EnableFloatingIP: to.Ptr(true), - FrontendIPConfiguration: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - }, - FrontendPort: to.Ptr[int32](3389), - IdleTimeoutInMinutes: to.Ptr[int32](15), - Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - }, - }}, - LoadBalancingRules: []*armnetwork.LoadBalancingRule{ - { - Name: to.Ptr("rulelb"), - Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ - BackendAddressPool: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), - }, - BackendPort: to.Ptr[int32](80), - EnableFloatingIP: to.Ptr(true), - FrontendIPConfiguration: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - }, - FrontendPort: to.Ptr[int32](80), - IdleTimeoutInMinutes: to.Ptr[int32](15), - LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), - Probe: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), - }, - Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - }, - }}, - OutboundRules: []*armnetwork.OutboundRule{}, - Probes: []*armnetwork.Probe{ - { - Name: to.Ptr("probe-lb"), - Properties: &armnetwork.ProbePropertiesFormat{ - IntervalInSeconds: to.Ptr[int32](15), - NumberOfProbes: to.Ptr[int32](2), - Port: to.Ptr[int32](80), - ProbeThreshold: to.Ptr[int32](1), - RequestPath: to.Ptr("healthcheck.aspx"), - Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), - }, - }}, - }, - SKU: &armnetwork.LoadBalancerSKU{ - Name: to.Ptr(armnetwork.LoadBalancerSKUNameStandard), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LoadBalancer = armnetwork.LoadBalancer{ - // Name: to.Ptr("lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb"), - // Location: to.Ptr("eastus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.LoadBalancerPropertiesFormat{ - // BackendAddressPools: []*armnetwork.BackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), - // Name: to.Ptr("be-lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - // Name: to.Ptr("fe-lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/frontendIPConfigurations"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ - // InboundNatRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"), - // }}, - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // PrivateIPAddress: to.Ptr("10.0.1.4"), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), - // }, - // }, - // }}, - // InboundNatPools: []*armnetwork.InboundNatPool{ - // }, - // InboundNatRules: []*armnetwork.InboundNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"), - // Name: to.Ptr("in-nat-rule"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/inboundNatRules"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.InboundNatRulePropertiesFormat{ - // BackendPort: to.Ptr[int32](3389), - // EnableFloatingIP: to.Ptr(true), - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - // }, - // FrontendPort: to.Ptr[int32](3389), - // IdleTimeoutInMinutes: to.Ptr[int32](15), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - // }, - // }}, - // LoadBalancingRules: []*armnetwork.LoadBalancingRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // Name: to.Ptr("rulelb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/loadBalancingRules"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ - // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), - // }, - // BackendPort: to.Ptr[int32](80), - // DisableOutboundSnat: to.Ptr(false), - // EnableFloatingIP: to.Ptr(true), - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - // }, - // FrontendPort: to.Ptr[int32](80), - // IdleTimeoutInMinutes: to.Ptr[int32](15), - // LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), - // Probe: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - // }, - // }}, - // OutboundRules: []*armnetwork.OutboundRule{ - // }, - // Probes: []*armnetwork.Probe{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), - // Name: to.Ptr("probe-lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/probes"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.ProbePropertiesFormat{ - // IntervalInSeconds: to.Ptr[int32](15), - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // NumberOfProbes: to.Ptr[int32](2), - // Port: to.Ptr[int32](80), - // ProbeThreshold: to.Ptr[int32](1), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RequestPath: to.Ptr("healthcheck.aspx"), - // Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // }, - // SKU: &armnetwork.LoadBalancerSKU{ - // Name: to.Ptr(armnetwork.LoadBalancerSKUNameStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/LoadBalancerCreateWithInboundNatPool.json -func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancerWithInboundNatPool() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLoadBalancersClient().BeginCreateOrUpdate(ctx, "rg1", "lb", armnetwork.LoadBalancer{ - Location: to.Ptr("eastus"), - Properties: &armnetwork.LoadBalancerPropertiesFormat{ - BackendAddressPools: []*armnetwork.BackendAddressPool{}, - FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/test"), - Name: to.Ptr("test"), - Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ - PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - Subnet: &armnetwork.Subnet{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/lbvnet/subnets/lbsubnet"), - }, - }, - Zones: []*string{}, - }}, - InboundNatPools: []*armnetwork.InboundNatPool{ - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatPools/test"), - Name: to.Ptr("test"), - Properties: &armnetwork.InboundNatPoolPropertiesFormat{ - BackendPort: to.Ptr[int32](8888), - EnableFloatingIP: to.Ptr(true), - EnableTCPReset: to.Ptr(true), - FrontendIPConfiguration: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/test"), - }, - FrontendPortRangeEnd: to.Ptr[int32](8085), - FrontendPortRangeStart: to.Ptr[int32](8080), - IdleTimeoutInMinutes: to.Ptr[int32](10), - Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - }, - }}, - InboundNatRules: []*armnetwork.InboundNatRule{}, - LoadBalancingRules: []*armnetwork.LoadBalancingRule{}, - OutboundRules: []*armnetwork.OutboundRule{}, - Probes: []*armnetwork.Probe{}, - }, - SKU: &armnetwork.LoadBalancerSKU{ - Name: to.Ptr(armnetwork.LoadBalancerSKUNameStandard), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LoadBalancer = armnetwork.LoadBalancer{ - // Name: to.Ptr("lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb"), - // Location: to.Ptr("eastus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.LoadBalancerPropertiesFormat{ - // BackendAddressPools: []*armnetwork.BackendAddressPool{ - // }, - // FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/test"), - // Name: to.Ptr("test"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/frontendIPConfigurations"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ - // InboundNatPools: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatPools/test"), - // }}, - // PrivateIPAddress: to.Ptr("10.0.1.4"), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/lbvnet/subnets/lbsubnet"), - // }, - // }, - // }}, - // InboundNatPools: []*armnetwork.InboundNatPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatPools/test"), - // Name: to.Ptr("test"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/inboundNatPools"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.InboundNatPoolPropertiesFormat{ - // BackendPort: to.Ptr[int32](8888), - // EnableFloatingIP: to.Ptr(true), - // EnableTCPReset: to.Ptr(true), - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/test"), - // }, - // FrontendPortRangeEnd: to.Ptr[int32](8085), - // FrontendPortRangeStart: to.Ptr[int32](8080), - // IdleTimeoutInMinutes: to.Ptr[int32](10), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - // }, - // }}, - // InboundNatRules: []*armnetwork.InboundNatRule{ - // }, - // LoadBalancingRules: []*armnetwork.LoadBalancingRule{ - // }, - // OutboundRules: []*armnetwork.OutboundRule{ - // }, - // Probes: []*armnetwork.Probe{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // }, - // SKU: &armnetwork.LoadBalancerSKU{ - // Name: to.Ptr(armnetwork.LoadBalancerSKUNameStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/LoadBalancerCreateWithOutboundRules.json -func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancerWithOutboundRules() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLoadBalancersClient().BeginCreateOrUpdate(ctx, "rg1", "lb", armnetwork.LoadBalancer{ - Location: to.Ptr("eastus"), - Properties: &armnetwork.LoadBalancerPropertiesFormat{ - BackendAddressPools: []*armnetwork.BackendAddressPool{ - { - Name: to.Ptr("be-lb"), - Properties: &armnetwork.BackendAddressPoolPropertiesFormat{}, - }}, - FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ - { - Name: to.Ptr("fe-lb"), - Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ - PublicIPAddress: &armnetwork.PublicIPAddress{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pip"), - }, - }, - }}, - InboundNatPools: []*armnetwork.InboundNatPool{}, - InboundNatRules: []*armnetwork.InboundNatRule{ - { - Name: to.Ptr("in-nat-rule"), - Properties: &armnetwork.InboundNatRulePropertiesFormat{ - BackendPort: to.Ptr[int32](3389), - EnableFloatingIP: to.Ptr(true), - FrontendIPConfiguration: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - }, - FrontendPort: to.Ptr[int32](3389), - IdleTimeoutInMinutes: to.Ptr[int32](15), - Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - }, - }}, - LoadBalancingRules: []*armnetwork.LoadBalancingRule{ - { - Name: to.Ptr("rulelb"), - Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ - BackendAddressPool: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), - }, - BackendPort: to.Ptr[int32](80), - DisableOutboundSnat: to.Ptr(true), - EnableFloatingIP: to.Ptr(true), - FrontendIPConfiguration: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - }, - FrontendPort: to.Ptr[int32](80), - IdleTimeoutInMinutes: to.Ptr[int32](15), - LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), - Probe: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), - }, - Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - }, - }}, - OutboundRules: []*armnetwork.OutboundRule{ - { - Name: to.Ptr("rule1"), - Properties: &armnetwork.OutboundRulePropertiesFormat{ - BackendAddressPool: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), - }, - FrontendIPConfigurations: []*armnetwork.SubResource{ - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - }}, - Protocol: to.Ptr(armnetwork.LoadBalancerOutboundRuleProtocolAll), - }, - }}, - Probes: []*armnetwork.Probe{ - { - Name: to.Ptr("probe-lb"), - Properties: &armnetwork.ProbePropertiesFormat{ - IntervalInSeconds: to.Ptr[int32](15), - NumberOfProbes: to.Ptr[int32](2), - Port: to.Ptr[int32](80), - ProbeThreshold: to.Ptr[int32](1), - RequestPath: to.Ptr("healthcheck.aspx"), - Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), - }, - }}, - }, - SKU: &armnetwork.LoadBalancerSKU{ - Name: to.Ptr(armnetwork.LoadBalancerSKUNameStandard), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LoadBalancer = armnetwork.LoadBalancer{ - // Name: to.Ptr("lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb"), - // Location: to.Ptr("eastus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.LoadBalancerPropertiesFormat{ - // BackendAddressPools: []*armnetwork.BackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), - // Name: to.Ptr("be-lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // OutboundRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/outboundRules/rule1"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - // Name: to.Ptr("fe-lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/frontendIPConfigurations"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ - // InboundNatRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"), - // }}, - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // OutboundRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/outboundRules/rule1"), - // }}, - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.PublicIPAddress{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pip"), - // }, - // }, - // }}, - // InboundNatPools: []*armnetwork.InboundNatPool{ - // }, - // InboundNatRules: []*armnetwork.InboundNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"), - // Name: to.Ptr("in-nat-rule"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/inboundNatRules"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.InboundNatRulePropertiesFormat{ - // BackendPort: to.Ptr[int32](3389), - // EnableFloatingIP: to.Ptr(true), - // EnableTCPReset: to.Ptr(false), - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - // }, - // FrontendPort: to.Ptr[int32](3389), - // IdleTimeoutInMinutes: to.Ptr[int32](15), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - // }, - // }}, - // LoadBalancingRules: []*armnetwork.LoadBalancingRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // Name: to.Ptr("rulelb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/loadBalancingRules"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ - // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), - // }, - // BackendPort: to.Ptr[int32](80), - // DisableOutboundSnat: to.Ptr(true), - // EnableFloatingIP: to.Ptr(true), - // EnableTCPReset: to.Ptr(false), - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - // }, - // FrontendPort: to.Ptr[int32](80), - // IdleTimeoutInMinutes: to.Ptr[int32](15), - // LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), - // Probe: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - // }, - // }}, - // OutboundRules: []*armnetwork.OutboundRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/outboundRules/rule1"), - // Name: to.Ptr("rule1"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/outboundRules"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.OutboundRulePropertiesFormat{ - // AllocatedOutboundPorts: to.Ptr[int32](1024), - // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), - // }, - // EnableTCPReset: to.Ptr(false), - // FrontendIPConfigurations: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - // }}, - // IdleTimeoutInMinutes: to.Ptr[int32](4), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.LoadBalancerOutboundRuleProtocolAll), - // }, - // }}, - // Probes: []*armnetwork.Probe{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), - // Name: to.Ptr("probe-lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/probes"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.ProbePropertiesFormat{ - // IntervalInSeconds: to.Ptr[int32](15), - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // NumberOfProbes: to.Ptr[int32](2), - // Port: to.Ptr[int32](80), - // ProbeThreshold: to.Ptr[int32](1), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RequestPath: to.Ptr("healthcheck.aspx"), - // Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // }, - // SKU: &armnetwork.LoadBalancerSKU{ - // Name: to.Ptr(armnetwork.LoadBalancerSKUNameStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/LoadBalancerUpdateTags.json -func ExampleLoadBalancersClient_UpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLoadBalancersClient().UpdateTags(ctx, "rg1", "lb", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LoadBalancer = armnetwork.LoadBalancer{ - // Name: to.Ptr("lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armnetwork.LoadBalancerPropertiesFormat{ - // BackendAddressPools: []*armnetwork.BackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), - // Name: to.Ptr("be-lb"), - // Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - // Name: to.Ptr("fe-lb"), - // Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ - // InboundNatRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"), - // }}, - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // PrivateIPAddress: to.Ptr("10.0.1.4"), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), - // }, - // }, - // }}, - // InboundNatPools: []*armnetwork.InboundNatPool{ - // }, - // InboundNatRules: []*armnetwork.InboundNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/in-nat-rule"), - // Name: to.Ptr("in-nat-rule"), - // Properties: &armnetwork.InboundNatRulePropertiesFormat{ - // BackendPort: to.Ptr[int32](3389), - // EnableFloatingIP: to.Ptr(true), - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - // }, - // FrontendPort: to.Ptr[int32](3389), - // IdleTimeoutInMinutes: to.Ptr[int32](15), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - // }, - // }}, - // LoadBalancingRules: []*armnetwork.LoadBalancingRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // Name: to.Ptr("rulelb"), - // Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ - // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), - // }, - // BackendPort: to.Ptr[int32](80), - // DisableOutboundSnat: to.Ptr(false), - // EnableFloatingIP: to.Ptr(true), - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - // }, - // FrontendPort: to.Ptr[int32](80), - // IdleTimeoutInMinutes: to.Ptr[int32](15), - // LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), - // Probe: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - // }, - // }}, - // OutboundRules: []*armnetwork.OutboundRule{ - // }, - // Probes: []*armnetwork.Probe{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), - // Name: to.Ptr("probe-lb"), - // Properties: &armnetwork.ProbePropertiesFormat{ - // IntervalInSeconds: to.Ptr[int32](15), - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // NumberOfProbes: to.Ptr[int32](2), - // Port: to.Ptr[int32](80), - // ProbeThreshold: to.Ptr[int32](1), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RequestPath: to.Ptr("healthcheck.aspx"), - // Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/LoadBalancerListAll.json -func ExampleLoadBalancersClient_NewListAllPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLoadBalancersClient().NewListAllPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.LoadBalancerListResult = armnetwork.LoadBalancerListResult{ - // Value: []*armnetwork.LoadBalancer{ - // { - // Name: to.Ptr("lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.LoadBalancerPropertiesFormat{ - // BackendAddressPools: []*armnetwork.BackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/belb"), - // Name: to.Ptr("belb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/felb"), - // Name: to.Ptr("felb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/frontendIPConfigurations"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ - // InboundNatRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/inrlb"), - // }}, - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // PrivateIPAddress: to.Ptr("10.0.1.4"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), - // }, - // }, - // }}, - // InboundNatPools: []*armnetwork.InboundNatPool{ - // }, - // InboundNatRules: []*armnetwork.InboundNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/inrlb"), - // Name: to.Ptr("inrlb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/inboundNatRules"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.InboundNatRulePropertiesFormat{ - // BackendPort: to.Ptr[int32](3389), - // EnableFloatingIP: to.Ptr(true), - // EnableTCPReset: to.Ptr(true), - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/felb"), - // }, - // FrontendPort: to.Ptr[int32](3389), - // IdleTimeoutInMinutes: to.Ptr[int32](15), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - // }, - // }}, - // LoadBalancingRules: []*armnetwork.LoadBalancingRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // Name: to.Ptr("rulelb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/loadBalancingRules"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ - // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/belb"), - // }, - // BackendPort: to.Ptr[int32](80), - // EnableFloatingIP: to.Ptr(true), - // EnableTCPReset: to.Ptr(true), - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/felb"), - // }, - // FrontendPort: to.Ptr[int32](80), - // IdleTimeoutInMinutes: to.Ptr[int32](15), - // LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), - // Probe: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/prlb"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - // }, - // }}, - // Probes: []*armnetwork.Probe{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/prlb"), - // Name: to.Ptr("prlb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/probes"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.ProbePropertiesFormat{ - // IntervalInSeconds: to.Ptr[int32](15), - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // NumberOfProbes: to.Ptr[int32](2), - // Port: to.Ptr[int32](80), - // ProbeThreshold: to.Ptr[int32](1), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RequestPath: to.Ptr("healthcheck.aspx"), - // Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // }, - // SKU: &armnetwork.LoadBalancerSKU{ - // Name: to.Ptr(armnetwork.LoadBalancerSKUNameBasic), - // }, - // }, - // { - // Name: to.Ptr("lb3"), - // Type: to.Ptr("Microsoft.Network/loadBalancers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/loadBalancers/lb3"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.LoadBalancerPropertiesFormat{ - // BackendAddressPools: []*armnetwork.BackendAddressPool{ - // }, - // FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ - // }, - // InboundNatPools: []*armnetwork.InboundNatPool{ - // }, - // InboundNatRules: []*armnetwork.InboundNatRule{ - // }, - // LoadBalancingRules: []*armnetwork.LoadBalancingRule{ - // }, - // Probes: []*armnetwork.Probe{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // }, - // SKU: &armnetwork.LoadBalancerSKU{ - // Name: to.Ptr(armnetwork.LoadBalancerSKUNameBasic), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/LoadBalancerList.json -func ExampleLoadBalancersClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLoadBalancersClient().NewListPager("rg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.LoadBalancerListResult = armnetwork.LoadBalancerListResult{ - // Value: []*armnetwork.LoadBalancer{ - // { - // Name: to.Ptr("lb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.LoadBalancerPropertiesFormat{ - // BackendAddressPools: []*armnetwork.BackendAddressPool{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/belb"), - // Name: to.Ptr("belb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/backendAddressPools"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/felb"), - // Name: to.Ptr("felb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/frontendIPConfigurations"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.FrontendIPConfigurationPropertiesFormat{ - // InboundNatRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/inrlb"), - // }}, - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // PrivateIPAddress: to.Ptr("10.0.1.4"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), - // }, - // }, - // }}, - // InboundNatPools: []*armnetwork.InboundNatPool{ - // }, - // InboundNatRules: []*armnetwork.InboundNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatRules/inrlb"), - // Name: to.Ptr("inrlb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/inboundNatRules"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.InboundNatRulePropertiesFormat{ - // BackendPort: to.Ptr[int32](3389), - // EnableFloatingIP: to.Ptr(true), - // EnableTCPReset: to.Ptr(true), - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/felb"), - // }, - // FrontendPort: to.Ptr[int32](3389), - // IdleTimeoutInMinutes: to.Ptr[int32](15), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - // }, - // }}, - // LoadBalancingRules: []*armnetwork.LoadBalancingRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // Name: to.Ptr("rulelb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/loadBalancingRules"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ - // BackendAddressPool: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/belb"), - // }, - // BackendPort: to.Ptr[int32](80), - // EnableFloatingIP: to.Ptr(true), - // EnableTCPReset: to.Ptr(true), - // FrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/felb"), - // }, - // FrontendPort: to.Ptr[int32](80), - // IdleTimeoutInMinutes: to.Ptr[int32](15), - // LoadDistribution: to.Ptr(armnetwork.LoadDistributionDefault), - // Probe: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/prlb"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - // }, - // }}, - // Probes: []*armnetwork.Probe{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/prlb"), - // Name: to.Ptr("prlb"), - // Type: to.Ptr("Microsoft.Network/loadBalancers/probes"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.ProbePropertiesFormat{ - // IntervalInSeconds: to.Ptr[int32](15), - // LoadBalancingRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/loadBalancingRules/rulelb"), - // }}, - // NumberOfProbes: to.Ptr[int32](2), - // Port: to.Ptr[int32](80), - // ProbeThreshold: to.Ptr[int32](1), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RequestPath: to.Ptr("healthcheck.aspx"), - // Protocol: to.Ptr(armnetwork.ProbeProtocolHTTP), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // }, - // SKU: &armnetwork.LoadBalancerSKU{ - // Name: to.Ptr(armnetwork.LoadBalancerSKUNameBasic), - // }, - // }, - // { - // Name: to.Ptr("lb2"), - // Type: to.Ptr("Microsoft.Network/loadBalancers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb2"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.LoadBalancerPropertiesFormat{ - // BackendAddressPools: []*armnetwork.BackendAddressPool{ - // }, - // FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ - // }, - // InboundNatPools: []*armnetwork.InboundNatPool{ - // }, - // InboundNatRules: []*armnetwork.InboundNatRule{ - // }, - // LoadBalancingRules: []*armnetwork.LoadBalancingRule{ - // }, - // Probes: []*armnetwork.Probe{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // }, - // SKU: &armnetwork.LoadBalancerSKU{ - // Name: to.Ptr(armnetwork.LoadBalancerSKUNameBasic), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/LoadBalancersSwapPublicIpAddresses.json -func ExampleLoadBalancersClient_BeginSwapPublicIPAddresses() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLoadBalancersClient().BeginSwapPublicIPAddresses(ctx, "westus", armnetwork.LoadBalancerVipSwapRequest{ - FrontendIPConfigurations: []*armnetwork.LoadBalancerVipSwapRequestFrontendIPConfiguration{ - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/lbfe1"), - Properties: &armnetwork.LoadBalancerVipSwapRequestFrontendIPConfigurationProperties{ - PublicIPAddress: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/publicIPAddresses/pip2"), - }, - }, - }, - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/loadBalancers/lb2/frontendIPConfigurations/lbfe2"), - Properties: &armnetwork.LoadBalancerVipSwapRequestFrontendIPConfigurationProperties{ - PublicIPAddress: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pip1"), - }, - }, - }}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/QueryInboundNatRulePortMapping.json -func ExampleLoadBalancersClient_BeginListInboundNatRulePortMappings() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLoadBalancersClient().BeginListInboundNatRulePortMappings(ctx, "rg1", "lb1", "bp1", armnetwork.QueryInboundNatRulePortMappingRequest{ - IPAddress: to.Ptr("10.0.0.4"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.BackendAddressInboundNatRulePortMappings = armnetwork.BackendAddressInboundNatRulePortMappings{ - // InboundNatRulePortMappings: []*armnetwork.InboundNatRulePortMapping{ - // { - // BackendPort: to.Ptr[int32](3389), - // FrontendPort: to.Ptr[int32](3389), - // InboundNatRuleName: to.Ptr("natRule"), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - // }}, - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/localnetworkgateways_client.go b/sdk/resourcemanager/network/armnetwork/localnetworkgateways_client.go index 28470865d77f..ac74806cb78b 100644 --- a/sdk/resourcemanager/network/armnetwork/localnetworkgateways_client.go +++ b/sdk/resourcemanager/network/armnetwork/localnetworkgateways_client.go @@ -47,7 +47,7 @@ func NewLocalNetworkGatewaysClient(subscriptionID string, credential azcore.Toke // BeginCreateOrUpdate - Creates or updates a local network gateway in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - localNetworkGatewayName - The name of the local network gateway. // - parameters - Parameters supplied to the create or update local network gateway operation. @@ -71,7 +71,7 @@ func (client *LocalNetworkGatewaysClient) BeginCreateOrUpdate(ctx context.Contex // CreateOrUpdate - Creates or updates a local network gateway in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *LocalNetworkGatewaysClient) createOrUpdate(ctx context.Context, resourceGroupName string, localNetworkGatewayName string, parameters LocalNetworkGateway, options *LocalNetworkGatewaysClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "LocalNetworkGatewaysClient.BeginCreateOrUpdate" @@ -113,7 +113,7 @@ func (client *LocalNetworkGatewaysClient) createOrUpdateCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -125,7 +125,7 @@ func (client *LocalNetworkGatewaysClient) createOrUpdateCreateRequest(ctx contex // BeginDelete - Deletes the specified local network gateway. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - localNetworkGatewayName - The name of the local network gateway. // - options - LocalNetworkGatewaysClientBeginDeleteOptions contains the optional parameters for the LocalNetworkGatewaysClient.BeginDelete @@ -148,7 +148,7 @@ func (client *LocalNetworkGatewaysClient) BeginDelete(ctx context.Context, resou // Delete - Deletes the specified local network gateway. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *LocalNetworkGatewaysClient) deleteOperation(ctx context.Context, resourceGroupName string, localNetworkGatewayName string, options *LocalNetworkGatewaysClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "LocalNetworkGatewaysClient.BeginDelete" @@ -190,7 +190,7 @@ func (client *LocalNetworkGatewaysClient) deleteCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -199,7 +199,7 @@ func (client *LocalNetworkGatewaysClient) deleteCreateRequest(ctx context.Contex // Get - Gets the specified local network gateway in a resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - localNetworkGatewayName - The name of the local network gateway. // - options - LocalNetworkGatewaysClientGetOptions contains the optional parameters for the LocalNetworkGatewaysClient.Get @@ -246,7 +246,7 @@ func (client *LocalNetworkGatewaysClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -263,7 +263,7 @@ func (client *LocalNetworkGatewaysClient) getHandleResponse(resp *http.Response) // NewListPager - Gets all the local network gateways in a resource group. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - options - LocalNetworkGatewaysClientListOptions contains the optional parameters for the LocalNetworkGatewaysClient.NewListPager // method. @@ -313,7 +313,7 @@ func (client *LocalNetworkGatewaysClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -331,7 +331,7 @@ func (client *LocalNetworkGatewaysClient) listHandleResponse(resp *http.Response // UpdateTags - Updates a local network gateway tags. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - localNetworkGatewayName - The name of the local network gateway. // - parameters - Parameters supplied to update local network gateway tags. @@ -379,7 +379,7 @@ func (client *LocalNetworkGatewaysClient) updateTagsCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/localnetworkgateways_client_example_test.go b/sdk/resourcemanager/network/armnetwork/localnetworkgateways_client_example_test.go deleted file mode 100644 index b9c229775e06..000000000000 --- a/sdk/resourcemanager/network/armnetwork/localnetworkgateways_client_example_test.go +++ /dev/null @@ -1,230 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/LocalNetworkGatewayCreate.json -func ExampleLocalNetworkGatewaysClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLocalNetworkGatewaysClient().BeginCreateOrUpdate(ctx, "rg1", "localgw", armnetwork.LocalNetworkGateway{ - Location: to.Ptr("Central US"), - Properties: &armnetwork.LocalNetworkGatewayPropertiesFormat{ - Fqdn: to.Ptr("site1.contoso.com"), - GatewayIPAddress: to.Ptr("11.12.13.14"), - LocalNetworkAddressSpace: &armnetwork.AddressSpace{ - AddressPrefixes: []*string{ - to.Ptr("10.1.0.0/16")}, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LocalNetworkGateway = armnetwork.LocalNetworkGateway{ - // Name: to.Ptr("localgw"), - // Type: to.Ptr("Microsoft.Network/localNetworkGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/localNetworkGateways/localgw"), - // Location: to.Ptr("centralus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.LocalNetworkGatewayPropertiesFormat{ - // GatewayIPAddress: to.Ptr("11.12.13.14"), - // LocalNetworkAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("10.1.0.0/16")}, - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/LocalNetworkGatewayGet.json -func ExampleLocalNetworkGatewaysClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLocalNetworkGatewaysClient().Get(ctx, "rg1", "localgw", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LocalNetworkGateway = armnetwork.LocalNetworkGateway{ - // Name: to.Ptr("localgw"), - // Type: to.Ptr("Microsoft.Network/localNetworkGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/localNetworkGateways/localgw"), - // Location: to.Ptr("centralus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.LocalNetworkGatewayPropertiesFormat{ - // GatewayIPAddress: to.Ptr("x.x.x.x"), - // LocalNetworkAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("10.1.0.0/16")}, - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/LocalNetworkGatewayDelete.json -func ExampleLocalNetworkGatewaysClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLocalNetworkGatewaysClient().BeginDelete(ctx, "rg1", "localgw", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/LocalNetworkGatewayUpdateTags.json -func ExampleLocalNetworkGatewaysClient_UpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLocalNetworkGatewaysClient().UpdateTags(ctx, "rg1", "lgw", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LocalNetworkGateway = armnetwork.LocalNetworkGateway{ - // Name: to.Ptr("lgw"), - // Type: to.Ptr("Microsoft.Network/localNetworkGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/localNetworkGateways/lgw"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armnetwork.LocalNetworkGatewayPropertiesFormat{ - // GatewayIPAddress: to.Ptr("12.0.0.1"), - // LocalNetworkAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("12.0.0.0/8")}, - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/LocalNetworkGatewayList.json -func ExampleLocalNetworkGatewaysClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLocalNetworkGatewaysClient().NewListPager("rg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.LocalNetworkGatewayListResult = armnetwork.LocalNetworkGatewayListResult{ - // Value: []*armnetwork.LocalNetworkGateway{ - // { - // Name: to.Ptr("localgw1"), - // Type: to.Ptr("Microsoft.Network/localNetworkGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/localNetworkGateways/localgw1"), - // Location: to.Ptr("centralus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.LocalNetworkGatewayPropertiesFormat{ - // GatewayIPAddress: to.Ptr("x.x.x.x"), - // LocalNetworkAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("10.1.0.0/16")}, - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // }, - // { - // Name: to.Ptr("localgw2"), - // Type: to.Ptr("Microsoft.Network/localNetworkGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/localNetworkGateways/localgw2"), - // Location: to.Ptr("eastus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.LocalNetworkGatewayPropertiesFormat{ - // GatewayIPAddress: to.Ptr("x.x.x.x"), - // LocalNetworkAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("10.2.0.0/16")}, - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/management_client.go b/sdk/resourcemanager/network/armnetwork/management_client.go index c13ca2ca01be..e9971bc9267a 100644 --- a/sdk/resourcemanager/network/armnetwork/management_client.go +++ b/sdk/resourcemanager/network/armnetwork/management_client.go @@ -48,7 +48,7 @@ func NewManagementClient(subscriptionID string, credential azcore.TokenCredentia // CheckDNSNameAvailability - Checks whether a domain name in the cloudapp.azure.com zone is available for use. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - location - The location of the domain name. // - domainNameLabel - The domain name to be verified. It must conform to the following regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. // - options - ManagementClientCheckDNSNameAvailabilityOptions contains the optional parameters for the ManagementClient.CheckDNSNameAvailability @@ -92,7 +92,7 @@ func (client *ManagementClient) checkDNSNameAvailabilityCreateRequest(ctx contex } reqQP := req.Raw().URL.Query() reqQP.Set("domainNameLabel", domainNameLabel) - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -110,7 +110,7 @@ func (client *ManagementClient) checkDNSNameAvailabilityHandleResponse(resp *htt // BeginDeleteBastionShareableLink - Deletes the Bastion Shareable Links for all the VMs specified in the request. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - bastionHostName - The name of the Bastion Host. // - bslRequest - Post request for all the Bastion Shareable Link endpoints. @@ -134,7 +134,7 @@ func (client *ManagementClient) BeginDeleteBastionShareableLink(ctx context.Cont // DeleteBastionShareableLink - Deletes the Bastion Shareable Links for all the VMs specified in the request. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *ManagementClient) deleteBastionShareableLink(ctx context.Context, resourceGroupName string, bastionHostName string, bslRequest BastionShareableLinkListRequest, options *ManagementClientBeginDeleteBastionShareableLinkOptions) (*http.Response, error) { var err error const operationName = "ManagementClient.BeginDeleteBastionShareableLink" @@ -176,7 +176,7 @@ func (client *ManagementClient) deleteBastionShareableLinkCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, bslRequest); err != nil { @@ -187,7 +187,7 @@ func (client *ManagementClient) deleteBastionShareableLinkCreateRequest(ctx cont // NewDisconnectActiveSessionsPager - Returns the list of currently active sessions on the Bastion. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - bastionHostName - The name of the Bastion Host. // - sessionIDs - The list of sessionids to disconnect. @@ -243,7 +243,7 @@ func (client *ManagementClient) disconnectActiveSessionsCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, sessionIDs); err != nil { @@ -264,7 +264,7 @@ func (client *ManagementClient) disconnectActiveSessionsHandleResponse(resp *htt // ExpressRouteProviderPort - Retrieves detail of a provider port. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - providerport - The name of the provider port. // - options - ManagementClientExpressRouteProviderPortOptions contains the optional parameters for the ManagementClient.ExpressRouteProviderPort // method. @@ -306,7 +306,7 @@ func (client *ManagementClient) expressRouteProviderPortCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -325,7 +325,7 @@ func (client *ManagementClient) expressRouteProviderPortHandleResponse(resp *htt // and associated VpnServerConfiguration combination in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name. // - virtualWANName - The name of the VirtualWAN whose associated VpnServerConfigurations is needed. // - vpnClientParams - Parameters supplied to the generate VirtualWan VPN profile generation operation. @@ -350,7 +350,7 @@ func (client *ManagementClient) BeginGeneratevirtualwanvpnserverconfigurationvpn // associated VpnServerConfiguration combination in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *ManagementClient) generatevirtualwanvpnserverconfigurationvpnprofile(ctx context.Context, resourceGroupName string, virtualWANName string, vpnClientParams VirtualWanVPNProfileParameters, options *ManagementClientBeginGeneratevirtualwanvpnserverconfigurationvpnprofileOptions) (*http.Response, error) { var err error const operationName = "ManagementClient.BeginGeneratevirtualwanvpnserverconfigurationvpnprofile" @@ -392,7 +392,7 @@ func (client *ManagementClient) generatevirtualwanvpnserverconfigurationvpnprofi return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, vpnClientParams); err != nil { @@ -403,7 +403,7 @@ func (client *ManagementClient) generatevirtualwanvpnserverconfigurationvpnprofi // BeginGetActiveSessions - Returns the list of currently active sessions on the Bastion. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - bastionHostName - The name of the Bastion Host. // - options - ManagementClientBeginGetActiveSessionsOptions contains the optional parameters for the ManagementClient.BeginGetActiveSessions @@ -449,7 +449,7 @@ func (client *ManagementClient) BeginGetActiveSessions(ctx context.Context, reso // GetActiveSessions - Returns the list of currently active sessions on the Bastion. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *ManagementClient) getActiveSessions(ctx context.Context, resourceGroupName string, bastionHostName string, options *ManagementClientBeginGetActiveSessionsOptions) (*http.Response, error) { var err error const operationName = "ManagementClient.BeginGetActiveSessions" @@ -491,7 +491,7 @@ func (client *ManagementClient) getActiveSessionsCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -508,7 +508,7 @@ func (client *ManagementClient) getActiveSessionsHandleResponse(resp *http.Respo // NewGetBastionShareableLinkPager - Return the Bastion Shareable Links for all the VMs specified in the request. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - bastionHostName - The name of the Bastion Host. // - bslRequest - Post request for all the Bastion Shareable Link endpoints. @@ -564,7 +564,7 @@ func (client *ManagementClient) getBastionShareableLinkCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, bslRequest); err != nil { @@ -585,7 +585,7 @@ func (client *ManagementClient) getBastionShareableLinkHandleResponse(resp *http // ListActiveConnectivityConfigurations - Lists active connectivity configurations in a network manager. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - parameters - Active Configuration Parameter. @@ -633,7 +633,7 @@ func (client *ManagementClient) listActiveConnectivityConfigurationsCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } @@ -657,7 +657,7 @@ func (client *ManagementClient) listActiveConnectivityConfigurationsHandleRespon // ListActiveSecurityAdminRules - Lists active security admin rules in a network manager. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - parameters - Active Configuration Parameter. @@ -705,7 +705,7 @@ func (client *ManagementClient) listActiveSecurityAdminRulesCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } @@ -730,7 +730,7 @@ func (client *ManagementClient) listActiveSecurityAdminRulesHandleResponse(resp // network. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkName - The name of the virtual network. // - parameters - Parameters supplied to list correct page. @@ -778,7 +778,7 @@ func (client *ManagementClient) listNetworkManagerEffectiveConnectivityConfigura return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } @@ -802,7 +802,7 @@ func (client *ManagementClient) listNetworkManagerEffectiveConnectivityConfigura // ListNetworkManagerEffectiveSecurityAdminRules - List all effective security admin rules applied on a virtual network. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkName - The name of the virtual network. // - parameters - Parameters supplied to list correct page. @@ -850,7 +850,7 @@ func (client *ManagementClient) listNetworkManagerEffectiveSecurityAdminRulesCre return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } @@ -873,7 +873,7 @@ func (client *ManagementClient) listNetworkManagerEffectiveSecurityAdminRulesHan // BeginPutBastionShareableLink - Creates a Bastion Shareable Links for all the VMs specified in the request. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - bastionHostName - The name of the Bastion Host. // - bslRequest - Post request for all the Bastion Shareable Link endpoints. @@ -920,7 +920,7 @@ func (client *ManagementClient) BeginPutBastionShareableLink(ctx context.Context // PutBastionShareableLink - Creates a Bastion Shareable Links for all the VMs specified in the request. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *ManagementClient) putBastionShareableLink(ctx context.Context, resourceGroupName string, bastionHostName string, bslRequest BastionShareableLinkListRequest, options *ManagementClientBeginPutBastionShareableLinkOptions) (*http.Response, error) { var err error const operationName = "ManagementClient.BeginPutBastionShareableLink" @@ -962,7 +962,7 @@ func (client *ManagementClient) putBastionShareableLinkCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, bslRequest); err != nil { @@ -983,7 +983,7 @@ func (client *ManagementClient) putBastionShareableLinkHandleResponse(resp *http // SupportedSecurityProviders - Gives the supported security providers for the virtual wan. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name. // - virtualWANName - The name of the VirtualWAN for which supported security providers are needed. // - options - ManagementClientSupportedSecurityProvidersOptions contains the optional parameters for the ManagementClient.SupportedSecurityProviders @@ -1030,7 +1030,7 @@ func (client *ManagementClient) supportedSecurityProvidersCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/management_client_example_test.go b/sdk/resourcemanager/network/armnetwork/management_client_example_test.go deleted file mode 100644 index 53df5a25cf74..000000000000 --- a/sdk/resourcemanager/network/armnetwork/management_client_example_test.go +++ /dev/null @@ -1,629 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/BastionShareableLinkCreate.json -func ExampleManagementClient_BeginPutBastionShareableLink() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagementClient().BeginPutBastionShareableLink(ctx, "rg1", "bastionhosttenant", armnetwork.BastionShareableLinkListRequest{ - VMs: []*armnetwork.BastionShareableLink{ - { - VM: &armnetwork.VM{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm1"), - }, - }, - { - VM: &armnetwork.VM{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm2"), - }, - }}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - for res.More() { - page, err := res.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.BastionShareableLinkListResult = armnetwork.BastionShareableLinkListResult{ - // Value: []*armnetwork.BastionShareableLink{ - // { - // Bsl: to.Ptr("http://bst-bastionhostid.bastion.com/api/shareable-url/tokenvm1"), - // CreatedAt: to.Ptr("2019-10-18T12:00:00.0000Z"), - // VM: &armnetwork.VM{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm1"), - // }, - // }, - // { - // Bsl: to.Ptr("http://bst-bastionhostid.bastion.com/api/shareable-url/tokenvm2"), - // CreatedAt: to.Ptr("2019-10-17T12:00:00.0000Z"), - // VM: &armnetwork.VM{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm2"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/BastionShareableLinkDelete.json -func ExampleManagementClient_BeginDeleteBastionShareableLink() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagementClient().BeginDeleteBastionShareableLink(ctx, "rg1", "bastionhosttenant", armnetwork.BastionShareableLinkListRequest{ - VMs: []*armnetwork.BastionShareableLink{ - { - VM: &armnetwork.VM{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm1"), - }, - }, - { - VM: &armnetwork.VM{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm2"), - }, - }}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/BastionShareableLinkGet.json -func ExampleManagementClient_NewGetBastionShareableLinkPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagementClient().NewGetBastionShareableLinkPager("rg1", "bastionhosttenant", armnetwork.BastionShareableLinkListRequest{ - VMs: []*armnetwork.BastionShareableLink{ - { - VM: &armnetwork.VM{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm1"), - }, - }, - { - VM: &armnetwork.VM{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm2"), - }, - }}, - }, nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.BastionShareableLinkListResult = armnetwork.BastionShareableLinkListResult{ - // Value: []*armnetwork.BastionShareableLink{ - // { - // Bsl: to.Ptr("http://bst-bastionhostid.bastion.com/api/shareable-url/tokenvm1"), - // CreatedAt: to.Ptr("2019-10-18T12:00:00.0000Z"), - // VM: &armnetwork.VM{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm1"), - // }, - // }, - // { - // Bsl: to.Ptr("http://bst-bastionhostid.bastion.com/api/shareable-url/tokenvm2"), - // CreatedAt: to.Ptr("2019-10-17T12:00:00.0000Z"), - // VM: &armnetwork.VM{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm2"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/BastionSessionsList.json -func ExampleManagementClient_BeginGetActiveSessions() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagementClient().BeginGetActiveSessions(ctx, "rg1", "bastionhosttenant", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - for res.More() { - page, err := res.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.BastionActiveSessionListResult = armnetwork.BastionActiveSessionListResult{ - // Value: []*armnetwork.BastionActiveSession{ - // { - // ResourceType: to.Ptr("VM"), - // SessionDurationInMins: to.Ptr[float32](0), - // SessionID: to.Ptr("sessionId"), - // StartTime: "2019-1-1T12:00:00.0000Z", - // TargetHostName: to.Ptr("vm01"), - // TargetIPAddress: to.Ptr("1.1.1.1"), - // TargetResourceGroup: to.Ptr("rg1"), - // TargetResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/vm01"), - // TargetSubscriptionID: to.Ptr("subid"), - // UserName: to.Ptr("user"), - // Protocol: to.Ptr(armnetwork.BastionConnectProtocolSSH), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/BastionSessionDelete.json -func ExampleManagementClient_NewDisconnectActiveSessionsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagementClient().NewDisconnectActiveSessionsPager("rg1", "bastionhosttenant", armnetwork.SessionIDs{}, nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.BastionSessionDeleteResult = armnetwork.BastionSessionDeleteResult{ - // Value: []*armnetwork.BastionSessionState{ - // { - // Message: to.Ptr("session session1 invalidated!"), - // SessionID: to.Ptr("session1"), - // State: to.Ptr("Disconnected"), - // }, - // { - // Message: to.Ptr("session session2 could not be disconnected!"), - // SessionID: to.Ptr("session2"), - // State: to.Ptr("Failed"), - // }, - // { - // Message: to.Ptr("session session3 not found!"), - // SessionID: to.Ptr("session3"), - // State: to.Ptr("NotFound"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/CheckDnsNameAvailability.json -func ExampleManagementClient_CheckDNSNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagementClient().CheckDNSNameAvailability(ctx, "westus", "testdns", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DNSNameAvailabilityResult = armnetwork.DNSNameAvailabilityResult{ - // Available: to.Ptr(false), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/expressRouteProviderPort.json -func ExampleManagementClient_ExpressRouteProviderPort() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagementClient().ExpressRouteProviderPort(ctx, "abc", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ExpressRouteProviderPort = armnetwork.ExpressRouteProviderPort{ - // Type: to.Ptr("Microsoft.Network/expressRouteProviderPort"), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/ExpressRoutePortsLocations/SiliconValley/bvtazureixpportpair1"), - // Location: to.Ptr("uswest"), - // Etag: to.Ptr("W/\"c0e6477e-8150-4d4f-9bf6-bb10e6acb63a\""), - // Properties: &armnetwork.ExpressRouteProviderPortProperties{ - // OverprovisionFactor: to.Ptr[int32](4), - // PeeringLocation: to.Ptr("SiliconValley"), - // PortBandwidthInMbps: to.Ptr[int32](4000), - // PortPairDescriptor: to.Ptr("bvtazureixpportpair1"), - // PrimaryAzurePort: to.Ptr("bvtazureixp01"), - // RemainingBandwidthInMbps: to.Ptr[int32](1500), - // SecondaryAzurePort: to.Ptr("bvtazureixp01"), - // UsedBandwidthInMbps: to.Ptr[int32](2500), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkManagerActiveConnectivityConfigurationsList.json -func ExampleManagementClient_ListActiveConnectivityConfigurations() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagementClient().ListActiveConnectivityConfigurations(ctx, "myResourceGroup", "testNetworkManager", armnetwork.ActiveConfigurationParameter{ - Regions: []*string{ - to.Ptr("westus")}, - SkipToken: to.Ptr("fakeSkipTokenCode"), - }, &armnetwork.ManagementClientListActiveConnectivityConfigurationsOptions{Top: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ActiveConnectivityConfigurationsListResult = armnetwork.ActiveConnectivityConfigurationsListResult{ - // SkipToken: to.Ptr("FakeSkipTokenCode"), - // Value: []*armnetwork.ActiveConnectivityConfiguration{ - // { - // ConfigurationGroups: []*armnetwork.ConfigurationGroup{ - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroup/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/group1"), - // Properties: &armnetwork.GroupProperties{ - // Description: to.Ptr("A group for all test Virtual Networks"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/connectivityConfigurations/myTestConnectivityConfig"), - // Properties: &armnetwork.ConnectivityConfigurationProperties{ - // Description: to.Ptr("Sample Configuration"), - // AppliesToGroups: []*armnetwork.ConnectivityGroupItem{ - // { - // GroupConnectivity: to.Ptr(armnetwork.GroupConnectivityNone), - // IsGlobal: to.Ptr(armnetwork.IsGlobalFalse), - // NetworkGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/group1"), - // UseHubGateway: to.Ptr(armnetwork.UseHubGatewayTrue), - // }}, - // ConnectivityTopology: to.Ptr(armnetwork.ConnectivityTopologyHubAndSpoke), - // DeleteExistingPeering: to.Ptr(armnetwork.DeleteExistingPeeringTrue), - // Hubs: []*armnetwork.Hub{ - // { - // ResourceID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myTestConnectivityConfig"), - // ResourceType: to.Ptr("Microsoft.Network/virtualNetworks"), - // }}, - // IsGlobal: to.Ptr(armnetwork.IsGlobalTrue), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // CommitTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-07-10T18:03:22.2578238+05:30"); return t}()), - // Region: to.Ptr("westus"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkManagerActiveSecurityAdminRulesList.json -func ExampleManagementClient_ListActiveSecurityAdminRules() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagementClient().ListActiveSecurityAdminRules(ctx, "myResourceGroup", "testNetworkManager", armnetwork.ActiveConfigurationParameter{ - Regions: []*string{ - to.Ptr("westus")}, - SkipToken: to.Ptr("fakeSkipTokenCode"), - }, &armnetwork.ManagementClientListActiveSecurityAdminRulesOptions{Top: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ActiveSecurityAdminRulesListResult = armnetwork.ActiveSecurityAdminRulesListResult{ - // SkipToken: to.Ptr("FakeSkipTokenCode"), - // Value: []armnetwork.ActiveBaseSecurityAdminRuleClassification{ - // &armnetwork.ActiveDefaultSecurityAdminRule{ - // CommitTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-07-10T18:03:22.2578238+05:30"); return t}()), - // ConfigurationDescription: to.Ptr("SampleDescription"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/securityAdminConfigurations/myTestSecurityConfig/ruleCollections/testRuleCollection/rules/SampleAdminRule"), - // Kind: to.Ptr(armnetwork.EffectiveAdminRuleKindDefault), - // Region: to.Ptr("westus"), - // RuleCollectionAppliesToGroups: []*armnetwork.ManagerSecurityGroupItem{ - // { - // NetworkGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroup/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/group1"), - // }}, - // RuleCollectionDescription: to.Ptr("SampleRuleCollectionDescription"), - // RuleGroups: []*armnetwork.ConfigurationGroup{ - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroup/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/group1"), - // Properties: &armnetwork.GroupProperties{ - // Description: to.Ptr("A group for all test Virtual Networks"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // Properties: &armnetwork.DefaultAdminPropertiesFormat{ - // Description: to.Ptr("Sample Admin Rule"), - // Access: to.Ptr(armnetwork.SecurityConfigurationRuleAccessDeny), - // DestinationPortRanges: []*string{ - // to.Ptr("22")}, - // Destinations: []*armnetwork.AddressPrefixItem{ - // { - // AddressPrefix: to.Ptr("*"), - // AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeIPPrefix), - // }}, - // Direction: to.Ptr(armnetwork.SecurityConfigurationRuleDirectionInbound), - // Flag: to.Ptr("AllowVnetInbound"), - // Priority: to.Ptr[int32](1), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourcePortRanges: []*string{ - // to.Ptr("0-65535")}, - // Sources: []*armnetwork.AddressPrefixItem{ - // { - // AddressPrefix: to.Ptr("*"), - // AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeIPPrefix), - // }}, - // Protocol: to.Ptr(armnetwork.SecurityConfigurationRuleProtocolTCP), - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkManagerEffectiveConnectivityConfigurationsList.json -func ExampleManagementClient_ListNetworkManagerEffectiveConnectivityConfigurations() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagementClient().ListNetworkManagerEffectiveConnectivityConfigurations(ctx, "myResourceGroup", "testVirtualNetwork", armnetwork.QueryRequestOptions{ - SkipToken: to.Ptr("FakeSkipTokenCode"), - }, &armnetwork.ManagementClientListNetworkManagerEffectiveConnectivityConfigurationsOptions{Top: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagerEffectiveConnectivityConfigurationListResult = armnetwork.ManagerEffectiveConnectivityConfigurationListResult{ - // SkipToken: to.Ptr("FakeSkipTokenCode"), - // Value: []*armnetwork.EffectiveConnectivityConfiguration{ - // { - // ConfigurationGroups: []*armnetwork.ConfigurationGroup{ - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroup/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/group1"), - // Properties: &armnetwork.GroupProperties{ - // Description: to.Ptr("A group for all test Virtual Networks"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/connectivityConfigurations/myTestConnectivityConfig"), - // Properties: &armnetwork.ConnectivityConfigurationProperties{ - // Description: to.Ptr("Sample Configuration"), - // AppliesToGroups: []*armnetwork.ConnectivityGroupItem{ - // { - // GroupConnectivity: to.Ptr(armnetwork.GroupConnectivityNone), - // IsGlobal: to.Ptr(armnetwork.IsGlobalFalse), - // NetworkGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/groups/group1"), - // UseHubGateway: to.Ptr(armnetwork.UseHubGatewayTrue), - // }}, - // ConnectivityTopology: to.Ptr(armnetwork.ConnectivityTopologyHubAndSpoke), - // DeleteExistingPeering: to.Ptr(armnetwork.DeleteExistingPeeringTrue), - // Hubs: []*armnetwork.Hub{ - // { - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myHubVnet"), - // ResourceType: to.Ptr("Microsoft.Network/virtualNetworks"), - // }}, - // IsGlobal: to.Ptr(armnetwork.IsGlobalTrue), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkManagerEffectiveSecurityAdminRulesList.json -func ExampleManagementClient_ListNetworkManagerEffectiveSecurityAdminRules() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagementClient().ListNetworkManagerEffectiveSecurityAdminRules(ctx, "myResourceGroup", "testVirtualNetwork", armnetwork.QueryRequestOptions{ - SkipToken: to.Ptr("FakeSkipTokenCode"), - }, &armnetwork.ManagementClientListNetworkManagerEffectiveSecurityAdminRulesOptions{Top: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagerEffectiveSecurityAdminRulesListResult = armnetwork.ManagerEffectiveSecurityAdminRulesListResult{ - // SkipToken: to.Ptr("FakeSkipTokenCode"), - // Value: []armnetwork.EffectiveBaseSecurityAdminRuleClassification{ - // &armnetwork.EffectiveDefaultSecurityAdminRule{ - // ConfigurationDescription: to.Ptr("SampleDescription"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/securityAdminConfigurations/myTestSecurityConfig/ruleCollections/testRuleCollection/rules/SampleAdminRule"), - // Kind: to.Ptr(armnetwork.EffectiveAdminRuleKindDefault), - // RuleCollectionAppliesToGroups: []*armnetwork.ManagerSecurityGroupItem{ - // { - // NetworkGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroup/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/group1"), - // }}, - // RuleCollectionDescription: to.Ptr("SampleRuleCollectionDescription"), - // RuleGroups: []*armnetwork.ConfigurationGroup{ - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroup/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/group1"), - // Properties: &armnetwork.GroupProperties{ - // Description: to.Ptr("A group for all test Virtual Networks"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // Properties: &armnetwork.DefaultAdminPropertiesFormat{ - // Description: to.Ptr("Sample Admin Rule"), - // Access: to.Ptr(armnetwork.SecurityConfigurationRuleAccessDeny), - // DestinationPortRanges: []*string{ - // to.Ptr("22")}, - // Destinations: []*armnetwork.AddressPrefixItem{ - // { - // AddressPrefix: to.Ptr("*"), - // AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeIPPrefix), - // }}, - // Direction: to.Ptr(armnetwork.SecurityConfigurationRuleDirectionInbound), - // Flag: to.Ptr("AllowVnetInbound"), - // Priority: to.Ptr[int32](1), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourcePortRanges: []*string{ - // to.Ptr("0-65535")}, - // Sources: []*armnetwork.AddressPrefixItem{ - // { - // AddressPrefix: to.Ptr("*"), - // AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeIPPrefix), - // }}, - // Protocol: to.Ptr(armnetwork.SecurityConfigurationRuleProtocolTCP), - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualWanSupportedSecurityProviders.json -func ExampleManagementClient_SupportedSecurityProviders() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagementClient().SupportedSecurityProviders(ctx, "rg1", "wan1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualWanSecurityProviders = armnetwork.VirtualWanSecurityProviders{ - // SupportedProviders: []*armnetwork.VirtualWanSecurityProvider{ - // { - // Name: to.Ptr("AzureFirewall"), - // Type: to.Ptr(armnetwork.VirtualWanSecurityProviderTypeNative), - // URL: to.Ptr(""), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/GenerateVirtualWanVpnServerConfigurationVpnProfile.json -func ExampleManagementClient_BeginGeneratevirtualwanvpnserverconfigurationvpnprofile() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagementClient().BeginGeneratevirtualwanvpnserverconfigurationvpnprofile(ctx, "rg1", "wan1", armnetwork.VirtualWanVPNProfileParameters{ - AuthenticationMethod: to.Ptr(armnetwork.AuthenticationMethodEAPTLS), - VPNServerConfigurationResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnconfig1"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VPNProfileResponse = armnetwork.VPNProfileResponse{ - // ProfileURL: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/managementgroupnetworkmanagerconnections_client.go b/sdk/resourcemanager/network/armnetwork/managementgroupnetworkmanagerconnections_client.go index 3d6769285201..2825516ced77 100644 --- a/sdk/resourcemanager/network/armnetwork/managementgroupnetworkmanagerconnections_client.go +++ b/sdk/resourcemanager/network/armnetwork/managementgroupnetworkmanagerconnections_client.go @@ -44,7 +44,7 @@ func NewManagementGroupNetworkManagerConnectionsClient(credential azcore.TokenCr // CreateOrUpdate - Create a network manager connection on this management group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - managementGroupID - The management group Id which uniquely identify the Microsoft Azure management group. // - networkManagerConnectionName - Name for the network manager connection. // - parameters - Network manager connection to be created/updated. @@ -88,7 +88,7 @@ func (client *ManagementGroupNetworkManagerConnectionsClient) createOrUpdateCrea return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -109,7 +109,7 @@ func (client *ManagementGroupNetworkManagerConnectionsClient) createOrUpdateHand // Delete - Delete specified pending connection created by this management group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - managementGroupID - The management group Id which uniquely identify the Microsoft Azure management group. // - networkManagerConnectionName - Name for the network manager connection. // - options - ManagementGroupNetworkManagerConnectionsClientDeleteOptions contains the optional parameters for the ManagementGroupNetworkManagerConnectionsClient.Delete @@ -151,7 +151,7 @@ func (client *ManagementGroupNetworkManagerConnectionsClient) deleteCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -160,7 +160,7 @@ func (client *ManagementGroupNetworkManagerConnectionsClient) deleteCreateReques // Get - Get a specified connection created by this management group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - managementGroupID - The management group Id which uniquely identify the Microsoft Azure management group. // - networkManagerConnectionName - Name for the network manager connection. // - options - ManagementGroupNetworkManagerConnectionsClientGetOptions contains the optional parameters for the ManagementGroupNetworkManagerConnectionsClient.Get @@ -203,7 +203,7 @@ func (client *ManagementGroupNetworkManagerConnectionsClient) getCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -220,7 +220,7 @@ func (client *ManagementGroupNetworkManagerConnectionsClient) getHandleResponse( // NewListPager - List all network manager connections created by this management group. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - managementGroupID - The management group Id which uniquely identify the Microsoft Azure management group. // - options - ManagementGroupNetworkManagerConnectionsClientListOptions contains the optional parameters for the ManagementGroupNetworkManagerConnectionsClient.NewListPager // method. @@ -266,7 +266,7 @@ func (client *ManagementGroupNetworkManagerConnectionsClient) listCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } diff --git a/sdk/resourcemanager/network/armnetwork/managementgroupnetworkmanagerconnections_client_example_test.go b/sdk/resourcemanager/network/armnetwork/managementgroupnetworkmanagerconnections_client_example_test.go deleted file mode 100644 index 6c19cc6aea8a..000000000000 --- a/sdk/resourcemanager/network/armnetwork/managementgroupnetworkmanagerconnections_client_example_test.go +++ /dev/null @@ -1,164 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkManagerConnectionManagementGroupPut.json -func ExampleManagementGroupNetworkManagerConnectionsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagementGroupNetworkManagerConnectionsClient().CreateOrUpdate(ctx, "managementGroupA", "TestNMConnection", armnetwork.ManagerConnection{ - Properties: &armnetwork.ManagerConnectionProperties{ - NetworkManagerID: to.Ptr("/subscriptions/subscriptionC/resourceGroup/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagerConnection = armnetwork.ManagerConnection{ - // Name: to.Ptr("TestNMConnection"), - // Type: to.Ptr("Microsoft.Network/networkManagerConnections"), - // ID: to.Ptr("/providers/Microsoft.Management/managementGroups/managementGroupA/providers/Microsoft.Network/networkManagerConnections/TestNMConnection"), - // Properties: &armnetwork.ManagerConnectionProperties{ - // Description: to.Ptr("This is a network manager connection to testNetworkManager."), - // ConnectionState: to.Ptr(armnetwork.ScopeConnectionStatePending), - // NetworkManagerID: to.Ptr("/subscriptions/subscriptionC/resourceGroup/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkManagerConnectionManagementGroupGet.json -func ExampleManagementGroupNetworkManagerConnectionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagementGroupNetworkManagerConnectionsClient().Get(ctx, "managementGroupA", "TestNMConnection", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagerConnection = armnetwork.ManagerConnection{ - // Name: to.Ptr("TestNMConnection"), - // Type: to.Ptr("Microsoft.Network/networkManagerConnections"), - // ID: to.Ptr("providers/Microsoft.Management/managementGroups/managementGroupA/providers/Microsoft.Network/networkManagerConnections/TestNMConnection"), - // Properties: &armnetwork.ManagerConnectionProperties{ - // Description: to.Ptr("This is a network manager connection to testNetworkManager."), - // ConnectionState: to.Ptr(armnetwork.ScopeConnectionStatePending), - // NetworkManagerID: to.Ptr("/subscriptions/subscriptionC/resourceGroup/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkManagerConnectionManagementGroupDelete.json -func ExampleManagementGroupNetworkManagerConnectionsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewManagementGroupNetworkManagerConnectionsClient().Delete(ctx, "managementGroupA", "TestNMConnection", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkManagerConnectionManagementGroupList.json -func ExampleManagementGroupNetworkManagerConnectionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagementGroupNetworkManagerConnectionsClient().NewListPager("managementGroupA", &armnetwork.ManagementGroupNetworkManagerConnectionsClientListOptions{Top: nil, - SkipToken: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ManagerConnectionListResult = armnetwork.ManagerConnectionListResult{ - // Value: []*armnetwork.ManagerConnection{ - // { - // Name: to.Ptr("TestNMConnection"), - // Type: to.Ptr("Microsoft.Network/networkManagerConnections"), - // ID: to.Ptr("/providers/Microsoft.Management/managementGroups/managementGroupA/providers/Microsoft.Network/networkManagerConnections/TestNMConnection"), - // Properties: &armnetwork.ManagerConnectionProperties{ - // Description: to.Ptr("This is a network manager connection to testNetworkManager."), - // ConnectionState: to.Ptr(armnetwork.ScopeConnectionStatePending), - // NetworkManagerID: to.Ptr("/subscriptions/subscriptionC/resourceGroup/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/managercommits_client.go b/sdk/resourcemanager/network/armnetwork/managercommits_client.go index 357c3412d54b..469d218674e5 100644 --- a/sdk/resourcemanager/network/armnetwork/managercommits_client.go +++ b/sdk/resourcemanager/network/armnetwork/managercommits_client.go @@ -47,7 +47,7 @@ func NewManagerCommitsClient(subscriptionID string, credential azcore.TokenCrede // BeginPost - Post a Network Manager Commit. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - parameters - Parameters supplied to specify which Managed Network commit is. @@ -71,7 +71,7 @@ func (client *ManagerCommitsClient) BeginPost(ctx context.Context, resourceGroup // Post - Post a Network Manager Commit. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *ManagerCommitsClient) post(ctx context.Context, resourceGroupName string, networkManagerName string, parameters ManagerCommit, options *ManagerCommitsClientBeginPostOptions) (*http.Response, error) { var err error const operationName = "ManagerCommitsClient.BeginPost" @@ -113,7 +113,7 @@ func (client *ManagerCommitsClient) postCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/managercommits_client_example_test.go b/sdk/resourcemanager/network/armnetwork/managercommits_client_example_test.go deleted file mode 100644 index 67a021587f57..000000000000 --- a/sdk/resourcemanager/network/armnetwork/managercommits_client_example_test.go +++ /dev/null @@ -1,57 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkManagerCommitPost.json -func ExampleManagerCommitsClient_BeginPost() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagerCommitsClient().BeginPost(ctx, "resoureGroupSample", "testNetworkManager", armnetwork.ManagerCommit{ - CommitType: to.Ptr(armnetwork.ConfigurationTypeSecurityAdmin), - ConfigurationIDs: []*string{ - to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resoureGroupSample/providers/Microsoft.Network/networkManagers/testNetworkManager/securityAdminConfigurations/SampleSecurityAdminConfig")}, - TargetLocations: []*string{ - to.Ptr("useast")}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagerCommit = armnetwork.ManagerCommit{ - // CommitID: to.Ptr("testCommitId"), - // CommitType: to.Ptr(armnetwork.ConfigurationTypeSecurityAdmin), - // ConfigurationIDs: []*string{ - // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resoureGroupSample/providers/Microsoft.Network/networkManagers/testNetworkManager/securityAdminConfigurations/SampleSecurityAdminConfig")}, - // TargetLocations: []*string{ - // to.Ptr("useast")}, - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/managerdeploymentstatus_client.go b/sdk/resourcemanager/network/armnetwork/managerdeploymentstatus_client.go index 23ceb0dde4b4..42b3c5701b85 100644 --- a/sdk/resourcemanager/network/armnetwork/managerdeploymentstatus_client.go +++ b/sdk/resourcemanager/network/armnetwork/managerdeploymentstatus_client.go @@ -48,7 +48,7 @@ func NewManagerDeploymentStatusClient(subscriptionID string, credential azcore.T // List - Post to List of Network Manager Deployment Status. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - parameters - Parameters supplied to specify which Managed Network deployment status is. @@ -96,7 +96,7 @@ func (client *ManagerDeploymentStatusClient) listCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } diff --git a/sdk/resourcemanager/network/armnetwork/managerdeploymentstatus_client_example_test.go b/sdk/resourcemanager/network/armnetwork/managerdeploymentstatus_client_example_test.go deleted file mode 100644 index 83c82b735a1f..000000000000 --- a/sdk/resourcemanager/network/armnetwork/managerdeploymentstatus_client_example_test.go +++ /dev/null @@ -1,71 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkManagerDeploymentStatusList.json -func ExampleManagerDeploymentStatusClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagerDeploymentStatusClient().List(ctx, "resoureGroupSample", "testNetworkManager", armnetwork.ManagerDeploymentStatusParameter{ - DeploymentTypes: []*armnetwork.ConfigurationType{ - to.Ptr(armnetwork.ConfigurationTypeConnectivity), - to.Ptr(armnetwork.ConfigurationType("AdminPolicy"))}, - Regions: []*string{ - to.Ptr("eastus"), - to.Ptr("westus")}, - SkipToken: to.Ptr("FakeSkipTokenCode"), - }, &armnetwork.ManagerDeploymentStatusClientListOptions{Top: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagerDeploymentStatusListResult = armnetwork.ManagerDeploymentStatusListResult{ - // SkipToken: to.Ptr("NextFakeSkipTokenCode"), - // Value: []*armnetwork.ManagerDeploymentStatus{ - // { - // CommitTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-26T06:58:50.883Z"); return t}()), - // ConfigurationIDs: []*string{ - // to.Ptr("SecConfig1"), - // to.Ptr("SecConfig2")}, - // DeploymentStatus: to.Ptr(armnetwork.DeploymentStatusDeploying), - // DeploymentType: to.Ptr(armnetwork.ConfigurationType("AdminPolicy")), - // ErrorMessage: to.Ptr(""), - // Region: to.Ptr("eastus"), - // }, - // { - // CommitTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-26T06:58:50.883Z"); return t}()), - // ConfigurationIDs: []*string{ - // to.Ptr("ConnConfig1"), - // to.Ptr("ConnConfig2")}, - // DeploymentStatus: to.Ptr(armnetwork.DeploymentStatusDeployed), - // DeploymentType: to.Ptr(armnetwork.ConfigurationTypeConnectivity), - // ErrorMessage: to.Ptr(""), - // Region: to.Ptr("eastus"), - // }}, - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/managers_client.go b/sdk/resourcemanager/network/armnetwork/managers_client.go index c69e73025ded..4132b02902d3 100644 --- a/sdk/resourcemanager/network/armnetwork/managers_client.go +++ b/sdk/resourcemanager/network/armnetwork/managers_client.go @@ -48,7 +48,7 @@ func NewManagersClient(subscriptionID string, credential azcore.TokenCredential, // CreateOrUpdate - Creates or updates a Network Manager. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - parameters - Parameters supplied to specify which network manager is. @@ -95,7 +95,7 @@ func (client *ManagersClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -116,7 +116,7 @@ func (client *ManagersClient) createOrUpdateHandleResponse(resp *http.Response) // BeginDelete - Deletes a network manager. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - options - ManagersClientBeginDeleteOptions contains the optional parameters for the ManagersClient.BeginDelete method. @@ -138,7 +138,7 @@ func (client *ManagersClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Deletes a network manager. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *ManagersClient) deleteOperation(ctx context.Context, resourceGroupName string, networkManagerName string, options *ManagersClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ManagersClient.BeginDelete" @@ -180,7 +180,7 @@ func (client *ManagersClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } @@ -192,7 +192,7 @@ func (client *ManagersClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Gets the specified Network Manager. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - options - ManagersClientGetOptions contains the optional parameters for the ManagersClient.Get method. @@ -238,7 +238,7 @@ func (client *ManagersClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -255,7 +255,7 @@ func (client *ManagersClient) getHandleResponse(resp *http.Response) (ManagersCl // NewListPager - List network managers in a resource group. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - options - ManagersClientListOptions contains the optional parameters for the ManagersClient.NewListPager method. func (client *ManagersClient) NewListPager(resourceGroupName string, options *ManagersClientListOptions) *runtime.Pager[ManagersClientListResponse] { @@ -304,7 +304,7 @@ func (client *ManagersClient) listCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } @@ -327,7 +327,7 @@ func (client *ManagersClient) listHandleResponse(resp *http.Response) (ManagersC // NewListBySubscriptionPager - List all network managers in a subscription. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - options - ManagersClientListBySubscriptionOptions contains the optional parameters for the ManagersClient.NewListBySubscriptionPager // method. func (client *ManagersClient) NewListBySubscriptionPager(options *ManagersClientListBySubscriptionOptions) *runtime.Pager[ManagersClientListBySubscriptionResponse] { @@ -372,7 +372,7 @@ func (client *ManagersClient) listBySubscriptionCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } @@ -396,7 +396,7 @@ func (client *ManagersClient) listBySubscriptionHandleResponse(resp *http.Respon // Patch - Patch NetworkManager. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - parameters - Parameters supplied to specify which network manager is. @@ -443,7 +443,7 @@ func (client *ManagersClient) patchCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/managers_client_example_test.go b/sdk/resourcemanager/network/armnetwork/managers_client_example_test.go deleted file mode 100644 index 30a8a749522a..000000000000 --- a/sdk/resourcemanager/network/armnetwork/managers_client_example_test.go +++ /dev/null @@ -1,316 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkManagerGet.json -func ExampleManagersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagersClient().Get(ctx, "rg1", "testNetworkManager", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Manager = armnetwork.Manager{ - // Name: to.Ptr("testNetworkManager"), - // Type: to.Ptr("Microsoft.Network/networkManagers"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroup/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager"), - // Properties: &armnetwork.ManagerProperties{ - // Description: to.Ptr("My Test Network Manager"), - // NetworkManagerScopeAccesses: []*armnetwork.ConfigurationType{ - // to.Ptr(armnetwork.ConfigurationType("SecurityUser"))}, - // NetworkManagerScopes: &armnetwork.ManagerPropertiesNetworkManagerScopes{ - // ManagementGroups: []*string{ - // }, - // Subscriptions: []*string{ - // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000")}, - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkManagerPut.json -func ExampleManagersClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagersClient().CreateOrUpdate(ctx, "rg1", "TestNetworkManager", armnetwork.Manager{ - Properties: &armnetwork.ManagerProperties{ - Description: to.Ptr("My Test Network Manager"), - NetworkManagerScopeAccesses: []*armnetwork.ConfigurationType{ - to.Ptr(armnetwork.ConfigurationTypeConnectivity)}, - NetworkManagerScopes: &armnetwork.ManagerPropertiesNetworkManagerScopes{ - ManagementGroups: []*string{ - to.Ptr("/Microsoft.Management/testmg")}, - Subscriptions: []*string{ - to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000")}, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Manager = armnetwork.Manager{ - // Name: to.Ptr("TestNetworkManager"), - // Type: to.Ptr("Microsoft.Network/networkManagers"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroup/rg1/providers/Microsoft.Network/networkManagers/TestNetworkManager"), - // Etag: to.Ptr("sadf-asdf-asdf-asdf"), - // Properties: &armnetwork.ManagerProperties{ - // Description: to.Ptr("My Test Network Manager"), - // NetworkManagerScopeAccesses: []*armnetwork.ConfigurationType{ - // to.Ptr(armnetwork.ConfigurationTypeConnectivity)}, - // NetworkManagerScopes: &armnetwork.ManagerPropertiesNetworkManagerScopes{ - // ManagementGroups: []*string{ - // to.Ptr("Microsoft.Management/managementGroups/testMg")}, - // Subscriptions: []*string{ - // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000")}, - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkManagerDelete.json -func ExampleManagersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagersClient().BeginDelete(ctx, "rg1", "testNetworkManager", &armnetwork.ManagersClientBeginDeleteOptions{Force: to.Ptr(false)}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkManagerPatch.json -func ExampleManagersClient_Patch() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagersClient().Patch(ctx, "rg1", "testNetworkManager", armnetwork.PatchObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Manager = armnetwork.Manager{ - // Name: to.Ptr("testNetworkManager"), - // Type: to.Ptr("Microsoft.Network/networkManager"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroup/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.ManagerProperties{ - // Description: to.Ptr("My Test Network Manager"), - // NetworkManagerScopeAccesses: []*armnetwork.ConfigurationType{ - // to.Ptr(armnetwork.ConfigurationTypeConnectivity)}, - // NetworkManagerScopes: &armnetwork.ManagerPropertiesNetworkManagerScopes{ - // ManagementGroups: []*string{ - // }, - // Subscriptions: []*string{ - // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000001")}, - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkManagerListAll.json -func ExampleManagersClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagersClient().NewListBySubscriptionPager(&armnetwork.ManagersClientListBySubscriptionOptions{Top: nil, - SkipToken: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ManagerListResult = armnetwork.ManagerListResult{ - // Value: []*armnetwork.Manager{ - // { - // Name: to.Ptr("testNetworkManager"), - // Type: to.Ptr("Microsoft.Network/networkManagers"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroup/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager"), - // Etag: to.Ptr("sadf-asdf-asdf-asdf"), - // Properties: &armnetwork.ManagerProperties{ - // Description: to.Ptr("My Test Network Manager"), - // NetworkManagerScopeAccesses: []*armnetwork.ConfigurationType{ - // to.Ptr(armnetwork.ConfigurationType("SecurityUser"))}, - // NetworkManagerScopes: &armnetwork.ManagerPropertiesNetworkManagerScopes{ - // ManagementGroups: []*string{ - // }, - // Subscriptions: []*string{ - // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000")}, - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkManagerList.json -func ExampleManagersClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagersClient().NewListPager("rg1", &armnetwork.ManagersClientListOptions{Top: nil, - SkipToken: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ManagerListResult = armnetwork.ManagerListResult{ - // Value: []*armnetwork.Manager{ - // { - // Name: to.Ptr("testNetworkManager"), - // Type: to.Ptr("Microsoft.Network/networkManagers"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroup/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager"), - // Etag: to.Ptr("sadf-asdf-asdf-asdf"), - // Properties: &armnetwork.ManagerProperties{ - // Description: to.Ptr("My Test Network Manager"), - // NetworkManagerScopeAccesses: []*armnetwork.ConfigurationType{ - // to.Ptr(armnetwork.ConfigurationTypeConnectivity)}, - // NetworkManagerScopes: &armnetwork.ManagerPropertiesNetworkManagerScopes{ - // ManagementGroups: []*string{ - // }, - // Subscriptions: []*string{ - // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000")}, - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/models.go b/sdk/resourcemanager/network/armnetwork/models.go index 1f5c2e05492b..a88a30a3ac5f 100644 --- a/sdk/resourcemanager/network/armnetwork/models.go +++ b/sdk/resourcemanager/network/armnetwork/models.go @@ -1338,8 +1338,8 @@ type ApplicationGatewayProbePropertiesFormat struct { PickHostNameFromBackendSettings *bool // Custom port which will be used for probing the backend servers. The valid value ranges from 1 to 65535. In case not set, - // port from http settings will be used. This property is valid for Standardv2 and - // WAFv2 only. + // port from http settings will be used. This property is valid for Basic, + // Standardv2 and WAFv2 only. Port *int32 // The protocol used for the probe. @@ -2819,6 +2819,9 @@ type BackendAddressPoolPropertiesFormat struct { // The location of the backend address pool. Location *string + // Backend address synchronous mode for the backend pool + SyncMode *SyncMode + // An array of gateway load balancer tunnel interfaces. TunnelInterfaces []*GatewayLoadBalancerTunnelInterface @@ -3007,14 +3010,23 @@ type BastionHostPropertiesFormat struct { // IP configuration of the Bastion Host resource. IPConfigurations []*BastionHostIPConfiguration + NetworkACLs *BastionHostPropertiesFormatNetworkACLs // The scale units for the Bastion Host resource. ScaleUnits *int32 + // Reference to an existing virtual network required for Developer Bastion Host only. + VirtualNetwork *SubResource + // READ-ONLY; The provisioning state of the bastion host resource. ProvisioningState *ProvisioningState } +type BastionHostPropertiesFormatNetworkACLs struct { + // Sets the IP ACL rules for Developer Bastion Host. + IPRules []*IPRule +} + // BastionSessionDeleteResult - Response for DisconnectActiveSessions. type BastionSessionDeleteResult struct { // The URL to get the next set of results. @@ -6932,6 +6944,11 @@ type IPPrefixesList struct { IPPrefixes []*string } +type IPRule struct { + // Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. + AddressPrefix *string +} + // IPSecPolicy - An IPSec Policy configuration for a virtual network gateway connection. type IPSecPolicy struct { // REQUIRED; The DH Group used in IKE Phase 1 for initial SA. @@ -8324,6 +8341,18 @@ type MetricSpecification struct { Unit *string } +// MigrateLoadBalancerToIPBasedRequest - The request for a migrateToIpBased API. +type MigrateLoadBalancerToIPBasedRequest struct { + // A list of pool names that should be migrated from Nic based to IP based pool + Pools []*string +} + +// MigratedPools - The response for a migrateToIpBased API. +type MigratedPools struct { + // A list of pools migrated from Nic based to IP based pool + MigratedPools []*string +} + // NatGateway - Nat Gateway resource. type NatGateway struct { // Resource ID. diff --git a/sdk/resourcemanager/network/armnetwork/models_serde.go b/sdk/resourcemanager/network/armnetwork/models_serde.go index 86a96269f4b8..10f62a658ac7 100644 --- a/sdk/resourcemanager/network/armnetwork/models_serde.go +++ b/sdk/resourcemanager/network/armnetwork/models_serde.go @@ -6823,6 +6823,7 @@ func (b BackendAddressPoolPropertiesFormat) MarshalJSON() ([]byte, error) { populate(objectMap, "outboundRule", b.OutboundRule) populate(objectMap, "outboundRules", b.OutboundRules) populate(objectMap, "provisioningState", b.ProvisioningState) + populate(objectMap, "syncMode", b.SyncMode) populate(objectMap, "tunnelInterfaces", b.TunnelInterfaces) populate(objectMap, "virtualNetwork", b.VirtualNetwork) return json.Marshal(objectMap) @@ -6864,6 +6865,9 @@ func (b *BackendAddressPoolPropertiesFormat) UnmarshalJSON(data []byte) error { case "provisioningState": err = unpopulate(val, "ProvisioningState", &b.ProvisioningState) delete(rawMsg, key) + case "syncMode": + err = unpopulate(val, "SyncMode", &b.SyncMode) + delete(rawMsg, key) case "tunnelInterfaces": err = unpopulate(val, "TunnelInterfaces", &b.TunnelInterfaces) delete(rawMsg, key) @@ -7202,8 +7206,10 @@ func (b BastionHostPropertiesFormat) MarshalJSON() ([]byte, error) { populate(objectMap, "enableShareableLink", b.EnableShareableLink) populate(objectMap, "enableTunneling", b.EnableTunneling) populate(objectMap, "ipConfigurations", b.IPConfigurations) + populate(objectMap, "networkAcls", b.NetworkACLs) populate(objectMap, "provisioningState", b.ProvisioningState) populate(objectMap, "scaleUnits", b.ScaleUnits) + populate(objectMap, "virtualNetwork", b.VirtualNetwork) return json.Marshal(objectMap) } @@ -7240,12 +7246,45 @@ func (b *BastionHostPropertiesFormat) UnmarshalJSON(data []byte) error { case "ipConfigurations": err = unpopulate(val, "IPConfigurations", &b.IPConfigurations) delete(rawMsg, key) + case "networkAcls": + err = unpopulate(val, "NetworkACLs", &b.NetworkACLs) + delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &b.ProvisioningState) delete(rawMsg, key) case "scaleUnits": err = unpopulate(val, "ScaleUnits", &b.ScaleUnits) delete(rawMsg, key) + case "virtualNetwork": + err = unpopulate(val, "VirtualNetwork", &b.VirtualNetwork) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BastionHostPropertiesFormatNetworkACLs. +func (b BastionHostPropertiesFormatNetworkACLs) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "ipRules", b.IPRules) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BastionHostPropertiesFormatNetworkACLs. +func (b *BastionHostPropertiesFormatNetworkACLs) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "ipRules": + err = unpopulate(val, "IPRules", &b.IPRules) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", b, err) @@ -17161,6 +17200,33 @@ func (i *IPPrefixesList) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type IPRule. +func (i IPRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "addressPrefix", i.AddressPrefix) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IPRule. +func (i *IPRule) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "addressPrefix": + err = unpopulate(val, "AddressPrefix", &i.AddressPrefix) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type IPSecPolicy. func (i IPSecPolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -20635,6 +20701,60 @@ func (m *MetricSpecification) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type MigrateLoadBalancerToIPBasedRequest. +func (m MigrateLoadBalancerToIPBasedRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "pools", m.Pools) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateLoadBalancerToIPBasedRequest. +func (m *MigrateLoadBalancerToIPBasedRequest) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "pools": + err = unpopulate(val, "Pools", &m.Pools) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MigratedPools. +func (m MigratedPools) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "migratedPools", m.MigratedPools) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MigratedPools. +func (m *MigratedPools) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "migratedPools": + err = unpopulate(val, "MigratedPools", &m.MigratedPools) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type NatGateway. func (n NatGateway) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) diff --git a/sdk/resourcemanager/network/armnetwork/natgateways_client.go b/sdk/resourcemanager/network/armnetwork/natgateways_client.go index 7b837e3cde93..82cdf57daf7c 100644 --- a/sdk/resourcemanager/network/armnetwork/natgateways_client.go +++ b/sdk/resourcemanager/network/armnetwork/natgateways_client.go @@ -47,7 +47,7 @@ func NewNatGatewaysClient(subscriptionID string, credential azcore.TokenCredenti // BeginCreateOrUpdate - Creates or updates a nat gateway. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - natGatewayName - The name of the nat gateway. // - parameters - Parameters supplied to the create or update nat gateway operation. @@ -71,7 +71,7 @@ func (client *NatGatewaysClient) BeginCreateOrUpdate(ctx context.Context, resour // CreateOrUpdate - Creates or updates a nat gateway. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *NatGatewaysClient) createOrUpdate(ctx context.Context, resourceGroupName string, natGatewayName string, parameters NatGateway, options *NatGatewaysClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "NatGatewaysClient.BeginCreateOrUpdate" @@ -113,7 +113,7 @@ func (client *NatGatewaysClient) createOrUpdateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -125,7 +125,7 @@ func (client *NatGatewaysClient) createOrUpdateCreateRequest(ctx context.Context // BeginDelete - Deletes the specified nat gateway. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - natGatewayName - The name of the nat gateway. // - options - NatGatewaysClientBeginDeleteOptions contains the optional parameters for the NatGatewaysClient.BeginDelete method. @@ -147,7 +147,7 @@ func (client *NatGatewaysClient) BeginDelete(ctx context.Context, resourceGroupN // Delete - Deletes the specified nat gateway. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *NatGatewaysClient) deleteOperation(ctx context.Context, resourceGroupName string, natGatewayName string, options *NatGatewaysClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "NatGatewaysClient.BeginDelete" @@ -189,7 +189,7 @@ func (client *NatGatewaysClient) deleteCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -198,7 +198,7 @@ func (client *NatGatewaysClient) deleteCreateRequest(ctx context.Context, resour // Get - Gets the specified nat gateway in a specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - natGatewayName - The name of the nat gateway. // - options - NatGatewaysClientGetOptions contains the optional parameters for the NatGatewaysClient.Get method. @@ -244,7 +244,7 @@ func (client *NatGatewaysClient) getCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } @@ -264,7 +264,7 @@ func (client *NatGatewaysClient) getHandleResponse(resp *http.Response) (NatGate // NewListPager - Gets all nat gateways in a resource group. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - options - NatGatewaysClientListOptions contains the optional parameters for the NatGatewaysClient.NewListPager method. func (client *NatGatewaysClient) NewListPager(resourceGroupName string, options *NatGatewaysClientListOptions) *runtime.Pager[NatGatewaysClientListResponse] { @@ -313,7 +313,7 @@ func (client *NatGatewaysClient) listCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -330,7 +330,7 @@ func (client *NatGatewaysClient) listHandleResponse(resp *http.Response) (NatGat // NewListAllPager - Gets all the Nat Gateways in a subscription. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - options - NatGatewaysClientListAllOptions contains the optional parameters for the NatGatewaysClient.NewListAllPager method. func (client *NatGatewaysClient) NewListAllPager(options *NatGatewaysClientListAllOptions) *runtime.Pager[NatGatewaysClientListAllResponse] { return runtime.NewPager(runtime.PagingHandler[NatGatewaysClientListAllResponse]{ @@ -374,7 +374,7 @@ func (client *NatGatewaysClient) listAllCreateRequest(ctx context.Context, optio return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -392,7 +392,7 @@ func (client *NatGatewaysClient) listAllHandleResponse(resp *http.Response) (Nat // UpdateTags - Updates nat gateway tags. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - natGatewayName - The name of the nat gateway. // - parameters - Parameters supplied to update nat gateway tags. @@ -439,7 +439,7 @@ func (client *NatGatewaysClient) updateTagsCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/natgateways_client_example_test.go b/sdk/resourcemanager/network/armnetwork/natgateways_client_example_test.go deleted file mode 100644 index 049608e84cff..000000000000 --- a/sdk/resourcemanager/network/armnetwork/natgateways_client_example_test.go +++ /dev/null @@ -1,359 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NatGatewayDelete.json -func ExampleNatGatewaysClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNatGatewaysClient().BeginDelete(ctx, "rg1", "test-natGateway", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NatGatewayGet.json -func ExampleNatGatewaysClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewNatGatewaysClient().Get(ctx, "rg1", "test-natGateway", &armnetwork.NatGatewaysClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.NatGateway = armnetwork.NatGateway{ - // Name: to.Ptr("test-natGateway"), - // Type: to.Ptr("Microsoft.Network/natGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/natGateways/test-natGateway"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.NatGatewayPropertiesFormat{ - // IdleTimeoutInMinutes: to.Ptr[int32](5), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddresses: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1"), - // }}, - // PublicIPPrefixes: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix1"), - // }}, - // Subnets: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1"), - // }}, - // }, - // SKU: &armnetwork.NatGatewaySKU{ - // Name: to.Ptr(armnetwork.NatGatewaySKUNameStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NatGatewayCreateOrUpdate.json -func ExampleNatGatewaysClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNatGatewaysClient().BeginCreateOrUpdate(ctx, "rg1", "test-natgateway", armnetwork.NatGateway{ - Location: to.Ptr("westus"), - Properties: &armnetwork.NatGatewayPropertiesFormat{ - PublicIPAddresses: []*armnetwork.SubResource{ - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1"), - }}, - PublicIPPrefixes: []*armnetwork.SubResource{ - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix1"), - }}, - }, - SKU: &armnetwork.NatGatewaySKU{ - Name: to.Ptr(armnetwork.NatGatewaySKUNameStandard), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.NatGateway = armnetwork.NatGateway{ - // Name: to.Ptr("test-natGateway"), - // Type: to.Ptr("Microsoft.Network/natGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/natGateways/test-natGateway"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.NatGatewayPropertiesFormat{ - // IdleTimeoutInMinutes: to.Ptr[int32](5), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddresses: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1"), - // }}, - // PublicIPPrefixes: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix1"), - // }}, - // Subnets: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1"), - // }}, - // }, - // SKU: &armnetwork.NatGatewaySKU{ - // Name: to.Ptr(armnetwork.NatGatewaySKUNameStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NatGatewayUpdateTags.json -func ExampleNatGatewaysClient_UpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewNatGatewaysClient().UpdateTags(ctx, "rg1", "test-natGateway", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.NatGateway = armnetwork.NatGateway{ - // Name: to.Ptr("test-natGateway"), - // Type: to.Ptr("Microsoft.Network/natGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/natGateways/test-natGateway"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armnetwork.NatGatewayPropertiesFormat{ - // IdleTimeoutInMinutes: to.Ptr[int32](5), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddresses: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1"), - // }}, - // PublicIPPrefixes: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix1"), - // }}, - // Subnets: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1"), - // }}, - // }, - // SKU: &armnetwork.NatGatewaySKU{ - // Name: to.Ptr(armnetwork.NatGatewaySKUNameStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NatGatewayListAll.json -func ExampleNatGatewaysClient_NewListAllPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewNatGatewaysClient().NewListAllPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.NatGatewayListResult = armnetwork.NatGatewayListResult{ - // Value: []*armnetwork.NatGateway{ - // { - // Name: to.Ptr("test-natGateway"), - // Type: to.Ptr("Microsoft.Network/natGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/natGateways/test-natGateway"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.NatGatewayPropertiesFormat{ - // IdleTimeoutInMinutes: to.Ptr[int32](5), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddresses: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1"), - // }}, - // PublicIPPrefixes: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix1"), - // }}, - // Subnets: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1"), - // }}, - // }, - // SKU: &armnetwork.NatGatewaySKU{ - // Name: to.Ptr(armnetwork.NatGatewaySKUNameStandard), - // }, - // }, - // { - // Name: to.Ptr("test-natGateway2"), - // Type: to.Ptr("Microsoft.Network/natGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/natGatewayes/test-natGateway2"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.NatGatewayPropertiesFormat{ - // IdleTimeoutInMinutes: to.Ptr[int32](5), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddresses: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1"), - // }}, - // PublicIPPrefixes: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix1"), - // }}, - // Subnets: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1"), - // }}, - // }, - // SKU: &armnetwork.NatGatewaySKU{ - // Name: to.Ptr(armnetwork.NatGatewaySKUNameStandard), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NatGatewayList.json -func ExampleNatGatewaysClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewNatGatewaysClient().NewListPager("rg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.NatGatewayListResult = armnetwork.NatGatewayListResult{ - // Value: []*armnetwork.NatGateway{ - // { - // Name: to.Ptr("test-natGateway"), - // Type: to.Ptr("Microsoft.Network/natGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/natGateway/test-natGateway"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.NatGatewayPropertiesFormat{ - // IdleTimeoutInMinutes: to.Ptr[int32](5), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddresses: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1"), - // }}, - // PublicIPPrefixes: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix1"), - // }}, - // Subnets: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1"), - // }}, - // }, - // SKU: &armnetwork.NatGatewaySKU{ - // Name: to.Ptr(armnetwork.NatGatewaySKUNameStandard), - // }, - // }, - // { - // Name: to.Ptr("test-natGateway2"), - // Type: to.Ptr("Microsoft.Network/natGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/natGateway/test-natGateway2"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.NatGatewayPropertiesFormat{ - // IdleTimeoutInMinutes: to.Ptr[int32](5), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddresses: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1"), - // }}, - // PublicIPPrefixes: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix1"), - // }}, - // Subnets: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1"), - // }}, - // }, - // SKU: &armnetwork.NatGatewaySKU{ - // Name: to.Ptr(armnetwork.NatGatewaySKUNameStandard), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/natrules_client.go b/sdk/resourcemanager/network/armnetwork/natrules_client.go index fbe9f4db808d..4cb9a2b448dc 100644 --- a/sdk/resourcemanager/network/armnetwork/natrules_client.go +++ b/sdk/resourcemanager/network/armnetwork/natrules_client.go @@ -47,7 +47,7 @@ func NewNatRulesClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreateOrUpdate - Creates a nat rule to a scalable vpn gateway if it doesn't exist else updates the existing nat rules. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the VpnGateway. // - gatewayName - The name of the gateway. // - natRuleName - The name of the nat rule. @@ -72,7 +72,7 @@ func (client *NatRulesClient) BeginCreateOrUpdate(ctx context.Context, resourceG // CreateOrUpdate - Creates a nat rule to a scalable vpn gateway if it doesn't exist else updates the existing nat rules. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *NatRulesClient) createOrUpdate(ctx context.Context, resourceGroupName string, gatewayName string, natRuleName string, natRuleParameters VPNGatewayNatRule, options *NatRulesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "NatRulesClient.BeginCreateOrUpdate" @@ -118,7 +118,7 @@ func (client *NatRulesClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, natRuleParameters); err != nil { @@ -130,7 +130,7 @@ func (client *NatRulesClient) createOrUpdateCreateRequest(ctx context.Context, r // BeginDelete - Deletes a nat rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the VpnGateway. // - gatewayName - The name of the gateway. // - natRuleName - The name of the nat rule. @@ -153,7 +153,7 @@ func (client *NatRulesClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Deletes a nat rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *NatRulesClient) deleteOperation(ctx context.Context, resourceGroupName string, gatewayName string, natRuleName string, options *NatRulesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "NatRulesClient.BeginDelete" @@ -199,7 +199,7 @@ func (client *NatRulesClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -208,7 +208,7 @@ func (client *NatRulesClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Retrieves the details of a nat ruleGet. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the VpnGateway. // - gatewayName - The name of the gateway. // - natRuleName - The name of the nat rule. @@ -259,7 +259,7 @@ func (client *NatRulesClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -276,7 +276,7 @@ func (client *NatRulesClient) getHandleResponse(resp *http.Response) (NatRulesCl // NewListByVPNGatewayPager - Retrieves all nat rules for a particular virtual wan vpn gateway. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the VpnGateway. // - gatewayName - The name of the gateway. // - options - NatRulesClientListByVPNGatewayOptions contains the optional parameters for the NatRulesClient.NewListByVPNGatewayPager @@ -331,7 +331,7 @@ func (client *NatRulesClient) listByVPNGatewayCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/natrules_client_example_test.go b/sdk/resourcemanager/network/armnetwork/natrules_client_example_test.go deleted file mode 100644 index 7b8ca073d0ff..000000000000 --- a/sdk/resourcemanager/network/armnetwork/natrules_client_example_test.go +++ /dev/null @@ -1,172 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NatRuleGet.json -func ExampleNatRulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewNatRulesClient().Get(ctx, "rg1", "gateway1", "natRule1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VPNGatewayNatRule = armnetwork.VPNGatewayNatRule{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/natRules/natRule1"), - // Name: to.Ptr("natRule1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNGatewayNatRuleProperties{ - // Type: to.Ptr(armnetwork.VPNNatRuleTypeStatic), - // EgressVPNSiteLinkConnections: []*armnetwork.SubResource{ - // }, - // ExternalMappings: []*armnetwork.VPNNatRuleMapping{ - // }, - // IngressVPNSiteLinkConnections: []*armnetwork.SubResource{ - // }, - // InternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("10.4.0.0/24"), - // }}, - // Mode: to.Ptr(armnetwork.VPNNatRuleModeEgressSnat), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NatRulePut.json -func ExampleNatRulesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNatRulesClient().BeginCreateOrUpdate(ctx, "rg1", "gateway1", "natRule1", armnetwork.VPNGatewayNatRule{ - Properties: &armnetwork.VPNGatewayNatRuleProperties{ - Type: to.Ptr(armnetwork.VPNNatRuleTypeStatic), - ExternalMappings: []*armnetwork.VPNNatRuleMapping{ - { - AddressSpace: to.Ptr("192.168.21.0/24"), - }}, - InternalMappings: []*armnetwork.VPNNatRuleMapping{ - { - AddressSpace: to.Ptr("10.4.0.0/24"), - }}, - IPConfigurationID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/cloudnet1-VNG/ipConfigurations/default"), - Mode: to.Ptr(armnetwork.VPNNatRuleModeEgressSnat), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VPNGatewayNatRule = armnetwork.VPNGatewayNatRule{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/natRules/natRule1"), - // Name: to.Ptr("natRule1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNGatewayNatRuleProperties{ - // Type: to.Ptr(armnetwork.VPNNatRuleTypeStatic), - // EgressVPNSiteLinkConnections: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/vpnLinkConnections/vpnLinkConnection1"), - // }}, - // ExternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("192.168.21.0/24"), - // }}, - // IngressVPNSiteLinkConnections: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/vpnLinkConnections/vpnLinkConnection2"), - // }}, - // InternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("10.4.0.0/24"), - // }}, - // IPConfigurationID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/cloudnet1-VNG/ipConfigurations/default"), - // Mode: to.Ptr(armnetwork.VPNNatRuleModeEgressSnat), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NatRuleDelete.json -func ExampleNatRulesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNatRulesClient().BeginDelete(ctx, "rg1", "gateway1", "natRule1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NatRuleList.json -func ExampleNatRulesClient_NewListByVPNGatewayPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewNatRulesClient().NewListByVPNGatewayPager("rg1", "gateway1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ListVPNGatewayNatRulesResult = armnetwork.ListVPNGatewayNatRulesResult{ - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/operations_client.go b/sdk/resourcemanager/network/armnetwork/operations_client.go index fc3623f0855e..eea08374d711 100644 --- a/sdk/resourcemanager/network/armnetwork/operations_client.go +++ b/sdk/resourcemanager/network/armnetwork/operations_client.go @@ -39,7 +39,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Lists all of the available Network Rest API operations. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -79,7 +79,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/operations_client_example_test.go b/sdk/resourcemanager/network/armnetwork/operations_client_example_test.go deleted file mode 100644 index 5711a772c426..000000000000 --- a/sdk/resourcemanager/network/armnetwork/operations_client_example_test.go +++ /dev/null @@ -1,166 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/OperationList.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OperationListResult = armnetwork.OperationListResult{ - // Value: []*armnetwork.Operation{ - // { - // Name: to.Ptr("Microsoft.Network/localnetworkgateways/read"), - // Display: &armnetwork.OperationDisplay{ - // Description: to.Ptr("Gets LocalNetworkGateway"), - // Operation: to.Ptr("Get LocalNetworkGateway"), - // Provider: to.Ptr("Microsoft Network"), - // Resource: to.Ptr("LocalNetworkGateway"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Network/localnetworkgateways/write"), - // Display: &armnetwork.OperationDisplay{ - // Description: to.Ptr("Creates or updates an existing LocalNetworkGateway"), - // Operation: to.Ptr("Create or update LocalNetworkGateway"), - // Provider: to.Ptr("Microsoft Network"), - // Resource: to.Ptr("LocalNetworkGateway"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Network/localnetworkgateways/delete"), - // Display: &armnetwork.OperationDisplay{ - // Description: to.Ptr("Deletes LocalNetworkGateway"), - // Operation: to.Ptr("Delete LocalNetworkGateway"), - // Provider: to.Ptr("Microsoft Network"), - // Resource: to.Ptr("LocalNetworkGateway"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Network/networkInterfaces/providers/Microsoft.Insights/metricDefinitions/read"), - // Display: &armnetwork.OperationDisplay{ - // Description: to.Ptr("Gets available metrics for the Network Interface"), - // Operation: to.Ptr("Read Network Interface metric definitions"), - // Provider: to.Ptr("Microsoft Network"), - // Resource: to.Ptr("Network Interface metric definition"), - // }, - // Origin: to.Ptr("system"), - // Properties: &armnetwork.OperationPropertiesFormat{ - // ServiceSpecification: &armnetwork.OperationPropertiesFormatServiceSpecification{ - // MetricSpecifications: []*armnetwork.MetricSpecification{ - // { - // Name: to.Ptr("BytesSentRate"), - // AggregationType: to.Ptr("Total"), - // Availabilities: []*armnetwork.Availability{ - // { - // BlobDuration: to.Ptr("01:00:00"), - // Retention: to.Ptr("00:00:00"), - // TimeGrain: to.Ptr("00:01:00"), - // }, - // { - // BlobDuration: to.Ptr("1.00:00:00"), - // Retention: to.Ptr("00:00:00"), - // TimeGrain: to.Ptr("01:00:00"), - // }}, - // Dimensions: []*armnetwork.Dimension{ - // }, - // DisplayDescription: to.Ptr("Number of bytes the Network Interface sent"), - // DisplayName: to.Ptr("Bytes Sent"), - // EnableRegionalMdmAccount: to.Ptr(false), - // FillGapWithZero: to.Ptr(false), - // IsInternal: to.Ptr(false), - // MetricFilterPattern: to.Ptr("^__Ready__$"), - // Unit: to.Ptr("Count"), - // }, - // { - // Name: to.Ptr("BytesReceivedRate"), - // AggregationType: to.Ptr("Total"), - // Availabilities: []*armnetwork.Availability{ - // { - // BlobDuration: to.Ptr("01:00:00"), - // Retention: to.Ptr("00:00:00"), - // TimeGrain: to.Ptr("00:01:00"), - // }, - // { - // BlobDuration: to.Ptr("1.00:00:00"), - // Retention: to.Ptr("00:00:00"), - // TimeGrain: to.Ptr("01:00:00"), - // }}, - // Dimensions: []*armnetwork.Dimension{ - // }, - // DisplayDescription: to.Ptr("Number of bytes the Network Interface received"), - // DisplayName: to.Ptr("Bytes Received"), - // EnableRegionalMdmAccount: to.Ptr(false), - // FillGapWithZero: to.Ptr(false), - // IsInternal: to.Ptr(false), - // MetricFilterPattern: to.Ptr("^__Ready__$"), - // Unit: to.Ptr("Count"), - // }}, - // }, - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Network/networksecuritygroups/providers/Microsoft.Insights/logDefinitions/read"), - // Display: &armnetwork.OperationDisplay{ - // Description: to.Ptr("Gets the events for network security group"), - // Operation: to.Ptr("Get Network Security Group Event Log Definitions"), - // Provider: to.Ptr("Microsoft Network"), - // Resource: to.Ptr("Network Security Groups Log Definitions"), - // }, - // Origin: to.Ptr("system"), - // Properties: &armnetwork.OperationPropertiesFormat{ - // ServiceSpecification: &armnetwork.OperationPropertiesFormatServiceSpecification{ - // LogSpecifications: []*armnetwork.LogSpecification{ - // { - // Name: to.Ptr("NetworkSecurityGroupEvent"), - // BlobDuration: to.Ptr("PT1H"), - // DisplayName: to.Ptr("Network Security Group Event"), - // }, - // { - // Name: to.Ptr("NetworkSecurityGroupRuleCounter"), - // BlobDuration: to.Ptr("PT1H"), - // DisplayName: to.Ptr("Network Security Group Rule Counter"), - // }, - // { - // Name: to.Ptr("NetworkSecurityGroupFlowEvent"), - // BlobDuration: to.Ptr("PT1H"), - // DisplayName: to.Ptr("Network Security Group Rule Flow Event"), - // }}, - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/options.go b/sdk/resourcemanager/network/armnetwork/options.go index 362e4e60de26..5efa1c6cceff 100644 --- a/sdk/resourcemanager/network/armnetwork/options.go +++ b/sdk/resourcemanager/network/armnetwork/options.go @@ -1615,6 +1615,13 @@ type LoadBalancersClientListOptions struct { // placeholder for future optional parameters } +// LoadBalancersClientMigrateToIPBasedOptions contains the optional parameters for the LoadBalancersClient.MigrateToIPBased +// method. +type LoadBalancersClientMigrateToIPBasedOptions struct { + // Parameters supplied to the migrateToIpBased Api. + Parameters *MigrateLoadBalancerToIPBasedRequest +} + // LoadBalancersClientUpdateTagsOptions contains the optional parameters for the LoadBalancersClient.UpdateTags method. type LoadBalancersClientUpdateTagsOptions struct { // placeholder for future optional parameters diff --git a/sdk/resourcemanager/network/armnetwork/p2svpngateways_client.go b/sdk/resourcemanager/network/armnetwork/p2svpngateways_client.go index a236d2977e50..a3ac3d2c9e87 100644 --- a/sdk/resourcemanager/network/armnetwork/p2svpngateways_client.go +++ b/sdk/resourcemanager/network/armnetwork/p2svpngateways_client.go @@ -47,7 +47,7 @@ func NewP2SVPNGatewaysClient(subscriptionID string, credential azcore.TokenCrede // BeginCreateOrUpdate - Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the P2SVpnGateway. // - gatewayName - The name of the gateway. // - p2SVPNGatewayParameters - Parameters supplied to create or Update a virtual wan p2s vpn gateway. @@ -71,7 +71,7 @@ func (client *P2SVPNGatewaysClient) BeginCreateOrUpdate(ctx context.Context, res // CreateOrUpdate - Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *P2SVPNGatewaysClient) createOrUpdate(ctx context.Context, resourceGroupName string, gatewayName string, p2SVPNGatewayParameters P2SVPNGateway, options *P2SVPNGatewaysClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "P2SVPNGatewaysClient.BeginCreateOrUpdate" @@ -113,7 +113,7 @@ func (client *P2SVPNGatewaysClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, p2SVPNGatewayParameters); err != nil { @@ -125,7 +125,7 @@ func (client *P2SVPNGatewaysClient) createOrUpdateCreateRequest(ctx context.Cont // BeginDelete - Deletes a virtual wan p2s vpn gateway. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the P2SVpnGateway. // - gatewayName - The name of the gateway. // - options - P2SVPNGatewaysClientBeginDeleteOptions contains the optional parameters for the P2SVPNGatewaysClient.BeginDelete @@ -148,7 +148,7 @@ func (client *P2SVPNGatewaysClient) BeginDelete(ctx context.Context, resourceGro // Delete - Deletes a virtual wan p2s vpn gateway. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *P2SVPNGatewaysClient) deleteOperation(ctx context.Context, resourceGroupName string, gatewayName string, options *P2SVPNGatewaysClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "P2SVPNGatewaysClient.BeginDelete" @@ -190,7 +190,7 @@ func (client *P2SVPNGatewaysClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -200,7 +200,7 @@ func (client *P2SVPNGatewaysClient) deleteCreateRequest(ctx context.Context, res // group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - p2SVPNGatewayName - The name of the P2S Vpn Gateway. // - request - The parameters are supplied to disconnect p2s vpn connections. @@ -225,7 +225,7 @@ func (client *P2SVPNGatewaysClient) BeginDisconnectP2SVPNConnections(ctx context // group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *P2SVPNGatewaysClient) disconnectP2SVPNConnections(ctx context.Context, resourceGroupName string, p2SVPNGatewayName string, request P2SVPNConnectionRequest, options *P2SVPNGatewaysClientBeginDisconnectP2SVPNConnectionsOptions) (*http.Response, error) { var err error const operationName = "P2SVPNGatewaysClient.BeginDisconnectP2SVPNConnections" @@ -267,7 +267,7 @@ func (client *P2SVPNGatewaysClient) disconnectP2SVPNConnectionsCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, request); err != nil { @@ -279,7 +279,7 @@ func (client *P2SVPNGatewaysClient) disconnectP2SVPNConnectionsCreateRequest(ctx // BeginGenerateVPNProfile - Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - gatewayName - The name of the P2SVpnGateway. // - parameters - Parameters supplied to the generate P2SVpnGateway VPN client package operation. @@ -303,7 +303,7 @@ func (client *P2SVPNGatewaysClient) BeginGenerateVPNProfile(ctx context.Context, // GenerateVPNProfile - Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *P2SVPNGatewaysClient) generateVPNProfile(ctx context.Context, resourceGroupName string, gatewayName string, parameters P2SVPNProfileParameters, options *P2SVPNGatewaysClientBeginGenerateVPNProfileOptions) (*http.Response, error) { var err error const operationName = "P2SVPNGatewaysClient.BeginGenerateVPNProfile" @@ -345,7 +345,7 @@ func (client *P2SVPNGatewaysClient) generateVPNProfileCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -357,7 +357,7 @@ func (client *P2SVPNGatewaysClient) generateVPNProfileCreateRequest(ctx context. // Get - Retrieves the details of a virtual wan p2s vpn gateway. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the P2SVpnGateway. // - gatewayName - The name of the gateway. // - options - P2SVPNGatewaysClientGetOptions contains the optional parameters for the P2SVPNGatewaysClient.Get method. @@ -403,7 +403,7 @@ func (client *P2SVPNGatewaysClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -422,7 +422,7 @@ func (client *P2SVPNGatewaysClient) getHandleResponse(resp *http.Response) (P2SV // resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - gatewayName - The name of the P2SVpnGateway. // - options - P2SVPNGatewaysClientBeginGetP2SVPNConnectionHealthOptions contains the optional parameters for the P2SVPNGatewaysClient.BeginGetP2SVPNConnectionHealth @@ -446,7 +446,7 @@ func (client *P2SVPNGatewaysClient) BeginGetP2SVPNConnectionHealth(ctx context.C // resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *P2SVPNGatewaysClient) getP2SVPNConnectionHealth(ctx context.Context, resourceGroupName string, gatewayName string, options *P2SVPNGatewaysClientBeginGetP2SVPNConnectionHealthOptions) (*http.Response, error) { var err error const operationName = "P2SVPNGatewaysClient.BeginGetP2SVPNConnectionHealth" @@ -488,7 +488,7 @@ func (client *P2SVPNGatewaysClient) getP2SVPNConnectionHealthCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -498,7 +498,7 @@ func (client *P2SVPNGatewaysClient) getP2SVPNConnectionHealthCreateRequest(ctx c // wan P2SVpnGateway in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - gatewayName - The name of the P2SVpnGateway. // - request - Request parameters supplied to get p2s vpn connections detailed health. @@ -523,7 +523,7 @@ func (client *P2SVPNGatewaysClient) BeginGetP2SVPNConnectionHealthDetailed(ctx c // wan P2SVpnGateway in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *P2SVPNGatewaysClient) getP2SVPNConnectionHealthDetailed(ctx context.Context, resourceGroupName string, gatewayName string, request P2SVPNConnectionHealthRequest, options *P2SVPNGatewaysClientBeginGetP2SVPNConnectionHealthDetailedOptions) (*http.Response, error) { var err error const operationName = "P2SVPNGatewaysClient.BeginGetP2SVPNConnectionHealthDetailed" @@ -565,7 +565,7 @@ func (client *P2SVPNGatewaysClient) getP2SVPNConnectionHealthDetailedCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, request); err != nil { @@ -576,7 +576,7 @@ func (client *P2SVPNGatewaysClient) getP2SVPNConnectionHealthDetailedCreateReque // NewListPager - Lists all the P2SVpnGateways in a subscription. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - options - P2SVPNGatewaysClientListOptions contains the optional parameters for the P2SVPNGatewaysClient.NewListPager method. func (client *P2SVPNGatewaysClient) NewListPager(options *P2SVPNGatewaysClientListOptions) *runtime.Pager[P2SVPNGatewaysClientListResponse] { return runtime.NewPager(runtime.PagingHandler[P2SVPNGatewaysClientListResponse]{ @@ -620,7 +620,7 @@ func (client *P2SVPNGatewaysClient) listCreateRequest(ctx context.Context, optio return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -637,7 +637,7 @@ func (client *P2SVPNGatewaysClient) listHandleResponse(resp *http.Response) (P2S // NewListByResourceGroupPager - Lists all the P2SVpnGateways in a resource group. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the P2SVpnGateway. // - options - P2SVPNGatewaysClientListByResourceGroupOptions contains the optional parameters for the P2SVPNGatewaysClient.NewListByResourceGroupPager // method. @@ -687,7 +687,7 @@ func (client *P2SVPNGatewaysClient) listByResourceGroupCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -705,7 +705,7 @@ func (client *P2SVPNGatewaysClient) listByResourceGroupHandleResponse(resp *http // BeginReset - Resets the primary of the p2s vpn gateway in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the P2SVpnGateway. // - gatewayName - The name of the gateway. // - options - P2SVPNGatewaysClientBeginResetOptions contains the optional parameters for the P2SVPNGatewaysClient.BeginReset @@ -728,7 +728,7 @@ func (client *P2SVPNGatewaysClient) BeginReset(ctx context.Context, resourceGrou // Reset - Resets the primary of the p2s vpn gateway in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *P2SVPNGatewaysClient) reset(ctx context.Context, resourceGroupName string, gatewayName string, options *P2SVPNGatewaysClientBeginResetOptions) (*http.Response, error) { var err error const operationName = "P2SVPNGatewaysClient.BeginReset" @@ -770,7 +770,7 @@ func (client *P2SVPNGatewaysClient) resetCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -779,7 +779,7 @@ func (client *P2SVPNGatewaysClient) resetCreateRequest(ctx context.Context, reso // BeginUpdateTags - Updates virtual wan p2s vpn gateway tags. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the P2SVpnGateway. // - gatewayName - The name of the gateway. // - p2SVPNGatewayParameters - Parameters supplied to update a virtual wan p2s vpn gateway tags. @@ -803,7 +803,7 @@ func (client *P2SVPNGatewaysClient) BeginUpdateTags(ctx context.Context, resourc // UpdateTags - Updates virtual wan p2s vpn gateway tags. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *P2SVPNGatewaysClient) updateTags(ctx context.Context, resourceGroupName string, gatewayName string, p2SVPNGatewayParameters TagsObject, options *P2SVPNGatewaysClientBeginUpdateTagsOptions) (*http.Response, error) { var err error const operationName = "P2SVPNGatewaysClient.BeginUpdateTags" @@ -845,7 +845,7 @@ func (client *P2SVPNGatewaysClient) updateTagsCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, p2SVPNGatewayParameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/p2svpngateways_client_example_test.go b/sdk/resourcemanager/network/armnetwork/p2svpngateways_client_example_test.go deleted file mode 100644 index bb80155a5306..000000000000 --- a/sdk/resourcemanager/network/armnetwork/p2svpngateways_client_example_test.go +++ /dev/null @@ -1,1079 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/P2SVpnGatewayGet.json -func ExampleP2SVPNGatewaysClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewP2SVPNGatewaysClient().Get(ctx, "rg1", "p2sVpnGateway1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.P2SVPNGateway = armnetwork.P2SVPNGateway{ - // Name: to.Ptr("p2sVpnGateway1"), - // Type: to.Ptr("Microsoft.Network/p2sVpnGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/P2SvpnGateways/p2sVpnGateway1"), - // Location: to.Ptr("West US"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.P2SVPNGatewayProperties{ - // CustomDNSServers: []*string{ - // to.Ptr("3.3.3.3")}, - // IsRoutingPreferenceInternet: to.Ptr(false), - // P2SConnectionConfigurations: []*armnetwork.P2SConnectionConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"), - // Name: to.Ptr("P2SConnectionConfig1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.P2SConnectionConfigurationProperties{ - // ConfigurationPolicyGroupAssociations: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/configurationPolicyGroups/policyGroup1"), - // }}, - // EnableInternetSecurity: to.Ptr(false), - // PreviousConfigurationPolicyGroupAssociations: []*armnetwork.VPNServerConfigurationPolicyGroup{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"), - // Name: to.Ptr("policyGroup1"), - // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ - // IsDefault: to.Ptr(true), - // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ - // { - // Name: to.Ptr("policy1"), - // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID), - // AttributeValue: to.Ptr("6ad1bd08"), - // }}, - // Priority: to.Ptr[int32](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RoutingConfiguration: &armnetwork.RoutingConfiguration{ - // AssociatedRouteTable: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - // }, - // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ - // IDs: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable2"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable3"), - // }}, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, - // }, - // VnetRoutes: &armnetwork.VnetRoute{ - // StaticRoutes: []*armnetwork.StaticRoute{ - // }, - // }, - // }, - // VPNClientAddressPool: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("101.3.0.0/16")}, - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualHub: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"), - // }, - // VPNClientConnectionHealth: &armnetwork.VPNClientConnectionHealth{ - // AllocatedIPAddresses: []*string{ - // to.Ptr("1.1.1.1"), - // to.Ptr("2.2.2.2")}, - // TotalEgressBytesTransferred: to.Ptr[int64](3000), - // TotalIngressBytesTransferred: to.Ptr[int64](2000), - // VPNClientConnectionsCount: to.Ptr[int32](2), - // }, - // VPNGatewayScaleUnit: to.Ptr[int32](1), - // VPNServerConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/P2SVpnGatewayPut.json -func ExampleP2SVPNGatewaysClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewP2SVPNGatewaysClient().BeginCreateOrUpdate(ctx, "rg1", "p2sVpnGateway1", armnetwork.P2SVPNGateway{ - Location: to.Ptr("West US"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, - Properties: &armnetwork.P2SVPNGatewayProperties{ - CustomDNSServers: []*string{ - to.Ptr("1.1.1.1"), - to.Ptr("2.2.2.2")}, - IsRoutingPreferenceInternet: to.Ptr(false), - P2SConnectionConfigurations: []*armnetwork.P2SConnectionConfiguration{ - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"), - Name: to.Ptr("P2SConnectionConfig1"), - Properties: &armnetwork.P2SConnectionConfigurationProperties{ - RoutingConfiguration: &armnetwork.RoutingConfiguration{ - AssociatedRouteTable: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - }, - PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ - IDs: []*armnetwork.SubResource{ - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - }, - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable2"), - }, - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable3"), - }}, - Labels: []*string{ - to.Ptr("label1"), - to.Ptr("label2")}, - }, - VnetRoutes: &armnetwork.VnetRoute{ - StaticRoutes: []*armnetwork.StaticRoute{}, - }, - }, - VPNClientAddressPool: &armnetwork.AddressSpace{ - AddressPrefixes: []*string{ - to.Ptr("101.3.0.0/16")}, - }, - }, - }}, - VirtualHub: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"), - }, - VPNGatewayScaleUnit: to.Ptr[int32](1), - VPNServerConfiguration: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.P2SVPNGateway = armnetwork.P2SVPNGateway{ - // Name: to.Ptr("p2sVpnGateway1"), - // Type: to.Ptr("Microsoft.Network/p2sVpnGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/P2SvpnGateways/p2sVpnGateway1"), - // Location: to.Ptr("West US"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.P2SVPNGatewayProperties{ - // CustomDNSServers: []*string{ - // to.Ptr("1.1.1.1"), - // to.Ptr("2.2.2.2")}, - // IsRoutingPreferenceInternet: to.Ptr(false), - // P2SConnectionConfigurations: []*armnetwork.P2SConnectionConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"), - // Name: to.Ptr("P2SConnectionConfig1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.P2SConnectionConfigurationProperties{ - // ConfigurationPolicyGroupAssociations: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/configurationPolicyGroups/policyGroup1"), - // }}, - // EnableInternetSecurity: to.Ptr(false), - // PreviousConfigurationPolicyGroupAssociations: []*armnetwork.VPNServerConfigurationPolicyGroup{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"), - // Name: to.Ptr("policyGroup1"), - // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ - // IsDefault: to.Ptr(true), - // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ - // { - // Name: to.Ptr("policy1"), - // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID), - // AttributeValue: to.Ptr("6ad1bd08"), - // }}, - // Priority: to.Ptr[int32](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RoutingConfiguration: &armnetwork.RoutingConfiguration{ - // AssociatedRouteTable: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - // }, - // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ - // IDs: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable2"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable3"), - // }}, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, - // }, - // VnetRoutes: &armnetwork.VnetRoute{ - // StaticRoutes: []*armnetwork.StaticRoute{ - // }, - // }, - // }, - // VPNClientAddressPool: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("101.3.0.0/16")}, - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualHub: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"), - // }, - // VPNClientConnectionHealth: &armnetwork.VPNClientConnectionHealth{ - // AllocatedIPAddresses: []*string{ - // }, - // TotalEgressBytesTransferred: to.Ptr[int64](0), - // TotalIngressBytesTransferred: to.Ptr[int64](0), - // VPNClientConnectionsCount: to.Ptr[int32](0), - // }, - // VPNGatewayScaleUnit: to.Ptr[int32](1), - // VPNServerConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/P2SVpnGatewayUpdateTags.json -func ExampleP2SVPNGatewaysClient_BeginUpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewP2SVPNGatewaysClient().BeginUpdateTags(ctx, "rg1", "p2sVpnGateway1", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.P2SVPNGateway = armnetwork.P2SVPNGateway{ - // Name: to.Ptr("p2sVpnGateway1"), - // Type: to.Ptr("Microsoft.Network/p2sVpnGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/P2SvpnGateways/p2sVpnGateway1"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.P2SVPNGatewayProperties{ - // CustomDNSServers: []*string{ - // to.Ptr("3.3.3.3")}, - // IsRoutingPreferenceInternet: to.Ptr(false), - // P2SConnectionConfigurations: []*armnetwork.P2SConnectionConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"), - // Name: to.Ptr("P2SConnectionConfig1"), - // Properties: &armnetwork.P2SConnectionConfigurationProperties{ - // ConfigurationPolicyGroupAssociations: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/configurationPolicyGroups/policyGroup1"), - // }}, - // EnableInternetSecurity: to.Ptr(false), - // PreviousConfigurationPolicyGroupAssociations: []*armnetwork.VPNServerConfigurationPolicyGroup{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"), - // Name: to.Ptr("policyGroup1"), - // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ - // IsDefault: to.Ptr(true), - // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ - // { - // Name: to.Ptr("policy1"), - // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID), - // AttributeValue: to.Ptr("6ad1bd08"), - // }}, - // Priority: to.Ptr[int32](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // RoutingConfiguration: &armnetwork.RoutingConfiguration{ - // AssociatedRouteTable: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - // }, - // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ - // IDs: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable2"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable3"), - // }}, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, - // }, - // VnetRoutes: &armnetwork.VnetRoute{ - // StaticRoutes: []*armnetwork.StaticRoute{ - // }, - // }, - // }, - // VPNClientAddressPool: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("101.3.0.0/16")}, - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualHub: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"), - // }, - // VPNClientConnectionHealth: &armnetwork.VPNClientConnectionHealth{ - // AllocatedIPAddresses: []*string{ - // to.Ptr("1.1.1.1"), - // to.Ptr("2.2.2.2")}, - // TotalEgressBytesTransferred: to.Ptr[int64](3000), - // TotalIngressBytesTransferred: to.Ptr[int64](2000), - // VPNClientConnectionsCount: to.Ptr[int32](2), - // }, - // VPNGatewayScaleUnit: to.Ptr[int32](1), - // VPNServerConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/P2SVpnGatewayDelete.json -func ExampleP2SVPNGatewaysClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewP2SVPNGatewaysClient().BeginDelete(ctx, "rg1", "p2sVpnGateway1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/P2SVpnGatewayListByResourceGroup.json -func ExampleP2SVPNGatewaysClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewP2SVPNGatewaysClient().NewListByResourceGroupPager("rg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ListP2SVPNGatewaysResult = armnetwork.ListP2SVPNGatewaysResult{ - // Value: []*armnetwork.P2SVPNGateway{ - // { - // Name: to.Ptr("p2sVpnGateway1"), - // Type: to.Ptr("Microsoft.Network/p2sVpnGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/P2SvpnGateways/p2sVpnGateway1"), - // Location: to.Ptr("West US"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.P2SVPNGatewayProperties{ - // CustomDNSServers: []*string{ - // to.Ptr("3.3.3.3")}, - // IsRoutingPreferenceInternet: to.Ptr(false), - // P2SConnectionConfigurations: []*armnetwork.P2SConnectionConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"), - // Name: to.Ptr("P2SConnectionConfig1"), - // Properties: &armnetwork.P2SConnectionConfigurationProperties{ - // ConfigurationPolicyGroupAssociations: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/configurationPolicyGroups/policyGroup1"), - // }}, - // EnableInternetSecurity: to.Ptr(false), - // PreviousConfigurationPolicyGroupAssociations: []*armnetwork.VPNServerConfigurationPolicyGroup{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"), - // Name: to.Ptr("policyGroup1"), - // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ - // IsDefault: to.Ptr(true), - // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ - // { - // Name: to.Ptr("policy1"), - // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID), - // AttributeValue: to.Ptr("6ad1bd08"), - // }}, - // Priority: to.Ptr[int32](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // RoutingConfiguration: &armnetwork.RoutingConfiguration{ - // AssociatedRouteTable: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - // }, - // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ - // IDs: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable2"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable3"), - // }}, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, - // }, - // VnetRoutes: &armnetwork.VnetRoute{ - // StaticRoutes: []*armnetwork.StaticRoute{ - // }, - // }, - // }, - // VPNClientAddressPool: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("101.3.0.0/16")}, - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualHub: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"), - // }, - // VPNClientConnectionHealth: &armnetwork.VPNClientConnectionHealth{ - // AllocatedIPAddresses: []*string{ - // to.Ptr("1.1.1.1"), - // to.Ptr("2.2.2.2")}, - // TotalEgressBytesTransferred: to.Ptr[int64](3000), - // TotalIngressBytesTransferred: to.Ptr[int64](2000), - // VPNClientConnectionsCount: to.Ptr[int32](2), - // }, - // VPNGatewayScaleUnit: to.Ptr[int32](1), - // VPNServerConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1"), - // }, - // }, - // }, - // { - // Name: to.Ptr("p2sVpnGateway2"), - // Type: to.Ptr("Microsoft.Network/p2sVpnGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/P2SvpnGateways/p2sVpnGateway2"), - // Location: to.Ptr("West US"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.P2SVPNGatewayProperties{ - // CustomDNSServers: []*string{ - // to.Ptr("4.4.4.4")}, - // IsRoutingPreferenceInternet: to.Ptr(false), - // P2SConnectionConfigurations: []*armnetwork.P2SConnectionConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"), - // Name: to.Ptr("P2SConnectionConfig1"), - // Properties: &armnetwork.P2SConnectionConfigurationProperties{ - // ConfigurationPolicyGroupAssociations: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/configurationPolicyGroups/policyGroup1"), - // }}, - // EnableInternetSecurity: to.Ptr(false), - // PreviousConfigurationPolicyGroupAssociations: []*armnetwork.VPNServerConfigurationPolicyGroup{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"), - // Name: to.Ptr("policyGroup1"), - // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ - // IsDefault: to.Ptr(true), - // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ - // { - // Name: to.Ptr("policy1"), - // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID), - // AttributeValue: to.Ptr("6ad1bd08"), - // }}, - // Priority: to.Ptr[int32](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // RoutingConfiguration: &armnetwork.RoutingConfiguration{ - // AssociatedRouteTable: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub2/hubRouteTables/hubRouteTable1"), - // }, - // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ - // IDs: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub2/hubRouteTables/hubRouteTable1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub2/hubRouteTables/hubRouteTable2"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub2/hubRouteTables/hubRouteTable3"), - // }}, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, - // }, - // VnetRoutes: &armnetwork.VnetRoute{ - // StaticRoutes: []*armnetwork.StaticRoute{ - // }, - // }, - // }, - // VPNClientAddressPool: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("101.3.0.0/16")}, - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualHub: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub2"), - // }, - // VPNClientConnectionHealth: &armnetwork.VPNClientConnectionHealth{ - // AllocatedIPAddresses: []*string{ - // to.Ptr("1.1.1.1"), - // to.Ptr("2.2.2.2")}, - // TotalEgressBytesTransferred: to.Ptr[int64](3000), - // TotalIngressBytesTransferred: to.Ptr[int64](2000), - // VPNClientConnectionsCount: to.Ptr[int32](2), - // }, - // VPNGatewayScaleUnit: to.Ptr[int32](1), - // VPNServerConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/P2SVpnGatewayList.json -func ExampleP2SVPNGatewaysClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewP2SVPNGatewaysClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ListP2SVPNGatewaysResult = armnetwork.ListP2SVPNGatewaysResult{ - // Value: []*armnetwork.P2SVPNGateway{ - // { - // Name: to.Ptr("p2sVpnGateway1"), - // Type: to.Ptr("Microsoft.Network/p2sVpnGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/P2SvpnGateways/p2sVpnGateway1"), - // Location: to.Ptr("West US"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.P2SVPNGatewayProperties{ - // CustomDNSServers: []*string{ - // to.Ptr("3.3.3.3")}, - // IsRoutingPreferenceInternet: to.Ptr(false), - // P2SConnectionConfigurations: []*armnetwork.P2SConnectionConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"), - // Name: to.Ptr("P2SConnectionConfig1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.P2SConnectionConfigurationProperties{ - // ConfigurationPolicyGroupAssociations: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/configurationPolicyGroups/policyGroup1"), - // }}, - // EnableInternetSecurity: to.Ptr(true), - // PreviousConfigurationPolicyGroupAssociations: []*armnetwork.VPNServerConfigurationPolicyGroup{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"), - // Name: to.Ptr("policyGroup1"), - // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ - // IsDefault: to.Ptr(true), - // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ - // { - // Name: to.Ptr("policy1"), - // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID), - // AttributeValue: to.Ptr("6ad1bd08"), - // }}, - // Priority: to.Ptr[int32](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RoutingConfiguration: &armnetwork.RoutingConfiguration{ - // AssociatedRouteTable: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - // }, - // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ - // IDs: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable2"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable3"), - // }}, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, - // }, - // VnetRoutes: &armnetwork.VnetRoute{ - // StaticRoutes: []*armnetwork.StaticRoute{ - // }, - // }, - // }, - // VPNClientAddressPool: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("101.3.0.0/16")}, - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualHub: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"), - // }, - // VPNClientConnectionHealth: &armnetwork.VPNClientConnectionHealth{ - // AllocatedIPAddresses: []*string{ - // to.Ptr("1.1.1.1"), - // to.Ptr("2.2.2.2")}, - // TotalEgressBytesTransferred: to.Ptr[int64](3000), - // TotalIngressBytesTransferred: to.Ptr[int64](2000), - // VPNClientConnectionsCount: to.Ptr[int32](2), - // }, - // VPNGatewayScaleUnit: to.Ptr[int32](1), - // VPNServerConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1"), - // }, - // }, - // }, - // { - // Name: to.Ptr("p2sVpnGateway2"), - // Type: to.Ptr("Microsoft.Network/p2sVpnGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/P2SvpnGateways/p2sVpnGateway2"), - // Location: to.Ptr("West US"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.P2SVPNGatewayProperties{ - // CustomDNSServers: []*string{ - // to.Ptr("4.4.4.4")}, - // IsRoutingPreferenceInternet: to.Ptr(false), - // P2SConnectionConfigurations: []*armnetwork.P2SConnectionConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"), - // Name: to.Ptr("P2SConnectionConfig1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.P2SConnectionConfigurationProperties{ - // ConfigurationPolicyGroupAssociations: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/configurationPolicyGroups/policyGroup1"), - // }}, - // EnableInternetSecurity: to.Ptr(true), - // PreviousConfigurationPolicyGroupAssociations: []*armnetwork.VPNServerConfigurationPolicyGroup{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"), - // Name: to.Ptr("policyGroup1"), - // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ - // IsDefault: to.Ptr(true), - // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ - // { - // Name: to.Ptr("policy1"), - // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID), - // AttributeValue: to.Ptr("6ad1bd08"), - // }}, - // Priority: to.Ptr[int32](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RoutingConfiguration: &armnetwork.RoutingConfiguration{ - // AssociatedRouteTable: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub2/hubRouteTables/hubRouteTable1"), - // }, - // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ - // IDs: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub2/hubRouteTables/hubRouteTable1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub2/hubRouteTables/hubRouteTable2"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub2/hubRouteTables/hubRouteTable3"), - // }}, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, - // }, - // VnetRoutes: &armnetwork.VnetRoute{ - // StaticRoutes: []*armnetwork.StaticRoute{ - // }, - // }, - // }, - // VPNClientAddressPool: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("101.4.0.0/16")}, - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualHub: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub2"), - // }, - // VPNClientConnectionHealth: &armnetwork.VPNClientConnectionHealth{ - // AllocatedIPAddresses: []*string{ - // to.Ptr("1.1.1.1"), - // to.Ptr("2.2.2.2")}, - // TotalEgressBytesTransferred: to.Ptr[int64](3000), - // TotalIngressBytesTransferred: to.Ptr[int64](2000), - // VPNClientConnectionsCount: to.Ptr[int32](2), - // }, - // VPNGatewayScaleUnit: to.Ptr[int32](1), - // VPNServerConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/P2SVpnGatewayReset.json -func ExampleP2SVPNGatewaysClient_BeginReset() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewP2SVPNGatewaysClient().BeginReset(ctx, "rg1", "p2sVpnGateway1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.P2SVPNGateway = armnetwork.P2SVPNGateway{ - // Name: to.Ptr("p2sVpnGateway1"), - // Type: to.Ptr("Microsoft.Network/p2sVpnGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/P2SvpnGateways/p2sVpnGateway1"), - // Location: to.Ptr("West US"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.P2SVPNGatewayProperties{ - // CustomDNSServers: []*string{ - // to.Ptr("3.3.3.3")}, - // IsRoutingPreferenceInternet: to.Ptr(false), - // P2SConnectionConfigurations: []*armnetwork.P2SConnectionConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"), - // Name: to.Ptr("P2SConnectionConfig1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.P2SConnectionConfigurationProperties{ - // ConfigurationPolicyGroupAssociations: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/configurationPolicyGroups/policyGroup1"), - // }}, - // EnableInternetSecurity: to.Ptr(false), - // PreviousConfigurationPolicyGroupAssociations: []*armnetwork.VPNServerConfigurationPolicyGroup{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"), - // Name: to.Ptr("policyGroup1"), - // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ - // IsDefault: to.Ptr(true), - // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ - // { - // Name: to.Ptr("policy1"), - // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID), - // AttributeValue: to.Ptr("6ad1bd08"), - // }}, - // Priority: to.Ptr[int32](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VPNClientAddressPool: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("101.3.0.0/16")}, - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualHub: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"), - // }, - // VPNClientConnectionHealth: &armnetwork.VPNClientConnectionHealth{ - // AllocatedIPAddresses: []*string{ - // to.Ptr("1.1.1.1"), - // to.Ptr("2.2.2.2")}, - // TotalEgressBytesTransferred: to.Ptr[int64](3000), - // TotalIngressBytesTransferred: to.Ptr[int64](2000), - // VPNClientConnectionsCount: to.Ptr[int32](2), - // }, - // VPNGatewayScaleUnit: to.Ptr[int32](1), - // VPNServerConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/P2SVpnGatewayGenerateVpnProfile.json -func ExampleP2SVPNGatewaysClient_BeginGenerateVPNProfile() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewP2SVPNGatewaysClient().BeginGenerateVPNProfile(ctx, "rg1", "p2sVpnGateway1", armnetwork.P2SVPNProfileParameters{ - AuthenticationMethod: to.Ptr(armnetwork.AuthenticationMethodEAPTLS), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VPNProfileResponse = armnetwork.VPNProfileResponse{ - // ProfileURL: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/P2SVpnGatewayGetConnectionHealth.json -func ExampleP2SVPNGatewaysClient_BeginGetP2SVPNConnectionHealth() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewP2SVPNGatewaysClient().BeginGetP2SVPNConnectionHealth(ctx, "rg1", "p2sVpnGateway1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.P2SVPNGateway = armnetwork.P2SVPNGateway{ - // Name: to.Ptr("p2sVpnGateway1"), - // Type: to.Ptr("Microsoft.Network/p2sVpnGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/P2SvpnGateways/p2sVpnGateway1"), - // Location: to.Ptr("West US"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.P2SVPNGatewayProperties{ - // CustomDNSServers: []*string{ - // to.Ptr("3.3.3.3")}, - // IsRoutingPreferenceInternet: to.Ptr(false), - // P2SConnectionConfigurations: []*armnetwork.P2SConnectionConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"), - // Name: to.Ptr("P2SConnectionConfig1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.P2SConnectionConfigurationProperties{ - // ConfigurationPolicyGroupAssociations: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/configurationPolicyGroups/policyGroup1"), - // }}, - // EnableInternetSecurity: to.Ptr(false), - // PreviousConfigurationPolicyGroupAssociations: []*armnetwork.VPNServerConfigurationPolicyGroup{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"), - // Name: to.Ptr("policyGroup1"), - // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ - // IsDefault: to.Ptr(true), - // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ - // { - // Name: to.Ptr("policy1"), - // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID), - // AttributeValue: to.Ptr("6ad1bd08"), - // }}, - // Priority: to.Ptr[int32](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VPNClientAddressPool: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("101.3.0.0/16")}, - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualHub: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"), - // }, - // VPNClientConnectionHealth: &armnetwork.VPNClientConnectionHealth{ - // AllocatedIPAddresses: []*string{ - // to.Ptr("1.1.1.1"), - // to.Ptr("2.2.2.2")}, - // TotalEgressBytesTransferred: to.Ptr[int64](3000), - // TotalIngressBytesTransferred: to.Ptr[int64](2000), - // VPNClientConnectionsCount: to.Ptr[int32](2), - // }, - // VPNGatewayScaleUnit: to.Ptr[int32](1), - // VPNServerConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/P2SVpnGatewayGetConnectionHealthDetailed.json -func ExampleP2SVPNGatewaysClient_BeginGetP2SVPNConnectionHealthDetailed() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewP2SVPNGatewaysClient().BeginGetP2SVPNConnectionHealthDetailed(ctx, "p2s-vpn-gateway-test", "p2svpngateway", armnetwork.P2SVPNConnectionHealthRequest{ - OutputBlobSasURL: to.Ptr("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"), - VPNUserNamesFilter: []*string{ - to.Ptr("vpnUser1"), - to.Ptr("vpnUser2")}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.P2SVPNConnectionHealth = armnetwork.P2SVPNConnectionHealth{ - // SasURL: to.Ptr("aaaaaaaaaaaaaaaaaa"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/P2sVpnGatewaysDisconnectP2sVpnConnections.json -func ExampleP2SVPNGatewaysClient_BeginDisconnectP2SVPNConnections() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewP2SVPNGatewaysClient().BeginDisconnectP2SVPNConnections(ctx, "p2s-vpn-gateway-test", "p2svpngateway", armnetwork.P2SVPNConnectionRequest{ - VPNConnectionIDs: []*string{ - to.Ptr("vpnconnId1"), - to.Ptr("vpnconnId2")}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/network/armnetwork/packetcaptures_client.go b/sdk/resourcemanager/network/armnetwork/packetcaptures_client.go index 0df4d027f3d6..47ae77d8f1ed 100644 --- a/sdk/resourcemanager/network/armnetwork/packetcaptures_client.go +++ b/sdk/resourcemanager/network/armnetwork/packetcaptures_client.go @@ -47,7 +47,7 @@ func NewPacketCapturesClient(subscriptionID string, credential azcore.TokenCrede // BeginCreate - Create and start a packet capture on the specified VM. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkWatcherName - The name of the network watcher. // - packetCaptureName - The name of the packet capture session. @@ -72,7 +72,7 @@ func (client *PacketCapturesClient) BeginCreate(ctx context.Context, resourceGro // Create - Create and start a packet capture on the specified VM. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *PacketCapturesClient) create(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string, parameters PacketCapture, options *PacketCapturesClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "PacketCapturesClient.BeginCreate" @@ -118,7 +118,7 @@ func (client *PacketCapturesClient) createCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -130,7 +130,7 @@ func (client *PacketCapturesClient) createCreateRequest(ctx context.Context, res // BeginDelete - Deletes the specified packet capture session. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkWatcherName - The name of the network watcher. // - packetCaptureName - The name of the packet capture session. @@ -154,7 +154,7 @@ func (client *PacketCapturesClient) BeginDelete(ctx context.Context, resourceGro // Delete - Deletes the specified packet capture session. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *PacketCapturesClient) deleteOperation(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string, options *PacketCapturesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "PacketCapturesClient.BeginDelete" @@ -200,7 +200,7 @@ func (client *PacketCapturesClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -209,7 +209,7 @@ func (client *PacketCapturesClient) deleteCreateRequest(ctx context.Context, res // Get - Gets a packet capture session by name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkWatcherName - The name of the network watcher. // - packetCaptureName - The name of the packet capture session. @@ -260,7 +260,7 @@ func (client *PacketCapturesClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -278,7 +278,7 @@ func (client *PacketCapturesClient) getHandleResponse(resp *http.Response) (Pack // BeginGetStatus - Query the status of a running packet capture session. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkWatcherName - The name of the Network Watcher resource. // - packetCaptureName - The name given to the packet capture session. @@ -302,7 +302,7 @@ func (client *PacketCapturesClient) BeginGetStatus(ctx context.Context, resource // GetStatus - Query the status of a running packet capture session. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *PacketCapturesClient) getStatus(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string, options *PacketCapturesClientBeginGetStatusOptions) (*http.Response, error) { var err error const operationName = "PacketCapturesClient.BeginGetStatus" @@ -348,7 +348,7 @@ func (client *PacketCapturesClient) getStatusCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -356,7 +356,7 @@ func (client *PacketCapturesClient) getStatusCreateRequest(ctx context.Context, // NewListPager - Lists all packet capture sessions within the specified resource group. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkWatcherName - The name of the Network Watcher resource. // - options - PacketCapturesClientListOptions contains the optional parameters for the PacketCapturesClient.NewListPager method. @@ -404,7 +404,7 @@ func (client *PacketCapturesClient) listCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -422,7 +422,7 @@ func (client *PacketCapturesClient) listHandleResponse(resp *http.Response) (Pac // BeginStop - Stops a specified packet capture session. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkWatcherName - The name of the network watcher. // - packetCaptureName - The name of the packet capture session. @@ -446,7 +446,7 @@ func (client *PacketCapturesClient) BeginStop(ctx context.Context, resourceGroup // Stop - Stops a specified packet capture session. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *PacketCapturesClient) stop(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string, options *PacketCapturesClientBeginStopOptions) (*http.Response, error) { var err error const operationName = "PacketCapturesClient.BeginStop" @@ -492,7 +492,7 @@ func (client *PacketCapturesClient) stopCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/packetcaptures_client_example_test.go b/sdk/resourcemanager/network/armnetwork/packetcaptures_client_example_test.go deleted file mode 100644 index 991546131f01..000000000000 --- a/sdk/resourcemanager/network/armnetwork/packetcaptures_client_example_test.go +++ /dev/null @@ -1,246 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkWatcherPacketCaptureCreate.json -func ExamplePacketCapturesClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPacketCapturesClient().BeginCreate(ctx, "rg1", "nw1", "pc1", armnetwork.PacketCapture{ - Properties: &armnetwork.PacketCaptureParameters{ - BytesToCapturePerPacket: to.Ptr[int64](10000), - Filters: []*armnetwork.PacketCaptureFilter{ - { - LocalIPAddress: to.Ptr("10.0.0.4"), - LocalPort: to.Ptr("80"), - Protocol: to.Ptr(armnetwork.PcProtocolTCP), - }}, - StorageLocation: &armnetwork.PacketCaptureStorageLocation{ - FilePath: to.Ptr("D:\\capture\\pc1.cap"), - StorageID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Storage/storageAccounts/pcstore"), - StoragePath: to.Ptr("https://mytestaccountname.blob.core.windows.net/capture/pc1.cap"), - }, - Target: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1"), - TimeLimitInSeconds: to.Ptr[int32](100), - TotalBytesPerSession: to.Ptr[int64](100000), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkWatcherPacketCaptureGet.json -func ExamplePacketCapturesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPacketCapturesClient().Get(ctx, "rg1", "nw1", "pc1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PacketCaptureResult = armnetwork.PacketCaptureResult{ - // Name: to.Ptr("pc1"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw1/packetCaptures/pc1"), - // Properties: &armnetwork.PacketCaptureResultProperties{ - // BytesToCapturePerPacket: to.Ptr[int64](10000), - // Filters: []*armnetwork.PacketCaptureFilter{ - // { - // LocalIPAddress: to.Ptr("10.0.0.4"), - // LocalPort: to.Ptr("80"), - // Protocol: to.Ptr(armnetwork.PcProtocolTCP), - // }}, - // StorageLocation: &armnetwork.PacketCaptureStorageLocation{ - // FilePath: to.Ptr("D:\\capture\\pc1.cap"), - // StorageID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Storage/storageAccounts/pcstore"), - // StoragePath: to.Ptr("https://mytestaccountname.blob.core.windows.net/capture/pc1.cap"), - // }, - // Target: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1"), - // TimeLimitInSeconds: to.Ptr[int32](100), - // TotalBytesPerSession: to.Ptr[int64](100000), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkWatcherPacketCaptureDelete.json -func ExamplePacketCapturesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPacketCapturesClient().BeginDelete(ctx, "rg1", "nw1", "pc1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkWatcherPacketCaptureStop.json -func ExamplePacketCapturesClient_BeginStop() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPacketCapturesClient().BeginStop(ctx, "rg1", "nw1", "pc1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkWatcherPacketCaptureQueryStatus.json -func ExamplePacketCapturesClient_BeginGetStatus() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPacketCapturesClient().BeginGetStatus(ctx, "rg1", "nw1", "pc1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PacketCaptureQueryStatusResult = armnetwork.PacketCaptureQueryStatusResult{ - // Name: to.Ptr("pc1"), - // CaptureStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-09-07T12:35:24Z"); return t}()), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw1/packetCaptures/pc1"), - // PacketCaptureError: []*armnetwork.PcError{ - // }, - // PacketCaptureStatus: to.Ptr(armnetwork.PcStatusStopped), - // StopReason: to.Ptr("TimeExceeded"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkWatcherPacketCapturesList.json -func ExamplePacketCapturesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPacketCapturesClient().NewListPager("rg1", "nw1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PacketCaptureListResult = armnetwork.PacketCaptureListResult{ - // Value: []*armnetwork.PacketCaptureResult{ - // { - // Name: to.Ptr("pc1"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw1/packetCaptures/pc1"), - // Properties: &armnetwork.PacketCaptureResultProperties{ - // BytesToCapturePerPacket: to.Ptr[int64](10000), - // Filters: []*armnetwork.PacketCaptureFilter{ - // { - // LocalIPAddress: to.Ptr("10.0.0.4"), - // LocalPort: to.Ptr("80"), - // Protocol: to.Ptr(armnetwork.PcProtocolTCP), - // }}, - // StorageLocation: &armnetwork.PacketCaptureStorageLocation{ - // FilePath: to.Ptr("D:\\capture\\pc1.cap"), - // StorageID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Storage/storageAccounts/pcstore"), - // StoragePath: to.Ptr("https://mytestaccountname.blob.core.windows.net/capture/pc1.cap"), - // }, - // Target: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1"), - // TimeLimitInSeconds: to.Ptr[int32](100), - // TotalBytesPerSession: to.Ptr[int64](100000), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }, - // { - // Name: to.Ptr("pc2"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw1/packetCaptures/pc2"), - // Properties: &armnetwork.PacketCaptureResultProperties{ - // BytesToCapturePerPacket: to.Ptr[int64](10000), - // Filters: []*armnetwork.PacketCaptureFilter{ - // }, - // StorageLocation: &armnetwork.PacketCaptureStorageLocation{ - // FilePath: to.Ptr("D:\\capture\\pc2.cap"), - // StorageID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Storage/storageAccounts/pcstore"), - // StoragePath: to.Ptr("https://mytestaccountname.blob.core.windows.net/capture/pc2.cap"), - // }, - // Target: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1"), - // TimeLimitInSeconds: to.Ptr[int32](100), - // TotalBytesPerSession: to.Ptr[int64](100000), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/peerexpressroutecircuitconnections_client.go b/sdk/resourcemanager/network/armnetwork/peerexpressroutecircuitconnections_client.go index 53a520d42092..46011654c4c8 100644 --- a/sdk/resourcemanager/network/armnetwork/peerexpressroutecircuitconnections_client.go +++ b/sdk/resourcemanager/network/armnetwork/peerexpressroutecircuitconnections_client.go @@ -47,7 +47,7 @@ func NewPeerExpressRouteCircuitConnectionsClient(subscriptionID string, credenti // Get - Gets the specified Peer Express Route Circuit Connection from the specified express route circuit. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - circuitName - The name of the express route circuit. // - peeringName - The name of the peering. @@ -104,7 +104,7 @@ func (client *PeerExpressRouteCircuitConnectionsClient) getCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -121,7 +121,7 @@ func (client *PeerExpressRouteCircuitConnectionsClient) getHandleResponse(resp * // NewListPager - Gets all global reach peer connections associated with a private peering in an express route circuit. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - circuitName - The name of the circuit. // - peeringName - The name of the peering. @@ -181,7 +181,7 @@ func (client *PeerExpressRouteCircuitConnectionsClient) listCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/peerexpressroutecircuitconnections_client_example_test.go b/sdk/resourcemanager/network/armnetwork/peerexpressroutecircuitconnections_client_example_test.go deleted file mode 100644 index d1b3cd96a0cb..000000000000 --- a/sdk/resourcemanager/network/armnetwork/peerexpressroutecircuitconnections_client_example_test.go +++ /dev/null @@ -1,120 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/PeerExpressRouteCircuitConnectionGet.json -func ExamplePeerExpressRouteCircuitConnectionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPeerExpressRouteCircuitConnectionsClient().Get(ctx, "rg1", "ExpressRouteARMCircuitA", "AzurePrivatePeering", "60aee347-e889-4a42-8c1b-0aae8b1e4013", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PeerExpressRouteCircuitConnection = armnetwork.PeerExpressRouteCircuitConnection{ - // ID: to.Ptr("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/ExpressRouteARMCircuitA/peerings/AzurePrivatePeering/peerConnections/60aee347-e889-4a42-8c1b-0aae8b1e4013"), - // Name: to.Ptr("60aee347-e889-4a42-8c1b-0aae8b1e4013"), - // Etag: to.Ptr("W/\"6ffbbb06-da20-44ca-a34f-280c4653b1e9\""), - // Properties: &armnetwork.PeerExpressRouteCircuitConnectionPropertiesFormat{ - // AddressPrefix: to.Ptr("20.0.0.0/29"), - // AuthResourceGUID: to.Ptr(""), - // CircuitConnectionStatus: to.Ptr(armnetwork.CircuitConnectionStatusConnected), - // ConnectionName: to.Ptr("circuitConnectionWestusEastus"), - // ExpressRouteCircuitPeering: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/ExpressRouteARMCircuitA/peerings/AzurePrivatePeering"), - // }, - // PeerExpressRouteCircuitPeering: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/ExpressRouteARMCircuitB/peerings/AzurePrivatePeering"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/PeerExpressRouteCircuitConnectionList.json -func ExamplePeerExpressRouteCircuitConnectionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPeerExpressRouteCircuitConnectionsClient().NewListPager("rg1", "ExpressRouteARMCircuitA", "AzurePrivatePeering", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PeerExpressRouteCircuitConnectionListResult = armnetwork.PeerExpressRouteCircuitConnectionListResult{ - // Value: []*armnetwork.PeerExpressRouteCircuitConnection{ - // { - // ID: to.Ptr("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/ExpressRouteARMCircuitA/peerings/AzurePrivatePeering/peerConnections/60aee347-e889-4a42-8c1b-0aae8b1e4013"), - // Name: to.Ptr("60aee347-e889-4a42-8c1b-0aae8b1e4013"), - // Etag: to.Ptr("W/\"6ffbbb06-da20-44ca-a34f-280c4653b1e9\""), - // Properties: &armnetwork.PeerExpressRouteCircuitConnectionPropertiesFormat{ - // AddressPrefix: to.Ptr("20.0.0.0/29"), - // AuthResourceGUID: to.Ptr(""), - // CircuitConnectionStatus: to.Ptr(armnetwork.CircuitConnectionStatusConnected), - // ConnectionName: to.Ptr("circuitConnectionWestusEastus"), - // ExpressRouteCircuitPeering: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/ExpressRouteARMCircuitA/peerings/AzurePrivatePeering"), - // }, - // PeerExpressRouteCircuitPeering: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/ExpressRouteARMCircuitB/peerings/AzurePrivatePeering"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/ExpressRouteARMCircuitA/peerings/AzurePrivatePeering/peerConnections/c8b17193-8dd3-4f61-866d-8cdd2e2e268e"), - // Name: to.Ptr("c8b17193-8dd3-4f61-866d-8cdd2e2e268e"), - // Etag: to.Ptr("W/\"6ffbbb06-da20-44ca-a34f-280c4653b1e9\""), - // Properties: &armnetwork.PeerExpressRouteCircuitConnectionPropertiesFormat{ - // AddressPrefix: to.Ptr("30.0.0.0/29"), - // AuthResourceGUID: to.Ptr("64283012-d377-421d-8398-f6aeb2ac7ea0"), - // CircuitConnectionStatus: to.Ptr(armnetwork.CircuitConnectionStatusConnected), - // ConnectionName: to.Ptr("circuitConnectionCentralusEastus"), - // ExpressRouteCircuitPeering: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/ExpressRouteARMCircuitA/peerings/AzurePrivatePeering"), - // }, - // PeerExpressRouteCircuitPeering: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid2/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/ExpressRouteARMCircuitC/peerings/AzurePrivatePeering"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/privatednszonegroups_client.go b/sdk/resourcemanager/network/armnetwork/privatednszonegroups_client.go index 0fc47320f1f8..8051993734f2 100644 --- a/sdk/resourcemanager/network/armnetwork/privatednszonegroups_client.go +++ b/sdk/resourcemanager/network/armnetwork/privatednszonegroups_client.go @@ -47,7 +47,7 @@ func NewPrivateDNSZoneGroupsClient(subscriptionID string, credential azcore.Toke // BeginCreateOrUpdate - Creates or updates a private dns zone group in the specified private endpoint. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - privateEndpointName - The name of the private endpoint. // - privateDNSZoneGroupName - The name of the private dns zone group. @@ -72,7 +72,7 @@ func (client *PrivateDNSZoneGroupsClient) BeginCreateOrUpdate(ctx context.Contex // CreateOrUpdate - Creates or updates a private dns zone group in the specified private endpoint. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *PrivateDNSZoneGroupsClient) createOrUpdate(ctx context.Context, resourceGroupName string, privateEndpointName string, privateDNSZoneGroupName string, parameters PrivateDNSZoneGroup, options *PrivateDNSZoneGroupsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "PrivateDNSZoneGroupsClient.BeginCreateOrUpdate" @@ -118,7 +118,7 @@ func (client *PrivateDNSZoneGroupsClient) createOrUpdateCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -130,7 +130,7 @@ func (client *PrivateDNSZoneGroupsClient) createOrUpdateCreateRequest(ctx contex // BeginDelete - Deletes the specified private dns zone group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - privateEndpointName - The name of the private endpoint. // - privateDNSZoneGroupName - The name of the private dns zone group. @@ -154,7 +154,7 @@ func (client *PrivateDNSZoneGroupsClient) BeginDelete(ctx context.Context, resou // Delete - Deletes the specified private dns zone group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *PrivateDNSZoneGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, privateEndpointName string, privateDNSZoneGroupName string, options *PrivateDNSZoneGroupsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "PrivateDNSZoneGroupsClient.BeginDelete" @@ -200,7 +200,7 @@ func (client *PrivateDNSZoneGroupsClient) deleteCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -209,7 +209,7 @@ func (client *PrivateDNSZoneGroupsClient) deleteCreateRequest(ctx context.Contex // Get - Gets the private dns zone group resource by specified private dns zone group name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - privateEndpointName - The name of the private endpoint. // - privateDNSZoneGroupName - The name of the private dns zone group. @@ -261,7 +261,7 @@ func (client *PrivateDNSZoneGroupsClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -278,7 +278,7 @@ func (client *PrivateDNSZoneGroupsClient) getHandleResponse(resp *http.Response) // NewListPager - Gets all private dns zone groups in a private endpoint. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - privateEndpointName - The name of the private endpoint. // - resourceGroupName - The name of the resource group. // - options - PrivateDNSZoneGroupsClientListOptions contains the optional parameters for the PrivateDNSZoneGroupsClient.NewListPager @@ -333,7 +333,7 @@ func (client *PrivateDNSZoneGroupsClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/privatednszonegroups_client_example_test.go b/sdk/resourcemanager/network/armnetwork/privatednszonegroups_client_example_test.go deleted file mode 100644 index d5971813c48d..000000000000 --- a/sdk/resourcemanager/network/armnetwork/privatednszonegroups_client_example_test.go +++ /dev/null @@ -1,253 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/PrivateEndpointDnsZoneGroupDelete.json -func ExamplePrivateDNSZoneGroupsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateDNSZoneGroupsClient().BeginDelete(ctx, "rg1", "testPe", "testPdnsgroup", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/PrivateEndpointDnsZoneGroupGet.json -func ExamplePrivateDNSZoneGroupsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateDNSZoneGroupsClient().Get(ctx, "rg1", "testPe", "testPdnsgroup", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateDNSZoneGroup = armnetwork.PrivateDNSZoneGroup{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPe/privateDnsZoneGroups/testPdnsgroup"), - // Name: to.Ptr("testPdnsgroup"), - // Properties: &armnetwork.PrivateDNSZoneGroupPropertiesFormat{ - // PrivateDNSZoneConfigs: []*armnetwork.PrivateDNSZoneConfig{ - // { - // Properties: &armnetwork.PrivateDNSZonePropertiesFormat{ - // PrivateDNSZoneID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateDnsZones/zone1.com"), - // RecordSets: []*armnetwork.RecordSet{ - // { - // Fqdn: to.Ptr("abc.zone1.com"), - // IPAddresses: []*string{ - // to.Ptr("10.0.0.4")}, - // RecordSetName: to.Ptr("abc"), - // RecordType: to.Ptr("A"), - // }, - // { - // Fqdn: to.Ptr("abc2.zone1.com"), - // IPAddresses: []*string{ - // to.Ptr("10.0.0.5")}, - // RecordSetName: to.Ptr("abc2"), - // RecordType: to.Ptr("A"), - // }}, - // }, - // }, - // { - // Properties: &armnetwork.PrivateDNSZonePropertiesFormat{ - // PrivateDNSZoneID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateDnsZones/zone2.com"), - // RecordSets: []*armnetwork.RecordSet{ - // { - // Fqdn: to.Ptr("abc.zone2.com"), - // IPAddresses: []*string{ - // to.Ptr("10.0.0.6")}, - // RecordSetName: to.Ptr("abc"), - // RecordType: to.Ptr("A"), - // }, - // { - // Fqdn: to.Ptr("abc2.zone2.com"), - // IPAddresses: []*string{ - // to.Ptr("10.0.0.7")}, - // RecordSetName: to.Ptr("abc2"), - // RecordType: to.Ptr("A"), - // }}, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/PrivateEndpointDnsZoneGroupCreate.json -func ExamplePrivateDNSZoneGroupsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateDNSZoneGroupsClient().BeginCreateOrUpdate(ctx, "rg1", "testPe", "testPdnsgroup", armnetwork.PrivateDNSZoneGroup{ - Properties: &armnetwork.PrivateDNSZoneGroupPropertiesFormat{ - PrivateDNSZoneConfigs: []*armnetwork.PrivateDNSZoneConfig{ - { - Properties: &armnetwork.PrivateDNSZonePropertiesFormat{ - PrivateDNSZoneID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateDnsZones/zone1.com"), - }, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateDNSZoneGroup = armnetwork.PrivateDNSZoneGroup{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPe/privateDnsZoneGroups/testPdnsgroup"), - // Name: to.Ptr("testPdnsgroup"), - // Properties: &armnetwork.PrivateDNSZoneGroupPropertiesFormat{ - // PrivateDNSZoneConfigs: []*armnetwork.PrivateDNSZoneConfig{ - // { - // Properties: &armnetwork.PrivateDNSZonePropertiesFormat{ - // PrivateDNSZoneID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateDnsZones/zone1.com"), - // RecordSets: []*armnetwork.RecordSet{ - // { - // Fqdn: to.Ptr("abc.zone1.com"), - // IPAddresses: []*string{ - // to.Ptr("10.0.0.4")}, - // RecordSetName: to.Ptr("abc"), - // RecordType: to.Ptr("A"), - // }, - // { - // Fqdn: to.Ptr("abc2.zone1.com"), - // IPAddresses: []*string{ - // to.Ptr("10.0.0.5")}, - // RecordSetName: to.Ptr("abc2"), - // RecordType: to.Ptr("A"), - // }}, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/PrivateEndpointDnsZoneGroupList.json -func ExamplePrivateDNSZoneGroupsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrivateDNSZoneGroupsClient().NewListPager("testPe", "rg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PrivateDNSZoneGroupListResult = armnetwork.PrivateDNSZoneGroupListResult{ - // Value: []*armnetwork.PrivateDNSZoneGroup{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPe/privateDnsZoneGroups/testPdnsgroup1"), - // Name: to.Ptr("testPdnsgroup1"), - // Properties: &armnetwork.PrivateDNSZoneGroupPropertiesFormat{ - // PrivateDNSZoneConfigs: []*armnetwork.PrivateDNSZoneConfig{ - // { - // Properties: &armnetwork.PrivateDNSZonePropertiesFormat{ - // PrivateDNSZoneID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateDnsZones/zone1.com"), - // RecordSets: []*armnetwork.RecordSet{ - // { - // Fqdn: to.Ptr("abc.zone1.com"), - // IPAddresses: []*string{ - // to.Ptr("10.0.0.4")}, - // RecordSetName: to.Ptr("abc"), - // RecordType: to.Ptr("A"), - // }, - // { - // Fqdn: to.Ptr("abc2.zone1.com"), - // IPAddresses: []*string{ - // to.Ptr("10.0.0.5")}, - // RecordSetName: to.Ptr("abc2"), - // RecordType: to.Ptr("A"), - // }}, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPe/privateDnsZoneGroups/testPdnsgroup2"), - // Name: to.Ptr("testPdnsgroup2"), - // Properties: &armnetwork.PrivateDNSZoneGroupPropertiesFormat{ - // PrivateDNSZoneConfigs: []*armnetwork.PrivateDNSZoneConfig{ - // { - // Properties: &armnetwork.PrivateDNSZonePropertiesFormat{ - // PrivateDNSZoneID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateDnsZones/zone2.com"), - // RecordSets: []*armnetwork.RecordSet{ - // { - // Fqdn: to.Ptr("abc3.zone2.com"), - // IPAddresses: []*string{ - // to.Ptr("10.0.0.6")}, - // RecordSetName: to.Ptr("abc3"), - // RecordType: to.Ptr("A"), - // }, - // { - // Fqdn: to.Ptr("abc4.zone2.com"), - // IPAddresses: []*string{ - // to.Ptr("10.0.0.7")}, - // RecordSetName: to.Ptr("abc4"), - // RecordType: to.Ptr("A"), - // }}, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/privateendpoints_client.go b/sdk/resourcemanager/network/armnetwork/privateendpoints_client.go index fc30ea1e66a5..eb7069f9f9f8 100644 --- a/sdk/resourcemanager/network/armnetwork/privateendpoints_client.go +++ b/sdk/resourcemanager/network/armnetwork/privateendpoints_client.go @@ -47,7 +47,7 @@ func NewPrivateEndpointsClient(subscriptionID string, credential azcore.TokenCre // BeginCreateOrUpdate - Creates or updates an private endpoint in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - privateEndpointName - The name of the private endpoint. // - parameters - Parameters supplied to the create or update private endpoint operation. @@ -71,7 +71,7 @@ func (client *PrivateEndpointsClient) BeginCreateOrUpdate(ctx context.Context, r // CreateOrUpdate - Creates or updates an private endpoint in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *PrivateEndpointsClient) createOrUpdate(ctx context.Context, resourceGroupName string, privateEndpointName string, parameters PrivateEndpoint, options *PrivateEndpointsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "PrivateEndpointsClient.BeginCreateOrUpdate" @@ -113,7 +113,7 @@ func (client *PrivateEndpointsClient) createOrUpdateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -125,7 +125,7 @@ func (client *PrivateEndpointsClient) createOrUpdateCreateRequest(ctx context.Co // BeginDelete - Deletes the specified private endpoint. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - privateEndpointName - The name of the private endpoint. // - options - PrivateEndpointsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointsClient.BeginDelete @@ -148,7 +148,7 @@ func (client *PrivateEndpointsClient) BeginDelete(ctx context.Context, resourceG // Delete - Deletes the specified private endpoint. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *PrivateEndpointsClient) deleteOperation(ctx context.Context, resourceGroupName string, privateEndpointName string, options *PrivateEndpointsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "PrivateEndpointsClient.BeginDelete" @@ -190,7 +190,7 @@ func (client *PrivateEndpointsClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -199,7 +199,7 @@ func (client *PrivateEndpointsClient) deleteCreateRequest(ctx context.Context, r // Get - Gets the specified private endpoint by resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - privateEndpointName - The name of the private endpoint. // - options - PrivateEndpointsClientGetOptions contains the optional parameters for the PrivateEndpointsClient.Get method. @@ -245,7 +245,7 @@ func (client *PrivateEndpointsClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } @@ -265,7 +265,7 @@ func (client *PrivateEndpointsClient) getHandleResponse(resp *http.Response) (Pr // NewListPager - Gets all private endpoints in a resource group. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - options - PrivateEndpointsClientListOptions contains the optional parameters for the PrivateEndpointsClient.NewListPager // method. @@ -315,7 +315,7 @@ func (client *PrivateEndpointsClient) listCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -332,7 +332,7 @@ func (client *PrivateEndpointsClient) listHandleResponse(resp *http.Response) (P // NewListBySubscriptionPager - Gets all private endpoints in a subscription. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - options - PrivateEndpointsClientListBySubscriptionOptions contains the optional parameters for the PrivateEndpointsClient.NewListBySubscriptionPager // method. func (client *PrivateEndpointsClient) NewListBySubscriptionPager(options *PrivateEndpointsClientListBySubscriptionOptions) *runtime.Pager[PrivateEndpointsClientListBySubscriptionResponse] { @@ -377,7 +377,7 @@ func (client *PrivateEndpointsClient) listBySubscriptionCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/privateendpoints_client_example_test.go b/sdk/resourcemanager/network/armnetwork/privateendpoints_client_example_test.go deleted file mode 100644 index 8d314c00520b..000000000000 --- a/sdk/resourcemanager/network/armnetwork/privateendpoints_client_example_test.go +++ /dev/null @@ -1,930 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/PrivateEndpointDelete.json -func ExamplePrivateEndpointsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateEndpointsClient().BeginDelete(ctx, "rg1", "testPe", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/PrivateEndpointGet.json -func ExamplePrivateEndpointsClient_Get_getPrivateEndpoint() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateEndpointsClient().Get(ctx, "rg1", "testPe", &armnetwork.PrivateEndpointsClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateEndpoint = armnetwork.PrivateEndpoint{ - // Name: to.Ptr("testPe"), - // Type: to.Ptr("Microsoft.Network/privateEndpoints"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.PrivateEndpointProperties{ - // ApplicationSecurityGroups: []*armnetwork.ApplicationSecurityGroup{ - // }, - // CustomDNSConfigs: []*armnetwork.CustomDNSConfigPropertiesFormat{ - // { - // Fqdn: to.Ptr("abc.cosmos.com"), - // IPAddresses: []*string{ - // to.Ptr("192.168.0.4")}, - // }, - // { - // Fqdn: to.Ptr("abc2.cosmos.com"), - // IPAddresses: []*string{ - // to.Ptr("192.168.0.5")}, - // }}, - // CustomNetworkInterfaceName: to.Ptr("testPeNic"), - // IPConfigurations: []*armnetwork.PrivateEndpointIPConfiguration{ - // { - // Name: to.Ptr("pestaticconfig"), - // Properties: &armnetwork.PrivateEndpointIPConfigurationProperties{ - // GroupID: to.Ptr("file"), - // MemberName: to.Ptr("file"), - // PrivateIPAddress: to.Ptr("192.168.0.6"), - // }, - // }, - // { - // Name: to.Ptr("pestaticconfig2"), - // Properties: &armnetwork.PrivateEndpointIPConfigurationProperties{ - // GroupID: to.Ptr("file"), - // MemberName: to.Ptr("file2"), - // PrivateIPAddress: to.Ptr("192.168.0.7"), - // }, - // }}, - // ManualPrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ - // }, - // NetworkInterfaces: []*armnetwork.Interface{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/provders/Microsoft.Network/networkInterfaces/testPe.nic.abcd1234"), - // }}, - // PrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ - // { - // Properties: &armnetwork.PrivateLinkServiceConnectionProperties{ - // GroupIDs: []*string{ - // to.Ptr("groupIdFromResource")}, - // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // PrivateLinkServiceID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls"), - // RequestMessage: to.Ptr("Please approve my connection."), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/PrivateEndpointGetWithASG.json -func ExamplePrivateEndpointsClient_Get_getPrivateEndpointWithApplicationSecurityGroups() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateEndpointsClient().Get(ctx, "rg1", "testPe", &armnetwork.PrivateEndpointsClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateEndpoint = armnetwork.PrivateEndpoint{ - // Name: to.Ptr("testPe"), - // Type: to.Ptr("Microsoft.Network/privateEndpoints"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.PrivateEndpointProperties{ - // ApplicationSecurityGroups: []*armnetwork.ApplicationSecurityGroup{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/provders/Microsoft.Network/applicationSecurityGroup/asg1"), - // }}, - // CustomDNSConfigs: []*armnetwork.CustomDNSConfigPropertiesFormat{ - // { - // Fqdn: to.Ptr("abc.cosmos.com"), - // IPAddresses: []*string{ - // to.Ptr("192.168.0.4")}, - // }, - // { - // Fqdn: to.Ptr("abc2.cosmos.com"), - // IPAddresses: []*string{ - // to.Ptr("192.168.0.5")}, - // }}, - // ManualPrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ - // }, - // NetworkInterfaces: []*armnetwork.Interface{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/provders/Microsoft.Network/networkInterfaces/testPe.nic.abcd1234"), - // }}, - // PrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ - // { - // Properties: &armnetwork.PrivateLinkServiceConnectionProperties{ - // GroupIDs: []*string{ - // to.Ptr("groupIdFromResource")}, - // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // PrivateLinkServiceID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls"), - // RequestMessage: to.Ptr("Please approve my connection."), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/PrivateEndpointGetForManualApproval.json -func ExamplePrivateEndpointsClient_Get_getPrivateEndpointWithManualApprovalConnection() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateEndpointsClient().Get(ctx, "rg1", "testPe", &armnetwork.PrivateEndpointsClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateEndpoint = armnetwork.PrivateEndpoint{ - // Name: to.Ptr("testPe"), - // Type: to.Ptr("Microsoft.Network/privateEndpoints"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.PrivateEndpointProperties{ - // ApplicationSecurityGroups: []*armnetwork.ApplicationSecurityGroup{ - // }, - // CustomDNSConfigs: []*armnetwork.CustomDNSConfigPropertiesFormat{ - // { - // Fqdn: to.Ptr("abc.cosmos.com"), - // IPAddresses: []*string{ - // to.Ptr("192.168.0.4")}, - // }, - // { - // Fqdn: to.Ptr("abc2.cosmos.com"), - // IPAddresses: []*string{ - // to.Ptr("192.168.0.5")}, - // }}, - // CustomNetworkInterfaceName: to.Ptr("testPeNic"), - // IPConfigurations: []*armnetwork.PrivateEndpointIPConfiguration{ - // { - // Name: to.Ptr("pestaticconfig"), - // Properties: &armnetwork.PrivateEndpointIPConfigurationProperties{ - // GroupID: to.Ptr("file"), - // MemberName: to.Ptr("file"), - // PrivateIPAddress: to.Ptr("192.168.0.5"), - // }, - // }}, - // ManualPrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ - // { - // Properties: &armnetwork.PrivateLinkServiceConnectionProperties{ - // GroupIDs: []*string{ - // to.Ptr("groupIdFromResource")}, - // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Awaiting approval"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Pending"), - // }, - // PrivateLinkServiceID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls"), - // RequestMessage: to.Ptr("Please manually approve my connection."), - // }, - // }}, - // NetworkInterfaces: []*armnetwork.Interface{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/provders/Microsoft.Network/networkInterfaces/testPe.nic.abcd1234"), - // }}, - // PrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/PrivateEndpointCreate.json -func ExamplePrivateEndpointsClient_BeginCreateOrUpdate_createPrivateEndpoint() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateEndpointsClient().BeginCreateOrUpdate(ctx, "rg1", "testPe", armnetwork.PrivateEndpoint{ - Location: to.Ptr("eastus2euap"), - Properties: &armnetwork.PrivateEndpointProperties{ - CustomNetworkInterfaceName: to.Ptr("testPeNic"), - IPConfigurations: []*armnetwork.PrivateEndpointIPConfiguration{ - { - Name: to.Ptr("pestaticconfig"), - Properties: &armnetwork.PrivateEndpointIPConfigurationProperties{ - GroupID: to.Ptr("file"), - MemberName: to.Ptr("file"), - PrivateIPAddress: to.Ptr("192.168.0.6"), - }, - }}, - PrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ - { - Properties: &armnetwork.PrivateLinkServiceConnectionProperties{ - GroupIDs: []*string{ - to.Ptr("groupIdFromResource")}, - PrivateLinkServiceID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls"), - RequestMessage: to.Ptr("Please approve my connection."), - }, - }}, - Subnet: &armnetwork.Subnet{ - ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateEndpoint = armnetwork.PrivateEndpoint{ - // Name: to.Ptr("testPe"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe"), - // Location: to.Ptr("eastus2euap"), - // Properties: &armnetwork.PrivateEndpointProperties{ - // ApplicationSecurityGroups: []*armnetwork.ApplicationSecurityGroup{ - // }, - // CustomDNSConfigs: []*armnetwork.CustomDNSConfigPropertiesFormat{ - // { - // Fqdn: to.Ptr("abc.cosmos.com"), - // IPAddresses: []*string{ - // to.Ptr("192.168.0.4")}, - // }, - // { - // Fqdn: to.Ptr("abc2.cosmos.com"), - // IPAddresses: []*string{ - // to.Ptr("192.168.0.5")}, - // }}, - // CustomNetworkInterfaceName: to.Ptr("testPeNic"), - // IPConfigurations: []*armnetwork.PrivateEndpointIPConfiguration{ - // { - // Name: to.Ptr("pestaticconfig"), - // Properties: &armnetwork.PrivateEndpointIPConfigurationProperties{ - // GroupID: to.Ptr("file"), - // MemberName: to.Ptr("file"), - // PrivateIPAddress: to.Ptr("192.168.0.6"), - // }, - // }}, - // ManualPrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ - // }, - // NetworkInterfaces: []*armnetwork.Interface{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/provders/Microsoft.Network/networkInterfaces/testPe.nic.abcd1234"), - // }}, - // PrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ - // { - // Properties: &armnetwork.PrivateLinkServiceConnectionProperties{ - // GroupIDs: []*string{ - // to.Ptr("groupIdFromResource")}, - // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // PrivateLinkServiceID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls"), - // RequestMessage: to.Ptr("Please approve my connection."), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/PrivateEndpointCreateWithASG.json -func ExamplePrivateEndpointsClient_BeginCreateOrUpdate_createPrivateEndpointWithApplicationSecurityGroups() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateEndpointsClient().BeginCreateOrUpdate(ctx, "rg1", "testPe", armnetwork.PrivateEndpoint{ - Location: to.Ptr("eastus2euap"), - Properties: &armnetwork.PrivateEndpointProperties{ - ApplicationSecurityGroups: []*armnetwork.ApplicationSecurityGroup{ - { - ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/provders/Microsoft.Network/applicationSecurityGroup/asg1"), - }}, - PrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ - { - Properties: &armnetwork.PrivateLinkServiceConnectionProperties{ - GroupIDs: []*string{ - to.Ptr("groupIdFromResource")}, - PrivateLinkServiceID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls"), - RequestMessage: to.Ptr("Please approve my connection."), - }, - }}, - Subnet: &armnetwork.Subnet{ - ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateEndpoint = armnetwork.PrivateEndpoint{ - // Name: to.Ptr("testPe"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe"), - // Location: to.Ptr("eastus2euap"), - // Properties: &armnetwork.PrivateEndpointProperties{ - // ApplicationSecurityGroups: []*armnetwork.ApplicationSecurityGroup{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/provders/Microsoft.Network/applicationSecurityGroup/asg1"), - // }}, - // CustomDNSConfigs: []*armnetwork.CustomDNSConfigPropertiesFormat{ - // { - // Fqdn: to.Ptr("abc.cosmos.com"), - // IPAddresses: []*string{ - // to.Ptr("192.168.0.4")}, - // }, - // { - // Fqdn: to.Ptr("abc2.cosmos.com"), - // IPAddresses: []*string{ - // to.Ptr("192.168.0.5")}, - // }}, - // ManualPrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ - // }, - // NetworkInterfaces: []*armnetwork.Interface{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/provders/Microsoft.Network/networkInterfaces/testPe.nic.abcd1234"), - // }}, - // PrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ - // { - // Properties: &armnetwork.PrivateLinkServiceConnectionProperties{ - // GroupIDs: []*string{ - // to.Ptr("groupIdFromResource")}, - // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // PrivateLinkServiceID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls"), - // RequestMessage: to.Ptr("Please approve my connection."), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/PrivateEndpointCreateForManualApproval.json -func ExamplePrivateEndpointsClient_BeginCreateOrUpdate_createPrivateEndpointWithManualApprovalConnection() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateEndpointsClient().BeginCreateOrUpdate(ctx, "rg1", "testPe", armnetwork.PrivateEndpoint{ - Location: to.Ptr("eastus"), - Properties: &armnetwork.PrivateEndpointProperties{ - CustomNetworkInterfaceName: to.Ptr("testPeNic"), - IPConfigurations: []*armnetwork.PrivateEndpointIPConfiguration{ - { - Name: to.Ptr("pestaticconfig"), - Properties: &armnetwork.PrivateEndpointIPConfigurationProperties{ - GroupID: to.Ptr("file"), - MemberName: to.Ptr("file"), - PrivateIPAddress: to.Ptr("192.168.0.5"), - }, - }}, - ManualPrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ - { - Properties: &armnetwork.PrivateLinkServiceConnectionProperties{ - GroupIDs: []*string{ - to.Ptr("groupIdFromResource")}, - PrivateLinkServiceID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls"), - RequestMessage: to.Ptr("Please manually approve my connection."), - }, - }}, - Subnet: &armnetwork.Subnet{ - ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateEndpoint = armnetwork.PrivateEndpoint{ - // Name: to.Ptr("testPe"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.PrivateEndpointProperties{ - // ApplicationSecurityGroups: []*armnetwork.ApplicationSecurityGroup{ - // }, - // CustomDNSConfigs: []*armnetwork.CustomDNSConfigPropertiesFormat{ - // { - // Fqdn: to.Ptr("abc.cosmos.com"), - // IPAddresses: []*string{ - // to.Ptr("192.168.0.4")}, - // }, - // { - // Fqdn: to.Ptr("abc2.cosmos.com"), - // IPAddresses: []*string{ - // to.Ptr("192.168.0.5")}, - // }}, - // CustomNetworkInterfaceName: to.Ptr("testPeNic"), - // IPConfigurations: []*armnetwork.PrivateEndpointIPConfiguration{ - // { - // Name: to.Ptr("pestaticconfig"), - // Properties: &armnetwork.PrivateEndpointIPConfigurationProperties{ - // GroupID: to.Ptr("file"), - // MemberName: to.Ptr("file"), - // PrivateIPAddress: to.Ptr("192.168.0.5"), - // }, - // }}, - // ManualPrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ - // { - // Properties: &armnetwork.PrivateLinkServiceConnectionProperties{ - // GroupIDs: []*string{ - // to.Ptr("groupIdFromResource")}, - // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Awaiting approval"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Pending"), - // }, - // PrivateLinkServiceID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls"), - // RequestMessage: to.Ptr("Please manually approve my connection."), - // }, - // }}, - // NetworkInterfaces: []*armnetwork.Interface{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/provders/Microsoft.Network/networkInterfaces/testPe.nic.abcd1234"), - // }}, - // PrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/PrivateEndpointList.json -func ExamplePrivateEndpointsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrivateEndpointsClient().NewListPager("rg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PrivateEndpointListResult = armnetwork.PrivateEndpointListResult{ - // Value: []*armnetwork.PrivateEndpoint{ - // { - // Name: to.Ptr("pe1"), - // Type: to.Ptr("Microsoft.Network/privateEndpoints"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/pe1"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.PrivateEndpointProperties{ - // ApplicationSecurityGroups: []*armnetwork.ApplicationSecurityGroup{ - // }, - // CustomDNSConfigs: []*armnetwork.CustomDNSConfigPropertiesFormat{ - // { - // Fqdn: to.Ptr("abc.cosmos.com"), - // IPAddresses: []*string{ - // to.Ptr("192.168.0.4")}, - // }, - // { - // Fqdn: to.Ptr("abc2.cosmos.com"), - // IPAddresses: []*string{ - // to.Ptr("192.168.0.5")}, - // }}, - // CustomNetworkInterfaceName: to.Ptr("testPeNic"), - // IPConfigurations: []*armnetwork.PrivateEndpointIPConfiguration{ - // { - // Name: to.Ptr("pestaticconfig"), - // Properties: &armnetwork.PrivateEndpointIPConfigurationProperties{ - // GroupID: to.Ptr("file"), - // MemberName: to.Ptr("file"), - // PrivateIPAddress: to.Ptr("192.168.0.10"), - // }, - // }, - // { - // Name: to.Ptr("pestaticconfig"), - // Properties: &armnetwork.PrivateEndpointIPConfigurationProperties{ - // GroupID: to.Ptr("file"), - // MemberName: to.Ptr("file2"), - // PrivateIPAddress: to.Ptr("192.168.0.11"), - // }, - // }}, - // ManualPrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ - // }, - // NetworkInterfaces: []*armnetwork.Interface{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/provders/Microsoft.Network/networkInterfaces/pe1.nic.abcd1234"), - // }}, - // PrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ - // { - // Properties: &armnetwork.PrivateLinkServiceConnectionProperties{ - // GroupIDs: []*string{ - // to.Ptr("groupIdFromResource")}, - // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // PrivateLinkServiceID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls1"), - // RequestMessage: to.Ptr("Please approve my connection for pe1."), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet"), - // }, - // }, - // }, - // { - // Name: to.Ptr("pe2"), - // Type: to.Ptr("Microsoft.Network/privateEndpoints"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/pe2"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.PrivateEndpointProperties{ - // ApplicationSecurityGroups: []*armnetwork.ApplicationSecurityGroup{ - // }, - // CustomDNSConfigs: []*armnetwork.CustomDNSConfigPropertiesFormat{ - // { - // Fqdn: to.Ptr("abc3.cosmos1.com"), - // IPAddresses: []*string{ - // to.Ptr("192.168.0.6")}, - // }, - // { - // Fqdn: to.Ptr("abc4.cosmos1.com"), - // IPAddresses: []*string{ - // to.Ptr("192.168.0.7")}, - // }}, - // CustomNetworkInterfaceName: to.Ptr("testPeNic"), - // IPConfigurations: []*armnetwork.PrivateEndpointIPConfiguration{ - // { - // Name: to.Ptr("pestaticconfig3"), - // Properties: &armnetwork.PrivateEndpointIPConfigurationProperties{ - // GroupID: to.Ptr("file"), - // MemberName: to.Ptr("file"), - // PrivateIPAddress: to.Ptr("192.168.0.8"), - // }, - // }, - // { - // Name: to.Ptr("pestaticconfig4"), - // Properties: &armnetwork.PrivateEndpointIPConfigurationProperties{ - // GroupID: to.Ptr("file"), - // MemberName: to.Ptr("file2"), - // PrivateIPAddress: to.Ptr("192.168.0.9"), - // }, - // }}, - // ManualPrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ - // { - // Properties: &armnetwork.PrivateLinkServiceConnectionProperties{ - // GroupIDs: []*string{ - // to.Ptr("groupIdFromResource")}, - // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Awaiting approval"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Pending"), - // }, - // PrivateLinkServiceID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls2"), - // RequestMessage: to.Ptr("Please manually approve my connection for pe2."), - // }, - // }}, - // NetworkInterfaces: []*armnetwork.Interface{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/provders/Microsoft.Network/networkInterfaces/pe2.nic.zyxw9876"), - // }}, - // PrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet2"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/PrivateEndpointListAll.json -func ExamplePrivateEndpointsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrivateEndpointsClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PrivateEndpointListResult = armnetwork.PrivateEndpointListResult{ - // Value: []*armnetwork.PrivateEndpoint{ - // { - // Name: to.Ptr("pe1"), - // Type: to.Ptr("Microsoft.Network/privateEndpoints"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/pe1"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.PrivateEndpointProperties{ - // ApplicationSecurityGroups: []*armnetwork.ApplicationSecurityGroup{ - // }, - // CustomDNSConfigs: []*armnetwork.CustomDNSConfigPropertiesFormat{ - // { - // Fqdn: to.Ptr("abc.cosmos.com"), - // IPAddresses: []*string{ - // to.Ptr("192.168.0.4")}, - // }, - // { - // Fqdn: to.Ptr("abc2.cosmos.com"), - // IPAddresses: []*string{ - // to.Ptr("192.168.0.5")}, - // }}, - // CustomNetworkInterfaceName: to.Ptr("testPeNic"), - // IPConfigurations: []*armnetwork.PrivateEndpointIPConfiguration{ - // { - // Name: to.Ptr("pestaticconfig1"), - // Properties: &armnetwork.PrivateEndpointIPConfigurationProperties{ - // GroupID: to.Ptr("file"), - // MemberName: to.Ptr("file"), - // PrivateIPAddress: to.Ptr("192.168.0.9"), - // }, - // }, - // { - // Name: to.Ptr("pestaticconfig2"), - // Properties: &armnetwork.PrivateEndpointIPConfigurationProperties{ - // GroupID: to.Ptr("file"), - // MemberName: to.Ptr("file2"), - // PrivateIPAddress: to.Ptr("192.168.0.10"), - // }, - // }}, - // NetworkInterfaces: []*armnetwork.Interface{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/provders/Microsoft.Network/networkInterfaces/pe1.nic.abcd1234"), - // }}, - // PrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ - // { - // Properties: &armnetwork.PrivateLinkServiceConnectionProperties{ - // GroupIDs: []*string{ - // to.Ptr("groupIdFromResource")}, - // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // PrivateLinkServiceID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls1"), - // RequestMessage: to.Ptr("Please approve my connection for pe1."), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet"), - // }, - // }, - // }, - // { - // Name: to.Ptr("pe2"), - // Type: to.Ptr("Microsoft.Network/privateEndpoints"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg2/providers/Microsoft.Network/privateEndpoints/pe2"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.PrivateEndpointProperties{ - // ApplicationSecurityGroups: []*armnetwork.ApplicationSecurityGroup{ - // }, - // CustomDNSConfigs: []*armnetwork.CustomDNSConfigPropertiesFormat{ - // { - // Fqdn: to.Ptr("abc3.cosmos1.com"), - // IPAddresses: []*string{ - // to.Ptr("192.168.0.5")}, - // }, - // { - // Fqdn: to.Ptr("abc4.cosmos1.com"), - // IPAddresses: []*string{ - // to.Ptr("192.168.0.6")}, - // }}, - // CustomNetworkInterfaceName: to.Ptr("testPeNic"), - // IPConfigurations: []*armnetwork.PrivateEndpointIPConfiguration{ - // { - // Name: to.Ptr("pestaticconfig3"), - // Properties: &armnetwork.PrivateEndpointIPConfigurationProperties{ - // GroupID: to.Ptr("file"), - // MemberName: to.Ptr("file"), - // PrivateIPAddress: to.Ptr("192.168.0.11"), - // }, - // }, - // { - // Name: to.Ptr("pestaticconfig4"), - // Properties: &armnetwork.PrivateEndpointIPConfigurationProperties{ - // GroupID: to.Ptr("file"), - // MemberName: to.Ptr("file2"), - // PrivateIPAddress: to.Ptr("192.168.0.12"), - // }, - // }}, - // ManualPrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ - // { - // Properties: &armnetwork.PrivateLinkServiceConnectionProperties{ - // GroupIDs: []*string{ - // to.Ptr("groupIdFromResource")}, - // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Awaiting approval"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Pending"), - // }, - // PrivateLinkServiceID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls2"), - // RequestMessage: to.Ptr("Please manually approve my connection for pe2."), - // }, - // }}, - // NetworkInterfaces: []*armnetwork.Interface{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg2/provders/Microsoft.Network/networkInterfaces/pe2.nic.zyxw9876"), - // }}, - // PrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet2"), - // }, - // }, - // }, - // { - // Name: to.Ptr("pe3"), - // Type: to.Ptr("Microsoft.Network/privateEndpoints"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg3/providers/Microsoft.Network/privateEndpoints/pe3"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.PrivateEndpointProperties{ - // ApplicationSecurityGroups: []*armnetwork.ApplicationSecurityGroup{ - // }, - // CustomDNSConfigs: []*armnetwork.CustomDNSConfigPropertiesFormat{ - // { - // Fqdn: to.Ptr("abc5.cosmos2.com"), - // IPAddresses: []*string{ - // to.Ptr("192.168.0.7")}, - // }, - // { - // Fqdn: to.Ptr("abc6.cosmos2.com"), - // IPAddresses: []*string{ - // to.Ptr("192.168.0.8")}, - // }}, - // CustomNetworkInterfaceName: to.Ptr("testPeNic"), - // IPConfigurations: []*armnetwork.PrivateEndpointIPConfiguration{ - // { - // Name: to.Ptr("pestaticconfig5"), - // Properties: &armnetwork.PrivateEndpointIPConfigurationProperties{ - // GroupID: to.Ptr("file"), - // MemberName: to.Ptr("file"), - // PrivateIPAddress: to.Ptr("192.168.0.13"), - // }, - // }, - // { - // Name: to.Ptr("pestaticconfig6"), - // Properties: &armnetwork.PrivateEndpointIPConfigurationProperties{ - // GroupID: to.Ptr("file"), - // MemberName: to.Ptr("file2"), - // PrivateIPAddress: to.Ptr("192.168.0.14"), - // }, - // }}, - // NetworkInterfaces: []*armnetwork.Interface{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg3/provders/Microsoft.Network/networkInterfaces/pe3.nic.efgh5463"), - // }}, - // PrivateLinkServiceConnections: []*armnetwork.PrivateLinkServiceConnection{ - // { - // Properties: &armnetwork.PrivateLinkServiceConnectionProperties{ - // GroupIDs: []*string{ - // to.Ptr("groupIdFromResource")}, - // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // PrivateLinkServiceID: to.Ptr("/subscriptions/subId/resourceGroups/rg3/providers/Microsoft.Network/privateLinkServices/testPls3"), - // RequestMessage: to.Ptr("Please approve my connection for pe3."), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg3/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet3"), - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/privatelinkservices_client.go b/sdk/resourcemanager/network/armnetwork/privatelinkservices_client.go index d66be7b29306..b5b475387b8c 100644 --- a/sdk/resourcemanager/network/armnetwork/privatelinkservices_client.go +++ b/sdk/resourcemanager/network/armnetwork/privatelinkservices_client.go @@ -47,7 +47,7 @@ func NewPrivateLinkServicesClient(subscriptionID string, credential azcore.Token // BeginCheckPrivateLinkServiceVisibility - Checks whether the subscription is visible to private link service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - location - The location of the domain name. // - parameters - The request body of CheckPrivateLinkService API call. // - options - PrivateLinkServicesClientBeginCheckPrivateLinkServiceVisibilityOptions contains the optional parameters for the @@ -70,7 +70,7 @@ func (client *PrivateLinkServicesClient) BeginCheckPrivateLinkServiceVisibility( // CheckPrivateLinkServiceVisibility - Checks whether the subscription is visible to private link service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *PrivateLinkServicesClient) checkPrivateLinkServiceVisibility(ctx context.Context, location string, parameters CheckPrivateLinkServiceVisibilityRequest, options *PrivateLinkServicesClientBeginCheckPrivateLinkServiceVisibilityOptions) (*http.Response, error) { var err error const operationName = "PrivateLinkServicesClient.BeginCheckPrivateLinkServiceVisibility" @@ -108,7 +108,7 @@ func (client *PrivateLinkServicesClient) checkPrivateLinkServiceVisibilityCreate return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -121,7 +121,7 @@ func (client *PrivateLinkServicesClient) checkPrivateLinkServiceVisibilityCreate // in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - location - The location of the domain name. // - resourceGroupName - The name of the resource group. // - parameters - The request body of CheckPrivateLinkService API call. @@ -146,7 +146,7 @@ func (client *PrivateLinkServicesClient) BeginCheckPrivateLinkServiceVisibilityB // the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *PrivateLinkServicesClient) checkPrivateLinkServiceVisibilityByResourceGroup(ctx context.Context, location string, resourceGroupName string, parameters CheckPrivateLinkServiceVisibilityRequest, options *PrivateLinkServicesClientBeginCheckPrivateLinkServiceVisibilityByResourceGroupOptions) (*http.Response, error) { var err error const operationName = "PrivateLinkServicesClient.BeginCheckPrivateLinkServiceVisibilityByResourceGroup" @@ -188,7 +188,7 @@ func (client *PrivateLinkServicesClient) checkPrivateLinkServiceVisibilityByReso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -200,7 +200,7 @@ func (client *PrivateLinkServicesClient) checkPrivateLinkServiceVisibilityByReso // BeginCreateOrUpdate - Creates or updates an private link service in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - serviceName - The name of the private link service. // - parameters - Parameters supplied to the create or update private link service operation. @@ -224,7 +224,7 @@ func (client *PrivateLinkServicesClient) BeginCreateOrUpdate(ctx context.Context // CreateOrUpdate - Creates or updates an private link service in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *PrivateLinkServicesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, parameters PrivateLinkService, options *PrivateLinkServicesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "PrivateLinkServicesClient.BeginCreateOrUpdate" @@ -266,7 +266,7 @@ func (client *PrivateLinkServicesClient) createOrUpdateCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -278,7 +278,7 @@ func (client *PrivateLinkServicesClient) createOrUpdateCreateRequest(ctx context // BeginDelete - Deletes the specified private link service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - serviceName - The name of the private link service. // - options - PrivateLinkServicesClientBeginDeleteOptions contains the optional parameters for the PrivateLinkServicesClient.BeginDelete @@ -301,7 +301,7 @@ func (client *PrivateLinkServicesClient) BeginDelete(ctx context.Context, resour // Delete - Deletes the specified private link service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *PrivateLinkServicesClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, options *PrivateLinkServicesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "PrivateLinkServicesClient.BeginDelete" @@ -343,7 +343,7 @@ func (client *PrivateLinkServicesClient) deleteCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -352,7 +352,7 @@ func (client *PrivateLinkServicesClient) deleteCreateRequest(ctx context.Context // BeginDeletePrivateEndpointConnection - Delete private end point connection for a private link service in a subscription. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - serviceName - The name of the private link service. // - peConnectionName - The name of the private end point connection. @@ -376,7 +376,7 @@ func (client *PrivateLinkServicesClient) BeginDeletePrivateEndpointConnection(ct // DeletePrivateEndpointConnection - Delete private end point connection for a private link service in a subscription. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *PrivateLinkServicesClient) deletePrivateEndpointConnection(ctx context.Context, resourceGroupName string, serviceName string, peConnectionName string, options *PrivateLinkServicesClientBeginDeletePrivateEndpointConnectionOptions) (*http.Response, error) { var err error const operationName = "PrivateLinkServicesClient.BeginDeletePrivateEndpointConnection" @@ -422,7 +422,7 @@ func (client *PrivateLinkServicesClient) deletePrivateEndpointConnectionCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -431,7 +431,7 @@ func (client *PrivateLinkServicesClient) deletePrivateEndpointConnectionCreateRe // Get - Gets the specified private link service by resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - serviceName - The name of the private link service. // - options - PrivateLinkServicesClientGetOptions contains the optional parameters for the PrivateLinkServicesClient.Get method. @@ -477,7 +477,7 @@ func (client *PrivateLinkServicesClient) getCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } @@ -499,7 +499,7 @@ func (client *PrivateLinkServicesClient) getHandleResponse(resp *http.Response) // group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - serviceName - The name of the private link service. // - peConnectionName - The name of the private end point connection. @@ -551,7 +551,7 @@ func (client *PrivateLinkServicesClient) getPrivateEndpointConnectionCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } @@ -571,7 +571,7 @@ func (client *PrivateLinkServicesClient) getPrivateEndpointConnectionHandleRespo // NewListPager - Gets all private link services in a resource group. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - options - PrivateLinkServicesClientListOptions contains the optional parameters for the PrivateLinkServicesClient.NewListPager // method. @@ -621,7 +621,7 @@ func (client *PrivateLinkServicesClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -639,7 +639,7 @@ func (client *PrivateLinkServicesClient) listHandleResponse(resp *http.Response) // NewListAutoApprovedPrivateLinkServicesPager - Returns all of the private link service ids that can be linked to a Private // Endpoint with auto approved in this subscription in this region. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - location - The location of the domain name. // - options - PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesOptions contains the optional parameters for the // PrivateLinkServicesClient.NewListAutoApprovedPrivateLinkServicesPager method. @@ -689,7 +689,7 @@ func (client *PrivateLinkServicesClient) listAutoApprovedPrivateLinkServicesCrea return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -707,7 +707,7 @@ func (client *PrivateLinkServicesClient) listAutoApprovedPrivateLinkServicesHand // NewListAutoApprovedPrivateLinkServicesByResourceGroupPager - Returns all of the private link service ids that can be linked // to a Private Endpoint with auto approved in this subscription in this region. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - location - The location of the domain name. // - resourceGroupName - The name of the resource group. // - options - PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesByResourceGroupOptions contains the optional parameters @@ -762,7 +762,7 @@ func (client *PrivateLinkServicesClient) listAutoApprovedPrivateLinkServicesByRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -779,7 +779,7 @@ func (client *PrivateLinkServicesClient) listAutoApprovedPrivateLinkServicesByRe // NewListBySubscriptionPager - Gets all private link service in a subscription. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - options - PrivateLinkServicesClientListBySubscriptionOptions contains the optional parameters for the PrivateLinkServicesClient.NewListBySubscriptionPager // method. func (client *PrivateLinkServicesClient) NewListBySubscriptionPager(options *PrivateLinkServicesClientListBySubscriptionOptions) *runtime.Pager[PrivateLinkServicesClientListBySubscriptionResponse] { @@ -824,7 +824,7 @@ func (client *PrivateLinkServicesClient) listBySubscriptionCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -841,7 +841,7 @@ func (client *PrivateLinkServicesClient) listBySubscriptionHandleResponse(resp * // NewListPrivateEndpointConnectionsPager - Gets all private end point connections for a specific private link service. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - serviceName - The name of the private link service. // - options - PrivateLinkServicesClientListPrivateEndpointConnectionsOptions contains the optional parameters for the PrivateLinkServicesClient.NewListPrivateEndpointConnectionsPager @@ -896,7 +896,7 @@ func (client *PrivateLinkServicesClient) listPrivateEndpointConnectionsCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -914,7 +914,7 @@ func (client *PrivateLinkServicesClient) listPrivateEndpointConnectionsHandleRes // UpdatePrivateEndpointConnection - Approve or reject private end point connection for a private link service in a subscription. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - serviceName - The name of the private link service. // - peConnectionName - The name of the private end point connection. @@ -967,7 +967,7 @@ func (client *PrivateLinkServicesClient) updatePrivateEndpointConnectionCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/privatelinkservices_client_example_test.go b/sdk/resourcemanager/network/armnetwork/privatelinkservices_client_example_test.go deleted file mode 100644 index b38a214e2f7d..000000000000 --- a/sdk/resourcemanager/network/armnetwork/privatelinkservices_client_example_test.go +++ /dev/null @@ -1,783 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/PrivateLinkServiceDelete.json -func ExamplePrivateLinkServicesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateLinkServicesClient().BeginDelete(ctx, "rg1", "testPls", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/PrivateLinkServiceGet.json -func ExamplePrivateLinkServicesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateLinkServicesClient().Get(ctx, "rg1", "testPls", &armnetwork.PrivateLinkServicesClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateLinkService = armnetwork.PrivateLinkService{ - // Name: to.Ptr("testPls"), - // Type: to.Ptr("Microsoft.Network/privateLinkServices"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.PrivateLinkServiceProperties{ - // Alias: to.Ptr("ContosoService.{guid}.azure.privatelinkservice"), - // AutoApproval: &armnetwork.PrivateLinkServicePropertiesAutoApproval{ - // Subscriptions: []*string{ - // to.Ptr("subscription1"), - // to.Ptr("subscription2")}, - // }, - // Fqdns: []*string{ - // to.Ptr("fqdn1"), - // to.Ptr("fqdn2"), - // to.Ptr("fqdn3")}, - // IPConfigurations: []*armnetwork.PrivateLinkServiceIPConfiguration{ - // { - // Name: to.Ptr("fe-lb"), - // Properties: &armnetwork.PrivateLinkServiceIPConfigurationProperties{ - // PrivateIPAddress: to.Ptr("10.0.1.4"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodStatic), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), - // }, - // }, - // }}, - // LoadBalancerFrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - // }}, - // NetworkInterfaces: []*armnetwork.Interface{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/provders/Microsoft.Network/networkInterfaces/testPls.nic.abcd1234"), - // }}, - // PrivateEndpointConnections: []*armnetwork.PrivateEndpointConnection{ - // { - // Name: to.Ptr("privateEndpointConnection"), - // Properties: &armnetwork.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armnetwork.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe"), - // }, - // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("approved it for some reason."), - // Status: to.Ptr("Approved"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Visibility: &armnetwork.PrivateLinkServicePropertiesVisibility{ - // Subscriptions: []*string{ - // to.Ptr("subscription1"), - // to.Ptr("subscription2"), - // to.Ptr("subscription3")}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/PrivateLinkServiceCreate.json -func ExamplePrivateLinkServicesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateLinkServicesClient().BeginCreateOrUpdate(ctx, "rg1", "testPls", armnetwork.PrivateLinkService{ - Location: to.Ptr("eastus"), - Properties: &armnetwork.PrivateLinkServiceProperties{ - AutoApproval: &armnetwork.PrivateLinkServicePropertiesAutoApproval{ - Subscriptions: []*string{ - to.Ptr("subscription1"), - to.Ptr("subscription2")}, - }, - Fqdns: []*string{ - to.Ptr("fqdn1"), - to.Ptr("fqdn2"), - to.Ptr("fqdn3")}, - IPConfigurations: []*armnetwork.PrivateLinkServiceIPConfiguration{ - { - Name: to.Ptr("fe-lb"), - Properties: &armnetwork.PrivateLinkServiceIPConfigurationProperties{ - PrivateIPAddress: to.Ptr("10.0.1.4"), - PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodStatic), - Subnet: &armnetwork.Subnet{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), - }, - }, - }}, - LoadBalancerFrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - }}, - Visibility: &armnetwork.PrivateLinkServicePropertiesVisibility{ - Subscriptions: []*string{ - to.Ptr("subscription1"), - to.Ptr("subscription2"), - to.Ptr("subscription3")}, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateLinkService = armnetwork.PrivateLinkService{ - // Name: to.Ptr("testPls"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.PrivateLinkServiceProperties{ - // Alias: to.Ptr("ContosoService.{guid}.azure.privatelinkservice"), - // AutoApproval: &armnetwork.PrivateLinkServicePropertiesAutoApproval{ - // Subscriptions: []*string{ - // to.Ptr("subscription1"), - // to.Ptr("subscription2")}, - // }, - // Fqdns: []*string{ - // to.Ptr("fqdn1"), - // to.Ptr("fqdn2"), - // to.Ptr("fqdn3")}, - // IPConfigurations: []*armnetwork.PrivateLinkServiceIPConfiguration{ - // { - // Name: to.Ptr("fe-lb"), - // Properties: &armnetwork.PrivateLinkServiceIPConfigurationProperties{ - // PrivateIPAddress: to.Ptr("10.0.1.4"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodStatic), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb"), - // }, - // }, - // }}, - // LoadBalancerFrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - // }}, - // NetworkInterfaces: []*armnetwork.Interface{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/provders/Microsoft.Network/networkInterfaces/testPls.nic.abcd1234"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Visibility: &armnetwork.PrivateLinkServicePropertiesVisibility{ - // Subscriptions: []*string{ - // to.Ptr("subscription1"), - // to.Ptr("subscription2"), - // to.Ptr("subscription3")}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/PrivateLinkServiceList.json -func ExamplePrivateLinkServicesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrivateLinkServicesClient().NewListPager("rg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PrivateLinkServiceListResult = armnetwork.PrivateLinkServiceListResult{ - // Value: []*armnetwork.PrivateLinkService{ - // { - // Name: to.Ptr("testPls1"), - // Type: to.Ptr("Microsoft.Network/privateLinkServices"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls1"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.PrivateLinkServiceProperties{ - // Alias: to.Ptr("ContosoService.{guid}.azure.privatelinkservice"), - // AutoApproval: &armnetwork.PrivateLinkServicePropertiesAutoApproval{ - // Subscriptions: []*string{ - // to.Ptr("subscription1")}, - // }, - // Fqdns: []*string{ - // to.Ptr("fqdn1"), - // to.Ptr("fqdn2")}, - // IPConfigurations: []*armnetwork.PrivateLinkServiceIPConfiguration{ - // { - // Name: to.Ptr("fe-lb1"), - // Properties: &armnetwork.PrivateLinkServiceIPConfigurationProperties{ - // PrivateIPAddress: to.Ptr("10.0.1.4"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodStatic), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb1"), - // }, - // }, - // }}, - // LoadBalancerFrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb1"), - // }}, - // NetworkInterfaces: []*armnetwork.Interface{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/provders/Microsoft.Network/networkInterfaces/testPls1.nic.abcd1234"), - // }}, - // PrivateEndpointConnections: []*armnetwork.PrivateEndpointConnection{ - // { - // Name: to.Ptr("pec1"), - // Properties: &armnetwork.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armnetwork.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe1"), - // }, - // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("approved it for some reason."), - // Status: to.Ptr("Approved"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Visibility: &armnetwork.PrivateLinkServicePropertiesVisibility{ - // Subscriptions: []*string{ - // to.Ptr("subscription1")}, - // }, - // }, - // }, - // { - // Name: to.Ptr("testPls2"), - // Type: to.Ptr("Microsoft.Network/privateLinkServices"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls2"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.PrivateLinkServiceProperties{ - // Alias: to.Ptr("ContosoService.{guid}.azure.privatelinkservice"), - // AutoApproval: &armnetwork.PrivateLinkServicePropertiesAutoApproval{ - // Subscriptions: []*string{ - // to.Ptr("subscription1"), - // to.Ptr("subscription2")}, - // }, - // Fqdns: []*string{ - // to.Ptr("fqdn1"), - // to.Ptr("fqdn2"), - // to.Ptr("fqdn3")}, - // IPConfigurations: []*armnetwork.PrivateLinkServiceIPConfiguration{ - // { - // Name: to.Ptr("fe-lb2"), - // Properties: &armnetwork.PrivateLinkServiceIPConfigurationProperties{ - // PrivateIPAddress: to.Ptr("10.0.1.5"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodStatic), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb2"), - // }, - // }, - // }}, - // LoadBalancerFrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb2"), - // }}, - // NetworkInterfaces: []*armnetwork.Interface{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/provders/Microsoft.Network/networkInterfaces/testPls2.nic.efgh5678"), - // }}, - // PrivateEndpointConnections: []*armnetwork.PrivateEndpointConnection{ - // { - // Name: to.Ptr("pec2"), - // Properties: &armnetwork.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armnetwork.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe2"), - // }, - // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("approved it for some reason."), - // Status: to.Ptr("Approved"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Visibility: &armnetwork.PrivateLinkServicePropertiesVisibility{ - // Subscriptions: []*string{ - // to.Ptr("subscription1"), - // to.Ptr("subscription2"), - // to.Ptr("subscription3")}, - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/PrivateLinkServiceListAll.json -func ExamplePrivateLinkServicesClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrivateLinkServicesClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PrivateLinkServiceListResult = armnetwork.PrivateLinkServiceListResult{ - // Value: []*armnetwork.PrivateLinkService{ - // { - // Name: to.Ptr("testPls1"), - // Type: to.Ptr("Microsoft.Network/privateLinkServices"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls1"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.PrivateLinkServiceProperties{ - // Alias: to.Ptr("ContosoService.{guid}.azure.privatelinkservice"), - // AutoApproval: &armnetwork.PrivateLinkServicePropertiesAutoApproval{ - // Subscriptions: []*string{ - // to.Ptr("subscription1"), - // to.Ptr("subscription2")}, - // }, - // Fqdns: []*string{ - // to.Ptr("fqdn1"), - // to.Ptr("fqdn2"), - // to.Ptr("fqdn3")}, - // IPConfigurations: []*armnetwork.PrivateLinkServiceIPConfiguration{ - // { - // Name: to.Ptr("fe-lb1"), - // Properties: &armnetwork.PrivateLinkServiceIPConfigurationProperties{ - // PrivateIPAddress: to.Ptr("10.0.1.4"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodStatic), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb1"), - // }, - // }, - // }}, - // LoadBalancerFrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb1"), - // }}, - // NetworkInterfaces: []*armnetwork.Interface{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/provders/Microsoft.Network/networkInterfaces/testPls1.nic.abcd1234"), - // }}, - // PrivateEndpointConnections: []*armnetwork.PrivateEndpointConnection{ - // { - // Name: to.Ptr("pec1"), - // Properties: &armnetwork.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armnetwork.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe1"), - // }, - // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("approved it for some reason."), - // Status: to.Ptr("Approved"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Visibility: &armnetwork.PrivateLinkServicePropertiesVisibility{ - // Subscriptions: []*string{ - // to.Ptr("subscription1"), - // to.Ptr("subscription2"), - // to.Ptr("subscription3")}, - // }, - // }, - // }, - // { - // Name: to.Ptr("testPls2"), - // Type: to.Ptr("Microsoft.Network/privateLinkServices"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg2/providers/Microsoft.Network/privateLinkServices/testPls2"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.PrivateLinkServiceProperties{ - // Alias: to.Ptr("ContosoService.{guid}.azure.privatelinkservice"), - // AutoApproval: &armnetwork.PrivateLinkServicePropertiesAutoApproval{ - // Subscriptions: []*string{ - // to.Ptr("subscription1"), - // to.Ptr("subscription2")}, - // }, - // Fqdns: []*string{ - // to.Ptr("fqdn1"), - // to.Ptr("fqdn2")}, - // IPConfigurations: []*armnetwork.PrivateLinkServiceIPConfiguration{ - // { - // Name: to.Ptr("fe-lb2"), - // Properties: &armnetwork.PrivateLinkServiceIPConfigurationProperties{ - // PrivateIPAddress: to.Ptr("10.0.1.5"), - // PrivateIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodStatic), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb2"), - // }, - // }, - // }}, - // LoadBalancerFrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb2"), - // }}, - // NetworkInterfaces: []*armnetwork.Interface{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg2/provders/Microsoft.Network/networkInterfaces/testPls2.nic.efgh5678"), - // }}, - // PrivateEndpointConnections: []*armnetwork.PrivateEndpointConnection{ - // { - // Name: to.Ptr("pec1"), - // Properties: &armnetwork.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armnetwork.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg2/providers/Microsoft.Network/privateEndpoints/testPe2"), - // }, - // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("approved it for some reason."), - // Status: to.Ptr("Approved"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Visibility: &armnetwork.PrivateLinkServicePropertiesVisibility{ - // Subscriptions: []*string{ - // to.Ptr("subscription1"), - // to.Ptr("subscription2")}, - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/PrivateLinkServiceGetPrivateEndpointConnection.json -func ExamplePrivateLinkServicesClient_GetPrivateEndpointConnection() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateLinkServicesClient().GetPrivateEndpointConnection(ctx, "rg1", "testPls", "testPlePeConnection", &armnetwork.PrivateLinkServicesClientGetPrivateEndpointConnectionOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateEndpointConnection = armnetwork.PrivateEndpointConnection{ - // Name: to.Ptr("testPlePeConnection"), - // Properties: &armnetwork.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armnetwork.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe"), - // }, - // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("approved it for some reason."), - // Status: to.Ptr("Approved"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/PrivateLinkServiceUpdatePrivateEndpointConnection.json -func ExamplePrivateLinkServicesClient_UpdatePrivateEndpointConnection() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateLinkServicesClient().UpdatePrivateEndpointConnection(ctx, "rg1", "testPls", "testPlePeConnection", armnetwork.PrivateEndpointConnection{ - Name: to.Ptr("testPlePeConnection"), - Properties: &armnetwork.PrivateEndpointConnectionProperties{ - PrivateEndpoint: &armnetwork.PrivateEndpoint{ - ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe"), - }, - PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ - Description: to.Ptr("approved it for some reason."), - Status: to.Ptr("Approved"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateEndpointConnection = armnetwork.PrivateEndpointConnection{ - // Name: to.Ptr("testPlePeConnection"), - // Properties: &armnetwork.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armnetwork.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe"), - // }, - // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("approved it for some reason."), - // Status: to.Ptr("Approved"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/PrivateLinkServiceDeletePrivateEndpointConnection.json -func ExamplePrivateLinkServicesClient_BeginDeletePrivateEndpointConnection() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateLinkServicesClient().BeginDeletePrivateEndpointConnection(ctx, "rg1", "testPls", "testPlePeConnection", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/PrivateLinkServiceListPrivateEndpointConnection.json -func ExamplePrivateLinkServicesClient_NewListPrivateEndpointConnectionsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrivateLinkServicesClient().NewListPrivateEndpointConnectionsPager("rg1", "testPls", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PrivateEndpointConnectionListResult = armnetwork.PrivateEndpointConnectionListResult{ - // Value: []*armnetwork.PrivateEndpointConnection{ - // { - // Name: to.Ptr("testPlePeConnection1"), - // Properties: &armnetwork.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armnetwork.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe1"), - // }, - // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("approved it for some reason."), - // Status: to.Ptr("Approved"), - // }, - // }, - // }, - // { - // Name: to.Ptr("testPlePeConnection2"), - // Properties: &armnetwork.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armnetwork.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe2"), - // }, - // PrivateLinkServiceConnectionState: &armnetwork.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("rejected by some reason."), - // Status: to.Ptr("Rejected"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/CheckPrivateLinkServiceVisibility.json -func ExamplePrivateLinkServicesClient_BeginCheckPrivateLinkServiceVisibility() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateLinkServicesClient().BeginCheckPrivateLinkServiceVisibility(ctx, "westus", armnetwork.CheckPrivateLinkServiceVisibilityRequest{ - PrivateLinkServiceAlias: to.Ptr("mypls.00000000-0000-0000-0000-000000000000.azure.privatelinkservice"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateLinkServiceVisibility = armnetwork.PrivateLinkServiceVisibility{ - // Visible: to.Ptr(true), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/CheckPrivateLinkServiceVisibilityByResourceGroup.json -func ExamplePrivateLinkServicesClient_BeginCheckPrivateLinkServiceVisibilityByResourceGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateLinkServicesClient().BeginCheckPrivateLinkServiceVisibilityByResourceGroup(ctx, "westus", "rg1", armnetwork.CheckPrivateLinkServiceVisibilityRequest{ - PrivateLinkServiceAlias: to.Ptr("mypls.00000000-0000-0000-0000-000000000000.azure.privatelinkservice"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateLinkServiceVisibility = armnetwork.PrivateLinkServiceVisibility{ - // Visible: to.Ptr(true), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/AutoApprovedPrivateLinkServicesGet.json -func ExamplePrivateLinkServicesClient_NewListAutoApprovedPrivateLinkServicesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrivateLinkServicesClient().NewListAutoApprovedPrivateLinkServicesPager("regionName", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AutoApprovedPrivateLinkServicesResult = armnetwork.AutoApprovedPrivateLinkServicesResult{ - // Value: []*armnetwork.AutoApprovedPrivateLinkService{ - // { - // PrivateLinkService: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls1"), - // }, - // { - // PrivateLinkService: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls2"), - // }, - // { - // PrivateLinkService: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls3"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/AutoApprovedPrivateLinkServicesResourceGroupGet.json -func ExamplePrivateLinkServicesClient_NewListAutoApprovedPrivateLinkServicesByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrivateLinkServicesClient().NewListAutoApprovedPrivateLinkServicesByResourceGroupPager("regionName", "rg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AutoApprovedPrivateLinkServicesResult = armnetwork.AutoApprovedPrivateLinkServicesResult{ - // Value: []*armnetwork.AutoApprovedPrivateLinkService{ - // { - // PrivateLinkService: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls1"), - // }, - // { - // PrivateLinkService: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls2"), - // }, - // { - // PrivateLinkService: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls3"), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/profiles_client.go b/sdk/resourcemanager/network/armnetwork/profiles_client.go index d05cd41e0446..495827271a2a 100644 --- a/sdk/resourcemanager/network/armnetwork/profiles_client.go +++ b/sdk/resourcemanager/network/armnetwork/profiles_client.go @@ -47,7 +47,7 @@ func NewProfilesClient(subscriptionID string, credential azcore.TokenCredential, // CreateOrUpdate - Creates or updates a network profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkProfileName - The name of the network profile. // - parameters - Parameters supplied to the create or update network profile operation. @@ -94,7 +94,7 @@ func (client *ProfilesClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -115,7 +115,7 @@ func (client *ProfilesClient) createOrUpdateHandleResponse(resp *http.Response) // BeginDelete - Deletes the specified network profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkProfileName - The name of the NetworkProfile. // - options - ProfilesClientBeginDeleteOptions contains the optional parameters for the ProfilesClient.BeginDelete method. @@ -137,7 +137,7 @@ func (client *ProfilesClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Deletes the specified network profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *ProfilesClient) deleteOperation(ctx context.Context, resourceGroupName string, networkProfileName string, options *ProfilesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ProfilesClient.BeginDelete" @@ -179,7 +179,7 @@ func (client *ProfilesClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -188,7 +188,7 @@ func (client *ProfilesClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Gets the specified network profile in a specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkProfileName - The name of the public IP prefix. // - options - ProfilesClientGetOptions contains the optional parameters for the ProfilesClient.Get method. @@ -234,7 +234,7 @@ func (client *ProfilesClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } @@ -254,7 +254,7 @@ func (client *ProfilesClient) getHandleResponse(resp *http.Response) (ProfilesCl // NewListPager - Gets all network profiles in a resource group. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - options - ProfilesClientListOptions contains the optional parameters for the ProfilesClient.NewListPager method. func (client *ProfilesClient) NewListPager(resourceGroupName string, options *ProfilesClientListOptions) *runtime.Pager[ProfilesClientListResponse] { @@ -303,7 +303,7 @@ func (client *ProfilesClient) listCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -320,7 +320,7 @@ func (client *ProfilesClient) listHandleResponse(resp *http.Response) (ProfilesC // NewListAllPager - Gets all the network profiles in a subscription. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - options - ProfilesClientListAllOptions contains the optional parameters for the ProfilesClient.NewListAllPager method. func (client *ProfilesClient) NewListAllPager(options *ProfilesClientListAllOptions) *runtime.Pager[ProfilesClientListAllResponse] { return runtime.NewPager(runtime.PagingHandler[ProfilesClientListAllResponse]{ @@ -364,7 +364,7 @@ func (client *ProfilesClient) listAllCreateRequest(ctx context.Context, options return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -382,7 +382,7 @@ func (client *ProfilesClient) listAllHandleResponse(resp *http.Response) (Profil // UpdateTags - Updates network profile tags. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkProfileName - The name of the network profile. // - parameters - Parameters supplied to update network profile tags. @@ -429,7 +429,7 @@ func (client *ProfilesClient) updateTagsCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/profiles_client_example_test.go b/sdk/resourcemanager/network/armnetwork/profiles_client_example_test.go deleted file mode 100644 index c83ecad10254..000000000000 --- a/sdk/resourcemanager/network/armnetwork/profiles_client_example_test.go +++ /dev/null @@ -1,684 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkProfileDelete.json -func ExampleProfilesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewProfilesClient().BeginDelete(ctx, "rg1", "networkProfile1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkProfileGetConfigOnly.json -func ExampleProfilesClient_Get_getNetworkProfile() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProfilesClient().Get(ctx, "rg1", "networkProfile1", &armnetwork.ProfilesClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Profile = armnetwork.Profile{ - // Name: to.Ptr("networkProfile1"), - // Type: to.Ptr("Microsoft.Network/networkProfiles"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1"), - // Location: to.Ptr("centraluseuap"), - // Etag: to.Ptr("W/\"4d705a71-752f-4e0a-8057-c02b125b1c08\""), - // Properties: &armnetwork.ProfilePropertiesFormat{ - // ContainerNetworkInterfaceConfigurations: []*armnetwork.ContainerNetworkInterfaceConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth0"), - // Name: to.Ptr("eth0"), - // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations"), - // Etag: to.Ptr("W/\"4d705a71-752f-4e0a-8057-c02b125b1c08\""), - // Properties: &armnetwork.ContainerNetworkInterfaceConfigurationPropertiesFormat{ - // IPConfigurations: []*armnetwork.IPConfigurationProfile{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth0/ipConfigurations/ipconfigprofile1"), - // Name: to.Ptr("ipconfigprofile1"), - // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations/ipConfigurations"), - // Etag: to.Ptr("W/\"4d705a71-752f-4e0a-8057-c02b125b1c08\""), - // Properties: &armnetwork.IPConfigurationProfilePropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/networkProfileVnet/subnets/networkProfileSubnet1"), - // }, - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth0/ipConfigurations/ipconfigprofile2"), - // Name: to.Ptr("ipconfigprofile2"), - // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations/ipConfigurations"), - // Etag: to.Ptr("W/\"4d705a71-752f-4e0a-8057-c02b125b1c08\""), - // Properties: &armnetwork.IPConfigurationProfilePropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/networkProfileVnet/subnets/networkProfileSubnet1"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth1"), - // Name: to.Ptr("eth1"), - // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations"), - // Etag: to.Ptr("W/\"4d705a71-752f-4e0a-8057-c02b125b1c08\""), - // Properties: &armnetwork.ContainerNetworkInterfaceConfigurationPropertiesFormat{ - // IPConfigurations: []*armnetwork.IPConfigurationProfile{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth1/ipConfigurations/ipconfigprofile3"), - // Name: to.Ptr("ipconfigprofile3"), - // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations/ipConfigurations"), - // Etag: to.Ptr("W/\"4d705a71-752f-4e0a-8057-c02b125b1c08\""), - // Properties: &armnetwork.IPConfigurationProfilePropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/networkProfileVnet/subnets/networkProfileSubnet1"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // ContainerNetworkInterfaces: []*armnetwork.ContainerNetworkInterface{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("1570d8b6-ab8a-4ad2-81d6-d2799b429cbf"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkProfileGetWithContainerNic.json -func ExampleProfilesClient_Get_getNetworkProfileWithContainerNetworkInterfaces() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProfilesClient().Get(ctx, "rg1", "networkProfile1", &armnetwork.ProfilesClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Profile = armnetwork.Profile{ - // Name: to.Ptr("networkProfile1"), - // Type: to.Ptr("Microsoft.Network/networkProfiles"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1"), - // Location: to.Ptr("centraluseuap"), - // Etag: to.Ptr("W/\"de9b89d2-83b0-4da3-b488-6ea8b0557edd\""), - // Properties: &armnetwork.ProfilePropertiesFormat{ - // ContainerNetworkInterfaceConfigurations: []*armnetwork.ContainerNetworkInterfaceConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth0"), - // Name: to.Ptr("eth0"), - // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations"), - // Etag: to.Ptr("W/\"de9b89d2-83b0-4da3-b488-6ea8b0557edd\""), - // Properties: &armnetwork.ContainerNetworkInterfaceConfigurationPropertiesFormat{ - // ContainerNetworkInterfaces: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaces/containerGroup1_eth0"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaces/containerGroup2_eth0"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaces/containerGroup3_eth0"), - // }}, - // IPConfigurations: []*armnetwork.IPConfigurationProfile{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth0/ipConfigurations/ipconfigprofile1"), - // Name: to.Ptr("ipconfigprofile1"), - // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations/ipConfigurations"), - // Etag: to.Ptr("W/\"de9b89d2-83b0-4da3-b488-6ea8b0557edd\""), - // Properties: &armnetwork.IPConfigurationProfilePropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/networkProfileVnet/subnets/networkProfileSubnet1"), - // }, - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth0/ipConfigurations/ipconfigprofile2"), - // Name: to.Ptr("ipconfigprofile2"), - // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations/ipConfigurations"), - // Etag: to.Ptr("W/\"de9b89d2-83b0-4da3-b488-6ea8b0557edd\""), - // Properties: &armnetwork.IPConfigurationProfilePropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/networkProfileVnet/subnets/networkProfileSubnet1"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth1"), - // Name: to.Ptr("eth1"), - // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations"), - // Etag: to.Ptr("W/\"de9b89d2-83b0-4da3-b488-6ea8b0557edd\""), - // Properties: &armnetwork.ContainerNetworkInterfaceConfigurationPropertiesFormat{ - // ContainerNetworkInterfaces: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaces/containerGroup1_eth1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaces/containerGroup2_eth1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaces/containerGroup3_eth1"), - // }}, - // IPConfigurations: []*armnetwork.IPConfigurationProfile{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth1/ipConfigurations/ipconfigprofile3"), - // Name: to.Ptr("ipconfigprofile3"), - // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations/ipConfigurations"), - // Etag: to.Ptr("W/\"de9b89d2-83b0-4da3-b488-6ea8b0557edd\""), - // Properties: &armnetwork.IPConfigurationProfilePropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/networkProfileVnet/subnets/networkProfileSubnet1"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // ContainerNetworkInterfaces: []*armnetwork.ContainerNetworkInterface{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaces/containerGroup1_eth0"), - // Name: to.Ptr("containerGroup1_eth0"), - // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaces"), - // Etag: to.Ptr("W/\"de9b89d2-83b0-4da3-b488-6ea8b0557edd\""), - // Properties: &armnetwork.ContainerNetworkInterfacePropertiesFormat{ - // Container: &armnetwork.Container{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/networkProfilesDemo/providers/Microsoft.ContainerInstance/containerGroups/containerGroup1"), - // }, - // ContainerNetworkInterfaceConfiguration: &armnetwork.ContainerNetworkInterfaceConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth0"), - // }, - // IPConfigurations: []*armnetwork.ContainerNetworkInterfaceIPConfiguration{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaces/containerGroup1_eth1"), - // Name: to.Ptr("containerGroup1_eth1"), - // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaces"), - // Etag: to.Ptr("W/\"de9b89d2-83b0-4da3-b488-6ea8b0557edd\""), - // Properties: &armnetwork.ContainerNetworkInterfacePropertiesFormat{ - // Container: &armnetwork.Container{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/networkProfilesDemo/providers/Microsoft.ContainerInstance/containerGroups/containerGroup1"), - // }, - // ContainerNetworkInterfaceConfiguration: &armnetwork.ContainerNetworkInterfaceConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth1"), - // }, - // IPConfigurations: []*armnetwork.ContainerNetworkInterfaceIPConfiguration{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaces/containerGroup2_eth0"), - // Name: to.Ptr("containerGroup2_eth0"), - // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaces"), - // Etag: to.Ptr("W/\"de9b89d2-83b0-4da3-b488-6ea8b0557edd\""), - // Properties: &armnetwork.ContainerNetworkInterfacePropertiesFormat{ - // Container: &armnetwork.Container{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/networkProfilesDemo/providers/Microsoft.ContainerInstance/containerGroups/containerGroup2"), - // }, - // ContainerNetworkInterfaceConfiguration: &armnetwork.ContainerNetworkInterfaceConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth0"), - // }, - // IPConfigurations: []*armnetwork.ContainerNetworkInterfaceIPConfiguration{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaces/containerGroup2_eth1"), - // Name: to.Ptr("containerGroup2_eth1"), - // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaces"), - // Etag: to.Ptr("W/\"de9b89d2-83b0-4da3-b488-6ea8b0557edd\""), - // Properties: &armnetwork.ContainerNetworkInterfacePropertiesFormat{ - // Container: &armnetwork.Container{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/networkProfilesDemo/providers/Microsoft.ContainerInstance/containerGroups/containerGroup2"), - // }, - // ContainerNetworkInterfaceConfiguration: &armnetwork.ContainerNetworkInterfaceConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth1"), - // }, - // IPConfigurations: []*armnetwork.ContainerNetworkInterfaceIPConfiguration{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaces/containerGroup3_eth0"), - // Name: to.Ptr("containerGroup3_eth0"), - // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaces"), - // Etag: to.Ptr("W/\"de9b89d2-83b0-4da3-b488-6ea8b0557edd\""), - // Properties: &armnetwork.ContainerNetworkInterfacePropertiesFormat{ - // Container: &armnetwork.Container{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/networkProfilesDemo/providers/Microsoft.ContainerInstance/containerGroups/containerGroup3"), - // }, - // ContainerNetworkInterfaceConfiguration: &armnetwork.ContainerNetworkInterfaceConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth0"), - // }, - // IPConfigurations: []*armnetwork.ContainerNetworkInterfaceIPConfiguration{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaces/containerGroup3_eth1"), - // Name: to.Ptr("containerGroup3_eth1"), - // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaces"), - // Etag: to.Ptr("W/\"de9b89d2-83b0-4da3-b488-6ea8b0557edd\""), - // Properties: &armnetwork.ContainerNetworkInterfacePropertiesFormat{ - // Container: &armnetwork.Container{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/networkProfilesDemo/providers/Microsoft.ContainerInstance/containerGroups/containerGroup3"), - // }, - // ContainerNetworkInterfaceConfiguration: &armnetwork.ContainerNetworkInterfaceConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth1"), - // }, - // IPConfigurations: []*armnetwork.ContainerNetworkInterfaceIPConfiguration{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("1570d8b6-ab8a-4ad2-81d6-d2799b429cbf"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkProfileCreateConfigOnly.json -func ExampleProfilesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProfilesClient().CreateOrUpdate(ctx, "rg1", "networkProfile1", armnetwork.Profile{ - Location: to.Ptr("westus"), - Properties: &armnetwork.ProfilePropertiesFormat{ - ContainerNetworkInterfaceConfigurations: []*armnetwork.ContainerNetworkInterfaceConfiguration{ - { - Name: to.Ptr("eth1"), - Properties: &armnetwork.ContainerNetworkInterfaceConfigurationPropertiesFormat{ - IPConfigurations: []*armnetwork.IPConfigurationProfile{ - { - Name: to.Ptr("ipconfig1"), - Properties: &armnetwork.IPConfigurationProfilePropertiesFormat{ - Subnet: &armnetwork.Subnet{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/networkProfileVnet/subnets/networkProfileSubnet1"), - }, - }, - }}, - }, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Profile = armnetwork.Profile{ - // Name: to.Ptr("networkProfile1"), - // Type: to.Ptr("Microsoft.Network/networkProfiles"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("W/\"4d705a71-752f-4e0a-8057-c02b125b1c08\""), - // Properties: &armnetwork.ProfilePropertiesFormat{ - // ContainerNetworkInterfaceConfigurations: []*armnetwork.ContainerNetworkInterfaceConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth1"), - // Name: to.Ptr("eth1"), - // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations"), - // Etag: to.Ptr("W/\"4d705a71-752f-4e0a-8057-c02b125b1c08\""), - // Properties: &armnetwork.ContainerNetworkInterfaceConfigurationPropertiesFormat{ - // IPConfigurations: []*armnetwork.IPConfigurationProfile{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth1/ipConfigurations/ipconfig1"), - // Name: to.Ptr("ipconfig1"), - // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations/ipConfigurations"), - // Etag: to.Ptr("W/\"4d705a71-752f-4e0a-8057-c02b125b1c08\""), - // Properties: &armnetwork.IPConfigurationProfilePropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/networkProfileVnet/subnets/networkProfileSubnet1"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // ContainerNetworkInterfaces: []*armnetwork.ContainerNetworkInterface{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("1570d8b6-ab8a-4ad2-81d6-d2799b429cbf"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkProfileUpdateTags.json -func ExampleProfilesClient_UpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProfilesClient().UpdateTags(ctx, "rg1", "test-np", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Profile = armnetwork.Profile{ - // Name: to.Ptr("test-np"), - // Type: to.Ptr("Microsoft.Network/networkProfiles"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-np"), - // Location: to.Ptr("centraluseuap"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armnetwork.ProfilePropertiesFormat{ - // ContainerNetworkInterfaceConfigurations: []*armnetwork.ContainerNetworkInterfaceConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth0"), - // Name: to.Ptr("eth0"), - // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations"), - // Etag: to.Ptr("W/\"4d705a71-752f-4e0a-8057-c02b125b1c08\""), - // Properties: &armnetwork.ContainerNetworkInterfaceConfigurationPropertiesFormat{ - // IPConfigurations: []*armnetwork.IPConfigurationProfile{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth0/ipConfigurations/ipconfigprofile1"), - // Name: to.Ptr("ipconfigprofile1"), - // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations/ipConfigurations"), - // Etag: to.Ptr("W/\"4d705a71-752f-4e0a-8057-c02b125b1c08\""), - // Properties: &armnetwork.IPConfigurationProfilePropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/networkProfileVnet/subnets/networkProfileSubnet1"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // ContainerNetworkInterfaces: []*armnetwork.ContainerNetworkInterface{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("1570d8b6-ab8a-4ad2-81d6-d2799b429cbf"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkProfileListAll.json -func ExampleProfilesClient_NewListAllPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewProfilesClient().NewListAllPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ProfileListResult = armnetwork.ProfileListResult{ - // Value: []*armnetwork.Profile{ - // { - // Name: to.Ptr("networkProfile1"), - // Type: to.Ptr("Microsoft.Network/networkProfiles"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1"), - // Location: to.Ptr("centraluseuap"), - // Properties: &armnetwork.ProfilePropertiesFormat{ - // ContainerNetworkInterfaceConfigurations: []*armnetwork.ContainerNetworkInterfaceConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth0"), - // Name: to.Ptr("eth0"), - // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations"), - // Etag: to.Ptr("W/\"4d705a71-752f-4e0a-8057-c02b125b1c08\""), - // Properties: &armnetwork.ContainerNetworkInterfaceConfigurationPropertiesFormat{ - // IPConfigurations: []*armnetwork.IPConfigurationProfile{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth0/ipConfigurations/ipconfigprofile1"), - // Name: to.Ptr("ipconfigprofile1"), - // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations/ipConfigurations"), - // Etag: to.Ptr("W/\"4d705a71-752f-4e0a-8057-c02b125b1c08\""), - // Properties: &armnetwork.IPConfigurationProfilePropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/networkProfileVnet/subnets/networkProfileSubnet1"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // ContainerNetworkInterfaces: []*armnetwork.ContainerNetworkInterface{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("1570d8b6-ab8a-4ad2-81d6-d2799b429cbf"), - // }, - // }, - // { - // Name: to.Ptr("networkProfile2"), - // Type: to.Ptr("Microsoft.Network/networkProfiles"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/networkProfiles/networkProfile2"), - // Location: to.Ptr("centraluseuap"), - // Properties: &armnetwork.ProfilePropertiesFormat{ - // ContainerNetworkInterfaceConfigurations: []*armnetwork.ContainerNetworkInterfaceConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth1"), - // Name: to.Ptr("eth1"), - // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations"), - // Etag: to.Ptr("W/\"4d705a71-752f-4e0a-8057-c02b125b1c08\""), - // Properties: &armnetwork.ContainerNetworkInterfaceConfigurationPropertiesFormat{ - // IPConfigurations: []*armnetwork.IPConfigurationProfile{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth1/ipConfigurations/ipconfigprofile3"), - // Name: to.Ptr("ipconfigprofile3"), - // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations/ipConfigurations"), - // Etag: to.Ptr("W/\"4d705a71-752f-4e0a-8057-c02b125b1c08\""), - // Properties: &armnetwork.IPConfigurationProfilePropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/networkProfileVnet/subnets/networkProfileSubnet1"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // ContainerNetworkInterfaces: []*armnetwork.ContainerNetworkInterface{ - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkProfileList.json -func ExampleProfilesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewProfilesClient().NewListPager("rg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ProfileListResult = armnetwork.ProfileListResult{ - // Value: []*armnetwork.Profile{ - // { - // Name: to.Ptr("networkProfile1"), - // Type: to.Ptr("Microsoft.Network/networkProfiles"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1"), - // Location: to.Ptr("centraluseuap"), - // Properties: &armnetwork.ProfilePropertiesFormat{ - // ContainerNetworkInterfaceConfigurations: []*armnetwork.ContainerNetworkInterfaceConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth0"), - // Name: to.Ptr("eth0"), - // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations"), - // Etag: to.Ptr("W/\"4d705a71-752f-4e0a-8057-c02b125b1c08\""), - // Properties: &armnetwork.ContainerNetworkInterfaceConfigurationPropertiesFormat{ - // IPConfigurations: []*armnetwork.IPConfigurationProfile{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth0/ipConfigurations/ipconfigprofile1"), - // Name: to.Ptr("ipconfigprofile1"), - // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations/ipConfigurations"), - // Etag: to.Ptr("W/\"4d705a71-752f-4e0a-8057-c02b125b1c08\""), - // Properties: &armnetwork.IPConfigurationProfilePropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/networkProfileVnet/subnets/networkProfileSubnet1"), - // }, - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth0/ipConfigurations/ipconfigprofile2"), - // Name: to.Ptr("ipconfigprofile2"), - // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations/ipConfigurations"), - // Etag: to.Ptr("W/\"4d705a71-752f-4e0a-8057-c02b125b1c08\""), - // Properties: &armnetwork.IPConfigurationProfilePropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/networkProfileVnet/subnets/networkProfileSubnet1"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // ContainerNetworkInterfaces: []*armnetwork.ContainerNetworkInterface{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("1570d8b6-ab8a-4ad2-81d6-d2799b429cbf"), - // }, - // }, - // { - // Name: to.Ptr("networkProfile2"), - // Type: to.Ptr("Microsoft.Network/networkProfiles"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile2"), - // Location: to.Ptr("centraluseuap"), - // Properties: &armnetwork.ProfilePropertiesFormat{ - // ContainerNetworkInterfaceConfigurations: []*armnetwork.ContainerNetworkInterfaceConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth1"), - // Name: to.Ptr("eth1"), - // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations"), - // Etag: to.Ptr("W/\"4d705a71-752f-4e0a-8057-c02b125b1c08\""), - // Properties: &armnetwork.ContainerNetworkInterfaceConfigurationPropertiesFormat{ - // IPConfigurations: []*armnetwork.IPConfigurationProfile{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth1/ipConfigurations/ipconfigprofile3"), - // Name: to.Ptr("ipconfigprofile3"), - // Type: to.Ptr("Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations/ipConfigurations"), - // Etag: to.Ptr("W/\"4d705a71-752f-4e0a-8057-c02b125b1c08\""), - // Properties: &armnetwork.IPConfigurationProfilePropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/networkProfileVnet/subnets/networkProfileSubnet1"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // ContainerNetworkInterfaces: []*armnetwork.ContainerNetworkInterface{ - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/publicipaddresses_client.go b/sdk/resourcemanager/network/armnetwork/publicipaddresses_client.go index d82be99b6702..eb86425b102f 100644 --- a/sdk/resourcemanager/network/armnetwork/publicipaddresses_client.go +++ b/sdk/resourcemanager/network/armnetwork/publicipaddresses_client.go @@ -47,7 +47,7 @@ func NewPublicIPAddressesClient(subscriptionID string, credential azcore.TokenCr // BeginCreateOrUpdate - Creates or updates a static or dynamic public IP address. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - publicIPAddressName - The name of the public IP address. // - parameters - Parameters supplied to the create or update public IP address operation. @@ -71,7 +71,7 @@ func (client *PublicIPAddressesClient) BeginCreateOrUpdate(ctx context.Context, // CreateOrUpdate - Creates or updates a static or dynamic public IP address. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *PublicIPAddressesClient) createOrUpdate(ctx context.Context, resourceGroupName string, publicIPAddressName string, parameters PublicIPAddress, options *PublicIPAddressesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "PublicIPAddressesClient.BeginCreateOrUpdate" @@ -113,7 +113,7 @@ func (client *PublicIPAddressesClient) createOrUpdateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -125,7 +125,7 @@ func (client *PublicIPAddressesClient) createOrUpdateCreateRequest(ctx context.C // BeginDdosProtectionStatus - Gets the Ddos Protection Status of a Public IP Address // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - publicIPAddressName - The name of the public IP address. // - options - PublicIPAddressesClientBeginDdosProtectionStatusOptions contains the optional parameters for the PublicIPAddressesClient.BeginDdosProtectionStatus @@ -148,7 +148,7 @@ func (client *PublicIPAddressesClient) BeginDdosProtectionStatus(ctx context.Con // DdosProtectionStatus - Gets the Ddos Protection Status of a Public IP Address // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *PublicIPAddressesClient) ddosProtectionStatus(ctx context.Context, resourceGroupName string, publicIPAddressName string, options *PublicIPAddressesClientBeginDdosProtectionStatusOptions) (*http.Response, error) { var err error const operationName = "PublicIPAddressesClient.BeginDdosProtectionStatus" @@ -190,7 +190,7 @@ func (client *PublicIPAddressesClient) ddosProtectionStatusCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -199,7 +199,7 @@ func (client *PublicIPAddressesClient) ddosProtectionStatusCreateRequest(ctx con // BeginDelete - Deletes the specified public IP address. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - publicIPAddressName - The name of the public IP address. // - options - PublicIPAddressesClientBeginDeleteOptions contains the optional parameters for the PublicIPAddressesClient.BeginDelete @@ -222,7 +222,7 @@ func (client *PublicIPAddressesClient) BeginDelete(ctx context.Context, resource // Delete - Deletes the specified public IP address. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *PublicIPAddressesClient) deleteOperation(ctx context.Context, resourceGroupName string, publicIPAddressName string, options *PublicIPAddressesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "PublicIPAddressesClient.BeginDelete" @@ -264,7 +264,7 @@ func (client *PublicIPAddressesClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -273,7 +273,7 @@ func (client *PublicIPAddressesClient) deleteCreateRequest(ctx context.Context, // Get - Gets the specified public IP address in a specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - publicIPAddressName - The name of the public IP address. // - options - PublicIPAddressesClientGetOptions contains the optional parameters for the PublicIPAddressesClient.Get method. @@ -319,7 +319,7 @@ func (client *PublicIPAddressesClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } @@ -340,7 +340,7 @@ func (client *PublicIPAddressesClient) getHandleResponse(resp *http.Response) (P // GetCloudServicePublicIPAddress - Get the specified public IP address in a cloud service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - cloudServiceName - The name of the cloud service. // - roleInstanceName - The role instance name. @@ -407,7 +407,7 @@ func (client *PublicIPAddressesClient) getCloudServicePublicIPAddressCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } @@ -515,7 +515,7 @@ func (client *PublicIPAddressesClient) getVirtualMachineScaleSetPublicIPAddressH // NewListPager - Gets all public IP addresses in a resource group. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - options - PublicIPAddressesClientListOptions contains the optional parameters for the PublicIPAddressesClient.NewListPager // method. @@ -565,7 +565,7 @@ func (client *PublicIPAddressesClient) listCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -582,7 +582,7 @@ func (client *PublicIPAddressesClient) listHandleResponse(resp *http.Response) ( // NewListAllPager - Gets all the public IP addresses in a subscription. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - options - PublicIPAddressesClientListAllOptions contains the optional parameters for the PublicIPAddressesClient.NewListAllPager // method. func (client *PublicIPAddressesClient) NewListAllPager(options *PublicIPAddressesClientListAllOptions) *runtime.Pager[PublicIPAddressesClientListAllResponse] { @@ -627,7 +627,7 @@ func (client *PublicIPAddressesClient) listAllCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -644,7 +644,7 @@ func (client *PublicIPAddressesClient) listAllHandleResponse(resp *http.Response // NewListCloudServicePublicIPAddressesPager - Gets information about all public IP addresses on a cloud service level. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - cloudServiceName - The name of the cloud service. // - options - PublicIPAddressesClientListCloudServicePublicIPAddressesOptions contains the optional parameters for the PublicIPAddressesClient.NewListCloudServicePublicIPAddressesPager @@ -699,7 +699,7 @@ func (client *PublicIPAddressesClient) listCloudServicePublicIPAddressesCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -717,7 +717,7 @@ func (client *PublicIPAddressesClient) listCloudServicePublicIPAddressesHandleRe // NewListCloudServiceRoleInstancePublicIPAddressesPager - Gets information about all public IP addresses in a role instance // IP configuration in a cloud service. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - cloudServiceName - The name of the cloud service. // - roleInstanceName - The name of role instance. @@ -787,7 +787,7 @@ func (client *PublicIPAddressesClient) listCloudServiceRoleInstancePublicIPAddre return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -966,7 +966,7 @@ func (client *PublicIPAddressesClient) listVirtualMachineScaleSetVMPublicIPAddre // UpdateTags - Updates public IP address tags. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - publicIPAddressName - The name of the public IP address. // - parameters - Parameters supplied to update public IP address tags. @@ -1014,7 +1014,7 @@ func (client *PublicIPAddressesClient) updateTagsCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/publicipaddresses_client_example_test.go b/sdk/resourcemanager/network/armnetwork/publicipaddresses_client_example_test.go deleted file mode 100644 index 524e533c8114..000000000000 --- a/sdk/resourcemanager/network/armnetwork/publicipaddresses_client_example_test.go +++ /dev/null @@ -1,863 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/CloudServicePublicIpListAll.json -func ExamplePublicIPAddressesClient_NewListCloudServicePublicIPAddressesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPublicIPAddressesClient().NewListCloudServicePublicIPAddressesPager("cs-tester", "cs1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PublicIPAddressListResult = armnetwork.PublicIPAddressListResult{ - // Value: []*armnetwork.PublicIPAddress{ - // { - // Name: to.Ptr("pub1"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/cs-tester/providers/Microsoft.Compute/cloudServices/cs1/roleInstances/Test_VM_0/networkInterfaces/nic1/ipConfigurations/ip1/publicIPAddresses/pub1"), - // Properties: &armnetwork.PublicIPAddressPropertiesFormat{ - // DNSSettings: &armnetwork.PublicIPAddressDNSSettings{ - // DomainNameLabel: to.Ptr("vm1.testvmssacc"), - // Fqdn: to.Ptr("vm1.testvmssacc.southeastasia.cloudapp.azure.com"), - // }, - // IdleTimeoutInMinutes: to.Ptr[int32](10), - // IPAddress: to.Ptr("13.67.119.72"), - // IPConfiguration: &armnetwork.IPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/cs-tester/providers/Microsoft.Compute/cloudServices/cs1/roleInstances/Test_VM_0/networkInterfaces/nic1/ipConfigurations/ip1"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // }, - // }, - // { - // Name: to.Ptr("pub1"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/cs-tester/providers/Microsoft.Compute/cloudServices/cs1/roleInstances/Test_VM_3/networkInterfaces/nic1/ipConfigurations/ip1/publicIPAddresses/pub1"), - // Properties: &armnetwork.PublicIPAddressPropertiesFormat{ - // DNSSettings: &armnetwork.PublicIPAddressDNSSettings{ - // DomainNameLabel: to.Ptr("vm3.testvmssacc"), - // Fqdn: to.Ptr("vm3.testvmssacc.southeastasia.cloudapp.azure.com"), - // }, - // IdleTimeoutInMinutes: to.Ptr[int32](10), - // IPAddress: to.Ptr("13.67.118.216"), - // IPConfiguration: &armnetwork.IPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/cs-tester/providers/Microsoft.Compute/cloudServices/cs1/roleInstances/Test_VM_3/networkInterfaces/nic1/ipConfigurations/ip1"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/CloudServiceRoleInstancePublicIpList.json -func ExamplePublicIPAddressesClient_NewListCloudServiceRoleInstancePublicIPAddressesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPublicIPAddressesClient().NewListCloudServiceRoleInstancePublicIPAddressesPager("cs-tester", "cs1", "Test_VM_0", "nic1", "ip1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PublicIPAddressListResult = armnetwork.PublicIPAddressListResult{ - // Value: []*armnetwork.PublicIPAddress{ - // { - // Name: to.Ptr("pub1"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/cs-tester/providers/Microsoft.Compute/cloudServices/cs1/roleInstances/Test_VM_0/networkInterfaces/nic1/ipConfigurations/ip1/publicIPAddresses/pub1"), - // Properties: &armnetwork.PublicIPAddressPropertiesFormat{ - // DNSSettings: &armnetwork.PublicIPAddressDNSSettings{ - // DomainNameLabel: to.Ptr("vm1.testvmssacc"), - // Fqdn: to.Ptr("vm1.testvmssacc.southeastasia.cloudapp.azure.com"), - // }, - // IdleTimeoutInMinutes: to.Ptr[int32](10), - // IPAddress: to.Ptr("13.67.119.72"), - // IPConfiguration: &armnetwork.IPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/cs-tester/providers/Microsoft.Compute/cloudServices/cs1/roleInstances/Test_VM_0/networkInterfaces/nic1/ipConfigurations/ip1"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/CloudServicePublicIpGet.json -func ExamplePublicIPAddressesClient_GetCloudServicePublicIPAddress() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPublicIPAddressesClient().GetCloudServicePublicIPAddress(ctx, "cs-tester", "cs1", "Test_VM_0", "nic1", "ip1", "pub1", &armnetwork.PublicIPAddressesClientGetCloudServicePublicIPAddressOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PublicIPAddress = armnetwork.PublicIPAddress{ - // Name: to.Ptr("pub1"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/cs-tester/providers/Microsoft.Compute/cloudServices/cs1/roleInstances/Test_VM_0/networkInterfaces/nic1/ipConfigurations/ip1/publicIPAddresses/pub1"), - // Properties: &armnetwork.PublicIPAddressPropertiesFormat{ - // DNSSettings: &armnetwork.PublicIPAddressDNSSettings{ - // DomainNameLabel: to.Ptr("vm1.testvmssacc"), - // Fqdn: to.Ptr("vm1.testvmssacc.southeastasia.cloudapp.azure.com"), - // }, - // IdleTimeoutInMinutes: to.Ptr[int32](10), - // IPAddress: to.Ptr("13.67.119.72"), - // IPConfiguration: &armnetwork.IPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/cs-tester/providers/Microsoft.Compute/cloudServices/cs1/roleInstances/Test_VM_0/networkInterfaces/nic1/ipConfigurations/ip1"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/PublicIpAddressDelete.json -func ExamplePublicIPAddressesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPublicIPAddressesClient().BeginDelete(ctx, "rg1", "test-ip", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/PublicIpAddressGet.json -func ExamplePublicIPAddressesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPublicIPAddressesClient().Get(ctx, "rg1", "testDNS-ip", &armnetwork.PublicIPAddressesClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PublicIPAddress = armnetwork.PublicIPAddress{ - // Name: to.Ptr("testDNS-ip"), - // Type: to.Ptr("Microsoft.Network/publicIPAddresses"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/testDNS-ip"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.PublicIPAddressPropertiesFormat{ - // DdosSettings: &armnetwork.DdosSettings{ - // DdosProtectionPlan: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/ddosProtectionPlans/test-plan"), - // }, - // ProtectionMode: to.Ptr(armnetwork.DdosSettingsProtectionModeEnabled), - // }, - // IdleTimeoutInMinutes: to.Ptr[int32](4), - // IPConfiguration: &armnetwork.IPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testDNS649/ipConfigurations/ipconfig1"), - // }, - // IPTags: []*armnetwork.IPTag{ - // { - // IPTagType: to.Ptr("FirstPartyUsage"), - // Tag: to.Ptr("SQL"), - // }, - // { - // IPTagType: to.Ptr("FirstPartyUsage"), - // Tag: to.Ptr("Storage"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/PublicIpAddressCreateDns.json -func ExamplePublicIPAddressesClient_BeginCreateOrUpdate_createPublicIpAddressDns() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPublicIPAddressesClient().BeginCreateOrUpdate(ctx, "rg1", "test-ip", armnetwork.PublicIPAddress{ - Location: to.Ptr("eastus"), - Properties: &armnetwork.PublicIPAddressPropertiesFormat{ - DNSSettings: &armnetwork.PublicIPAddressDNSSettings{ - DomainNameLabel: to.Ptr("dnslbl"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PublicIPAddress = armnetwork.PublicIPAddress{ - // Name: to.Ptr("testDNS-ip"), - // Type: to.Ptr("Microsoft.Network/publicIPAddresses"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.PublicIPAddressPropertiesFormat{ - // DNSSettings: &armnetwork.PublicIPAddressDNSSettings{ - // DomainNameLabel: to.Ptr("dnslbl"), - // Fqdn: to.Ptr("dnslbl.westus.cloudapp.azure.com"), - // }, - // IdleTimeoutInMinutes: to.Ptr[int32](4), - // IPConfiguration: &armnetwork.IPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testDNS649/ipConfigurations/ipconfig1"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/PublicIpAddressCreateDnsWithDomainNameLabelScope.json -func ExamplePublicIPAddressesClient_BeginCreateOrUpdate_createPublicIpAddressDnsWithDomainNameLabelScope() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPublicIPAddressesClient().BeginCreateOrUpdate(ctx, "rg1", "test-ip", armnetwork.PublicIPAddress{ - Location: to.Ptr("eastus"), - Properties: &armnetwork.PublicIPAddressPropertiesFormat{ - DNSSettings: &armnetwork.PublicIPAddressDNSSettings{ - DomainNameLabel: to.Ptr("dnslbl"), - DomainNameLabelScope: to.Ptr(armnetwork.PublicIPAddressDNSSettingsDomainNameLabelScopeTenantReuse), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PublicIPAddress = armnetwork.PublicIPAddress{ - // Name: to.Ptr("testDNS-ip"), - // Type: to.Ptr("Microsoft.Network/publicIPAddresses"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.PublicIPAddressPropertiesFormat{ - // DNSSettings: &armnetwork.PublicIPAddressDNSSettings{ - // DomainNameLabel: to.Ptr("dnslbl"), - // DomainNameLabelScope: to.Ptr(armnetwork.PublicIPAddressDNSSettingsDomainNameLabelScopeTenantReuse), - // Fqdn: to.Ptr("dnslbl.hxdwgjcdfgbhgebs.eastus.sysgen.cloudapp.azure.com"), - // }, - // IdleTimeoutInMinutes: to.Ptr[int32](4), - // IPConfiguration: &armnetwork.IPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testDNS649/ipConfigurations/ipconfig1"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/PublicIpAddressCreateCustomizedValues.json -func ExamplePublicIPAddressesClient_BeginCreateOrUpdate_createPublicIpAddressAllocationMethod() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPublicIPAddressesClient().BeginCreateOrUpdate(ctx, "rg1", "test-ip", armnetwork.PublicIPAddress{ - Location: to.Ptr("eastus"), - Properties: &armnetwork.PublicIPAddressPropertiesFormat{ - IdleTimeoutInMinutes: to.Ptr[int32](10), - PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodStatic), - }, - SKU: &armnetwork.PublicIPAddressSKU{ - Name: to.Ptr(armnetwork.PublicIPAddressSKUNameStandard), - Tier: to.Ptr(armnetwork.PublicIPAddressSKUTierGlobal), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PublicIPAddress = armnetwork.PublicIPAddress{ - // Name: to.Ptr("testDNS-ip"), - // Type: to.Ptr("Microsoft.Network/publicIPAddresses"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.PublicIPAddressPropertiesFormat{ - // DdosSettings: &armnetwork.DdosSettings{ - // ProtectionMode: to.Ptr(armnetwork.DdosSettingsProtectionModeVirtualNetworkInherited), - // }, - // IdleTimeoutInMinutes: to.Ptr[int32](10), - // IPConfiguration: &armnetwork.IPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testDNS649/ipConfigurations/ipconfig1"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodStatic), - // }, - // SKU: &armnetwork.PublicIPAddressSKU{ - // Name: to.Ptr(armnetwork.PublicIPAddressSKUNameStandard), - // Tier: to.Ptr(armnetwork.PublicIPAddressSKUTierGlobal), - // }, - // Zones: []*string{ - // to.Ptr("1")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/PublicIpAddressCreateDefaults.json -func ExamplePublicIPAddressesClient_BeginCreateOrUpdate_createPublicIpAddressDefaults() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPublicIPAddressesClient().BeginCreateOrUpdate(ctx, "rg1", "test-ip", armnetwork.PublicIPAddress{ - Location: to.Ptr("eastus"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PublicIPAddress = armnetwork.PublicIPAddress{ - // Name: to.Ptr("testDNS-ip"), - // Type: to.Ptr("Microsoft.Network/publicIPAddresses"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.PublicIPAddressPropertiesFormat{ - // IdleTimeoutInMinutes: to.Ptr[int32](4), - // IPConfiguration: &armnetwork.IPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testDNS649/ipConfigurations/ipconfig1"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // }, - // SKU: &armnetwork.PublicIPAddressSKU{ - // Name: to.Ptr(armnetwork.PublicIPAddressSKUNameBasic), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/PublicIpAddressUpdateTags.json -func ExamplePublicIPAddressesClient_UpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPublicIPAddressesClient().UpdateTags(ctx, "rg1", "test-ip", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PublicIPAddress = armnetwork.PublicIPAddress{ - // Name: to.Ptr("testDNS-ip"), - // Type: to.Ptr("Microsoft.Network/publicIPAddresses"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armnetwork.PublicIPAddressPropertiesFormat{ - // DdosSettings: &armnetwork.DdosSettings{ - // ProtectionMode: to.Ptr(armnetwork.DdosSettingsProtectionModeVirtualNetworkInherited), - // }, - // IdleTimeoutInMinutes: to.Ptr[int32](10), - // IPConfiguration: &armnetwork.IPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testDNS649/ipConfigurations/ipconfig1"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodStatic), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/PublicIpAddressListAll.json -func ExamplePublicIPAddressesClient_NewListAllPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPublicIPAddressesClient().NewListAllPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PublicIPAddressListResult = armnetwork.PublicIPAddressListResult{ - // Value: []*armnetwork.PublicIPAddress{ - // { - // Name: to.Ptr("testDNS-ip"), - // Type: to.Ptr("Microsoft.Network/publicIPAddresses"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/testDNS-ip"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.PublicIPAddressPropertiesFormat{ - // DdosSettings: &armnetwork.DdosSettings{ - // ProtectionMode: to.Ptr(armnetwork.DdosSettingsProtectionModeVirtualNetworkInherited), - // }, - // IdleTimeoutInMinutes: to.Ptr[int32](4), - // IPConfiguration: &armnetwork.IPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testDNS649/ipConfigurations/ipconfig1"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // }, - // }, - // { - // Name: to.Ptr("ip01"), - // Type: to.Ptr("Microsoft.Network/publicIPAddresses"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/publicIPAddresses/ip01"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.PublicIPAddressPropertiesFormat{ - // DdosSettings: &armnetwork.DdosSettings{ - // ProtectionMode: to.Ptr(armnetwork.DdosSettingsProtectionModeVirtualNetworkInherited), - // }, - // DNSSettings: &armnetwork.PublicIPAddressDNSSettings{ - // DomainNameLabel: to.Ptr("testlbl"), - // Fqdn: to.Ptr("testlbl.westus.cloudapp.azure.com"), - // }, - // IdleTimeoutInMinutes: to.Ptr[int32](4), - // IPAddress: to.Ptr("40.85.154.247"), - // IPConfiguration: &armnetwork.IPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/loadBalancers/testLb/frontendIPConfigurations/LoadBalancerFrontEnd"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // }, - // }, - // { - // Name: to.Ptr("ip02"), - // Type: to.Ptr("Microsoft.Network/publicIPAddresses"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/publicIPAddresses/ip02"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.PublicIPAddressPropertiesFormat{ - // DdosSettings: &armnetwork.DdosSettings{ - // ProtectionMode: to.Ptr(armnetwork.DdosSettingsProtectionModeVirtualNetworkInherited), - // }, - // DNSSettings: &armnetwork.PublicIPAddressDNSSettings{ - // DomainNameLabel: to.Ptr("testlbl"), - // DomainNameLabelScope: to.Ptr(armnetwork.PublicIPAddressDNSSettingsDomainNameLabelScopeTenantReuse), - // Fqdn: to.Ptr("testlbl.hxdwgjcdfgbhgebs.eastus.sysgen.cloudapp.azure.com"), - // }, - // IdleTimeoutInMinutes: to.Ptr[int32](4), - // IPAddress: to.Ptr("40.85.154.248"), - // IPConfiguration: &armnetwork.IPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/loadBalancers/testLb/frontendIPConfigurations/LoadBalancerFrontEnd"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/PublicIpAddressList.json -func ExamplePublicIPAddressesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPublicIPAddressesClient().NewListPager("rg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PublicIPAddressListResult = armnetwork.PublicIPAddressListResult{ - // Value: []*armnetwork.PublicIPAddress{ - // { - // Name: to.Ptr("testDNS-ip"), - // Type: to.Ptr("Microsoft.Network/publicIPAddresses"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/testDNS-ip"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.PublicIPAddressPropertiesFormat{ - // DdosSettings: &armnetwork.DdosSettings{ - // ProtectionMode: to.Ptr(armnetwork.DdosSettingsProtectionModeVirtualNetworkInherited), - // }, - // IdleTimeoutInMinutes: to.Ptr[int32](4), - // IPConfiguration: &armnetwork.IPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testDNS649/ipConfigurations/ipconfig1"), - // }, - // IPTags: []*armnetwork.IPTag{ - // { - // IPTagType: to.Ptr("FirstPartyUsage"), - // Tag: to.Ptr("SQL"), - // }, - // { - // IPTagType: to.Ptr("FirstPartyUsage"), - // Tag: to.Ptr("Storage"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // }, - // }, - // { - // Name: to.Ptr("ip03"), - // Type: to.Ptr("Microsoft.Network/publicIPAddresses"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/ip03"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.PublicIPAddressPropertiesFormat{ - // DdosSettings: &armnetwork.DdosSettings{ - // ProtectionMode: to.Ptr(armnetwork.DdosSettingsProtectionModeVirtualNetworkInherited), - // }, - // DNSSettings: &armnetwork.PublicIPAddressDNSSettings{ - // DomainNameLabel: to.Ptr("testlbl"), - // Fqdn: to.Ptr("testlbl.westus.cloudapp.azure.com"), - // }, - // IdleTimeoutInMinutes: to.Ptr[int32](4), - // IPAddress: to.Ptr("40.85.154.247"), - // IPConfiguration: &armnetwork.IPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/testLb/frontendIPConfigurations/LoadBalancerFrontEnd"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // }, - // }, - // { - // Name: to.Ptr("ip04"), - // Type: to.Ptr("Microsoft.Network/publicIPAddresses"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/ip04"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.PublicIPAddressPropertiesFormat{ - // DdosSettings: &armnetwork.DdosSettings{ - // ProtectionMode: to.Ptr(armnetwork.DdosSettingsProtectionModeVirtualNetworkInherited), - // }, - // DNSSettings: &armnetwork.PublicIPAddressDNSSettings{ - // DomainNameLabel: to.Ptr("testlbl"), - // DomainNameLabelScope: to.Ptr(armnetwork.PublicIPAddressDNSSettingsDomainNameLabelScopeTenantReuse), - // Fqdn: to.Ptr("testlbl.hxdwgjcdfgbhgebs.eastus.sysgen.cloudapp.azure.com"), - // }, - // IdleTimeoutInMinutes: to.Ptr[int32](4), - // IPAddress: to.Ptr("40.85.154.248"), - // IPConfiguration: &armnetwork.IPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/testLb/frontendIPConfigurations/LoadBalancerFrontEnd"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/PublicIpAddressGetDdosProtectionStatus.json -func ExamplePublicIPAddressesClient_BeginDdosProtectionStatus() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPublicIPAddressesClient().BeginDdosProtectionStatus(ctx, "rg1", "test-pip", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PublicIPDdosProtectionStatusResult = armnetwork.PublicIPDdosProtectionStatusResult{ - // DdosProtectionPlanID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/ddosProtectionPlans/test-plan"), - // IsWorkloadProtected: to.Ptr(armnetwork.IsWorkloadProtectedTrue), - // PublicIPAddress: to.Ptr("10.0.1.5"), - // PublicIPAddressID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-pip"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VmssPublicIpListAll.json -func ExamplePublicIPAddressesClient_NewListVirtualMachineScaleSetPublicIPAddressesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPublicIPAddressesClient().NewListVirtualMachineScaleSetPublicIPAddressesPager("vmss-tester", "vmss1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PublicIPAddressListResult = armnetwork.PublicIPAddressListResult{ - // Value: []*armnetwork.PublicIPAddress{ - // { - // Name: to.Ptr("pub1"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/vmss-tester/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/1/networkInterfaces/nic1/ipConfigurations/ip1/publicIPAddresses/pub1"), - // Properties: &armnetwork.PublicIPAddressPropertiesFormat{ - // DNSSettings: &armnetwork.PublicIPAddressDNSSettings{ - // DomainNameLabel: to.Ptr("vm1.testvmssacc"), - // Fqdn: to.Ptr("vm1.testvmssacc.southeastasia.cloudapp.azure.com"), - // }, - // IdleTimeoutInMinutes: to.Ptr[int32](10), - // IPAddress: to.Ptr("13.67.119.72"), - // IPConfiguration: &armnetwork.IPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/vmss-tester/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/1/networkInterfaces/nic1/ipConfigurations/ip1"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // }, - // }, - // { - // Name: to.Ptr("pub1"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/vmss-tester/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/3/networkInterfaces/nic1/ipConfigurations/ip1/publicIPAddresses/pub1"), - // Properties: &armnetwork.PublicIPAddressPropertiesFormat{ - // DNSSettings: &armnetwork.PublicIPAddressDNSSettings{ - // DomainNameLabel: to.Ptr("vm3.testvmssacc"), - // Fqdn: to.Ptr("vm3.testvmssacc.southeastasia.cloudapp.azure.com"), - // }, - // IdleTimeoutInMinutes: to.Ptr[int32](10), - // IPAddress: to.Ptr("13.67.118.216"), - // IPConfiguration: &armnetwork.IPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/vmss-tester/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/3/networkInterfaces/nic1/ipConfigurations/ip1"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VmssVmPublicIpList.json -func ExamplePublicIPAddressesClient_NewListVirtualMachineScaleSetVMPublicIPAddressesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPublicIPAddressesClient().NewListVirtualMachineScaleSetVMPublicIPAddressesPager("vmss-tester", "vmss1", "1", "nic1", "ip1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PublicIPAddressListResult = armnetwork.PublicIPAddressListResult{ - // Value: []*armnetwork.PublicIPAddress{ - // { - // Name: to.Ptr("pub1"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/vmss-tester/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/1/networkInterfaces/nic1/ipConfigurations/ip1/publicIPAddresses/pub1"), - // Properties: &armnetwork.PublicIPAddressPropertiesFormat{ - // DNSSettings: &armnetwork.PublicIPAddressDNSSettings{ - // DomainNameLabel: to.Ptr("vm1.testvmssacc"), - // Fqdn: to.Ptr("vm1.testvmssacc.southeastasia.cloudapp.azure.com"), - // }, - // IdleTimeoutInMinutes: to.Ptr[int32](10), - // IPAddress: to.Ptr("13.67.119.72"), - // IPConfiguration: &armnetwork.IPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/vmss-tester/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/1/networkInterfaces/nic1/ipConfigurations/ip1"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VmssPublicIpGet.json -func ExamplePublicIPAddressesClient_GetVirtualMachineScaleSetPublicIPAddress() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPublicIPAddressesClient().GetVirtualMachineScaleSetPublicIPAddress(ctx, "vmss-tester", "vmss1", "1", "nic1", "ip1", "pub1", &armnetwork.PublicIPAddressesClientGetVirtualMachineScaleSetPublicIPAddressOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PublicIPAddress = armnetwork.PublicIPAddress{ - // Name: to.Ptr("pub1"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/vmss-tester/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/1/networkInterfaces/nic1/ipConfigurations/ip1/publicIPAddresses/pub1"), - // Properties: &armnetwork.PublicIPAddressPropertiesFormat{ - // DNSSettings: &armnetwork.PublicIPAddressDNSSettings{ - // DomainNameLabel: to.Ptr("vm1.testvmssacc"), - // Fqdn: to.Ptr("vm1.testvmssacc.southeastasia.cloudapp.azure.com"), - // }, - // IdleTimeoutInMinutes: to.Ptr[int32](10), - // IPAddress: to.Ptr("13.67.119.72"), - // IPConfiguration: &armnetwork.IPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/vmss-tester/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/1/networkInterfaces/nic1/ipConfigurations/ip1"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // }, - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/publicipprefixes_client.go b/sdk/resourcemanager/network/armnetwork/publicipprefixes_client.go index aa6e026b41e0..a6c6d3a57b9a 100644 --- a/sdk/resourcemanager/network/armnetwork/publicipprefixes_client.go +++ b/sdk/resourcemanager/network/armnetwork/publicipprefixes_client.go @@ -47,7 +47,7 @@ func NewPublicIPPrefixesClient(subscriptionID string, credential azcore.TokenCre // BeginCreateOrUpdate - Creates or updates a static or dynamic public IP prefix. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - publicIPPrefixName - The name of the public IP prefix. // - parameters - Parameters supplied to the create or update public IP prefix operation. @@ -71,7 +71,7 @@ func (client *PublicIPPrefixesClient) BeginCreateOrUpdate(ctx context.Context, r // CreateOrUpdate - Creates or updates a static or dynamic public IP prefix. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *PublicIPPrefixesClient) createOrUpdate(ctx context.Context, resourceGroupName string, publicIPPrefixName string, parameters PublicIPPrefix, options *PublicIPPrefixesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "PublicIPPrefixesClient.BeginCreateOrUpdate" @@ -113,7 +113,7 @@ func (client *PublicIPPrefixesClient) createOrUpdateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -125,7 +125,7 @@ func (client *PublicIPPrefixesClient) createOrUpdateCreateRequest(ctx context.Co // BeginDelete - Deletes the specified public IP prefix. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - publicIPPrefixName - The name of the PublicIpPrefix. // - options - PublicIPPrefixesClientBeginDeleteOptions contains the optional parameters for the PublicIPPrefixesClient.BeginDelete @@ -148,7 +148,7 @@ func (client *PublicIPPrefixesClient) BeginDelete(ctx context.Context, resourceG // Delete - Deletes the specified public IP prefix. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *PublicIPPrefixesClient) deleteOperation(ctx context.Context, resourceGroupName string, publicIPPrefixName string, options *PublicIPPrefixesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "PublicIPPrefixesClient.BeginDelete" @@ -190,7 +190,7 @@ func (client *PublicIPPrefixesClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -199,7 +199,7 @@ func (client *PublicIPPrefixesClient) deleteCreateRequest(ctx context.Context, r // Get - Gets the specified public IP prefix in a specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - publicIPPrefixName - The name of the public IP prefix. // - options - PublicIPPrefixesClientGetOptions contains the optional parameters for the PublicIPPrefixesClient.Get method. @@ -245,7 +245,7 @@ func (client *PublicIPPrefixesClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } @@ -265,7 +265,7 @@ func (client *PublicIPPrefixesClient) getHandleResponse(resp *http.Response) (Pu // NewListPager - Gets all public IP prefixes in a resource group. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - options - PublicIPPrefixesClientListOptions contains the optional parameters for the PublicIPPrefixesClient.NewListPager // method. @@ -315,7 +315,7 @@ func (client *PublicIPPrefixesClient) listCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -332,7 +332,7 @@ func (client *PublicIPPrefixesClient) listHandleResponse(resp *http.Response) (P // NewListAllPager - Gets all the public IP prefixes in a subscription. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - options - PublicIPPrefixesClientListAllOptions contains the optional parameters for the PublicIPPrefixesClient.NewListAllPager // method. func (client *PublicIPPrefixesClient) NewListAllPager(options *PublicIPPrefixesClientListAllOptions) *runtime.Pager[PublicIPPrefixesClientListAllResponse] { @@ -377,7 +377,7 @@ func (client *PublicIPPrefixesClient) listAllCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -395,7 +395,7 @@ func (client *PublicIPPrefixesClient) listAllHandleResponse(resp *http.Response) // UpdateTags - Updates public IP prefix tags. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - publicIPPrefixName - The name of the public IP prefix. // - parameters - Parameters supplied to update public IP prefix tags. @@ -443,7 +443,7 @@ func (client *PublicIPPrefixesClient) updateTagsCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/publicipprefixes_client_example_test.go b/sdk/resourcemanager/network/armnetwork/publicipprefixes_client_example_test.go deleted file mode 100644 index dd049cae3574..000000000000 --- a/sdk/resourcemanager/network/armnetwork/publicipprefixes_client_example_test.go +++ /dev/null @@ -1,399 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/PublicIpPrefixDelete.json -func ExamplePublicIPPrefixesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPublicIPPrefixesClient().BeginDelete(ctx, "rg1", "test-ipprefix", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/PublicIpPrefixGet.json -func ExamplePublicIPPrefixesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPublicIPPrefixesClient().Get(ctx, "rg1", "test-ipprefix", &armnetwork.PublicIPPrefixesClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PublicIPPrefix = armnetwork.PublicIPPrefix{ - // Name: to.Ptr("test-ipprefix"), - // Type: to.Ptr("Microsoft.Network/publicIPPrefixes"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/test-ipprefix"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.PublicIPPrefixPropertiesFormat{ - // IPPrefix: to.Ptr("192.168.254.2/30"), - // IPTags: []*armnetwork.IPTag{ - // }, - // PrefixLength: to.Ptr[int32](30), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PublicIPAddresses: []*armnetwork.ReferencedPublicIPAddress{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1"), - // }}, - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // }, - // SKU: &armnetwork.PublicIPPrefixSKU{ - // Name: to.Ptr(armnetwork.PublicIPPrefixSKUNameStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/PublicIpPrefixCreateCustomizedValues.json -func ExamplePublicIPPrefixesClient_BeginCreateOrUpdate_createPublicIpPrefixAllocationMethod() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPublicIPPrefixesClient().BeginCreateOrUpdate(ctx, "rg1", "test-ipprefix", armnetwork.PublicIPPrefix{ - Location: to.Ptr("westus"), - Properties: &armnetwork.PublicIPPrefixPropertiesFormat{ - PrefixLength: to.Ptr[int32](30), - PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - }, - SKU: &armnetwork.PublicIPPrefixSKU{ - Name: to.Ptr(armnetwork.PublicIPPrefixSKUNameStandard), - Tier: to.Ptr(armnetwork.PublicIPPrefixSKUTierRegional), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PublicIPPrefix = armnetwork.PublicIPPrefix{ - // Name: to.Ptr("test-ipprefix"), - // Type: to.Ptr("Microsoft.Network/publicIPPrefixes"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/test-ipprefix"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.PublicIPPrefixPropertiesFormat{ - // IPPrefix: to.Ptr("192.168.254.2/30"), - // IPTags: []*armnetwork.IPTag{ - // }, - // PrefixLength: to.Ptr[int32](30), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // }, - // SKU: &armnetwork.PublicIPPrefixSKU{ - // Name: to.Ptr(armnetwork.PublicIPPrefixSKUNameStandard), - // Tier: to.Ptr(armnetwork.PublicIPPrefixSKUTierRegional), - // }, - // Zones: []*string{ - // to.Ptr("1")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/PublicIpPrefixCreateDefaults.json -func ExamplePublicIPPrefixesClient_BeginCreateOrUpdate_createPublicIpPrefixDefaults() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPublicIPPrefixesClient().BeginCreateOrUpdate(ctx, "rg1", "test-ipprefix", armnetwork.PublicIPPrefix{ - Location: to.Ptr("westus"), - Properties: &armnetwork.PublicIPPrefixPropertiesFormat{ - PrefixLength: to.Ptr[int32](30), - }, - SKU: &armnetwork.PublicIPPrefixSKU{ - Name: to.Ptr(armnetwork.PublicIPPrefixSKUNameStandard), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PublicIPPrefix = armnetwork.PublicIPPrefix{ - // Name: to.Ptr("test-ipprefix"), - // Type: to.Ptr("Microsoft.Network/publicIPPrefixes"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/test-ipprefix"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.PublicIPPrefixPropertiesFormat{ - // IPPrefix: to.Ptr("192.168.254.2/30"), - // IPTags: []*armnetwork.IPTag{ - // }, - // PrefixLength: to.Ptr[int32](30), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // }, - // SKU: &armnetwork.PublicIPPrefixSKU{ - // Name: to.Ptr(armnetwork.PublicIPPrefixSKUNameStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/PublicIpPrefixUpdateTags.json -func ExamplePublicIPPrefixesClient_UpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPublicIPPrefixesClient().UpdateTags(ctx, "rg1", "test-ipprefix", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PublicIPPrefix = armnetwork.PublicIPPrefix{ - // Name: to.Ptr("test-ipprefix"), - // Type: to.Ptr("Microsoft.Network/publicIPPrefixes"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/test-ipprefix"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.PublicIPPrefixPropertiesFormat{ - // IPPrefix: to.Ptr("40.85.154.247/30"), - // IPTags: []*armnetwork.IPTag{ - // }, - // PrefixLength: to.Ptr[int32](30), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // }, - // SKU: &armnetwork.PublicIPPrefixSKU{ - // Name: to.Ptr(armnetwork.PublicIPPrefixSKUNameStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/PublicIpPrefixListAll.json -func ExamplePublicIPPrefixesClient_NewListAllPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPublicIPPrefixesClient().NewListAllPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PublicIPPrefixListResult = armnetwork.PublicIPPrefixListResult{ - // Value: []*armnetwork.PublicIPPrefix{ - // { - // Name: to.Ptr("test-ipprefix"), - // Type: to.Ptr("Microsoft.Network/publicIPPrefixes"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/test-ipprefix"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.PublicIPPrefixPropertiesFormat{ - // IPPrefix: to.Ptr("41.85.154.247/30"), - // IPTags: []*armnetwork.IPTag{ - // }, - // PrefixLength: to.Ptr[int32](30), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // PublicIPAddresses: []*armnetwork.ReferencedPublicIPAddress{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1"), - // }}, - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // }, - // SKU: &armnetwork.PublicIPPrefixSKU{ - // Name: to.Ptr(armnetwork.PublicIPPrefixSKUNameStandard), - // }, - // }, - // { - // Name: to.Ptr("ipprefix01"), - // Type: to.Ptr("Microsoft.Network/publicIPPrefixes"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/publicIPPrefixes/ipprefix01"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.PublicIPPrefixPropertiesFormat{ - // IPPrefix: to.Ptr("40.85.154.247/30"), - // IPTags: []*armnetwork.IPTag{ - // }, - // PrefixLength: to.Ptr[int32](30), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // }, - // SKU: &armnetwork.PublicIPPrefixSKU{ - // Name: to.Ptr(armnetwork.PublicIPPrefixSKUNameStandard), - // }, - // }, - // { - // Name: to.Ptr("pfx"), - // Type: to.Ptr("Microsoft.Network/publicIPPrefixes"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg3/providers/Microsoft.Network/publicIPPrefixes/pfx"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.PublicIPPrefixPropertiesFormat{ - // IPPrefix: to.Ptr("25.101.84.16/30"), - // IPTags: []*armnetwork.IPTag{ - // }, - // LoadBalancerFrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg3/providers/Microsoft.Network/loadBalancers/lb-pfx/frontendIPConfigurations/ipconfig1"), - // }, - // PrefixLength: to.Ptr[int32](30), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // }, - // SKU: &armnetwork.PublicIPPrefixSKU{ - // Name: to.Ptr(armnetwork.PublicIPPrefixSKUNameStandard), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/PublicIpPrefixList.json -func ExamplePublicIPPrefixesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPublicIPPrefixesClient().NewListPager("rg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PublicIPPrefixListResult = armnetwork.PublicIPPrefixListResult{ - // Value: []*armnetwork.PublicIPPrefix{ - // { - // Name: to.Ptr("test-ipprefix"), - // Type: to.Ptr("Microsoft.Network/publicIPPrefixes"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/test-ipprefix"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.PublicIPPrefixPropertiesFormat{ - // IPPrefix: to.Ptr("40.85.154.2/30"), - // IPTags: []*armnetwork.IPTag{ - // { - // IPTagType: to.Ptr("FirstPartyUsage"), - // Tag: to.Ptr("SQL"), - // }}, - // PrefixLength: to.Ptr[int32](30), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // }, - // SKU: &armnetwork.PublicIPPrefixSKU{ - // Name: to.Ptr(armnetwork.PublicIPPrefixSKUNameStandard), - // }, - // }, - // { - // Name: to.Ptr("ipprefix03"), - // Type: to.Ptr("Microsoft.Network/publicIPPrefixes"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/ipprefix03"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-00000000\""), - // Properties: &armnetwork.PublicIPPrefixPropertiesFormat{ - // IPPrefix: to.Ptr("40.85.153.2/31"), - // IPTags: []*armnetwork.IPTag{ - // }, - // PrefixLength: to.Ptr[int32](31), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddressVersion: to.Ptr(armnetwork.IPVersionIPv4), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-00000000"), - // }, - // SKU: &armnetwork.PublicIPPrefixSKU{ - // Name: to.Ptr(armnetwork.PublicIPPrefixSKUNameStandard), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/resourcenavigationlinks_client.go b/sdk/resourcemanager/network/armnetwork/resourcenavigationlinks_client.go index 18f0d76f3827..00edc4378c0a 100644 --- a/sdk/resourcemanager/network/armnetwork/resourcenavigationlinks_client.go +++ b/sdk/resourcemanager/network/armnetwork/resourcenavigationlinks_client.go @@ -47,7 +47,7 @@ func NewResourceNavigationLinksClient(subscriptionID string, credential azcore.T // List - Gets a list of resource navigation links for a subnet. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkName - The name of the virtual network. // - subnetName - The name of the subnet. @@ -99,7 +99,7 @@ func (client *ResourceNavigationLinksClient) listCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/resourcenavigationlinks_client_example_test.go b/sdk/resourcemanager/network/armnetwork/resourcenavigationlinks_client_example_test.go deleted file mode 100644 index 15c2016966a6..000000000000 --- a/sdk/resourcemanager/network/armnetwork/resourcenavigationlinks_client_example_test.go +++ /dev/null @@ -1,52 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkGetResourceNavigationLinks.json -func ExampleResourceNavigationLinksClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewResourceNavigationLinksClient().List(ctx, "rg1", "vnet", "subnet", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ResourceNavigationLinksListResult = armnetwork.ResourceNavigationLinksListResult{ - // Value: []*armnetwork.ResourceNavigationLink{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet/subnets/subnet/resourceNavigationLinks/redisCache_redis-tester"), - // Name: to.Ptr("redisCache_redis-tester"), - // Type: to.Ptr("Microsoft.Network/virtualNetworks/subnets/resourceNavigationLinks"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.ResourceNavigationLinkFormat{ - // Link: to.Ptr("/subscriptions/subid/resourceGroups/another-rg/providers/Microsoft.Cache/Redis/redis-tester"), - // LinkedResourceType: to.Ptr("Microsoft.Cache/redis"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/response_types.go b/sdk/resourcemanager/network/armnetwork/response_types.go index 11e5d0ad2792..d59e968e4fb2 100644 --- a/sdk/resourcemanager/network/armnetwork/response_types.go +++ b/sdk/resourcemanager/network/armnetwork/response_types.go @@ -1521,6 +1521,12 @@ type LoadBalancersClientListResponse struct { LoadBalancerListResult } +// LoadBalancersClientMigrateToIPBasedResponse contains the response from method LoadBalancersClient.MigrateToIPBased. +type LoadBalancersClientMigrateToIPBasedResponse struct { + // The response for a migrateToIpBased API. + MigratedPools +} + // LoadBalancersClientSwapPublicIPAddressesResponse contains the response from method LoadBalancersClient.BeginSwapPublicIPAddresses. type LoadBalancersClientSwapPublicIPAddressesResponse struct { // placeholder for future response values diff --git a/sdk/resourcemanager/network/armnetwork/routefilterrules_client.go b/sdk/resourcemanager/network/armnetwork/routefilterrules_client.go index 3344acf621b6..b5b5b760811b 100644 --- a/sdk/resourcemanager/network/armnetwork/routefilterrules_client.go +++ b/sdk/resourcemanager/network/armnetwork/routefilterrules_client.go @@ -47,7 +47,7 @@ func NewRouteFilterRulesClient(subscriptionID string, credential azcore.TokenCre // BeginCreateOrUpdate - Creates or updates a route in the specified route filter. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - routeFilterName - The name of the route filter. // - ruleName - The name of the route filter rule. @@ -72,7 +72,7 @@ func (client *RouteFilterRulesClient) BeginCreateOrUpdate(ctx context.Context, r // CreateOrUpdate - Creates or updates a route in the specified route filter. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *RouteFilterRulesClient) createOrUpdate(ctx context.Context, resourceGroupName string, routeFilterName string, ruleName string, routeFilterRuleParameters RouteFilterRule, options *RouteFilterRulesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "RouteFilterRulesClient.BeginCreateOrUpdate" @@ -118,7 +118,7 @@ func (client *RouteFilterRulesClient) createOrUpdateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, routeFilterRuleParameters); err != nil { @@ -130,7 +130,7 @@ func (client *RouteFilterRulesClient) createOrUpdateCreateRequest(ctx context.Co // BeginDelete - Deletes the specified rule from a route filter. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - routeFilterName - The name of the route filter. // - ruleName - The name of the rule. @@ -154,7 +154,7 @@ func (client *RouteFilterRulesClient) BeginDelete(ctx context.Context, resourceG // Delete - Deletes the specified rule from a route filter. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *RouteFilterRulesClient) deleteOperation(ctx context.Context, resourceGroupName string, routeFilterName string, ruleName string, options *RouteFilterRulesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "RouteFilterRulesClient.BeginDelete" @@ -200,7 +200,7 @@ func (client *RouteFilterRulesClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -209,7 +209,7 @@ func (client *RouteFilterRulesClient) deleteCreateRequest(ctx context.Context, r // Get - Gets the specified rule from a route filter. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - routeFilterName - The name of the route filter. // - ruleName - The name of the rule. @@ -260,7 +260,7 @@ func (client *RouteFilterRulesClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -277,7 +277,7 @@ func (client *RouteFilterRulesClient) getHandleResponse(resp *http.Response) (Ro // NewListByRouteFilterPager - Gets all RouteFilterRules in a route filter. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - routeFilterName - The name of the route filter. // - options - RouteFilterRulesClientListByRouteFilterOptions contains the optional parameters for the RouteFilterRulesClient.NewListByRouteFilterPager @@ -332,7 +332,7 @@ func (client *RouteFilterRulesClient) listByRouteFilterCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/routefilterrules_client_example_test.go b/sdk/resourcemanager/network/armnetwork/routefilterrules_client_example_test.go deleted file mode 100644 index 5a5a20e8e0c6..000000000000 --- a/sdk/resourcemanager/network/armnetwork/routefilterrules_client_example_test.go +++ /dev/null @@ -1,159 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/RouteFilterRuleDelete.json -func ExampleRouteFilterRulesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRouteFilterRulesClient().BeginDelete(ctx, "rg1", "filterName", "ruleName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/RouteFilterRuleGet.json -func ExampleRouteFilterRulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRouteFilterRulesClient().Get(ctx, "rg1", "filterName", "filterName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RouteFilterRule = armnetwork.RouteFilterRule{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/routeFilters/filterName/routeFilterRules/ruleName"), - // Name: to.Ptr("ruleName"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.RouteFilterRulePropertiesFormat{ - // Access: to.Ptr(armnetwork.AccessAllow), - // Communities: []*string{ - // to.Ptr("12076:5030"), - // to.Ptr("12076:5040")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RouteFilterRuleType: to.Ptr(armnetwork.RouteFilterRuleTypeCommunity), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/RouteFilterRuleCreate.json -func ExampleRouteFilterRulesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRouteFilterRulesClient().BeginCreateOrUpdate(ctx, "rg1", "filterName", "ruleName", armnetwork.RouteFilterRule{ - Properties: &armnetwork.RouteFilterRulePropertiesFormat{ - Access: to.Ptr(armnetwork.AccessAllow), - Communities: []*string{ - to.Ptr("12076:5030"), - to.Ptr("12076:5040")}, - RouteFilterRuleType: to.Ptr(armnetwork.RouteFilterRuleTypeCommunity), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RouteFilterRule = armnetwork.RouteFilterRule{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/routeFilters/filterName/routeFilterRules/ruleName"), - // Name: to.Ptr("ruleName"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.RouteFilterRulePropertiesFormat{ - // Access: to.Ptr(armnetwork.AccessAllow), - // Communities: []*string{ - // to.Ptr("12076:5030"), - // to.Ptr("12076:5040")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RouteFilterRuleType: to.Ptr(armnetwork.RouteFilterRuleTypeCommunity), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/RouteFilterRuleListByRouteFilter.json -func ExampleRouteFilterRulesClient_NewListByRouteFilterPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRouteFilterRulesClient().NewListByRouteFilterPager("rg1", "filterName", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.RouteFilterRuleListResult = armnetwork.RouteFilterRuleListResult{ - // Value: []*armnetwork.RouteFilterRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/routeFilters/filterName/routeFilterRules/ruleName"), - // Name: to.Ptr("ruleName"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.RouteFilterRulePropertiesFormat{ - // Access: to.Ptr(armnetwork.AccessAllow), - // Communities: []*string{ - // to.Ptr("12076:5030"), - // to.Ptr("12076:5040")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RouteFilterRuleType: to.Ptr(armnetwork.RouteFilterRuleTypeCommunity), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/routefilters_client.go b/sdk/resourcemanager/network/armnetwork/routefilters_client.go index 4714ddfe6129..532691df4831 100644 --- a/sdk/resourcemanager/network/armnetwork/routefilters_client.go +++ b/sdk/resourcemanager/network/armnetwork/routefilters_client.go @@ -47,7 +47,7 @@ func NewRouteFiltersClient(subscriptionID string, credential azcore.TokenCredent // BeginCreateOrUpdate - Creates or updates a route filter in a specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - routeFilterName - The name of the route filter. // - routeFilterParameters - Parameters supplied to the create or update route filter operation. @@ -71,7 +71,7 @@ func (client *RouteFiltersClient) BeginCreateOrUpdate(ctx context.Context, resou // CreateOrUpdate - Creates or updates a route filter in a specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *RouteFiltersClient) createOrUpdate(ctx context.Context, resourceGroupName string, routeFilterName string, routeFilterParameters RouteFilter, options *RouteFiltersClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "RouteFiltersClient.BeginCreateOrUpdate" @@ -113,7 +113,7 @@ func (client *RouteFiltersClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, routeFilterParameters); err != nil { @@ -125,7 +125,7 @@ func (client *RouteFiltersClient) createOrUpdateCreateRequest(ctx context.Contex // BeginDelete - Deletes the specified route filter. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - routeFilterName - The name of the route filter. // - options - RouteFiltersClientBeginDeleteOptions contains the optional parameters for the RouteFiltersClient.BeginDelete @@ -148,7 +148,7 @@ func (client *RouteFiltersClient) BeginDelete(ctx context.Context, resourceGroup // Delete - Deletes the specified route filter. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *RouteFiltersClient) deleteOperation(ctx context.Context, resourceGroupName string, routeFilterName string, options *RouteFiltersClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "RouteFiltersClient.BeginDelete" @@ -190,7 +190,7 @@ func (client *RouteFiltersClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -199,7 +199,7 @@ func (client *RouteFiltersClient) deleteCreateRequest(ctx context.Context, resou // Get - Gets the specified route filter. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - routeFilterName - The name of the route filter. // - options - RouteFiltersClientGetOptions contains the optional parameters for the RouteFiltersClient.Get method. @@ -245,7 +245,7 @@ func (client *RouteFiltersClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } @@ -265,7 +265,7 @@ func (client *RouteFiltersClient) getHandleResponse(resp *http.Response) (RouteF // NewListPager - Gets all route filters in a subscription. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - options - RouteFiltersClientListOptions contains the optional parameters for the RouteFiltersClient.NewListPager method. func (client *RouteFiltersClient) NewListPager(options *RouteFiltersClientListOptions) *runtime.Pager[RouteFiltersClientListResponse] { return runtime.NewPager(runtime.PagingHandler[RouteFiltersClientListResponse]{ @@ -309,7 +309,7 @@ func (client *RouteFiltersClient) listCreateRequest(ctx context.Context, options return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -326,7 +326,7 @@ func (client *RouteFiltersClient) listHandleResponse(resp *http.Response) (Route // NewListByResourceGroupPager - Gets all route filters in a resource group. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - options - RouteFiltersClientListByResourceGroupOptions contains the optional parameters for the RouteFiltersClient.NewListByResourceGroupPager // method. @@ -376,7 +376,7 @@ func (client *RouteFiltersClient) listByResourceGroupCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -394,7 +394,7 @@ func (client *RouteFiltersClient) listByResourceGroupHandleResponse(resp *http.R // UpdateTags - Updates tags of a route filter. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - routeFilterName - The name of the route filter. // - parameters - Parameters supplied to update route filter tags. @@ -441,7 +441,7 @@ func (client *RouteFiltersClient) updateTagsCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/routefilters_client_example_test.go b/sdk/resourcemanager/network/armnetwork/routefilters_client_example_test.go deleted file mode 100644 index 2d25a9081a5e..000000000000 --- a/sdk/resourcemanager/network/armnetwork/routefilters_client_example_test.go +++ /dev/null @@ -1,326 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/RouteFilterDelete.json -func ExampleRouteFiltersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRouteFiltersClient().BeginDelete(ctx, "rg1", "filterName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/RouteFilterGet.json -func ExampleRouteFiltersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRouteFiltersClient().Get(ctx, "rg1", "filterName", &armnetwork.RouteFiltersClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RouteFilter = armnetwork.RouteFilter{ - // Name: to.Ptr("filterName"), - // Type: to.Ptr("Microsoft.Network/routeFilters"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/routeFilters/filterName"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.RouteFilterPropertiesFormat{ - // Peerings: []*armnetwork.ExpressRouteCircuitPeering{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Rules: []*armnetwork.RouteFilterRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/routeFilters/filterName/routeFilterRules/ruleName"), - // Name: to.Ptr("ruleName"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.RouteFilterRulePropertiesFormat{ - // Access: to.Ptr(armnetwork.AccessAllow), - // Communities: []*string{ - // to.Ptr("12076:5030"), - // to.Ptr("12076:5040")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RouteFilterRuleType: to.Ptr(armnetwork.RouteFilterRuleTypeCommunity), - // }, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/RouteFilterCreate.json -func ExampleRouteFiltersClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRouteFiltersClient().BeginCreateOrUpdate(ctx, "rg1", "filterName", armnetwork.RouteFilter{ - Location: to.Ptr("West US"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, - Properties: &armnetwork.RouteFilterPropertiesFormat{ - Rules: []*armnetwork.RouteFilterRule{ - { - Name: to.Ptr("ruleName"), - Properties: &armnetwork.RouteFilterRulePropertiesFormat{ - Access: to.Ptr(armnetwork.AccessAllow), - Communities: []*string{ - to.Ptr("12076:5030"), - to.Ptr("12076:5040")}, - RouteFilterRuleType: to.Ptr(armnetwork.RouteFilterRuleTypeCommunity), - }, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RouteFilter = armnetwork.RouteFilter{ - // Name: to.Ptr("filterName"), - // Type: to.Ptr("Microsoft.Network/routeFilters"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/routeFilters/filterName"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.RouteFilterPropertiesFormat{ - // Peerings: []*armnetwork.ExpressRouteCircuitPeering{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Rules: []*armnetwork.RouteFilterRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/routeFilters/filterName/routeFilterRules/ruleName"), - // Name: to.Ptr("ruleName"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.RouteFilterRulePropertiesFormat{ - // Access: to.Ptr(armnetwork.AccessAllow), - // Communities: []*string{ - // to.Ptr("12076:5030"), - // to.Ptr("12076:5040")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RouteFilterRuleType: to.Ptr(armnetwork.RouteFilterRuleTypeCommunity), - // }, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/RouteFilterUpdateTags.json -func ExampleRouteFiltersClient_UpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRouteFiltersClient().UpdateTags(ctx, "rg1", "filterName", armnetwork.TagsObject{ - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RouteFilter = armnetwork.RouteFilter{ - // Name: to.Ptr("filterName"), - // Type: to.Ptr("Microsoft.Network/routeFilters"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/routeFilters/filterName"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.RouteFilterPropertiesFormat{ - // Peerings: []*armnetwork.ExpressRouteCircuitPeering{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Rules: []*armnetwork.RouteFilterRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/routeFilters/filterName/routeFilterRules/ruleName"), - // Name: to.Ptr("ruleName"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.RouteFilterRulePropertiesFormat{ - // Access: to.Ptr(armnetwork.AccessAllow), - // Communities: []*string{ - // to.Ptr("12076:5030")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RouteFilterRuleType: to.Ptr(armnetwork.RouteFilterRuleTypeCommunity), - // }, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/RouteFilterListByResourceGroup.json -func ExampleRouteFiltersClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRouteFiltersClient().NewListByResourceGroupPager("rg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.RouteFilterListResult = armnetwork.RouteFilterListResult{ - // Value: []*armnetwork.RouteFilter{ - // { - // Name: to.Ptr("filterName"), - // Type: to.Ptr("Microsoft.Network/routeFilters"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/routeFilters/filterName"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.RouteFilterPropertiesFormat{ - // Peerings: []*armnetwork.ExpressRouteCircuitPeering{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Rules: []*armnetwork.RouteFilterRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/routeFilters/filterName/routeFilterRules/ruleName"), - // Name: to.Ptr("ruleName"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.RouteFilterRulePropertiesFormat{ - // Access: to.Ptr(armnetwork.AccessAllow), - // Communities: []*string{ - // to.Ptr("12076:5030"), - // to.Ptr("12076:5040")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RouteFilterRuleType: to.Ptr(armnetwork.RouteFilterRuleTypeCommunity), - // }, - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/RouteFilterList.json -func ExampleRouteFiltersClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRouteFiltersClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.RouteFilterListResult = armnetwork.RouteFilterListResult{ - // Value: []*armnetwork.RouteFilter{ - // { - // Name: to.Ptr("filterName"), - // Type: to.Ptr("Microsoft.Network/routeFilters"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/routeFilters/filterName"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.RouteFilterPropertiesFormat{ - // Peerings: []*armnetwork.ExpressRouteCircuitPeering{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Rules: []*armnetwork.RouteFilterRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/routeFilters/filterName/routeFilterRules/ruleName"), - // Name: to.Ptr("ruleName"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.RouteFilterRulePropertiesFormat{ - // Access: to.Ptr(armnetwork.AccessAllow), - // Communities: []*string{ - // to.Ptr("12076:5030"), - // to.Ptr("12076:5040")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RouteFilterRuleType: to.Ptr(armnetwork.RouteFilterRuleTypeCommunity), - // }, - // }}, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/routemaps_client.go b/sdk/resourcemanager/network/armnetwork/routemaps_client.go index 04c20a9c7251..7fa1ba0185d8 100644 --- a/sdk/resourcemanager/network/armnetwork/routemaps_client.go +++ b/sdk/resourcemanager/network/armnetwork/routemaps_client.go @@ -47,7 +47,7 @@ func NewRouteMapsClient(subscriptionID string, credential azcore.TokenCredential // BeginCreateOrUpdate - Creates a RouteMap if it doesn't exist else updates the existing one. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the RouteMap's resource group. // - virtualHubName - The name of the VirtualHub containing the RouteMap. // - routeMapName - The name of the RouteMap. @@ -72,7 +72,7 @@ func (client *RouteMapsClient) BeginCreateOrUpdate(ctx context.Context, resource // CreateOrUpdate - Creates a RouteMap if it doesn't exist else updates the existing one. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *RouteMapsClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, routeMapName string, routeMapParameters RouteMap, options *RouteMapsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "RouteMapsClient.BeginCreateOrUpdate" @@ -118,7 +118,7 @@ func (client *RouteMapsClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, routeMapParameters); err != nil { @@ -130,7 +130,7 @@ func (client *RouteMapsClient) createOrUpdateCreateRequest(ctx context.Context, // BeginDelete - Deletes a RouteMap. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the RouteMap's resource group. // - virtualHubName - The name of the VirtualHub containing the RouteMap. // - routeMapName - The name of the RouteMap. @@ -153,7 +153,7 @@ func (client *RouteMapsClient) BeginDelete(ctx context.Context, resourceGroupNam // Delete - Deletes a RouteMap. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *RouteMapsClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualHubName string, routeMapName string, options *RouteMapsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "RouteMapsClient.BeginDelete" @@ -199,7 +199,7 @@ func (client *RouteMapsClient) deleteCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -208,7 +208,7 @@ func (client *RouteMapsClient) deleteCreateRequest(ctx context.Context, resource // Get - Retrieves the details of a RouteMap. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the RouteMap's resource group. // - virtualHubName - The name of the VirtualHub containing the RouteMap. // - routeMapName - The name of the RouteMap. @@ -259,7 +259,7 @@ func (client *RouteMapsClient) getCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -276,7 +276,7 @@ func (client *RouteMapsClient) getHandleResponse(resp *http.Response) (RouteMaps // NewListPager - Retrieves the details of all RouteMaps. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the RouteMap's resource group'. // - virtualHubName - The name of the VirtualHub containing the RouteMap. // - options - RouteMapsClientListOptions contains the optional parameters for the RouteMapsClient.NewListPager method. @@ -330,7 +330,7 @@ func (client *RouteMapsClient) listCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/routemaps_client_example_test.go b/sdk/resourcemanager/network/armnetwork/routemaps_client_example_test.go deleted file mode 100644 index f672d4bd1e35..000000000000 --- a/sdk/resourcemanager/network/armnetwork/routemaps_client_example_test.go +++ /dev/null @@ -1,265 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/RouteMapGet.json -func ExampleRouteMapsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRouteMapsClient().Get(ctx, "rg1", "virtualHub1", "routeMap1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RouteMap = armnetwork.RouteMap{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1"), - // Name: to.Ptr("routeMap1"), - // Type: to.Ptr("Microsoft.Network/virtualHubs/routeMaps"), - // Etag: to.Ptr("W/\"e203e953-7ba7-4302-a246-aa2ec03f6edf\""), - // Properties: &armnetwork.RouteMapProperties{ - // AssociatedInboundConnections: []*string{ - // to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteGateways/exrGateway1/expressRouteConnections/exrConn1")}, - // AssociatedOutboundConnections: []*string{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Rules: []*armnetwork.RouteMapRule{ - // { - // Name: to.Ptr("rule1"), - // Actions: []*armnetwork.Action{ - // { - // Type: to.Ptr(armnetwork.RouteMapActionTypeAdd), - // Parameters: []*armnetwork.Parameter{ - // { - // AsPath: []*string{ - // to.Ptr("22334")}, - // Community: []*string{ - // }, - // RoutePrefix: []*string{ - // }, - // }}, - // }}, - // MatchCriteria: []*armnetwork.Criterion{ - // { - // AsPath: []*string{ - // }, - // Community: []*string{ - // }, - // MatchCondition: to.Ptr(armnetwork.RouteMapMatchConditionContains), - // RoutePrefix: []*string{ - // to.Ptr("10.0.0.0/8")}, - // }}, - // NextStepIfMatched: to.Ptr(armnetwork.NextStepContinue), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/RouteMapPut.json -func ExampleRouteMapsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRouteMapsClient().BeginCreateOrUpdate(ctx, "rg1", "virtualHub1", "routeMap1", armnetwork.RouteMap{ - Properties: &armnetwork.RouteMapProperties{ - AssociatedInboundConnections: []*string{ - to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteGateways/exrGateway1/expressRouteConnections/exrConn1")}, - AssociatedOutboundConnections: []*string{}, - Rules: []*armnetwork.RouteMapRule{ - { - Name: to.Ptr("rule1"), - Actions: []*armnetwork.Action{ - { - Type: to.Ptr(armnetwork.RouteMapActionTypeAdd), - Parameters: []*armnetwork.Parameter{ - { - AsPath: []*string{ - to.Ptr("22334")}, - Community: []*string{}, - RoutePrefix: []*string{}, - }}, - }}, - MatchCriteria: []*armnetwork.Criterion{ - { - AsPath: []*string{}, - Community: []*string{}, - MatchCondition: to.Ptr(armnetwork.RouteMapMatchConditionContains), - RoutePrefix: []*string{ - to.Ptr("10.0.0.0/8")}, - }}, - NextStepIfMatched: to.Ptr(armnetwork.NextStepContinue), - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RouteMap = armnetwork.RouteMap{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1"), - // Name: to.Ptr("routeMap1"), - // Type: to.Ptr("Microsoft.Network/virtualHubs/routeMaps"), - // Etag: to.Ptr("W/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.RouteMapProperties{ - // AssociatedInboundConnections: []*string{ - // to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteGateways/exrGateway1/expressRouteConnections/exrConn1")}, - // AssociatedOutboundConnections: []*string{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Rules: []*armnetwork.RouteMapRule{ - // { - // Name: to.Ptr("rule1"), - // Actions: []*armnetwork.Action{ - // { - // Type: to.Ptr(armnetwork.RouteMapActionTypeAdd), - // Parameters: []*armnetwork.Parameter{ - // { - // AsPath: []*string{ - // to.Ptr("22334")}, - // Community: []*string{ - // }, - // RoutePrefix: []*string{ - // }, - // }}, - // }}, - // MatchCriteria: []*armnetwork.Criterion{ - // { - // AsPath: []*string{ - // }, - // Community: []*string{ - // }, - // MatchCondition: to.Ptr(armnetwork.RouteMapMatchConditionContains), - // RoutePrefix: []*string{ - // to.Ptr("10.0.0.0/8")}, - // }}, - // NextStepIfMatched: to.Ptr(armnetwork.NextStepContinue), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/RouteMapDelete.json -func ExampleRouteMapsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRouteMapsClient().BeginDelete(ctx, "rg1", "virtualHub1", "routeMap1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/RouteMapList.json -func ExampleRouteMapsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRouteMapsClient().NewListPager("rg1", "virtualHub1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ListRouteMapsResult = armnetwork.ListRouteMapsResult{ - // Value: []*armnetwork.RouteMap{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1"), - // Name: to.Ptr("routeMap1"), - // Type: to.Ptr("Microsoft.Network/virtualHubs/routeMaps"), - // Etag: to.Ptr("W/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.RouteMapProperties{ - // AssociatedInboundConnections: []*string{ - // to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteGateways/exrGateway1/expressRouteConnections/exrConn1")}, - // AssociatedOutboundConnections: []*string{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Rules: []*armnetwork.RouteMapRule{ - // { - // Name: to.Ptr("rule1"), - // Actions: []*armnetwork.Action{ - // { - // Type: to.Ptr(armnetwork.RouteMapActionTypeAdd), - // Parameters: []*armnetwork.Parameter{ - // { - // AsPath: []*string{ - // to.Ptr("22334")}, - // Community: []*string{ - // }, - // RoutePrefix: []*string{ - // }, - // }}, - // }}, - // MatchCriteria: []*armnetwork.Criterion{ - // { - // AsPath: []*string{ - // }, - // Community: []*string{ - // }, - // MatchCondition: to.Ptr(armnetwork.RouteMapMatchConditionContains), - // RoutePrefix: []*string{ - // to.Ptr("10.0.0.0/8")}, - // }}, - // NextStepIfMatched: to.Ptr(armnetwork.NextStepContinue), - // }}, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/routes_client.go b/sdk/resourcemanager/network/armnetwork/routes_client.go index f8fdea9fdb30..a2a02dd2c413 100644 --- a/sdk/resourcemanager/network/armnetwork/routes_client.go +++ b/sdk/resourcemanager/network/armnetwork/routes_client.go @@ -47,7 +47,7 @@ func NewRoutesClient(subscriptionID string, credential azcore.TokenCredential, o // BeginCreateOrUpdate - Creates or updates a route in the specified route table. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - routeTableName - The name of the route table. // - routeName - The name of the route. @@ -72,7 +72,7 @@ func (client *RoutesClient) BeginCreateOrUpdate(ctx context.Context, resourceGro // CreateOrUpdate - Creates or updates a route in the specified route table. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *RoutesClient) createOrUpdate(ctx context.Context, resourceGroupName string, routeTableName string, routeName string, routeParameters Route, options *RoutesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "RoutesClient.BeginCreateOrUpdate" @@ -118,7 +118,7 @@ func (client *RoutesClient) createOrUpdateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, routeParameters); err != nil { @@ -130,7 +130,7 @@ func (client *RoutesClient) createOrUpdateCreateRequest(ctx context.Context, res // BeginDelete - Deletes the specified route from a route table. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - routeTableName - The name of the route table. // - routeName - The name of the route. @@ -153,7 +153,7 @@ func (client *RoutesClient) BeginDelete(ctx context.Context, resourceGroupName s // Delete - Deletes the specified route from a route table. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *RoutesClient) deleteOperation(ctx context.Context, resourceGroupName string, routeTableName string, routeName string, options *RoutesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "RoutesClient.BeginDelete" @@ -199,7 +199,7 @@ func (client *RoutesClient) deleteCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -208,7 +208,7 @@ func (client *RoutesClient) deleteCreateRequest(ctx context.Context, resourceGro // Get - Gets the specified route from a route table. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - routeTableName - The name of the route table. // - routeName - The name of the route. @@ -259,7 +259,7 @@ func (client *RoutesClient) getCreateRequest(ctx context.Context, resourceGroupN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -276,7 +276,7 @@ func (client *RoutesClient) getHandleResponse(resp *http.Response) (RoutesClient // NewListPager - Gets all routes in a route table. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - routeTableName - The name of the route table. // - options - RoutesClientListOptions contains the optional parameters for the RoutesClient.NewListPager method. @@ -330,7 +330,7 @@ func (client *RoutesClient) listCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/routes_client_example_test.go b/sdk/resourcemanager/network/armnetwork/routes_client_example_test.go deleted file mode 100644 index 6d9ffda63ae8..000000000000 --- a/sdk/resourcemanager/network/armnetwork/routes_client_example_test.go +++ /dev/null @@ -1,153 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/RouteTableRouteDelete.json -func ExampleRoutesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRoutesClient().BeginDelete(ctx, "rg1", "testrt", "route1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/RouteTableRouteGet.json -func ExampleRoutesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRoutesClient().Get(ctx, "rg1", "testrt", "route1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Route = armnetwork.Route{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/routeTables/testrt/routes/route1"), - // Name: to.Ptr("route1"), - // Properties: &armnetwork.RoutePropertiesFormat{ - // AddressPrefix: to.Ptr("10.0.3.0/24"), - // NextHopType: to.Ptr(armnetwork.RouteNextHopTypeInternet), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/RouteTableRouteCreate.json -func ExampleRoutesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRoutesClient().BeginCreateOrUpdate(ctx, "rg1", "testrt", "route1", armnetwork.Route{ - Properties: &armnetwork.RoutePropertiesFormat{ - AddressPrefix: to.Ptr("10.0.3.0/24"), - NextHopType: to.Ptr(armnetwork.RouteNextHopTypeVirtualNetworkGateway), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Route = armnetwork.Route{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/routeTables/testrt/routes/route1"), - // Name: to.Ptr("route1"), - // Properties: &armnetwork.RoutePropertiesFormat{ - // AddressPrefix: to.Ptr("10.0.3.0/24"), - // NextHopType: to.Ptr(armnetwork.RouteNextHopTypeVirtualNetworkGateway), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/RouteTableRouteList.json -func ExampleRoutesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRoutesClient().NewListPager("rg1", "testrt", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.RouteListResult = armnetwork.RouteListResult{ - // Value: []*armnetwork.Route{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/routeTables/testrt/routes/route1"), - // Name: to.Ptr("route1"), - // Properties: &armnetwork.RoutePropertiesFormat{ - // AddressPrefix: to.Ptr("10.0.3.0/24"), - // NextHopType: to.Ptr(armnetwork.RouteNextHopTypeInternet), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/routeTables/testrt/routes/route2"), - // Name: to.Ptr("route2"), - // Properties: &armnetwork.RoutePropertiesFormat{ - // AddressPrefix: to.Ptr("10.0.2.0/24"), - // NextHopType: to.Ptr(armnetwork.RouteNextHopTypeVirtualNetworkGateway), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/routetables_client.go b/sdk/resourcemanager/network/armnetwork/routetables_client.go index f29108d18acb..2ca79638b9fe 100644 --- a/sdk/resourcemanager/network/armnetwork/routetables_client.go +++ b/sdk/resourcemanager/network/armnetwork/routetables_client.go @@ -47,7 +47,7 @@ func NewRouteTablesClient(subscriptionID string, credential azcore.TokenCredenti // BeginCreateOrUpdate - Create or updates a route table in a specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - routeTableName - The name of the route table. // - parameters - Parameters supplied to the create or update route table operation. @@ -71,7 +71,7 @@ func (client *RouteTablesClient) BeginCreateOrUpdate(ctx context.Context, resour // CreateOrUpdate - Create or updates a route table in a specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *RouteTablesClient) createOrUpdate(ctx context.Context, resourceGroupName string, routeTableName string, parameters RouteTable, options *RouteTablesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "RouteTablesClient.BeginCreateOrUpdate" @@ -113,7 +113,7 @@ func (client *RouteTablesClient) createOrUpdateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -125,7 +125,7 @@ func (client *RouteTablesClient) createOrUpdateCreateRequest(ctx context.Context // BeginDelete - Deletes the specified route table. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - routeTableName - The name of the route table. // - options - RouteTablesClientBeginDeleteOptions contains the optional parameters for the RouteTablesClient.BeginDelete method. @@ -147,7 +147,7 @@ func (client *RouteTablesClient) BeginDelete(ctx context.Context, resourceGroupN // Delete - Deletes the specified route table. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *RouteTablesClient) deleteOperation(ctx context.Context, resourceGroupName string, routeTableName string, options *RouteTablesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "RouteTablesClient.BeginDelete" @@ -189,7 +189,7 @@ func (client *RouteTablesClient) deleteCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -198,7 +198,7 @@ func (client *RouteTablesClient) deleteCreateRequest(ctx context.Context, resour // Get - Gets the specified route table. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - routeTableName - The name of the route table. // - options - RouteTablesClientGetOptions contains the optional parameters for the RouteTablesClient.Get method. @@ -244,7 +244,7 @@ func (client *RouteTablesClient) getCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } @@ -264,7 +264,7 @@ func (client *RouteTablesClient) getHandleResponse(resp *http.Response) (RouteTa // NewListPager - Gets all route tables in a resource group. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - options - RouteTablesClientListOptions contains the optional parameters for the RouteTablesClient.NewListPager method. func (client *RouteTablesClient) NewListPager(resourceGroupName string, options *RouteTablesClientListOptions) *runtime.Pager[RouteTablesClientListResponse] { @@ -313,7 +313,7 @@ func (client *RouteTablesClient) listCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -330,7 +330,7 @@ func (client *RouteTablesClient) listHandleResponse(resp *http.Response) (RouteT // NewListAllPager - Gets all route tables in a subscription. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - options - RouteTablesClientListAllOptions contains the optional parameters for the RouteTablesClient.NewListAllPager method. func (client *RouteTablesClient) NewListAllPager(options *RouteTablesClientListAllOptions) *runtime.Pager[RouteTablesClientListAllResponse] { return runtime.NewPager(runtime.PagingHandler[RouteTablesClientListAllResponse]{ @@ -374,7 +374,7 @@ func (client *RouteTablesClient) listAllCreateRequest(ctx context.Context, optio return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -392,7 +392,7 @@ func (client *RouteTablesClient) listAllHandleResponse(resp *http.Response) (Rou // UpdateTags - Updates a route table tags. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - routeTableName - The name of the route table. // - parameters - Parameters supplied to update route table tags. @@ -439,7 +439,7 @@ func (client *RouteTablesClient) updateTagsCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/routetables_client_example_test.go b/sdk/resourcemanager/network/armnetwork/routetables_client_example_test.go deleted file mode 100644 index 129a8fcbc426..000000000000 --- a/sdk/resourcemanager/network/armnetwork/routetables_client_example_test.go +++ /dev/null @@ -1,333 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/RouteTableDelete.json -func ExampleRouteTablesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRouteTablesClient().BeginDelete(ctx, "rg1", "testrt", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/RouteTableGet.json -func ExampleRouteTablesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRouteTablesClient().Get(ctx, "rg1", "testrt", &armnetwork.RouteTablesClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RouteTable = armnetwork.RouteTable{ - // Name: to.Ptr("testrt"), - // Type: to.Ptr("Microsoft.Network/routeTables"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/routeTables/testrt"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.RouteTablePropertiesFormat{ - // DisableBgpRoutePropagation: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Routes: []*armnetwork.Route{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/routeTables/testrt/routes/route1"), - // Name: to.Ptr("route1"), - // Properties: &armnetwork.RoutePropertiesFormat{ - // AddressPrefix: to.Ptr("10.0.3.0/24"), - // NextHopType: to.Ptr(armnetwork.RouteNextHopTypeVirtualNetworkGateway), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/RouteTableCreate.json -func ExampleRouteTablesClient_BeginCreateOrUpdate_createRouteTable() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRouteTablesClient().BeginCreateOrUpdate(ctx, "rg1", "testrt", armnetwork.RouteTable{ - Location: to.Ptr("westus"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RouteTable = armnetwork.RouteTable{ - // Name: to.Ptr("testrt"), - // Type: to.Ptr("Microsoft.Network/routeTables"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/routeTables/testrt"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.RouteTablePropertiesFormat{ - // DisableBgpRoutePropagation: to.Ptr(true), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Routes: []*armnetwork.Route{ - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/RouteTableCreateWithRoute.json -func ExampleRouteTablesClient_BeginCreateOrUpdate_createRouteTableWithRoute() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRouteTablesClient().BeginCreateOrUpdate(ctx, "rg1", "testrt", armnetwork.RouteTable{ - Location: to.Ptr("westus"), - Properties: &armnetwork.RouteTablePropertiesFormat{ - DisableBgpRoutePropagation: to.Ptr(true), - Routes: []*armnetwork.Route{ - { - Name: to.Ptr("route1"), - Properties: &armnetwork.RoutePropertiesFormat{ - AddressPrefix: to.Ptr("10.0.3.0/24"), - NextHopType: to.Ptr(armnetwork.RouteNextHopTypeVirtualNetworkGateway), - }, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RouteTable = armnetwork.RouteTable{ - // Name: to.Ptr("testrt"), - // Type: to.Ptr("Microsoft.Network/routeTables"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/routeTables/testrt"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.RouteTablePropertiesFormat{ - // DisableBgpRoutePropagation: to.Ptr(true), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Routes: []*armnetwork.Route{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/routeTables/testrt/routes/route1"), - // Name: to.Ptr("route1"), - // Properties: &armnetwork.RoutePropertiesFormat{ - // AddressPrefix: to.Ptr("10.0.3.0/24"), - // NextHopType: to.Ptr(armnetwork.RouteNextHopTypeVirtualNetworkGateway), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/RouteTableUpdateTags.json -func ExampleRouteTablesClient_UpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRouteTablesClient().UpdateTags(ctx, "rg1", "testrt", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RouteTable = armnetwork.RouteTable{ - // Name: to.Ptr("testrt"), - // Type: to.Ptr("Microsoft.Network/routeTables"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/routeTables/testrt"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armnetwork.RouteTablePropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Routes: []*armnetwork.Route{ - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/RouteTableList.json -func ExampleRouteTablesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRouteTablesClient().NewListPager("rg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.RouteTableListResult = armnetwork.RouteTableListResult{ - // Value: []*armnetwork.RouteTable{ - // { - // Name: to.Ptr("testrt"), - // Type: to.Ptr("Microsoft.Network/routeTables"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/routeTables/testrt"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.RouteTablePropertiesFormat{ - // DisableBgpRoutePropagation: to.Ptr(true), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Routes: []*armnetwork.Route{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/routeTables/testrt/routes/route1"), - // Name: to.Ptr("route1"), - // Properties: &armnetwork.RoutePropertiesFormat{ - // AddressPrefix: to.Ptr("10.0.3.0/24"), - // NextHopType: to.Ptr(armnetwork.RouteNextHopTypeVirtualNetworkGateway), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // }, - // }, - // { - // Name: to.Ptr("testrt2"), - // Type: to.Ptr("Microsoft.Network/routeTables"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/routeTables/testrt2"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.RouteTablePropertiesFormat{ - // DisableBgpRoutePropagation: to.Ptr(true), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Routes: []*armnetwork.Route{ - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/RouteTableListAll.json -func ExampleRouteTablesClient_NewListAllPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRouteTablesClient().NewListAllPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.RouteTableListResult = armnetwork.RouteTableListResult{ - // Value: []*armnetwork.RouteTable{ - // { - // Name: to.Ptr("testrt"), - // Type: to.Ptr("Microsoft.Network/routeTables"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/routeTables/testrt"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.RouteTablePropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Routes: []*armnetwork.Route{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/routeTables/testrt/routes/route1"), - // Name: to.Ptr("route1"), - // Properties: &armnetwork.RoutePropertiesFormat{ - // AddressPrefix: to.Ptr("10.0.3.0/24"), - // NextHopType: to.Ptr(armnetwork.RouteNextHopTypeVirtualNetworkGateway), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // }, - // }, - // { - // Name: to.Ptr("testrt3"), - // Type: to.Ptr("Microsoft.Network/routeTables"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/routeTables/testrt3"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.RouteTablePropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Routes: []*armnetwork.Route{ - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/routingintent_client.go b/sdk/resourcemanager/network/armnetwork/routingintent_client.go index da8e311813e8..bb5a955b2b57 100644 --- a/sdk/resourcemanager/network/armnetwork/routingintent_client.go +++ b/sdk/resourcemanager/network/armnetwork/routingintent_client.go @@ -47,7 +47,7 @@ func NewRoutingIntentClient(subscriptionID string, credential azcore.TokenCreden // BeginCreateOrUpdate - Creates a RoutingIntent resource if it doesn't exist else updates the existing RoutingIntent. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the RoutingIntent. // - virtualHubName - The name of the VirtualHub. // - routingIntentName - The name of the per VirtualHub singleton Routing Intent resource. @@ -72,7 +72,7 @@ func (client *RoutingIntentClient) BeginCreateOrUpdate(ctx context.Context, reso // CreateOrUpdate - Creates a RoutingIntent resource if it doesn't exist else updates the existing RoutingIntent. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *RoutingIntentClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, routingIntentName string, routingIntentParameters RoutingIntent, options *RoutingIntentClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "RoutingIntentClient.BeginCreateOrUpdate" @@ -118,7 +118,7 @@ func (client *RoutingIntentClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, routingIntentParameters); err != nil { @@ -130,7 +130,7 @@ func (client *RoutingIntentClient) createOrUpdateCreateRequest(ctx context.Conte // BeginDelete - Deletes a RoutingIntent. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the RoutingIntent. // - virtualHubName - The name of the VirtualHub. // - routingIntentName - The name of the RoutingIntent. @@ -154,7 +154,7 @@ func (client *RoutingIntentClient) BeginDelete(ctx context.Context, resourceGrou // Delete - Deletes a RoutingIntent. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *RoutingIntentClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualHubName string, routingIntentName string, options *RoutingIntentClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "RoutingIntentClient.BeginDelete" @@ -200,7 +200,7 @@ func (client *RoutingIntentClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -209,7 +209,7 @@ func (client *RoutingIntentClient) deleteCreateRequest(ctx context.Context, reso // Get - Retrieves the details of a RoutingIntent. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the RoutingIntent. // - virtualHubName - The name of the VirtualHub. // - routingIntentName - The name of the RoutingIntent. @@ -260,7 +260,7 @@ func (client *RoutingIntentClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -277,7 +277,7 @@ func (client *RoutingIntentClient) getHandleResponse(resp *http.Response) (Routi // NewListPager - Retrieves the details of all RoutingIntent child resources of the VirtualHub. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the VirtualHub. // - virtualHubName - The name of the VirtualHub. // - options - RoutingIntentClientListOptions contains the optional parameters for the RoutingIntentClient.NewListPager method. @@ -331,7 +331,7 @@ func (client *RoutingIntentClient) listCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/routingintent_client_example_test.go b/sdk/resourcemanager/network/armnetwork/routingintent_client_example_test.go deleted file mode 100644 index 4a7d712a8ccb..000000000000 --- a/sdk/resourcemanager/network/armnetwork/routingintent_client_example_test.go +++ /dev/null @@ -1,194 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/RoutingIntentPut.json -func ExampleRoutingIntentClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRoutingIntentClient().BeginCreateOrUpdate(ctx, "rg1", "virtualHub1", "Intent1", armnetwork.RoutingIntent{ - Properties: &armnetwork.RoutingIntentProperties{ - RoutingPolicies: []*armnetwork.RoutingPolicy{ - { - Name: to.Ptr("InternetTraffic"), - Destinations: []*string{ - to.Ptr("Internet")}, - NextHop: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azfw1"), - }, - { - Name: to.Ptr("PrivateTrafficPolicy"), - Destinations: []*string{ - to.Ptr("PrivateTraffic")}, - NextHop: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azfw1"), - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RoutingIntent = armnetwork.RoutingIntent{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routingIntent/Intent1"), - // Name: to.Ptr("Intent1"), - // Type: to.Ptr("Microsoft.Network/virtualHubs/routingIntent"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.RoutingIntentProperties{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RoutingPolicies: []*armnetwork.RoutingPolicy{ - // { - // Name: to.Ptr("InternetTraffic"), - // Destinations: []*string{ - // to.Ptr("Internet")}, - // NextHop: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azfw1"), - // }, - // { - // Name: to.Ptr("PrivateTrafficPolicy"), - // Destinations: []*string{ - // to.Ptr("PrivateTraffic")}, - // NextHop: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azfw1"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/RoutingIntentGet.json -func ExampleRoutingIntentClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRoutingIntentClient().Get(ctx, "rg1", "virtualHub1", "Intent1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RoutingIntent = armnetwork.RoutingIntent{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routingIntent/Intent1"), - // Name: to.Ptr("Intent1"), - // Type: to.Ptr("Microsoft.Network/virtualHubs/routingIntent"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.RoutingIntentProperties{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RoutingPolicies: []*armnetwork.RoutingPolicy{ - // { - // Name: to.Ptr("InternetTraffic"), - // Destinations: []*string{ - // to.Ptr("Internet")}, - // NextHop: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azfw1"), - // }, - // { - // Name: to.Ptr("PrivateTrafficPolicy"), - // Destinations: []*string{ - // to.Ptr("PrivateTraffic")}, - // NextHop: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azfw1"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/RoutingIntentDelete.json -func ExampleRoutingIntentClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRoutingIntentClient().BeginDelete(ctx, "rg1", "virtualHub1", "Intent1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/RoutingIntentList.json -func ExampleRoutingIntentClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRoutingIntentClient().NewListPager("rg1", "virtualHub1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ListRoutingIntentResult = armnetwork.ListRoutingIntentResult{ - // Value: []*armnetwork.RoutingIntent{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routingIntent/Intent1"), - // Name: to.Ptr("Intent1"), - // Type: to.Ptr("Microsoft.Network/virtualHubs/routingIntent"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.RoutingIntentProperties{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RoutingPolicies: []*armnetwork.RoutingPolicy{ - // { - // Name: to.Ptr("InternetTraffic"), - // Destinations: []*string{ - // to.Ptr("Internet")}, - // NextHop: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azfw1"), - // }, - // { - // Name: to.Ptr("PrivateTrafficPolicy"), - // Destinations: []*string{ - // to.Ptr("PrivateTraffic")}, - // NextHop: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azfw1"), - // }}, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/scopeconnections_client.go b/sdk/resourcemanager/network/armnetwork/scopeconnections_client.go index 67a1c6578951..08b36878d7e2 100644 --- a/sdk/resourcemanager/network/armnetwork/scopeconnections_client.go +++ b/sdk/resourcemanager/network/armnetwork/scopeconnections_client.go @@ -48,7 +48,7 @@ func NewScopeConnectionsClient(subscriptionID string, credential azcore.TokenCre // CreateOrUpdate - Creates or updates scope connection from Network Manager // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - scopeConnectionName - Name for the cross-tenant connection. @@ -101,7 +101,7 @@ func (client *ScopeConnectionsClient) createOrUpdateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -122,7 +122,7 @@ func (client *ScopeConnectionsClient) createOrUpdateHandleResponse(resp *http.Re // Delete - Delete the pending scope connection created by this network manager. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - scopeConnectionName - Name for the cross-tenant connection. @@ -172,7 +172,7 @@ func (client *ScopeConnectionsClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -181,7 +181,7 @@ func (client *ScopeConnectionsClient) deleteCreateRequest(ctx context.Context, r // Get - Get specified scope connection created by this Network Manager. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - scopeConnectionName - Name for the cross-tenant connection. @@ -232,7 +232,7 @@ func (client *ScopeConnectionsClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -249,7 +249,7 @@ func (client *ScopeConnectionsClient) getHandleResponse(resp *http.Response) (Sc // NewListPager - List all scope connections created by this network manager. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - options - ScopeConnectionsClientListOptions contains the optional parameters for the ScopeConnectionsClient.NewListPager @@ -304,7 +304,7 @@ func (client *ScopeConnectionsClient) listCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } diff --git a/sdk/resourcemanager/network/armnetwork/scopeconnections_client_example_test.go b/sdk/resourcemanager/network/armnetwork/scopeconnections_client_example_test.go deleted file mode 100644 index b380a1b4a4f5..000000000000 --- a/sdk/resourcemanager/network/armnetwork/scopeconnections_client_example_test.go +++ /dev/null @@ -1,169 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkManagerScopeConnectionPut.json -func ExampleScopeConnectionsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewScopeConnectionsClient().CreateOrUpdate(ctx, "rg1", "testNetworkManager", "TestScopeConnection", armnetwork.ScopeConnection{ - Properties: &armnetwork.ScopeConnectionProperties{ - Description: to.Ptr("This is a scope connection to a cross tenant subscription."), - ResourceID: to.Ptr("subscriptions/f0dc2b34-dfad-40e4-83e0-2309fed8d00b"), - TenantID: to.Ptr("6babcaad-604b-40ac-a9d7-9fd97c0b779f"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ScopeConnection = armnetwork.ScopeConnection{ - // Name: to.Ptr("TestScopeConnection"), - // Type: to.Ptr("Microsoft.Network/networkManagers/scopeConnections"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroup/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/scopeConnections/TestScopeConnection"), - // Properties: &armnetwork.ScopeConnectionProperties{ - // Description: to.Ptr("This is a scope connection to a cross tenant subscription."), - // ConnectionState: to.Ptr(armnetwork.ScopeConnectionStatePending), - // ResourceID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000"), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkManagerScopeConnectionGet.json -func ExampleScopeConnectionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewScopeConnectionsClient().Get(ctx, "rg1", "testNetworkManager", "TestScopeConnection", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ScopeConnection = armnetwork.ScopeConnection{ - // Name: to.Ptr("TestScopeConnection"), - // Type: to.Ptr("Microsoft.Network/networkManagers/scopeConnections"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroup/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/scopeConnections/TestScopeConnection"), - // Properties: &armnetwork.ScopeConnectionProperties{ - // Description: to.Ptr("This is a scope connection to a cross tenant subscription."), - // ConnectionState: to.Ptr(armnetwork.ScopeConnectionStatePending), - // ResourceID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000"), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkManagerScopeConnectionDelete.json -func ExampleScopeConnectionsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewScopeConnectionsClient().Delete(ctx, "rg1", "testNetworkManager", "TestScopeConnection", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkManagerScopeConnectionList.json -func ExampleScopeConnectionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewScopeConnectionsClient().NewListPager("rg1", "testNetworkManager", &armnetwork.ScopeConnectionsClientListOptions{Top: nil, - SkipToken: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ScopeConnectionListResult = armnetwork.ScopeConnectionListResult{ - // Value: []*armnetwork.ScopeConnection{ - // { - // Name: to.Ptr("TestScopeConnection"), - // Type: to.Ptr("Microsoft.Network/networkManagers/scopeConnections"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroup/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/scopeConnections/TestScopeConnection"), - // Properties: &armnetwork.ScopeConnectionProperties{ - // Description: to.Ptr("This is a scope connection to a cross tenant subscription."), - // ConnectionState: to.Ptr(armnetwork.ScopeConnectionStatePending), - // ResourceID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000"), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/securityadminconfigurations_client.go b/sdk/resourcemanager/network/armnetwork/securityadminconfigurations_client.go index 780b505ec92a..cfeb6b8f46a9 100644 --- a/sdk/resourcemanager/network/armnetwork/securityadminconfigurations_client.go +++ b/sdk/resourcemanager/network/armnetwork/securityadminconfigurations_client.go @@ -48,7 +48,7 @@ func NewSecurityAdminConfigurationsClient(subscriptionID string, credential azco // CreateOrUpdate - Creates or updates a network manager security admin configuration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Security Configuration. @@ -101,7 +101,7 @@ func (client *SecurityAdminConfigurationsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, securityAdminConfiguration); err != nil { @@ -122,7 +122,7 @@ func (client *SecurityAdminConfigurationsClient) createOrUpdateHandleResponse(re // BeginDelete - Deletes a network manager security admin configuration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Security Configuration. @@ -146,7 +146,7 @@ func (client *SecurityAdminConfigurationsClient) BeginDelete(ctx context.Context // Delete - Deletes a network manager security admin configuration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *SecurityAdminConfigurationsClient) deleteOperation(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, options *SecurityAdminConfigurationsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "SecurityAdminConfigurationsClient.BeginDelete" @@ -192,7 +192,7 @@ func (client *SecurityAdminConfigurationsClient) deleteCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } @@ -204,7 +204,7 @@ func (client *SecurityAdminConfigurationsClient) deleteCreateRequest(ctx context // Get - Retrieves a network manager security admin configuration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Security Configuration. @@ -256,7 +256,7 @@ func (client *SecurityAdminConfigurationsClient) getCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -273,7 +273,7 @@ func (client *SecurityAdminConfigurationsClient) getHandleResponse(resp *http.Re // NewListPager - Lists all the network manager security admin configurations in a network manager, in a paginated format. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - options - SecurityAdminConfigurationsClientListOptions contains the optional parameters for the SecurityAdminConfigurationsClient.NewListPager @@ -328,7 +328,7 @@ func (client *SecurityAdminConfigurationsClient) listCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } diff --git a/sdk/resourcemanager/network/armnetwork/securityadminconfigurations_client_example_test.go b/sdk/resourcemanager/network/armnetwork/securityadminconfigurations_client_example_test.go deleted file mode 100644 index c43488cf17a0..000000000000 --- a/sdk/resourcemanager/network/armnetwork/securityadminconfigurations_client_example_test.go +++ /dev/null @@ -1,176 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkManagerSecurityAdminConfigurationList.json -func ExampleSecurityAdminConfigurationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSecurityAdminConfigurationsClient().NewListPager("rg1", "testNetworkManager", &armnetwork.SecurityAdminConfigurationsClientListOptions{Top: nil, - SkipToken: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SecurityAdminConfigurationListResult = armnetwork.SecurityAdminConfigurationListResult{ - // Value: []*armnetwork.SecurityAdminConfiguration{ - // { - // Name: to.Ptr("myTestSecurityConfig"), - // Type: to.Ptr("Microsoft.Network/networkManagers/securityAdminConfigurations"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/securityAdminConfigurations/myTestSecurityConfig"), - // Properties: &armnetwork.SecurityAdminConfigurationPropertiesFormat{ - // Description: to.Ptr("A sample policy"), - // ApplyOnNetworkIntentPolicyBasedServices: []*armnetwork.NetworkIntentPolicyBasedService{ - // to.Ptr(armnetwork.NetworkIntentPolicyBasedServiceNone)}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkManagerSecurityAdminConfigurationGet.json -func ExampleSecurityAdminConfigurationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSecurityAdminConfigurationsClient().Get(ctx, "rg1", "testNetworkManager", "myTestSecurityConfig", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SecurityAdminConfiguration = armnetwork.SecurityAdminConfiguration{ - // Name: to.Ptr("myTestSecurityConfig"), - // Type: to.Ptr("Microsoft.Network/networkManagers/securityAdminConfigurations"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/securityAdminConfigurations/myTestSecurityConfig"), - // Properties: &armnetwork.SecurityAdminConfigurationPropertiesFormat{ - // Description: to.Ptr("A sample policy"), - // ApplyOnNetworkIntentPolicyBasedServices: []*armnetwork.NetworkIntentPolicyBasedService{ - // to.Ptr(armnetwork.NetworkIntentPolicyBasedServiceNone)}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkManagerSecurityAdminConfigurationPut.json -func ExampleSecurityAdminConfigurationsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSecurityAdminConfigurationsClient().CreateOrUpdate(ctx, "rg1", "testNetworkManager", "myTestSecurityConfig", armnetwork.SecurityAdminConfiguration{ - Properties: &armnetwork.SecurityAdminConfigurationPropertiesFormat{ - Description: to.Ptr("A sample policy"), - ApplyOnNetworkIntentPolicyBasedServices: []*armnetwork.NetworkIntentPolicyBasedService{ - to.Ptr(armnetwork.NetworkIntentPolicyBasedServiceNone)}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SecurityAdminConfiguration = armnetwork.SecurityAdminConfiguration{ - // Name: to.Ptr("myTestSecurityConfig"), - // Type: to.Ptr("Microsoft.Network/networkManagers/securityAdminConfigurations"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManager/testNetworkManager/securityAdminConfigurations/myTestSecurityConfig"), - // Properties: &armnetwork.SecurityAdminConfigurationPropertiesFormat{ - // Description: to.Ptr("A sample policy"), - // ApplyOnNetworkIntentPolicyBasedServices: []*armnetwork.NetworkIntentPolicyBasedService{ - // to.Ptr(armnetwork.NetworkIntentPolicyBasedServiceNone)}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkManagerSecurityAdminConfigurationDelete.json -func ExampleSecurityAdminConfigurationsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSecurityAdminConfigurationsClient().BeginDelete(ctx, "rg1", "testNetworkManager", "myTestSecurityConfig", &armnetwork.SecurityAdminConfigurationsClientBeginDeleteOptions{Force: to.Ptr(false)}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/network/armnetwork/securitygroups_client.go b/sdk/resourcemanager/network/armnetwork/securitygroups_client.go index 0239b87e1c4a..b21dfe11742b 100644 --- a/sdk/resourcemanager/network/armnetwork/securitygroups_client.go +++ b/sdk/resourcemanager/network/armnetwork/securitygroups_client.go @@ -47,7 +47,7 @@ func NewSecurityGroupsClient(subscriptionID string, credential azcore.TokenCrede // BeginCreateOrUpdate - Creates or updates a network security group in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkSecurityGroupName - The name of the network security group. // - parameters - Parameters supplied to the create or update network security group operation. @@ -71,7 +71,7 @@ func (client *SecurityGroupsClient) BeginCreateOrUpdate(ctx context.Context, res // CreateOrUpdate - Creates or updates a network security group in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *SecurityGroupsClient) createOrUpdate(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, parameters SecurityGroup, options *SecurityGroupsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "SecurityGroupsClient.BeginCreateOrUpdate" @@ -113,7 +113,7 @@ func (client *SecurityGroupsClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -125,7 +125,7 @@ func (client *SecurityGroupsClient) createOrUpdateCreateRequest(ctx context.Cont // BeginDelete - Deletes the specified network security group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkSecurityGroupName - The name of the network security group. // - options - SecurityGroupsClientBeginDeleteOptions contains the optional parameters for the SecurityGroupsClient.BeginDelete @@ -148,7 +148,7 @@ func (client *SecurityGroupsClient) BeginDelete(ctx context.Context, resourceGro // Delete - Deletes the specified network security group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *SecurityGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, options *SecurityGroupsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "SecurityGroupsClient.BeginDelete" @@ -190,7 +190,7 @@ func (client *SecurityGroupsClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -199,7 +199,7 @@ func (client *SecurityGroupsClient) deleteCreateRequest(ctx context.Context, res // Get - Gets the specified network security group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkSecurityGroupName - The name of the network security group. // - options - SecurityGroupsClientGetOptions contains the optional parameters for the SecurityGroupsClient.Get method. @@ -245,7 +245,7 @@ func (client *SecurityGroupsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } @@ -265,7 +265,7 @@ func (client *SecurityGroupsClient) getHandleResponse(resp *http.Response) (Secu // NewListPager - Gets all network security groups in a resource group. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - options - SecurityGroupsClientListOptions contains the optional parameters for the SecurityGroupsClient.NewListPager method. func (client *SecurityGroupsClient) NewListPager(resourceGroupName string, options *SecurityGroupsClientListOptions) *runtime.Pager[SecurityGroupsClientListResponse] { @@ -314,7 +314,7 @@ func (client *SecurityGroupsClient) listCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -331,7 +331,7 @@ func (client *SecurityGroupsClient) listHandleResponse(resp *http.Response) (Sec // NewListAllPager - Gets all network security groups in a subscription. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - options - SecurityGroupsClientListAllOptions contains the optional parameters for the SecurityGroupsClient.NewListAllPager // method. func (client *SecurityGroupsClient) NewListAllPager(options *SecurityGroupsClientListAllOptions) *runtime.Pager[SecurityGroupsClientListAllResponse] { @@ -376,7 +376,7 @@ func (client *SecurityGroupsClient) listAllCreateRequest(ctx context.Context, op return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -394,7 +394,7 @@ func (client *SecurityGroupsClient) listAllHandleResponse(resp *http.Response) ( // UpdateTags - Updates a network security group tags. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkSecurityGroupName - The name of the network security group. // - parameters - Parameters supplied to update network security group tags. @@ -442,7 +442,7 @@ func (client *SecurityGroupsClient) updateTagsCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/securitygroups_client_example_test.go b/sdk/resourcemanager/network/armnetwork/securitygroups_client_example_test.go deleted file mode 100644 index 66c3a84b5e8c..000000000000 --- a/sdk/resourcemanager/network/armnetwork/securitygroups_client_example_test.go +++ /dev/null @@ -1,1106 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkSecurityGroupDelete.json -func ExampleSecurityGroupsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSecurityGroupsClient().BeginDelete(ctx, "rg1", "testnsg", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkSecurityGroupGet.json -func ExampleSecurityGroupsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSecurityGroupsClient().Get(ctx, "rg1", "testnsg", &armnetwork.SecurityGroupsClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SecurityGroup = armnetwork.SecurityGroup{ - // Name: to.Ptr("testnsg"), - // Type: to.Ptr("Microsoft.Network/networkSecurityGroups"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.SecurityGroupPropertiesFormat{ - // DefaultSecurityRules: []*armnetwork.SecurityRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowVnetInBound"), - // Name: to.Ptr("AllowVnetInBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow inbound traffic from all VMs in VNET"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("VirtualNetwork"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](65000), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("VirtualNetwork"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowAzureLoadBalancerInBound"), - // Name: to.Ptr("AllowAzureLoadBalancerInBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow inbound traffic from azure load balancer"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](65001), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("AzureLoadBalancer"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/DenyAllInBound"), - // Name: to.Ptr("DenyAllInBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Deny all inbound traffic"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessDeny), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](65500), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("*"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowVnetOutBound"), - // Name: to.Ptr("AllowVnetOutBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow outbound traffic from all VMs to all VMs in VNET"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("VirtualNetwork"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), - // Priority: to.Ptr[int32](65000), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("VirtualNetwork"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowInternetOutBound"), - // Name: to.Ptr("AllowInternetOutBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow outbound traffic from all VMs to Internet"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("Internet"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), - // Priority: to.Ptr[int32](65001), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("*"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/DenyAllOutBound"), - // Name: to.Ptr("DenyAllOutBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Deny all outbound traffic"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessDeny), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), - // Priority: to.Ptr[int32](65500), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("*"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SecurityRules: []*armnetwork.SecurityRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/securityRules/rule1"), - // Name: to.Ptr("rule1"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationPortRange: to.Ptr("80"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](130), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("*"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkSecurityGroupCreate.json -func ExampleSecurityGroupsClient_BeginCreateOrUpdate_createNetworkSecurityGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSecurityGroupsClient().BeginCreateOrUpdate(ctx, "rg1", "testnsg", armnetwork.SecurityGroup{ - Location: to.Ptr("eastus"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SecurityGroup = armnetwork.SecurityGroup{ - // Name: to.Ptr("testnsg"), - // Type: to.Ptr("Microsoft.Network/networkSecurityGroups"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.SecurityGroupPropertiesFormat{ - // DefaultSecurityRules: []*armnetwork.SecurityRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowVnetInBound"), - // Name: to.Ptr("AllowVnetInBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow inbound traffic from all VMs in VNET"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("VirtualNetwork"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](65000), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("VirtualNetwork"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowAzureLoadBalancerInBound"), - // Name: to.Ptr("AllowAzureLoadBalancerInBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow inbound traffic from azure load balancer"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](65001), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("AzureLoadBalancer"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/DenyAllInBound"), - // Name: to.Ptr("DenyAllInBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Deny all inbound traffic"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessDeny), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](65500), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("*"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowVnetOutBound"), - // Name: to.Ptr("AllowVnetOutBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow outbound traffic from all VMs to all VMs in VNET"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("VirtualNetwork"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), - // Priority: to.Ptr[int32](65000), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("VirtualNetwork"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowInternetOutBound"), - // Name: to.Ptr("AllowInternetOutBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow outbound traffic from all VMs to Internet"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("Internet"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), - // Priority: to.Ptr[int32](65001), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("*"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/DenyAllOutBound"), - // Name: to.Ptr("DenyAllOutBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Deny all outbound traffic"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessDeny), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), - // Priority: to.Ptr[int32](65500), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("*"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }}, - // FlushConnection: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SecurityRules: []*armnetwork.SecurityRule{ - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkSecurityGroupCreateWithRule.json -func ExampleSecurityGroupsClient_BeginCreateOrUpdate_createNetworkSecurityGroupWithRule() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSecurityGroupsClient().BeginCreateOrUpdate(ctx, "rg1", "testnsg", armnetwork.SecurityGroup{ - Location: to.Ptr("eastus"), - Properties: &armnetwork.SecurityGroupPropertiesFormat{ - SecurityRules: []*armnetwork.SecurityRule{ - { - Name: to.Ptr("rule1"), - Properties: &armnetwork.SecurityRulePropertiesFormat{ - Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - DestinationAddressPrefix: to.Ptr("*"), - DestinationPortRange: to.Ptr("80"), - Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - Priority: to.Ptr[int32](130), - SourceAddressPrefix: to.Ptr("*"), - SourcePortRange: to.Ptr("*"), - Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - }, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SecurityGroup = armnetwork.SecurityGroup{ - // Name: to.Ptr("testnsg"), - // Type: to.Ptr("Microsoft.Network/networkSecurityGroups"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.SecurityGroupPropertiesFormat{ - // DefaultSecurityRules: []*armnetwork.SecurityRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowVnetInBound"), - // Name: to.Ptr("AllowVnetInBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow inbound traffic from all VMs in VNET"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("VirtualNetwork"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](65000), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("VirtualNetwork"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowAzureLoadBalancerInBound"), - // Name: to.Ptr("AllowAzureLoadBalancerInBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow inbound traffic from azure load balancer"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](65001), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("AzureLoadBalancer"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/DenyAllInBound"), - // Name: to.Ptr("DenyAllInBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Deny all inbound traffic"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessDeny), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](65500), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("*"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowVnetOutBound"), - // Name: to.Ptr("AllowVnetOutBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow outbound traffic from all VMs to all VMs in VNET"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("VirtualNetwork"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), - // Priority: to.Ptr[int32](65000), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("VirtualNetwork"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowInternetOutBound"), - // Name: to.Ptr("AllowInternetOutBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow outbound traffic from all VMs to Internet"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("Internet"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), - // Priority: to.Ptr[int32](65001), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("*"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/DenyAllOutBound"), - // Name: to.Ptr("DenyAllOutBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Deny all outbound traffic"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessDeny), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), - // Priority: to.Ptr[int32](65500), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("*"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SecurityRules: []*armnetwork.SecurityRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/securityRules/rule1"), - // Name: to.Ptr("rule1"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationPortRange: to.Ptr("80"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](130), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("*"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkSecurityGroupUpdateTags.json -func ExampleSecurityGroupsClient_UpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSecurityGroupsClient().UpdateTags(ctx, "rg1", "testnsg", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SecurityGroup = armnetwork.SecurityGroup{ - // Name: to.Ptr("testnsg"), - // Type: to.Ptr("Microsoft.Network/networkSecurityGroups"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armnetwork.SecurityGroupPropertiesFormat{ - // DefaultSecurityRules: []*armnetwork.SecurityRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowVnetInBound"), - // Name: to.Ptr("AllowVnetInBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow inbound traffic from all VMs in VNET"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("VirtualNetwork"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](65000), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("VirtualNetwork"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowAzureLoadBalancerInBound"), - // Name: to.Ptr("AllowAzureLoadBalancerInBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow inbound traffic from azure load balancer"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](65001), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("AzureLoadBalancer"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/DenyAllInBound"), - // Name: to.Ptr("DenyAllInBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Deny all inbound traffic"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessDeny), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](65500), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("*"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowVnetOutBound"), - // Name: to.Ptr("AllowVnetOutBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow outbound traffic from all VMs to all VMs in VNET"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("VirtualNetwork"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), - // Priority: to.Ptr[int32](65000), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("VirtualNetwork"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowInternetOutBound"), - // Name: to.Ptr("AllowInternetOutBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow outbound traffic from all VMs to Internet"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("Internet"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), - // Priority: to.Ptr[int32](65001), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("*"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/DenyAllOutBound"), - // Name: to.Ptr("DenyAllOutBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Deny all outbound traffic"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessDeny), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), - // Priority: to.Ptr[int32](65500), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("*"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SecurityRules: []*armnetwork.SecurityRule{ - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkSecurityGroupListAll.json -func ExampleSecurityGroupsClient_NewListAllPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSecurityGroupsClient().NewListAllPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SecurityGroupListResult = armnetwork.SecurityGroupListResult{ - // Value: []*armnetwork.SecurityGroup{ - // { - // Name: to.Ptr("nsg1"), - // Type: to.Ptr("Microsoft.Network/networkSecurityGroups"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.SecurityGroupPropertiesFormat{ - // DefaultSecurityRules: []*armnetwork.SecurityRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/AllowVnetInBound"), - // Name: to.Ptr("AllowVnetInBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow inbound traffic from all VMs in VNET"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("VirtualNetwork"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](65000), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("VirtualNetwork"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/AllowAzureLoadBalancerInBound"), - // Name: to.Ptr("AllowAzureLoadBalancerInBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow inbound traffic from azure load balancer"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](65001), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("AzureLoadBalancer"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/DenyAllInBound"), - // Name: to.Ptr("DenyAllInBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Deny all inbound traffic"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessDeny), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](65500), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("*"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/AllowVnetOutBound"), - // Name: to.Ptr("AllowVnetOutBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow outbound traffic from all VMs to all VMs in VNET"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("VirtualNetwork"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), - // Priority: to.Ptr[int32](65000), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("VirtualNetwork"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/AllowInternetOutBound"), - // Name: to.Ptr("AllowInternetOutBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow outbound traffic from all VMs to Internet"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("Internet"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), - // Priority: to.Ptr[int32](65001), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("*"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/DenyAllOutBound"), - // Name: to.Ptr("DenyAllOutBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Deny all outbound traffic"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessDeny), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), - // Priority: to.Ptr[int32](65500), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("*"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SecurityRules: []*armnetwork.SecurityRule{ - // }, - // }, - // }, - // { - // Name: to.Ptr("nsg3"), - // Type: to.Ptr("Microsoft.Network/networkSecurityGroups"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/networkSecurityGroups/nsg3"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.SecurityGroupPropertiesFormat{ - // DefaultSecurityRules: []*armnetwork.SecurityRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/networkSecurityGroups/nsg3/defaultSecurityRules/AllowVnetInBound"), - // Name: to.Ptr("AllowVnetInBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow inbound traffic from all VMs in VNET"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("VirtualNetwork"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](65000), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("VirtualNetwork"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/networkSecurityGroups/nsg3/defaultSecurityRules/AllowAzureLoadBalancerInBound"), - // Name: to.Ptr("AllowAzureLoadBalancerInBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow inbound traffic from azure load balancer"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](65001), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("AzureLoadBalancer"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/networkSecurityGroups/nsg3/defaultSecurityRules/DenyAllInBound"), - // Name: to.Ptr("DenyAllInBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Deny all inbound traffic"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessDeny), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](65500), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("*"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/networkSecurityGroups/nsg3/defaultSecurityRules/AllowVnetOutBound"), - // Name: to.Ptr("AllowVnetOutBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow outbound traffic from all VMs to all VMs in VNET"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("VirtualNetwork"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), - // Priority: to.Ptr[int32](65000), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("VirtualNetwork"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/networkSecurityGroups/nsg3/defaultSecurityRules/AllowInternetOutBound"), - // Name: to.Ptr("AllowInternetOutBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow outbound traffic from all VMs to Internet"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("Internet"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), - // Priority: to.Ptr[int32](65001), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("*"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/networkSecurityGroups/nsg3/defaultSecurityRules/DenyAllOutBound"), - // Name: to.Ptr("DenyAllOutBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Deny all outbound traffic"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessDeny), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), - // Priority: to.Ptr[int32](65500), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("*"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SecurityRules: []*armnetwork.SecurityRule{ - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkSecurityGroupList.json -func ExampleSecurityGroupsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSecurityGroupsClient().NewListPager("rg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SecurityGroupListResult = armnetwork.SecurityGroupListResult{ - // Value: []*armnetwork.SecurityGroup{ - // { - // Name: to.Ptr("nsg1"), - // Type: to.Ptr("Microsoft.Network/networkSecurityGroups"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.SecurityGroupPropertiesFormat{ - // DefaultSecurityRules: []*armnetwork.SecurityRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/AllowVnetInBound"), - // Name: to.Ptr("AllowVnetInBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow inbound traffic from all VMs in VNET"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("VirtualNetwork"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](65000), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("VirtualNetwork"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/AllowAzureLoadBalancerInBound"), - // Name: to.Ptr("AllowAzureLoadBalancerInBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow inbound traffic from azure load balancer"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](65001), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("AzureLoadBalancer"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/DenyAllInBound"), - // Name: to.Ptr("DenyAllInBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Deny all inbound traffic"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessDeny), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](65500), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("*"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/AllowVnetOutBound"), - // Name: to.Ptr("AllowVnetOutBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow outbound traffic from all VMs to all VMs in VNET"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("VirtualNetwork"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), - // Priority: to.Ptr[int32](65000), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("VirtualNetwork"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/AllowInternetOutBound"), - // Name: to.Ptr("AllowInternetOutBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow outbound traffic from all VMs to Internet"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("Internet"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), - // Priority: to.Ptr[int32](65001), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("*"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/DenyAllOutBound"), - // Name: to.Ptr("DenyAllOutBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Deny all outbound traffic"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessDeny), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), - // Priority: to.Ptr[int32](65500), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("*"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SecurityRules: []*armnetwork.SecurityRule{ - // }, - // }, - // }, - // { - // Name: to.Ptr("nsg3"), - // Type: to.Ptr("Microsoft.Network/networkSecurityGroups"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg3"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.SecurityGroupPropertiesFormat{ - // DefaultSecurityRules: []*armnetwork.SecurityRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg3/defaultSecurityRules/AllowVnetInBound"), - // Name: to.Ptr("AllowVnetInBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow inbound traffic from all VMs in VNET"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("VirtualNetwork"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](65000), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("VirtualNetwork"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg3/defaultSecurityRules/AllowAzureLoadBalancerInBound"), - // Name: to.Ptr("AllowAzureLoadBalancerInBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow inbound traffic from azure load balancer"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](65001), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("AzureLoadBalancer"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg3/defaultSecurityRules/DenyAllInBound"), - // Name: to.Ptr("DenyAllInBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Deny all inbound traffic"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessDeny), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](65500), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("*"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg3/defaultSecurityRules/AllowVnetOutBound"), - // Name: to.Ptr("AllowVnetOutBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow outbound traffic from all VMs to all VMs in VNET"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("VirtualNetwork"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), - // Priority: to.Ptr[int32](65000), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("VirtualNetwork"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg3/defaultSecurityRules/AllowInternetOutBound"), - // Name: to.Ptr("AllowInternetOutBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow outbound traffic from all VMs to Internet"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("Internet"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), - // Priority: to.Ptr[int32](65001), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("*"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg3/defaultSecurityRules/DenyAllOutBound"), - // Name: to.Ptr("DenyAllOutBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Deny all outbound traffic"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessDeny), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), - // Priority: to.Ptr[int32](65500), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("*"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SecurityRules: []*armnetwork.SecurityRule{ - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/securitypartnerproviders_client.go b/sdk/resourcemanager/network/armnetwork/securitypartnerproviders_client.go index af37c459152d..4ba6f6f76cc9 100644 --- a/sdk/resourcemanager/network/armnetwork/securitypartnerproviders_client.go +++ b/sdk/resourcemanager/network/armnetwork/securitypartnerproviders_client.go @@ -47,7 +47,7 @@ func NewSecurityPartnerProvidersClient(subscriptionID string, credential azcore. // BeginCreateOrUpdate - Creates or updates the specified Security Partner Provider. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - securityPartnerProviderName - The name of the Security Partner Provider. // - parameters - Parameters supplied to the create or update Security Partner Provider operation. @@ -71,7 +71,7 @@ func (client *SecurityPartnerProvidersClient) BeginCreateOrUpdate(ctx context.Co // CreateOrUpdate - Creates or updates the specified Security Partner Provider. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *SecurityPartnerProvidersClient) createOrUpdate(ctx context.Context, resourceGroupName string, securityPartnerProviderName string, parameters SecurityPartnerProvider, options *SecurityPartnerProvidersClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "SecurityPartnerProvidersClient.BeginCreateOrUpdate" @@ -113,7 +113,7 @@ func (client *SecurityPartnerProvidersClient) createOrUpdateCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -125,7 +125,7 @@ func (client *SecurityPartnerProvidersClient) createOrUpdateCreateRequest(ctx co // BeginDelete - Deletes the specified Security Partner Provider. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - securityPartnerProviderName - The name of the Security Partner Provider. // - options - SecurityPartnerProvidersClientBeginDeleteOptions contains the optional parameters for the SecurityPartnerProvidersClient.BeginDelete @@ -148,7 +148,7 @@ func (client *SecurityPartnerProvidersClient) BeginDelete(ctx context.Context, r // Delete - Deletes the specified Security Partner Provider. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *SecurityPartnerProvidersClient) deleteOperation(ctx context.Context, resourceGroupName string, securityPartnerProviderName string, options *SecurityPartnerProvidersClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "SecurityPartnerProvidersClient.BeginDelete" @@ -190,7 +190,7 @@ func (client *SecurityPartnerProvidersClient) deleteCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -199,7 +199,7 @@ func (client *SecurityPartnerProvidersClient) deleteCreateRequest(ctx context.Co // Get - Gets the specified Security Partner Provider. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - securityPartnerProviderName - The name of the Security Partner Provider. // - options - SecurityPartnerProvidersClientGetOptions contains the optional parameters for the SecurityPartnerProvidersClient.Get @@ -246,7 +246,7 @@ func (client *SecurityPartnerProvidersClient) getCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -263,7 +263,7 @@ func (client *SecurityPartnerProvidersClient) getHandleResponse(resp *http.Respo // NewListPager - Gets all the Security Partner Providers in a subscription. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - options - SecurityPartnerProvidersClientListOptions contains the optional parameters for the SecurityPartnerProvidersClient.NewListPager // method. func (client *SecurityPartnerProvidersClient) NewListPager(options *SecurityPartnerProvidersClientListOptions) *runtime.Pager[SecurityPartnerProvidersClientListResponse] { @@ -308,7 +308,7 @@ func (client *SecurityPartnerProvidersClient) listCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -325,7 +325,7 @@ func (client *SecurityPartnerProvidersClient) listHandleResponse(resp *http.Resp // NewListByResourceGroupPager - Lists all Security Partner Providers in a resource group. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - options - SecurityPartnerProvidersClientListByResourceGroupOptions contains the optional parameters for the SecurityPartnerProvidersClient.NewListByResourceGroupPager // method. @@ -375,7 +375,7 @@ func (client *SecurityPartnerProvidersClient) listByResourceGroupCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -393,7 +393,7 @@ func (client *SecurityPartnerProvidersClient) listByResourceGroupHandleResponse( // UpdateTags - Updates tags of a Security Partner Provider resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - securityPartnerProviderName - The name of the Security Partner Provider. // - parameters - Parameters supplied to update Security Partner Provider tags. @@ -441,7 +441,7 @@ func (client *SecurityPartnerProvidersClient) updateTagsCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/securitypartnerproviders_client_example_test.go b/sdk/resourcemanager/network/armnetwork/securitypartnerproviders_client_example_test.go deleted file mode 100644 index a57996982e27..000000000000 --- a/sdk/resourcemanager/network/armnetwork/securitypartnerproviders_client_example_test.go +++ /dev/null @@ -1,261 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/SecurityPartnerProviderDelete.json -func ExampleSecurityPartnerProvidersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSecurityPartnerProvidersClient().BeginDelete(ctx, "rg1", "securityPartnerProvider", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/SecurityPartnerProviderGet.json -func ExampleSecurityPartnerProvidersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSecurityPartnerProvidersClient().Get(ctx, "rg1", "securityPartnerProvider", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SecurityPartnerProvider = armnetwork.SecurityPartnerProvider{ - // Name: to.Ptr("securityPartnerProvider"), - // Type: to.Ptr("Microsoft.Network/securityPartnerProviders"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/securityPartnerProviders/securityPartnerProvider"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.SecurityPartnerProviderPropertiesFormat{ - // ConnectionStatus: to.Ptr(armnetwork.SecurityPartnerProviderConnectionStatusUnknown), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SecurityProviderName: to.Ptr(armnetwork.SecurityProviderNameZScaler), - // VirtualHub: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/SecurityPartnerProviderPut.json -func ExampleSecurityPartnerProvidersClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSecurityPartnerProvidersClient().BeginCreateOrUpdate(ctx, "rg1", "securityPartnerProvider", armnetwork.SecurityPartnerProvider{ - Location: to.Ptr("West US"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, - Properties: &armnetwork.SecurityPartnerProviderPropertiesFormat{ - SecurityProviderName: to.Ptr(armnetwork.SecurityProviderNameZScaler), - VirtualHub: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SecurityPartnerProvider = armnetwork.SecurityPartnerProvider{ - // Name: to.Ptr("securityPartnerProvider"), - // Type: to.Ptr("Microsoft.Network/securityPartnerProviders"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/securityPartnerProviders/securityPartnerProvider"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.SecurityPartnerProviderPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SecurityProviderName: to.Ptr(armnetwork.SecurityProviderNameZScaler), - // VirtualHub: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/SecurityPartnerProviderUpdateTags.json -func ExampleSecurityPartnerProvidersClient_UpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSecurityPartnerProvidersClient().UpdateTags(ctx, "rg1", "securityPartnerProvider", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SecurityPartnerProvider = armnetwork.SecurityPartnerProvider{ - // Name: to.Ptr("fw1"), - // Type: to.Ptr("Microsoft.Network/securityPartnerProviders"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/azfwtest/providers/Microsoft.Network/securityPartnerProviders/securityPartnerProvider"), - // Location: to.Ptr("brazilsouth"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armnetwork.SecurityPartnerProviderPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SecurityProviderName: to.Ptr(armnetwork.SecurityProviderNameZScaler), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/SecurityPartnerProviderListByResourceGroup.json -func ExampleSecurityPartnerProvidersClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSecurityPartnerProvidersClient().NewListByResourceGroupPager("rg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SecurityPartnerProviderListResult = armnetwork.SecurityPartnerProviderListResult{ - // Value: []*armnetwork.SecurityPartnerProvider{ - // { - // Name: to.Ptr("securityPartnerProvider"), - // Type: to.Ptr("Microsoft.Network/securityPartnerProviders"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/securityPartnerProviders/securityPartnerProvider"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.SecurityPartnerProviderPropertiesFormat{ - // ConnectionStatus: to.Ptr(armnetwork.SecurityPartnerProviderConnectionStatusUnknown), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SecurityProviderName: to.Ptr(armnetwork.SecurityProviderNameZScaler), - // VirtualHub: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/SecurityPartnerProviderListBySubscription.json -func ExampleSecurityPartnerProvidersClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSecurityPartnerProvidersClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SecurityPartnerProviderListResult = armnetwork.SecurityPartnerProviderListResult{ - // Value: []*armnetwork.SecurityPartnerProvider{ - // { - // Name: to.Ptr("securityPartnerProvider"), - // Type: to.Ptr("Microsoft.Network/securityPartnerProviders"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/securityPartnerProviders/securityPartnerProvider"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.SecurityPartnerProviderPropertiesFormat{ - // ConnectionStatus: to.Ptr(armnetwork.SecurityPartnerProviderConnectionStatusUnknown), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SecurityProviderName: to.Ptr(armnetwork.SecurityProviderNameZScaler), - // VirtualHub: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1"), - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/securityrules_client.go b/sdk/resourcemanager/network/armnetwork/securityrules_client.go index 699ec564c140..6d2104378507 100644 --- a/sdk/resourcemanager/network/armnetwork/securityrules_client.go +++ b/sdk/resourcemanager/network/armnetwork/securityrules_client.go @@ -47,7 +47,7 @@ func NewSecurityRulesClient(subscriptionID string, credential azcore.TokenCreden // BeginCreateOrUpdate - Creates or updates a security rule in the specified network security group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkSecurityGroupName - The name of the network security group. // - securityRuleName - The name of the security rule. @@ -72,7 +72,7 @@ func (client *SecurityRulesClient) BeginCreateOrUpdate(ctx context.Context, reso // CreateOrUpdate - Creates or updates a security rule in the specified network security group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *SecurityRulesClient) createOrUpdate(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, securityRuleName string, securityRuleParameters SecurityRule, options *SecurityRulesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "SecurityRulesClient.BeginCreateOrUpdate" @@ -118,7 +118,7 @@ func (client *SecurityRulesClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, securityRuleParameters); err != nil { @@ -130,7 +130,7 @@ func (client *SecurityRulesClient) createOrUpdateCreateRequest(ctx context.Conte // BeginDelete - Deletes the specified network security rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkSecurityGroupName - The name of the network security group. // - securityRuleName - The name of the security rule. @@ -154,7 +154,7 @@ func (client *SecurityRulesClient) BeginDelete(ctx context.Context, resourceGrou // Delete - Deletes the specified network security rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *SecurityRulesClient) deleteOperation(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, securityRuleName string, options *SecurityRulesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "SecurityRulesClient.BeginDelete" @@ -200,7 +200,7 @@ func (client *SecurityRulesClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -209,7 +209,7 @@ func (client *SecurityRulesClient) deleteCreateRequest(ctx context.Context, reso // Get - Get the specified network security rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkSecurityGroupName - The name of the network security group. // - securityRuleName - The name of the security rule. @@ -260,7 +260,7 @@ func (client *SecurityRulesClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -277,7 +277,7 @@ func (client *SecurityRulesClient) getHandleResponse(resp *http.Response) (Secur // NewListPager - Gets all security rules in a network security group. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkSecurityGroupName - The name of the network security group. // - options - SecurityRulesClientListOptions contains the optional parameters for the SecurityRulesClient.NewListPager method. @@ -331,7 +331,7 @@ func (client *SecurityRulesClient) listCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/securityrules_client_example_test.go b/sdk/resourcemanager/network/armnetwork/securityrules_client_example_test.go deleted file mode 100644 index 064361d10337..000000000000 --- a/sdk/resourcemanager/network/armnetwork/securityrules_client_example_test.go +++ /dev/null @@ -1,168 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkSecurityGroupRuleDelete.json -func ExampleSecurityRulesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSecurityRulesClient().BeginDelete(ctx, "rg1", "testnsg", "rule1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkSecurityGroupRuleGet.json -func ExampleSecurityRulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSecurityRulesClient().Get(ctx, "rg1", "testnsg", "rule1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SecurityRule = armnetwork.SecurityRule{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/securityRules/rule1"), - // Name: to.Ptr("rule1"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationPortRange: to.Ptr("80"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](130), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("*"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkSecurityGroupRuleCreate.json -func ExampleSecurityRulesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSecurityRulesClient().BeginCreateOrUpdate(ctx, "rg1", "testnsg", "rule1", armnetwork.SecurityRule{ - Properties: &armnetwork.SecurityRulePropertiesFormat{ - Access: to.Ptr(armnetwork.SecurityRuleAccessDeny), - DestinationAddressPrefix: to.Ptr("11.0.0.0/8"), - DestinationPortRange: to.Ptr("8080"), - Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), - Priority: to.Ptr[int32](100), - SourceAddressPrefix: to.Ptr("10.0.0.0/8"), - SourcePortRange: to.Ptr("*"), - Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SecurityRule = armnetwork.SecurityRule{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/securityRules/rule1"), - // Name: to.Ptr("rule1"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Access: to.Ptr(armnetwork.SecurityRuleAccessDeny), - // DestinationAddressPrefix: to.Ptr("11.0.0.0/8"), - // DestinationPortRange: to.Ptr("8080"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), - // Priority: to.Ptr[int32](100), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("10.0.0.0/8"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkSecurityGroupRuleList.json -func ExampleSecurityRulesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSecurityRulesClient().NewListPager("rg1", "testnsg", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SecurityRuleListResult = armnetwork.SecurityRuleListResult{ - // Value: []*armnetwork.SecurityRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/securityRules/rule1"), - // Name: to.Ptr("rule1"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationPortRange: to.Ptr("80"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](130), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("*"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/serviceassociationlinks_client.go b/sdk/resourcemanager/network/armnetwork/serviceassociationlinks_client.go index 81f1dc348b89..26ccb329af7b 100644 --- a/sdk/resourcemanager/network/armnetwork/serviceassociationlinks_client.go +++ b/sdk/resourcemanager/network/armnetwork/serviceassociationlinks_client.go @@ -47,7 +47,7 @@ func NewServiceAssociationLinksClient(subscriptionID string, credential azcore.T // List - Gets a list of service association links for a subnet. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkName - The name of the virtual network. // - subnetName - The name of the subnet. @@ -99,7 +99,7 @@ func (client *ServiceAssociationLinksClient) listCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/serviceassociationlinks_client_example_test.go b/sdk/resourcemanager/network/armnetwork/serviceassociationlinks_client_example_test.go deleted file mode 100644 index 5f49af9c0133..000000000000 --- a/sdk/resourcemanager/network/armnetwork/serviceassociationlinks_client_example_test.go +++ /dev/null @@ -1,54 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkGetServiceAssociationLinks.json -func ExampleServiceAssociationLinksClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServiceAssociationLinksClient().List(ctx, "rg1", "vnet", "subnet", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServiceAssociationLinksListResult = armnetwork.ServiceAssociationLinksListResult{ - // Value: []*armnetwork.ServiceAssociationLink{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet/subnets/subnet/serviceAssociationLinks/acisal"), - // Name: to.Ptr("acisal"), - // Type: to.Ptr("Microsoft.Network/virtualNetworks/subnets/serviceAssociationLinks"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.ServiceAssociationLinkPropertiesFormat{ - // AllowDelete: to.Ptr(true), - // LinkedResourceType: to.Ptr("Microsoft.ContainerInstance/containerGroups"), - // Locations: []*string{ - // to.Ptr("westus")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/serviceendpointpolicies_client.go b/sdk/resourcemanager/network/armnetwork/serviceendpointpolicies_client.go index 89cd2ab9412d..bbdb8fd00daf 100644 --- a/sdk/resourcemanager/network/armnetwork/serviceendpointpolicies_client.go +++ b/sdk/resourcemanager/network/armnetwork/serviceendpointpolicies_client.go @@ -47,7 +47,7 @@ func NewServiceEndpointPoliciesClient(subscriptionID string, credential azcore.T // BeginCreateOrUpdate - Creates or updates a service Endpoint Policies. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - serviceEndpointPolicyName - The name of the service endpoint policy. // - parameters - Parameters supplied to the create or update service endpoint policy operation. @@ -71,7 +71,7 @@ func (client *ServiceEndpointPoliciesClient) BeginCreateOrUpdate(ctx context.Con // CreateOrUpdate - Creates or updates a service Endpoint Policies. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *ServiceEndpointPoliciesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, parameters ServiceEndpointPolicy, options *ServiceEndpointPoliciesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ServiceEndpointPoliciesClient.BeginCreateOrUpdate" @@ -113,7 +113,7 @@ func (client *ServiceEndpointPoliciesClient) createOrUpdateCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -125,7 +125,7 @@ func (client *ServiceEndpointPoliciesClient) createOrUpdateCreateRequest(ctx con // BeginDelete - Deletes the specified service endpoint policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - serviceEndpointPolicyName - The name of the service endpoint policy. // - options - ServiceEndpointPoliciesClientBeginDeleteOptions contains the optional parameters for the ServiceEndpointPoliciesClient.BeginDelete @@ -148,7 +148,7 @@ func (client *ServiceEndpointPoliciesClient) BeginDelete(ctx context.Context, re // Delete - Deletes the specified service endpoint policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *ServiceEndpointPoliciesClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, options *ServiceEndpointPoliciesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ServiceEndpointPoliciesClient.BeginDelete" @@ -190,7 +190,7 @@ func (client *ServiceEndpointPoliciesClient) deleteCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -199,7 +199,7 @@ func (client *ServiceEndpointPoliciesClient) deleteCreateRequest(ctx context.Con // Get - Gets the specified service Endpoint Policies in a specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - serviceEndpointPolicyName - The name of the service endpoint policy. // - options - ServiceEndpointPoliciesClientGetOptions contains the optional parameters for the ServiceEndpointPoliciesClient.Get @@ -246,7 +246,7 @@ func (client *ServiceEndpointPoliciesClient) getCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } @@ -266,7 +266,7 @@ func (client *ServiceEndpointPoliciesClient) getHandleResponse(resp *http.Respon // NewListPager - Gets all the service endpoint policies in a subscription. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - options - ServiceEndpointPoliciesClientListOptions contains the optional parameters for the ServiceEndpointPoliciesClient.NewListPager // method. func (client *ServiceEndpointPoliciesClient) NewListPager(options *ServiceEndpointPoliciesClientListOptions) *runtime.Pager[ServiceEndpointPoliciesClientListResponse] { @@ -311,7 +311,7 @@ func (client *ServiceEndpointPoliciesClient) listCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -328,7 +328,7 @@ func (client *ServiceEndpointPoliciesClient) listHandleResponse(resp *http.Respo // NewListByResourceGroupPager - Gets all service endpoint Policies in a resource group. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - options - ServiceEndpointPoliciesClientListByResourceGroupOptions contains the optional parameters for the ServiceEndpointPoliciesClient.NewListByResourceGroupPager // method. @@ -378,7 +378,7 @@ func (client *ServiceEndpointPoliciesClient) listByResourceGroupCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -396,7 +396,7 @@ func (client *ServiceEndpointPoliciesClient) listByResourceGroupHandleResponse(r // UpdateTags - Updates tags of a service endpoint policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - serviceEndpointPolicyName - The name of the service endpoint policy. // - parameters - Parameters supplied to update service endpoint policy tags. @@ -444,7 +444,7 @@ func (client *ServiceEndpointPoliciesClient) updateTagsCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/serviceendpointpolicies_client_example_test.go b/sdk/resourcemanager/network/armnetwork/serviceendpointpolicies_client_example_test.go deleted file mode 100644 index 95afc286e336..000000000000 --- a/sdk/resourcemanager/network/armnetwork/serviceendpointpolicies_client_example_test.go +++ /dev/null @@ -1,391 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ServiceEndpointPolicyDelete.json -func ExampleServiceEndpointPoliciesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServiceEndpointPoliciesClient().BeginDelete(ctx, "rg1", "serviceEndpointPolicy1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ServiceEndpointPolicyGet.json -func ExampleServiceEndpointPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServiceEndpointPoliciesClient().Get(ctx, "rg1", "testServiceEndpointPolicy", &armnetwork.ServiceEndpointPoliciesClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServiceEndpointPolicy = armnetwork.ServiceEndpointPolicy{ - // Name: to.Ptr("testServiceEndpointPolicy"), - // Type: to.Ptr("Microsoft.Network/serviceEndpointPolicies"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/serviceEndpointPolicies/testServiceEndpointPolicy"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.ServiceEndpointPolicyPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("6A7C139D-8B8D-499B-B7CB-4F3F02A8A44F"), - // ServiceEndpointPolicyDefinitions: []*armnetwork.ServiceEndpointPolicyDefinition{ - // { - // Name: to.Ptr("StorageServiceEndpointPolicyDefinition"), - // Properties: &armnetwork.ServiceEndpointPolicyDefinitionPropertiesFormat{ - // Description: to.Ptr("Storage Service EndpointPolicy Definition"), - // Service: to.Ptr("Microsoft.Storage"), - // ServiceResources: []*string{ - // to.Ptr("/subscriptions/subid1"), - // to.Ptr("/subscriptions/subid1/resourceGroups/storageRg"), - // to.Ptr("/subscriptions/subid1/resourceGroups/storageRg/providers/Microsoft.Storage/storageAccounts/stAccount")}, - // }, - // }}, - // Subnets: []*armnetwork.Subnet{ - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ServiceEndpointPolicyCreate.json -func ExampleServiceEndpointPoliciesClient_BeginCreateOrUpdate_createServiceEndpointPolicy() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServiceEndpointPoliciesClient().BeginCreateOrUpdate(ctx, "rg1", "testPolicy", armnetwork.ServiceEndpointPolicy{ - Location: to.Ptr("westus"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServiceEndpointPolicy = armnetwork.ServiceEndpointPolicy{ - // Name: to.Ptr("testnsg"), - // Type: to.Ptr("Microsoft.Network/ServiceEndpointPolicies"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/ServiceEndpointPolicies/testpolicy"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.ServiceEndpointPolicyPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("6A7C139D-8B8D-499B-B7CB-4F3F02A8A44F"), - // ServiceEndpointPolicyDefinitions: []*armnetwork.ServiceEndpointPolicyDefinition{ - // }, - // Subnets: []*armnetwork.Subnet{ - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ServiceEndpointPolicyCreateWithDefinition.json -func ExampleServiceEndpointPoliciesClient_BeginCreateOrUpdate_createServiceEndpointPolicyWithDefinition() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServiceEndpointPoliciesClient().BeginCreateOrUpdate(ctx, "rg1", "testPolicy", armnetwork.ServiceEndpointPolicy{ - Location: to.Ptr("westus"), - Properties: &armnetwork.ServiceEndpointPolicyPropertiesFormat{ - ServiceEndpointPolicyDefinitions: []*armnetwork.ServiceEndpointPolicyDefinition{ - { - Name: to.Ptr("StorageServiceEndpointPolicyDefinition"), - Properties: &armnetwork.ServiceEndpointPolicyDefinitionPropertiesFormat{ - Description: to.Ptr("Storage Service EndpointPolicy Definition"), - Service: to.Ptr("Microsoft.Storage"), - ServiceResources: []*string{ - to.Ptr("/subscriptions/subid1"), - to.Ptr("/subscriptions/subid1/resourceGroups/storageRg"), - to.Ptr("/subscriptions/subid1/resourceGroups/storageRg/providers/Microsoft.Storage/storageAccounts/stAccount")}, - }, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServiceEndpointPolicy = armnetwork.ServiceEndpointPolicy{ - // Name: to.Ptr("testnsg"), - // Type: to.Ptr("Microsoft.Network/ServiceEndpointPolicies"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/ServiceEndpointPolicies/testpolicy"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.ServiceEndpointPolicyPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("6A7C139D-8B8D-499B-B7CB-4F3F02A8A44F"), - // ServiceEndpointPolicyDefinitions: []*armnetwork.ServiceEndpointPolicyDefinition{ - // { - // Name: to.Ptr("StorageServiceEndpointPolicyDefinition"), - // Properties: &armnetwork.ServiceEndpointPolicyDefinitionPropertiesFormat{ - // Description: to.Ptr("Storage Service EndpointPolicy Definition"), - // Service: to.Ptr("Microsoft.Storage"), - // ServiceResources: []*string{ - // to.Ptr("/subscriptions/subid1"), - // to.Ptr("/subscriptions/subid1/resourceGroups/storageRg"), - // to.Ptr("/subscriptions/subid1/resourceGroups/storageRg/providers/Microsoft.Storage/storageAccounts/stAccount")}, - // }, - // }}, - // Subnets: []*armnetwork.Subnet{ - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ServiceEndpointPolicyUpdateTags.json -func ExampleServiceEndpointPoliciesClient_UpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServiceEndpointPoliciesClient().UpdateTags(ctx, "rg1", "testServiceEndpointPolicy", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServiceEndpointPolicy = armnetwork.ServiceEndpointPolicy{ - // Name: to.Ptr("testServiceEndpointPolicy"), - // Type: to.Ptr("Microsoft.Network/serviceEndpointPolicies"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/serviceEndpointPolicies/testServiceEndpointPolicy"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armnetwork.ServiceEndpointPolicyPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // ServiceEndpointPolicyDefinitions: []*armnetwork.ServiceEndpointPolicyDefinition{ - // { - // Name: to.Ptr("StorageServiceEndpointPolicyDefinition"), - // Properties: &armnetwork.ServiceEndpointPolicyDefinitionPropertiesFormat{ - // Description: to.Ptr("Storage Service EndpointPolicy Definition"), - // Service: to.Ptr("Microsoft.Storage"), - // ServiceResources: []*string{ - // to.Ptr("/subscriptions/subid1"), - // to.Ptr("/subscriptions/subid1/resourceGroups/storageRg"), - // to.Ptr("/subscriptions/subid1/resourceGroups/storageRg/providers/Microsoft.Storage/storageAccounts/stAccount")}, - // }, - // }}, - // Subnets: []*armnetwork.Subnet{ - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ServiceEndpointPolicyListAll.json -func ExampleServiceEndpointPoliciesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServiceEndpointPoliciesClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ServiceEndpointPolicyListResult = armnetwork.ServiceEndpointPolicyListResult{ - // Value: []*armnetwork.ServiceEndpointPolicy{ - // { - // Name: to.Ptr("testPolicy"), - // Type: to.Ptr("Microsoft.Network/serviceEndpointPolicies"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/serviceEndpointPolicies/testPolicy"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.ServiceEndpointPolicyPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("6A7C139D-8B8D-499B-B7CB-4F3F02A8A44F"), - // ServiceEndpointPolicyDefinitions: []*armnetwork.ServiceEndpointPolicyDefinition{ - // { - // Name: to.Ptr("StorageServiceEndpointPolicyDefinition1"), - // Properties: &armnetwork.ServiceEndpointPolicyDefinitionPropertiesFormat{ - // Description: to.Ptr("Storage Service EndpointPolicy Definition"), - // Service: to.Ptr("Microsoft.Storage"), - // ServiceResources: []*string{ - // to.Ptr("/subscriptions/subid1"), - // to.Ptr("/subscriptions/subid1/resourceGroups/storageRg"), - // to.Ptr("/subscriptions/subid1/resourceGroups/storageRg/providers/Microsoft.Storage/storageAccounts/stAccount")}, - // }, - // }}, - // Subnets: []*armnetwork.Subnet{ - // }, - // }, - // }, - // { - // Name: to.Ptr("testPolicy1"), - // Type: to.Ptr("Microsoft.Network/serviceEndpointPolicies"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/serviceEndpointPolicies/testPolicy2"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.ServiceEndpointPolicyPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("6A7C139D-8B8D-499B-B7CB-4F3F02A8A44F"), - // ServiceEndpointPolicyDefinitions: []*armnetwork.ServiceEndpointPolicyDefinition{ - // { - // Name: to.Ptr("StorageServiceEndpointPolicyDefinition2"), - // Properties: &armnetwork.ServiceEndpointPolicyDefinitionPropertiesFormat{ - // Description: to.Ptr("Storage Service EndpointPolicy Definition"), - // Service: to.Ptr("Microsoft.Storage"), - // ServiceResources: []*string{ - // to.Ptr("/subscriptions/subid1"), - // to.Ptr("/subscriptions/subid1/resourceGroups/storageRg"), - // to.Ptr("/subscriptions/subid1/resourceGroups/storageRg/providers/Microsoft.Storage/storageAccounts/stAccount")}, - // }, - // }}, - // Subnets: []*armnetwork.Subnet{ - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ServiceEndpointPolicyList.json -func ExampleServiceEndpointPoliciesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServiceEndpointPoliciesClient().NewListByResourceGroupPager("rg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ServiceEndpointPolicyListResult = armnetwork.ServiceEndpointPolicyListResult{ - // Value: []*armnetwork.ServiceEndpointPolicy{ - // { - // Name: to.Ptr("testServiceEndpointPolicy"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/serviceEndpointPolicies/testServiceEndpointPolicy"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.ServiceEndpointPolicyPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("6A7C139D-8B8D-499B-B7CB-4F3F02A8A44F"), - // ServiceEndpointPolicyDefinitions: []*armnetwork.ServiceEndpointPolicyDefinition{ - // { - // Name: to.Ptr("StorageServiceEndpointPolicyDefinition"), - // Properties: &armnetwork.ServiceEndpointPolicyDefinitionPropertiesFormat{ - // Description: to.Ptr("Storage Service EndpointPolicy Definition"), - // Service: to.Ptr("Microsoft.Storage"), - // ServiceResources: []*string{ - // to.Ptr("/subscriptions/subid1"), - // to.Ptr("/subscriptions/subid1resourceGroups/storageRg"), - // to.Ptr("/subscriptions/subid1/resourceGroups/storageRg/providers/Microsoft.Storage/storageAccounts/stAccount")}, - // }, - // }}, - // Subnets: []*armnetwork.Subnet{ - // }, - // }, - // }, - // { - // Name: to.Ptr("testServiceEndpointPolicy1"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/serviceEndpointPolicies/testServiceEndpointPolicy1"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.ServiceEndpointPolicyPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("6A7C139D-8B8D-499B-B7CB-4F3F02A8A44F"), - // ServiceEndpointPolicyDefinitions: []*armnetwork.ServiceEndpointPolicyDefinition{ - // { - // Name: to.Ptr("StorageServiceEndpointPolicyDefinition1"), - // Properties: &armnetwork.ServiceEndpointPolicyDefinitionPropertiesFormat{ - // Description: to.Ptr("Storage Service EndpointPolicy Definition"), - // Service: to.Ptr("Microsoft.Storage"), - // ServiceResources: []*string{ - // to.Ptr("/subscriptions/subid1"), - // to.Ptr("/subscriptions/subid1/resourceGroups/storageRg"), - // to.Ptr("/subscriptions/subid1/resourceGroups/storageRg/providers/Microsoft.Storage/storageAccounts/stAccount")}, - // }, - // }}, - // Subnets: []*armnetwork.Subnet{ - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/serviceendpointpolicydefinitions_client.go b/sdk/resourcemanager/network/armnetwork/serviceendpointpolicydefinitions_client.go index 205f0e0c8785..8ffb9b6892ab 100644 --- a/sdk/resourcemanager/network/armnetwork/serviceendpointpolicydefinitions_client.go +++ b/sdk/resourcemanager/network/armnetwork/serviceendpointpolicydefinitions_client.go @@ -47,7 +47,7 @@ func NewServiceEndpointPolicyDefinitionsClient(subscriptionID string, credential // BeginCreateOrUpdate - Creates or updates a service endpoint policy definition in the specified service endpoint policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - serviceEndpointPolicyName - The name of the service endpoint policy. // - serviceEndpointPolicyDefinitionName - The name of the service endpoint policy definition name. @@ -72,7 +72,7 @@ func (client *ServiceEndpointPolicyDefinitionsClient) BeginCreateOrUpdate(ctx co // CreateOrUpdate - Creates or updates a service endpoint policy definition in the specified service endpoint policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *ServiceEndpointPolicyDefinitionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, serviceEndpointPolicyDefinitionName string, serviceEndpointPolicyDefinitions ServiceEndpointPolicyDefinition, options *ServiceEndpointPolicyDefinitionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ServiceEndpointPolicyDefinitionsClient.BeginCreateOrUpdate" @@ -118,7 +118,7 @@ func (client *ServiceEndpointPolicyDefinitionsClient) createOrUpdateCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, serviceEndpointPolicyDefinitions); err != nil { @@ -130,7 +130,7 @@ func (client *ServiceEndpointPolicyDefinitionsClient) createOrUpdateCreateReques // BeginDelete - Deletes the specified ServiceEndpoint policy definitions. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - serviceEndpointPolicyName - The name of the Service Endpoint Policy. // - serviceEndpointPolicyDefinitionName - The name of the service endpoint policy definition. @@ -154,7 +154,7 @@ func (client *ServiceEndpointPolicyDefinitionsClient) BeginDelete(ctx context.Co // Delete - Deletes the specified ServiceEndpoint policy definitions. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *ServiceEndpointPolicyDefinitionsClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, serviceEndpointPolicyDefinitionName string, options *ServiceEndpointPolicyDefinitionsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ServiceEndpointPolicyDefinitionsClient.BeginDelete" @@ -200,7 +200,7 @@ func (client *ServiceEndpointPolicyDefinitionsClient) deleteCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -209,7 +209,7 @@ func (client *ServiceEndpointPolicyDefinitionsClient) deleteCreateRequest(ctx co // Get - Get the specified service endpoint policy definitions from service endpoint policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - serviceEndpointPolicyName - The name of the service endpoint policy name. // - serviceEndpointPolicyDefinitionName - The name of the service endpoint policy definition name. @@ -261,7 +261,7 @@ func (client *ServiceEndpointPolicyDefinitionsClient) getCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -278,7 +278,7 @@ func (client *ServiceEndpointPolicyDefinitionsClient) getHandleResponse(resp *ht // NewListByResourceGroupPager - Gets all service endpoint policy definitions in a service end point policy. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - serviceEndpointPolicyName - The name of the service endpoint policy name. // - options - ServiceEndpointPolicyDefinitionsClientListByResourceGroupOptions contains the optional parameters for the ServiceEndpointPolicyDefinitionsClient.NewListByResourceGroupPager @@ -333,7 +333,7 @@ func (client *ServiceEndpointPolicyDefinitionsClient) listByResourceGroupCreateR return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/serviceendpointpolicydefinitions_client_example_test.go b/sdk/resourcemanager/network/armnetwork/serviceendpointpolicydefinitions_client_example_test.go deleted file mode 100644 index 0d91982fe40b..000000000000 --- a/sdk/resourcemanager/network/armnetwork/serviceendpointpolicydefinitions_client_example_test.go +++ /dev/null @@ -1,157 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ServiceEndpointPolicyDefinitionDelete.json -func ExampleServiceEndpointPolicyDefinitionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServiceEndpointPolicyDefinitionsClient().BeginDelete(ctx, "rg1", "testPolicy", "testDefinition", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ServiceEndpointPolicyDefinitionGet.json -func ExampleServiceEndpointPolicyDefinitionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServiceEndpointPolicyDefinitionsClient().Get(ctx, "rg1", "testPolicy", "testDefinition", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServiceEndpointPolicyDefinition = armnetwork.ServiceEndpointPolicyDefinition{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/serviceEndpointPolicies/testPolicy/serviceEndpointPolicyDefinitions/testDefinition"), - // Name: to.Ptr("testDefinition"), - // Properties: &armnetwork.ServiceEndpointPolicyDefinitionPropertiesFormat{ - // Description: to.Ptr("Storage Service EndpointPolicy Definition"), - // Service: to.Ptr("Microsoft.Storage"), - // ServiceResources: []*string{ - // to.Ptr("/subscriptions/subid1"), - // to.Ptr("/subscriptions/subid1/resourceGroups/storageRg"), - // to.Ptr("/subscriptions/subid1/resourceGroups/storageRg/providers/Microsoft.Storage/storageAccounts/stAccount")}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ServiceEndpointPolicyDefinitionCreate.json -func ExampleServiceEndpointPolicyDefinitionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServiceEndpointPolicyDefinitionsClient().BeginCreateOrUpdate(ctx, "rg1", "testPolicy", "testDefinition", armnetwork.ServiceEndpointPolicyDefinition{ - Properties: &armnetwork.ServiceEndpointPolicyDefinitionPropertiesFormat{ - Description: to.Ptr("Storage Service EndpointPolicy Definition"), - Service: to.Ptr("Microsoft.Storage"), - ServiceResources: []*string{ - to.Ptr("/subscriptions/subid1"), - to.Ptr("/subscriptions/subid1/resourceGroups/storageRg"), - to.Ptr("/subscriptions/subid1/resourceGroups/storageRg/providers/Microsoft.Storage/storageAccounts/stAccount")}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServiceEndpointPolicyDefinition = armnetwork.ServiceEndpointPolicyDefinition{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/serviceEndpointPolicies/testPolicy/serviceEndpointPolicyDefinitions/testDefinition"), - // Name: to.Ptr("testDefinition"), - // Properties: &armnetwork.ServiceEndpointPolicyDefinitionPropertiesFormat{ - // Description: to.Ptr("Storage Service EndpointPolicy Definition"), - // Service: to.Ptr("Microsoft.Storage"), - // ServiceResources: []*string{ - // to.Ptr("/subscriptions/subid1"), - // to.Ptr("/subscriptions/subid1/resourceGroups/storageRg"), - // to.Ptr("/subscriptions/subid1/resourceGroups/storageRg/providers/Microsoft.Storage/storageAccounts/stAccount")}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ServiceEndpointPolicyDefinitionList.json -func ExampleServiceEndpointPolicyDefinitionsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServiceEndpointPolicyDefinitionsClient().NewListByResourceGroupPager("rg1", "testPolicy", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ServiceEndpointPolicyDefinitionListResult = armnetwork.ServiceEndpointPolicyDefinitionListResult{ - // Value: []*armnetwork.ServiceEndpointPolicyDefinition{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/serviceEndpointPolicies/testPolicy/serviceEndpointPolicyDefinitions/testDef"), - // Name: to.Ptr("testDef"), - // Properties: &armnetwork.ServiceEndpointPolicyDefinitionPropertiesFormat{ - // Description: to.Ptr("Storage Service EndpointPolicy Definition"), - // Service: to.Ptr("Microsoft.Storage"), - // ServiceResources: []*string{ - // to.Ptr("/subscriptions/subid1"), - // to.Ptr("/subscriptions/subid1/resourceGroups/storageRg"), - // to.Ptr("/subscriptions/subid1/resourceGroups/storageRg/providers/Microsoft.Storage/storageAccounts/stAccount")}, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/servicetaginformation_client.go b/sdk/resourcemanager/network/armnetwork/servicetaginformation_client.go index 044f1e1dac2e..25b3bd96199c 100644 --- a/sdk/resourcemanager/network/armnetwork/servicetaginformation_client.go +++ b/sdk/resourcemanager/network/armnetwork/servicetaginformation_client.go @@ -47,7 +47,7 @@ func NewServiceTagInformationClient(subscriptionID string, credential azcore.Tok // NewListPager - Gets a list of service tag information resources with pagination. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - location - The location that will be used as a reference for cloud (not as a filter based on location, you will get the // list of service tags with prefix details across all regions but limited to the cloud that // your subscription belongs to). @@ -99,7 +99,7 @@ func (client *ServiceTagInformationClient) listCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") if options != nil && options.NoAddressPrefixes != nil { reqQP.Set("noAddressPrefixes", strconv.FormatBool(*options.NoAddressPrefixes)) } diff --git a/sdk/resourcemanager/network/armnetwork/servicetaginformation_client_example_test.go b/sdk/resourcemanager/network/armnetwork/servicetaginformation_client_example_test.go deleted file mode 100644 index 15c8720b3336..000000000000 --- a/sdk/resourcemanager/network/armnetwork/servicetaginformation_client_example_test.go +++ /dev/null @@ -1,169 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ServiceTagInformationListResult.json -func ExampleServiceTagInformationClient_NewListPager_getListOfServiceTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServiceTagInformationClient().NewListPager("westeurope", &armnetwork.ServiceTagInformationClientListOptions{NoAddressPrefixes: nil, - TagName: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ServiceTagInformationListResult = armnetwork.ServiceTagInformationListResult{ - // Value: []*armnetwork.ServiceTagInformation{ - // { - // Name: to.Ptr("ApiManagement"), - // ID: to.Ptr("ApiManagement"), - // Properties: &armnetwork.ServiceTagInformationPropertiesFormat{ - // AddressPrefixes: []*string{ - // to.Ptr("13.64.39.16/32"), - // to.Ptr("40.74.146.80/31"), - // to.Ptr("40.74.147.32/28")}, - // ChangeNumber: to.Ptr("7"), - // Region: to.Ptr(""), - // SystemService: to.Ptr("AzureApiManagement"), - // }, - // }, - // { - // Name: to.Ptr("ApiManagement.AustraliaCentral"), - // ID: to.Ptr("ApiManagement.AustraliaCentral"), - // Properties: &armnetwork.ServiceTagInformationPropertiesFormat{ - // AddressPrefixes: []*string{ - // to.Ptr("20.36.106.68/31"), - // to.Ptr("20.36.107.176/28")}, - // ChangeNumber: to.Ptr("2"), - // Region: to.Ptr("australiacentral"), - // SystemService: to.Ptr("AzureApiManagement"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ServiceTagInformationListResultWithNoAddressPrefixes.json -func ExampleServiceTagInformationClient_NewListPager_getListOfServiceTagsWithNoAddressPrefixes() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServiceTagInformationClient().NewListPager("westeurope", &armnetwork.ServiceTagInformationClientListOptions{NoAddressPrefixes: to.Ptr(true), - TagName: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ServiceTagInformationListResult = armnetwork.ServiceTagInformationListResult{ - // Value: []*armnetwork.ServiceTagInformation{ - // { - // Name: to.Ptr("ApiManagement"), - // ID: to.Ptr("ApiManagement"), - // Properties: &armnetwork.ServiceTagInformationPropertiesFormat{ - // AddressPrefixes: []*string{ - // }, - // ChangeNumber: to.Ptr("7"), - // Region: to.Ptr(""), - // SystemService: to.Ptr("AzureApiManagement"), - // }, - // }, - // { - // Name: to.Ptr("ApiManagement.AustraliaCentral"), - // ID: to.Ptr("ApiManagement.AustraliaCentral"), - // Properties: &armnetwork.ServiceTagInformationPropertiesFormat{ - // AddressPrefixes: []*string{ - // }, - // ChangeNumber: to.Ptr("2"), - // Region: to.Ptr("australiacentral"), - // SystemService: to.Ptr("AzureApiManagement"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ServiceTagInformationListResultWithTagname.json -func ExampleServiceTagInformationClient_NewListPager_getListOfServiceTagsWithTagName() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServiceTagInformationClient().NewListPager("westeurope", &armnetwork.ServiceTagInformationClientListOptions{NoAddressPrefixes: nil, - TagName: to.Ptr("ApiManagement"), - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ServiceTagInformationListResult = armnetwork.ServiceTagInformationListResult{ - // Value: []*armnetwork.ServiceTagInformation{ - // { - // Name: to.Ptr("ApiManagement"), - // ID: to.Ptr("ApiManagement"), - // Properties: &armnetwork.ServiceTagInformationPropertiesFormat{ - // AddressPrefixes: []*string{ - // to.Ptr("13.64.39.16/32"), - // to.Ptr("40.74.146.80/31"), - // to.Ptr("40.74.147.32/28")}, - // ChangeNumber: to.Ptr("7"), - // Region: to.Ptr(""), - // SystemService: to.Ptr("AzureApiManagement"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/servicetags_client.go b/sdk/resourcemanager/network/armnetwork/servicetags_client.go index 5c2deefdb9be..80cd4b296987 100644 --- a/sdk/resourcemanager/network/armnetwork/servicetags_client.go +++ b/sdk/resourcemanager/network/armnetwork/servicetags_client.go @@ -47,7 +47,7 @@ func NewServiceTagsClient(subscriptionID string, credential azcore.TokenCredenti // List - Gets a list of service tag information resources. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - location - The location that will be used as a reference for version (not as a filter based on location, you will get the // list of service tags with prefix details across all regions but limited to the cloud that // your subscription belongs to). @@ -90,7 +90,7 @@ func (client *ServiceTagsClient) listCreateRequest(ctx context.Context, location return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/servicetags_client_example_test.go b/sdk/resourcemanager/network/armnetwork/servicetags_client_example_test.go deleted file mode 100644 index 83630c4fd48e..000000000000 --- a/sdk/resourcemanager/network/armnetwork/servicetags_client_example_test.go +++ /dev/null @@ -1,109 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/ServiceTagsList.json -func ExampleServiceTagsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServiceTagsClient().List(ctx, "westcentralus", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServiceTagsListResult = armnetwork.ServiceTagsListResult{ - // Name: to.Ptr("public"), - // Type: to.Ptr("Microsoft.Network/serviceTags"), - // ChangeNumber: to.Ptr("63"), - // Cloud: to.Ptr("Public"), - // ID: to.Ptr("/subscriptions/subId/providers/Microsoft.Network/serviceTags/public"), - // Values: []*armnetwork.ServiceTagInformation{ - // { - // Name: to.Ptr("ApiManagement"), - // ID: to.Ptr("ApiManagement"), - // Properties: &armnetwork.ServiceTagInformationPropertiesFormat{ - // AddressPrefixes: []*string{ - // to.Ptr("13.64.39.16/32"), - // to.Ptr("40.74.146.80/31"), - // to.Ptr("40.74.147.32/28")}, - // ChangeNumber: to.Ptr("7"), - // Region: to.Ptr(""), - // SystemService: to.Ptr("AzureApiManagement"), - // }, - // }, - // { - // Name: to.Ptr("ApiManagement.AustraliaCentral"), - // ID: to.Ptr("ApiManagement.AustraliaCentral"), - // Properties: &armnetwork.ServiceTagInformationPropertiesFormat{ - // AddressPrefixes: []*string{ - // to.Ptr("20.36.106.68/31"), - // to.Ptr("20.36.107.176/28")}, - // ChangeNumber: to.Ptr("2"), - // Region: to.Ptr("australiacentral"), - // SystemService: to.Ptr("AzureApiManagement"), - // }, - // }, - // { - // Name: to.Ptr("AppService"), - // ID: to.Ptr("AppService"), - // Properties: &armnetwork.ServiceTagInformationPropertiesFormat{ - // AddressPrefixes: []*string{ - // to.Ptr("13.64.73.110/32"), - // to.Ptr("191.235.208.12/32"), - // to.Ptr("191.235.215.184/32")}, - // ChangeNumber: to.Ptr("13"), - // Region: to.Ptr(""), - // SystemService: to.Ptr("AzureAppService"), - // }, - // }, - // { - // Name: to.Ptr("ServiceBus"), - // ID: to.Ptr("ServiceBus"), - // Properties: &armnetwork.ServiceTagInformationPropertiesFormat{ - // AddressPrefixes: []*string{ - // to.Ptr("23.98.82.96/29"), - // to.Ptr("40.68.127.68/32"), - // to.Ptr("40.70.146.64/29")}, - // ChangeNumber: to.Ptr("10"), - // Region: to.Ptr(""), - // SystemService: to.Ptr("AzureServiceBus"), - // }, - // }, - // { - // Name: to.Ptr("ServiceBus.EastUS2"), - // ID: to.Ptr("ServiceBus.EastUS2"), - // Properties: &armnetwork.ServiceTagInformationPropertiesFormat{ - // AddressPrefixes: []*string{ - // to.Ptr("13.68.110.36/32"), - // to.Ptr("40.70.146.64/29")}, - // ChangeNumber: to.Ptr("1"), - // Region: to.Ptr("eastus2"), - // SystemService: to.Ptr("AzureServiceBus"), - // }, - // }}, - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/staticmembers_client.go b/sdk/resourcemanager/network/armnetwork/staticmembers_client.go index bd90fb69ba3d..0d3c1e0e9d7e 100644 --- a/sdk/resourcemanager/network/armnetwork/staticmembers_client.go +++ b/sdk/resourcemanager/network/armnetwork/staticmembers_client.go @@ -48,7 +48,7 @@ func NewStaticMembersClient(subscriptionID string, credential azcore.TokenCreden // CreateOrUpdate - Creates or updates a static member. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - networkGroupName - The name of the network group. @@ -106,7 +106,7 @@ func (client *StaticMembersClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -127,7 +127,7 @@ func (client *StaticMembersClient) createOrUpdateHandleResponse(resp *http.Respo // Delete - Deletes a static member. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - networkGroupName - The name of the network group. @@ -182,7 +182,7 @@ func (client *StaticMembersClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -191,7 +191,7 @@ func (client *StaticMembersClient) deleteCreateRequest(ctx context.Context, reso // Get - Gets the specified static member. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - networkGroupName - The name of the network group. @@ -247,7 +247,7 @@ func (client *StaticMembersClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -264,7 +264,7 @@ func (client *StaticMembersClient) getHandleResponse(resp *http.Response) (Stati // NewListPager - Lists the specified static member. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - networkGroupName - The name of the network group. @@ -323,7 +323,7 @@ func (client *StaticMembersClient) listCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } diff --git a/sdk/resourcemanager/network/armnetwork/staticmembers_client_example_test.go b/sdk/resourcemanager/network/armnetwork/staticmembers_client_example_test.go deleted file mode 100644 index b107be2c96e1..000000000000 --- a/sdk/resourcemanager/network/armnetwork/staticmembers_client_example_test.go +++ /dev/null @@ -1,162 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkManagerStaticMemberGet.json -func ExampleStaticMembersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewStaticMembersClient().Get(ctx, "rg1", "testNetworkManager", "testNetworkGroup", "testStaticMember", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.StaticMember = armnetwork.StaticMember{ - // Name: to.Ptr("testStaticMember"), - // Type: to.Ptr("Microsoft.Network/networkManagers/networkGroups/staticMembers"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroup/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/testNetworkGroup/staticMembers/testStaticMember"), - // Properties: &armnetwork.StaticMemberProperties{ - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroup/rg1/providers/Microsoft.Network/virtualnetworks/vnet1"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkManagerStaticMemberPut.json -func ExampleStaticMembersClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewStaticMembersClient().CreateOrUpdate(ctx, "rg1", "testNetworkManager", "testNetworkGroup", "testStaticMember", armnetwork.StaticMember{ - Properties: &armnetwork.StaticMemberProperties{ - ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroup/rg1/providers/Microsoft.Network/virtualnetworks/vnet1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.StaticMember = armnetwork.StaticMember{ - // Name: to.Ptr("testStaticMember"), - // Type: to.Ptr("Microsoft.Network/networkManagers/networkGroups/staticMembers"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroup/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/testNetworkGroup/staticMembers/testStaticMember"), - // Properties: &armnetwork.StaticMemberProperties{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Region: to.Ptr("useast2"), - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroup/rg1/providers/Microsoft.Network/virtualnetworks/vnet1"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkManagerStaticMemberDelete.json -func ExampleStaticMembersClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewStaticMembersClient().Delete(ctx, "SampleRG", "TestNM", "testNetworkGroup", "testStaticMember", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkManagerStaticMemberList.json -func ExampleStaticMembersClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewStaticMembersClient().NewListPager("rg1", "testNetworkManager", "testNetworkGroup", &armnetwork.StaticMembersClientListOptions{Top: nil, - SkipToken: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.StaticMemberListResult = armnetwork.StaticMemberListResult{ - // Value: []*armnetwork.StaticMember{ - // { - // Name: to.Ptr("testStaticMember"), - // Type: to.Ptr("Microsoft.Network/networkManagers/networkGroups/staticMembers"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroup/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/testNetworkGroup/staticMembers/testStaticMember"), - // Properties: &armnetwork.StaticMemberProperties{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Region: to.Ptr("useast2"), - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroup/rg1/providers/Microsoft.Network/virtualnetworks/vnet1"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/subnets_client.go b/sdk/resourcemanager/network/armnetwork/subnets_client.go index bde4ca0a37c8..45b759808edc 100644 --- a/sdk/resourcemanager/network/armnetwork/subnets_client.go +++ b/sdk/resourcemanager/network/armnetwork/subnets_client.go @@ -47,7 +47,7 @@ func NewSubnetsClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreateOrUpdate - Creates or updates a subnet in the specified virtual network. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkName - The name of the virtual network. // - subnetName - The name of the subnet. @@ -72,7 +72,7 @@ func (client *SubnetsClient) BeginCreateOrUpdate(ctx context.Context, resourceGr // CreateOrUpdate - Creates or updates a subnet in the specified virtual network. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *SubnetsClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, subnetParameters Subnet, options *SubnetsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "SubnetsClient.BeginCreateOrUpdate" @@ -118,7 +118,7 @@ func (client *SubnetsClient) createOrUpdateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, subnetParameters); err != nil { @@ -130,7 +130,7 @@ func (client *SubnetsClient) createOrUpdateCreateRequest(ctx context.Context, re // BeginDelete - Deletes the specified subnet. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkName - The name of the virtual network. // - subnetName - The name of the subnet. @@ -153,7 +153,7 @@ func (client *SubnetsClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Deletes the specified subnet. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *SubnetsClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, options *SubnetsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "SubnetsClient.BeginDelete" @@ -199,7 +199,7 @@ func (client *SubnetsClient) deleteCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -208,7 +208,7 @@ func (client *SubnetsClient) deleteCreateRequest(ctx context.Context, resourceGr // Get - Gets the specified subnet by virtual network and resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkName - The name of the virtual network. // - subnetName - The name of the subnet. @@ -259,7 +259,7 @@ func (client *SubnetsClient) getCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } @@ -279,7 +279,7 @@ func (client *SubnetsClient) getHandleResponse(resp *http.Response) (SubnetsClie // NewListPager - Gets all subnets in a virtual network. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkName - The name of the virtual network. // - options - SubnetsClientListOptions contains the optional parameters for the SubnetsClient.NewListPager method. @@ -333,7 +333,7 @@ func (client *SubnetsClient) listCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -351,7 +351,7 @@ func (client *SubnetsClient) listHandleResponse(resp *http.Response) (SubnetsCli // BeginPrepareNetworkPolicies - Prepares a subnet by applying network intent policies. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkName - The name of the virtual network. // - subnetName - The name of the subnet. @@ -376,7 +376,7 @@ func (client *SubnetsClient) BeginPrepareNetworkPolicies(ctx context.Context, re // PrepareNetworkPolicies - Prepares a subnet by applying network intent policies. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *SubnetsClient) prepareNetworkPolicies(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, prepareNetworkPoliciesRequestParameters PrepareNetworkPoliciesRequest, options *SubnetsClientBeginPrepareNetworkPoliciesOptions) (*http.Response, error) { var err error const operationName = "SubnetsClient.BeginPrepareNetworkPolicies" @@ -422,7 +422,7 @@ func (client *SubnetsClient) prepareNetworkPoliciesCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, prepareNetworkPoliciesRequestParameters); err != nil { @@ -434,7 +434,7 @@ func (client *SubnetsClient) prepareNetworkPoliciesCreateRequest(ctx context.Con // BeginUnprepareNetworkPolicies - Unprepares a subnet by removing network intent policies. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkName - The name of the virtual network. // - subnetName - The name of the subnet. @@ -459,7 +459,7 @@ func (client *SubnetsClient) BeginUnprepareNetworkPolicies(ctx context.Context, // UnprepareNetworkPolicies - Unprepares a subnet by removing network intent policies. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *SubnetsClient) unprepareNetworkPolicies(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, unprepareNetworkPoliciesRequestParameters UnprepareNetworkPoliciesRequest, options *SubnetsClientBeginUnprepareNetworkPoliciesOptions) (*http.Response, error) { var err error const operationName = "SubnetsClient.BeginUnprepareNetworkPolicies" @@ -505,7 +505,7 @@ func (client *SubnetsClient) unprepareNetworkPoliciesCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, unprepareNetworkPoliciesRequestParameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/subnets_client_example_test.go b/sdk/resourcemanager/network/armnetwork/subnets_client_example_test.go deleted file mode 100644 index c9e6b6fc4b74..000000000000 --- a/sdk/resourcemanager/network/armnetwork/subnets_client_example_test.go +++ /dev/null @@ -1,330 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/SubnetDelete.json -func ExampleSubnetsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSubnetsClient().BeginDelete(ctx, "subnet-test", "vnetname", "subnet1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/SubnetGet.json -func ExampleSubnetsClient_Get_getSubnet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSubnetsClient().Get(ctx, "subnet-test", "vnetname", "subnet1", &armnetwork.SubnetsClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Subnet = armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/subnet-test/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/subnet1"), - // Name: to.Ptr("subnet1"), - // Properties: &armnetwork.SubnetPropertiesFormat{ - // AddressPrefix: to.Ptr("10.0.0.0/16"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/SubnetGetWithDelegation.json -func ExampleSubnetsClient_Get_getSubnetWithADelegation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSubnetsClient().Get(ctx, "subnet-test", "vnetname", "subnet1", &armnetwork.SubnetsClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Subnet = armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/subnet-test/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/subnet1"), - // Name: to.Ptr("subnet1"), - // Properties: &armnetwork.SubnetPropertiesFormat{ - // AddressPrefix: to.Ptr("10.0.0.0/16"), - // Delegations: []*armnetwork.Delegation{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1/delegations/myDelegation"), - // Name: to.Ptr("myDelegation"), - // Properties: &armnetwork.ServiceDelegationPropertiesFormat{ - // Actions: []*string{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ServiceName: to.Ptr("Microsoft.Provider/resourceType"), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Purpose: to.Ptr(""), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/SubnetCreate.json -func ExampleSubnetsClient_BeginCreateOrUpdate_createSubnet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSubnetsClient().BeginCreateOrUpdate(ctx, "subnet-test", "vnetname", "subnet1", armnetwork.Subnet{ - Properties: &armnetwork.SubnetPropertiesFormat{ - AddressPrefix: to.Ptr("10.0.0.0/16"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Subnet = armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/subnet-test/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/subnet1"), - // Name: to.Ptr("subnet1"), - // Properties: &armnetwork.SubnetPropertiesFormat{ - // AddressPrefix: to.Ptr("10.0.0.0/16"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/SubnetCreateWithDelegation.json -func ExampleSubnetsClient_BeginCreateOrUpdate_createSubnetWithADelegation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSubnetsClient().BeginCreateOrUpdate(ctx, "subnet-test", "vnetname", "subnet1", armnetwork.Subnet{ - Properties: &armnetwork.SubnetPropertiesFormat{ - AddressPrefix: to.Ptr("10.0.0.0/16"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Subnet = armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/subnet-test/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/subnet1"), - // Name: to.Ptr("subnet1"), - // Properties: &armnetwork.SubnetPropertiesFormat{ - // AddressPrefix: to.Ptr("10.0.0.0/16"), - // Delegations: []*armnetwork.Delegation{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/subnet-test/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/subnet1/delegations/myDelegation"), - // Name: to.Ptr("myDelegation"), - // Properties: &armnetwork.ServiceDelegationPropertiesFormat{ - // Actions: []*string{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ServiceName: to.Ptr("Microsoft.Provider/resourceType"), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Purpose: to.Ptr(""), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/SubnetCreateServiceEndpoint.json -func ExampleSubnetsClient_BeginCreateOrUpdate_createSubnetWithServiceEndpoints() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSubnetsClient().BeginCreateOrUpdate(ctx, "subnet-test", "vnetname", "subnet1", armnetwork.Subnet{ - Properties: &armnetwork.SubnetPropertiesFormat{ - AddressPrefix: to.Ptr("10.0.0.0/16"), - ServiceEndpoints: []*armnetwork.ServiceEndpointPropertiesFormat{ - { - Service: to.Ptr("Microsoft.Storage"), - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Subnet = armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/subnet-test/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/subnet1"), - // Name: to.Ptr("subnet1"), - // Properties: &armnetwork.SubnetPropertiesFormat{ - // AddressPrefix: to.Ptr("10.0.0.0/16"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ServiceEndpoints: []*armnetwork.ServiceEndpointPropertiesFormat{ - // { - // Locations: []*string{ - // to.Ptr("eastus2(stage)"), - // to.Ptr("usnorth(stage)")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Service: to.Ptr("Microsoft.Storage"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/SubnetPrepareNetworkPolicies.json -func ExampleSubnetsClient_BeginPrepareNetworkPolicies() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSubnetsClient().BeginPrepareNetworkPolicies(ctx, "rg1", "test-vnet", "subnet1", armnetwork.PrepareNetworkPoliciesRequest{ - ServiceName: to.Ptr("Microsoft.Sql/managedInstances"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/SubnetUnprepareNetworkPolicies.json -func ExampleSubnetsClient_BeginUnprepareNetworkPolicies() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSubnetsClient().BeginUnprepareNetworkPolicies(ctx, "rg1", "test-vnet", "subnet1", armnetwork.UnprepareNetworkPoliciesRequest{ - ServiceName: to.Ptr("Microsoft.Sql/managedInstances"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/SubnetList.json -func ExampleSubnetsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSubnetsClient().NewListPager("subnet-test", "vnetname", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SubnetListResult = armnetwork.SubnetListResult{ - // Value: []*armnetwork.Subnet{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/subnet-test/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/subnet1"), - // Name: to.Ptr("subnet1"), - // Properties: &armnetwork.SubnetPropertiesFormat{ - // AddressPrefix: to.Ptr("10.0.0.0/16"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/subnet-test/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/subnet2"), - // Name: to.Ptr("subnet2"), - // Properties: &armnetwork.SubnetPropertiesFormat{ - // AddressPrefix: to.Ptr("10.0.0.0/16"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/subscriptionnetworkmanagerconnections_client.go b/sdk/resourcemanager/network/armnetwork/subscriptionnetworkmanagerconnections_client.go index 900d96d90425..fcbd03eb5cfc 100644 --- a/sdk/resourcemanager/network/armnetwork/subscriptionnetworkmanagerconnections_client.go +++ b/sdk/resourcemanager/network/armnetwork/subscriptionnetworkmanagerconnections_client.go @@ -48,7 +48,7 @@ func NewSubscriptionNetworkManagerConnectionsClient(subscriptionID string, crede // CreateOrUpdate - Create a network manager connection on this subscription. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - networkManagerConnectionName - Name for the network manager connection. // - parameters - Network manager connection to be created/updated. // - options - SubscriptionNetworkManagerConnectionsClientCreateOrUpdateOptions contains the optional parameters for the SubscriptionNetworkManagerConnectionsClient.CreateOrUpdate @@ -91,7 +91,7 @@ func (client *SubscriptionNetworkManagerConnectionsClient) createOrUpdateCreateR return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -112,7 +112,7 @@ func (client *SubscriptionNetworkManagerConnectionsClient) createOrUpdateHandleR // Delete - Delete specified connection created by this subscription. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - networkManagerConnectionName - Name for the network manager connection. // - options - SubscriptionNetworkManagerConnectionsClientDeleteOptions contains the optional parameters for the SubscriptionNetworkManagerConnectionsClient.Delete // method. @@ -153,7 +153,7 @@ func (client *SubscriptionNetworkManagerConnectionsClient) deleteCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -162,7 +162,7 @@ func (client *SubscriptionNetworkManagerConnectionsClient) deleteCreateRequest(c // Get - Get a specified connection created by this subscription. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - networkManagerConnectionName - Name for the network manager connection. // - options - SubscriptionNetworkManagerConnectionsClientGetOptions contains the optional parameters for the SubscriptionNetworkManagerConnectionsClient.Get // method. @@ -204,7 +204,7 @@ func (client *SubscriptionNetworkManagerConnectionsClient) getCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -221,7 +221,7 @@ func (client *SubscriptionNetworkManagerConnectionsClient) getHandleResponse(res // NewListPager - List all network manager connections created by this subscription. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - options - SubscriptionNetworkManagerConnectionsClientListOptions contains the optional parameters for the SubscriptionNetworkManagerConnectionsClient.NewListPager // method. func (client *SubscriptionNetworkManagerConnectionsClient) NewListPager(options *SubscriptionNetworkManagerConnectionsClientListOptions) *runtime.Pager[SubscriptionNetworkManagerConnectionsClientListResponse] { @@ -266,7 +266,7 @@ func (client *SubscriptionNetworkManagerConnectionsClient) listCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } diff --git a/sdk/resourcemanager/network/armnetwork/subscriptionnetworkmanagerconnections_client_example_test.go b/sdk/resourcemanager/network/armnetwork/subscriptionnetworkmanagerconnections_client_example_test.go deleted file mode 100644 index 08d8d01d32e1..000000000000 --- a/sdk/resourcemanager/network/armnetwork/subscriptionnetworkmanagerconnections_client_example_test.go +++ /dev/null @@ -1,164 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkManagerConnectionSubscriptionPut.json -func ExampleSubscriptionNetworkManagerConnectionsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSubscriptionNetworkManagerConnectionsClient().CreateOrUpdate(ctx, "TestNMConnection", armnetwork.ManagerConnection{ - Properties: &armnetwork.ManagerConnectionProperties{ - NetworkManagerID: to.Ptr("/subscriptions/subscriptionC/resourceGroup/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagerConnection = armnetwork.ManagerConnection{ - // Name: to.Ptr("TestNMConnection"), - // Type: to.Ptr("Microsoft.Network/networkManagerConnections"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/networkManagerConnections/TestNMConnection"), - // Properties: &armnetwork.ManagerConnectionProperties{ - // Description: to.Ptr("This is a network manager connection to testNetworkManager."), - // ConnectionState: to.Ptr(armnetwork.ScopeConnectionStatePending), - // NetworkManagerID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroup/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkManagerConnectionSubscriptionGet.json -func ExampleSubscriptionNetworkManagerConnectionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSubscriptionNetworkManagerConnectionsClient().Get(ctx, "TestNMConnection", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagerConnection = armnetwork.ManagerConnection{ - // Name: to.Ptr("TestNMConnection"), - // Type: to.Ptr("Microsoft.Network/networkManagerConnections"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/networkManagerConnections/TestNMConnection"), - // Properties: &armnetwork.ManagerConnectionProperties{ - // Description: to.Ptr("This is a network manager connection to testNetworkManager."), - // ConnectionState: to.Ptr(armnetwork.ScopeConnectionStatePending), - // NetworkManagerID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroup/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkManagerConnectionSubscriptionDelete.json -func ExampleSubscriptionNetworkManagerConnectionsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewSubscriptionNetworkManagerConnectionsClient().Delete(ctx, "TestNMConnection", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkManagerConnectionSubscriptionList.json -func ExampleSubscriptionNetworkManagerConnectionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSubscriptionNetworkManagerConnectionsClient().NewListPager(&armnetwork.SubscriptionNetworkManagerConnectionsClientListOptions{Top: nil, - SkipToken: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ManagerConnectionListResult = armnetwork.ManagerConnectionListResult{ - // Value: []*armnetwork.ManagerConnection{ - // { - // Name: to.Ptr("TestNMConnection"), - // Type: to.Ptr("Microsoft.Network/networkManagerConnections"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/networkManagerConnections/TestNMConnection"), - // Properties: &armnetwork.ManagerConnectionProperties{ - // Description: to.Ptr("This is a network manager connection to testNetworkManager."), - // ConnectionState: to.Ptr(armnetwork.ScopeConnectionStatePending), - // NetworkManagerID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroup/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // CreatedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // CreatedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/usages_client.go b/sdk/resourcemanager/network/armnetwork/usages_client.go index 83a65e295189..8cc911b584d0 100644 --- a/sdk/resourcemanager/network/armnetwork/usages_client.go +++ b/sdk/resourcemanager/network/armnetwork/usages_client.go @@ -46,7 +46,7 @@ func NewUsagesClient(subscriptionID string, credential azcore.TokenCredential, o // NewListPager - List network usages for a subscription. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - location - The location where resource usage is queried. // - options - UsagesClientListOptions contains the optional parameters for the UsagesClient.NewListPager method. func (client *UsagesClient) NewListPager(location string, options *UsagesClientListOptions) *runtime.Pager[UsagesClientListResponse] { @@ -95,7 +95,7 @@ func (client *UsagesClient) listCreateRequest(ctx context.Context, location stri return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/usages_client_example_test.go b/sdk/resourcemanager/network/armnetwork/usages_client_example_test.go deleted file mode 100644 index ffa5852c2a3f..000000000000 --- a/sdk/resourcemanager/network/armnetwork/usages_client_example_test.go +++ /dev/null @@ -1,644 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/UsageList.json -func ExampleUsagesClient_NewListPager_listUsages() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewUsagesClient().NewListPager("westus", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.UsagesListResult = armnetwork.UsagesListResult{ - // Value: []*armnetwork.Usage{ - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Virtual Networks"), - // Value: to.Ptr("VirtualNetworks"), - // }, - // CurrentValue: to.Ptr[int64](8), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/westus/usages/VirtualNetworks"), - // Limit: to.Ptr[int64](50), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Static Public IP Addresses"), - // Value: to.Ptr("StaticPublicIPAddresses"), - // }, - // CurrentValue: to.Ptr[int64](3), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/westus/usages/StaticPublicIPAddresses"), - // Limit: to.Ptr[int64](20), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Network Security Groups"), - // Value: to.Ptr("NetworkSecurityGroups"), - // }, - // CurrentValue: to.Ptr[int64](1), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/westus/usages/NetworkSecurityGroups"), - // Limit: to.Ptr[int64](100), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Public IP Addresses"), - // Value: to.Ptr("PublicIPAddresses"), - // }, - // CurrentValue: to.Ptr[int64](8), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/westus/usages/PublicIPAddresses"), - // Limit: to.Ptr[int64](60), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Network Interfaces"), - // Value: to.Ptr("NetworkInterfaces"), - // }, - // CurrentValue: to.Ptr[int64](2), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/westus/usages/NetworkInterfaces"), - // Limit: to.Ptr[int64](350), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Load Balancers"), - // Value: to.Ptr("LoadBalancers"), - // }, - // CurrentValue: to.Ptr[int64](2), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/westus/usages/LoadBalancers"), - // Limit: to.Ptr[int64](100), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Application Gateways"), - // Value: to.Ptr("ApplicationGateways"), - // }, - // CurrentValue: to.Ptr[int64](1), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/westus/usages/ApplicationGateways"), - // Limit: to.Ptr[int64](50), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Route Tables"), - // Value: to.Ptr("RouteTables"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/westus/usages/RouteTables"), - // Limit: to.Ptr[int64](100), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Route Filters"), - // Value: to.Ptr("RouteFilters"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/westus/usages/RouteFilters"), - // Limit: to.Ptr[int64](1000), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Network Watchers"), - // Value: to.Ptr("NetworkWatchers"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/westus/usages/NetworkWatchers"), - // Limit: to.Ptr[int64](1), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Packet Captures"), - // Value: to.Ptr("PacketCaptures"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/westus/usages/PacketCaptures"), - // Limit: to.Ptr[int64](10), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("DNS servers per Virtual Network"), - // Value: to.Ptr("DnsServersPerVirtualNetwork"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/westus/usages/DnsServersPerVirtualNetwork"), - // Limit: to.Ptr[int64](9), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Subnets per Virtual Network"), - // Value: to.Ptr("SubnetsPerVirtualNetwork"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/westus/usages/SubnetsPerVirtualNetwork"), - // Limit: to.Ptr[int64](1000), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("IP Configurations per Virtual Network"), - // Value: to.Ptr("IPConfigurationsPerVirtualNetwork"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/westus/usages/IPConfigurationsPerVirtualNetwork"), - // Limit: to.Ptr[int64](4096), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Peerings per Virtual Network"), - // Value: to.Ptr("PeeringsPerVirtualNetwork"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/westus/usages/PeeringsPerVirtualNetwork"), - // Limit: to.Ptr[int64](10), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Security rules per Network Security Group"), - // Value: to.Ptr("SecurityRulesPerNetworkSecurityGroup"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/westus/usages/SecurityRulesPerNetworkSecurityGroup"), - // Limit: to.Ptr[int64](200), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Security rules addresses or ports per Network Security Group"), - // Value: to.Ptr("SecurityRuleAddressesOrPortsPerNetworkSecurityGroup"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/westus/usages/SecurityRuleAddressesOrPortsPerNetworkSecurityGroup"), - // Limit: to.Ptr[int64](2000), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Inbound Rules per Load Balancer"), - // Value: to.Ptr("InboundRulesPerLoadBalancer"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/westus/usages/InboundRulesPerLoadBalancer"), - // Limit: to.Ptr[int64](150), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Frontend IP Configurations per Load Balancer"), - // Value: to.Ptr("FrontendIPConfigurationPerLoadBalancer"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/westus/usages/FrontendIPConfigurationPerLoadBalancer"), - // Limit: to.Ptr[int64](10), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Outbound Rules per Load Balancer"), - // Value: to.Ptr("outboundRulesPerLoadBalancer"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/westus/usages/outboundRulesPerLoadBalancer"), - // Limit: to.Ptr[int64](5), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Routes per Route Table"), - // Value: to.Ptr("RoutesPerRouteTable"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/westus/usages/RoutesPerRouteTable"), - // Limit: to.Ptr[int64](100), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Secondary IP Configurations per Network Interface"), - // Value: to.Ptr("SecondaryIPConfigurationsPerNetworkInterface"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/westus/usages/SecondaryIPConfigurationsPerNetworkInterface"), - // Limit: to.Ptr[int64](256), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Inbound rules per Network Interface"), - // Value: to.Ptr("InboundRulesPerNetworkInterface"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/westus/usages/InboundRulesPerNetworkInterface"), - // Limit: to.Ptr[int64](500), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Route filter rules per Route Filter"), - // Value: to.Ptr("RouteFilterRulesPerRouteFilter"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/westus/usages/RouteFilterRulesPerRouteFilter"), - // Limit: to.Ptr[int64](1), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Route filters per Express route BGP Peering"), - // Value: to.Ptr("RouteFiltersPerExpressRouteBgpPeering"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/westus/usages/RouteFiltersPerExpressRouteBgpPeering"), - // Limit: to.Ptr[int64](1), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/UsageListSpacedLocation.json -func ExampleUsagesClient_NewListPager_listUsagesSpacedLocation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewUsagesClient().NewListPager("West US", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.UsagesListResult = armnetwork.UsagesListResult{ - // Value: []*armnetwork.Usage{ - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Virtual Networks"), - // Value: to.Ptr("VirtualNetworks"), - // }, - // CurrentValue: to.Ptr[int64](12), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/West US/usages/VirtualNetworks"), - // Limit: to.Ptr[int64](50), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Static Public IP Addresses"), - // Value: to.Ptr("StaticPublicIPAddresses"), - // }, - // CurrentValue: to.Ptr[int64](1), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/West US/usages/StaticPublicIPAddresses"), - // Limit: to.Ptr[int64](20), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Network Security Groups"), - // Value: to.Ptr("NetworkSecurityGroups"), - // }, - // CurrentValue: to.Ptr[int64](3), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/West US/usages/NetworkSecurityGroups"), - // Limit: to.Ptr[int64](100), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Public IP Addresses"), - // Value: to.Ptr("PublicIPAddresses"), - // }, - // CurrentValue: to.Ptr[int64](12), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/West US/usages/PublicIPAddresses"), - // Limit: to.Ptr[int64](60), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Public Ip Prefixes"), - // Value: to.Ptr("PublicIpPrefixes"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/West US/usages/PublicIpPrefixes"), - // Limit: to.Ptr[int64](2147483647), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Network Interfaces"), - // Value: to.Ptr("NetworkInterfaces"), - // }, - // CurrentValue: to.Ptr[int64](2), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/West US/usages/NetworkInterfaces"), - // Limit: to.Ptr[int64](24000), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Load Balancers"), - // Value: to.Ptr("LoadBalancers"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/West US/usages/LoadBalancers"), - // Limit: to.Ptr[int64](100), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Application Gateways"), - // Value: to.Ptr("ApplicationGateways"), - // }, - // CurrentValue: to.Ptr[int64](3), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/West US/usages/ApplicationGateways"), - // Limit: to.Ptr[int64](50), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Route Tables"), - // Value: to.Ptr("RouteTables"), - // }, - // CurrentValue: to.Ptr[int64](5), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/West US/usages/RouteTables"), - // Limit: to.Ptr[int64](100), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Route Filters"), - // Value: to.Ptr("RouteFilters"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/West US/usages/RouteFilters"), - // Limit: to.Ptr[int64](1000), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Network Watchers"), - // Value: to.Ptr("NetworkWatchers"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/West US/usages/NetworkWatchers"), - // Limit: to.Ptr[int64](1), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Packet Captures"), - // Value: to.Ptr("PacketCaptures"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/West US/usages/PacketCaptures"), - // Limit: to.Ptr[int64](100), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Application Security Groups."), - // Value: to.Ptr("ApplicationSecurityGroups"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/West US/usages/ApplicationSecurityGroups"), - // Limit: to.Ptr[int64](500), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("DDoS Protection Plans."), - // Value: to.Ptr("DdosProtectionPlans"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/West US/usages/DdosProtectionPlans"), - // Limit: to.Ptr[int64](1), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Service Endpoint Policies"), - // Value: to.Ptr("ServiceEndpointPolicies"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/West US/usages/ServiceEndpointPolicies"), - // Limit: to.Ptr[int64](200), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Network Intent Policies"), - // Value: to.Ptr("NetworkIntentPolicies"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/West US/usages/NetworkIntentPolicies"), - // Limit: to.Ptr[int64](200), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("DNS servers per Virtual Network"), - // Value: to.Ptr("DnsServersPerVirtualNetwork"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/West US/usages/DnsServersPerVirtualNetwork"), - // Limit: to.Ptr[int64](9), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Subnets per Virtual Network"), - // Value: to.Ptr("SubnetsPerVirtualNetwork"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/West US/usages/SubnetsPerVirtualNetwork"), - // Limit: to.Ptr[int64](1000), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("IP Configurations per Virtual Network"), - // Value: to.Ptr("IPConfigurationsPerVirtualNetwork"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/West US/usages/IPConfigurationsPerVirtualNetwork"), - // Limit: to.Ptr[int64](16384), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Peerings per Virtual Network"), - // Value: to.Ptr("PeeringsPerVirtualNetwork"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/West US/usages/PeeringsPerVirtualNetwork"), - // Limit: to.Ptr[int64](50), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Security rules per Network Security Group"), - // Value: to.Ptr("SecurityRulesPerNetworkSecurityGroup"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/West US/usages/SecurityRulesPerNetworkSecurityGroup"), - // Limit: to.Ptr[int64](1000), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Security rules per Network Intent Policy"), - // Value: to.Ptr("SecurityRulesPerNetworkIntentPolicy"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/West US/usages/SecurityRulesPerNetworkIntentPolicy"), - // Limit: to.Ptr[int64](100), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Routes per Network Intent Policy"), - // Value: to.Ptr("RoutesPerNetworkIntentPolicy"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/West US/usages/RoutesPerNetworkIntentPolicy"), - // Limit: to.Ptr[int64](100), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Security rules addresses or ports per Network Security Group"), - // Value: to.Ptr("SecurityRuleAddressesOrPortsPerNetworkSecurityGroup"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/West US/usages/SecurityRuleAddressesOrPortsPerNetworkSecurityGroup"), - // Limit: to.Ptr[int64](2000), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Inbound Rules per Load Balancer"), - // Value: to.Ptr("InboundRulesPerLoadBalancer"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/West US/usages/InboundRulesPerLoadBalancer"), - // Limit: to.Ptr[int64](150), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Frontend IP Configurations per Load Balancer"), - // Value: to.Ptr("FrontendIPConfigurationPerLoadBalancer"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/West US/usages/FrontendIPConfigurationPerLoadBalancer"), - // Limit: to.Ptr[int64](10), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Outbound Rules per Load Balancer"), - // Value: to.Ptr("OutboundRulesPerLoadBalancer"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/West US/usages/OutboundRulesPerLoadBalancer"), - // Limit: to.Ptr[int64](5), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Routes per Route Table"), - // Value: to.Ptr("RoutesPerRouteTable"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/West US/usages/RoutesPerRouteTable"), - // Limit: to.Ptr[int64](400), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Secondary IP Configurations per Network Interface"), - // Value: to.Ptr("SecondaryIPConfigurationsPerNetworkInterface"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/West US/usages/SecondaryIPConfigurationsPerNetworkInterface"), - // Limit: to.Ptr[int64](256), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Inbound rules per Network Interface"), - // Value: to.Ptr("InboundRulesPerNetworkInterface"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/West US/usages/InboundRulesPerNetworkInterface"), - // Limit: to.Ptr[int64](500), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Route filter rules per Route Filter"), - // Value: to.Ptr("RouteFilterRulesPerRouteFilter"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/West US/usages/RouteFilterRulesPerRouteFilter"), - // Limit: to.Ptr[int64](1), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }, - // { - // Name: &armnetwork.UsageName{ - // LocalizedValue: to.Ptr("Route filters per Express route BGP Peering"), - // Value: to.Ptr("RouteFiltersPerExpressRouteBgpPeering"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Network/locations/West US/usages/RouteFiltersPerExpressRouteBgpPeering"), - // Limit: to.Ptr[int64](1), - // Unit: to.Ptr(armnetwork.UsageUnitCount), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/vipswap_client.go b/sdk/resourcemanager/network/armnetwork/vipswap_client.go index ddb0f347b81d..44568f10f4b9 100644 --- a/sdk/resourcemanager/network/armnetwork/vipswap_client.go +++ b/sdk/resourcemanager/network/armnetwork/vipswap_client.go @@ -47,7 +47,7 @@ func NewVipSwapClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreate - Performs vip swap operation on swappable cloud services. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - groupName - The name of the resource group. // - resourceName - The name of the cloud service. // - parameters - SwapResource object where slot type should be the target slot after vip swap for the specified cloud service. @@ -68,7 +68,7 @@ func (client *VipSwapClient) BeginCreate(ctx context.Context, groupName string, // Create - Performs vip swap operation on swappable cloud services. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VipSwapClient) create(ctx context.Context, groupName string, resourceName string, parameters SwapResource, options *VipSwapClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "VipSwapClient.BeginCreate" @@ -111,7 +111,7 @@ func (client *VipSwapClient) createCreateRequest(ctx context.Context, groupName return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -124,7 +124,7 @@ func (client *VipSwapClient) createCreateRequest(ctx context.Context, groupName // can either be Staging or Production // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - groupName - The name of the resource group. // - resourceName - The name of the cloud service. // - options - VipSwapClientGetOptions contains the optional parameters for the VipSwapClient.Get method. @@ -171,7 +171,7 @@ func (client *VipSwapClient) getCreateRequest(ctx context.Context, groupName str return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -190,7 +190,7 @@ func (client *VipSwapClient) getHandleResponse(resp *http.Response) (VipSwapClie // cloud service can either be Staging or Production // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - groupName - The name of the resource group. // - resourceName - The name of the cloud service. // - options - VipSwapClientListOptions contains the optional parameters for the VipSwapClient.List method. @@ -236,7 +236,7 @@ func (client *VipSwapClient) listCreateRequest(ctx context.Context, groupName st return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/vipswap_client_example_test.go b/sdk/resourcemanager/network/armnetwork/vipswap_client_example_test.go deleted file mode 100644 index e0a1ec4c48ba..000000000000 --- a/sdk/resourcemanager/network/armnetwork/vipswap_client_example_test.go +++ /dev/null @@ -1,103 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/CloudServiceSwapGet.json -func ExampleVipSwapClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVipSwapClient().Get(ctx, "rg1", "testCloudService", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SwapResource = armnetwork.SwapResource{ - // Name: to.Ptr("swap"), - // Type: to.Ptr("Microsoft.Network/cloudServiceSlots"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/cloudServices/testCloudService/providers/Microsoft.Network/cloudServiceSlots/swap"), - // Properties: &armnetwork.SwapResourceProperties{ - // SlotType: to.Ptr(armnetwork.SlotTypeStaging), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/CloudServiceSwapPut.json -func ExampleVipSwapClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVipSwapClient().BeginCreate(ctx, "rg1", "testCloudService", armnetwork.SwapResource{ - Properties: &armnetwork.SwapResourceProperties{ - SlotType: to.Ptr(armnetwork.SlotTypeProduction), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/CloudServiceSwapList.json -func ExampleVipSwapClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVipSwapClient().List(ctx, "rg1", "testCloudService", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SwapResourceListResult = armnetwork.SwapResourceListResult{ - // Value: []*armnetwork.SwapResource{ - // { - // Name: to.Ptr("swap"), - // Type: to.Ptr("Microsoft.Network/cloudServiceSlots"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/cloudServices/testCloudService/providers/Microsoft.Network/cloudServiceSlots/swap"), - // Properties: &armnetwork.SwapResourceProperties{ - // SlotType: to.Ptr(armnetwork.SlotTypeStaging), - // }, - // }}, - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/virtualapplianceconnections_client.go b/sdk/resourcemanager/network/armnetwork/virtualapplianceconnections_client.go index 94b5df095b30..5e93c55c4707 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualapplianceconnections_client.go +++ b/sdk/resourcemanager/network/armnetwork/virtualapplianceconnections_client.go @@ -48,7 +48,7 @@ func NewVirtualApplianceConnectionsClient(subscriptionID string, credential azco // NVA connection' // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkVirtualApplianceName - The name of the Network Virtual Appliance. // - connectionName - The name of the NVA connection. @@ -73,7 +73,7 @@ func (client *VirtualApplianceConnectionsClient) BeginCreateOrUpdate(ctx context // CreateOrUpdate - Creates a connection to Network Virtual Appliance, if it doesn't exist else updates the existing NVA connection' // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VirtualApplianceConnectionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, connectionName string, networkVirtualApplianceConnectionParameters VirtualApplianceConnection, options *VirtualApplianceConnectionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualApplianceConnectionsClient.BeginCreateOrUpdate" @@ -119,7 +119,7 @@ func (client *VirtualApplianceConnectionsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, networkVirtualApplianceConnectionParameters); err != nil { @@ -131,7 +131,7 @@ func (client *VirtualApplianceConnectionsClient) createOrUpdateCreateRequest(ctx // BeginDelete - Deletes a NVA connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkVirtualApplianceName - The name of the Network Virtual Appliance. // - connectionName - The name of the NVA connection. @@ -155,7 +155,7 @@ func (client *VirtualApplianceConnectionsClient) BeginDelete(ctx context.Context // Delete - Deletes a NVA connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VirtualApplianceConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, connectionName string, options *VirtualApplianceConnectionsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualApplianceConnectionsClient.BeginDelete" @@ -201,7 +201,7 @@ func (client *VirtualApplianceConnectionsClient) deleteCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -210,7 +210,7 @@ func (client *VirtualApplianceConnectionsClient) deleteCreateRequest(ctx context // Get - Retrieves the details of specified NVA connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkVirtualApplianceName - The name of the Network Virtual Appliance. // - connectionName - The name of the NVA connection. @@ -262,7 +262,7 @@ func (client *VirtualApplianceConnectionsClient) getCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -279,7 +279,7 @@ func (client *VirtualApplianceConnectionsClient) getHandleResponse(resp *http.Re // NewListPager - Lists NetworkVirtualApplianceConnections under the NVA. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkVirtualApplianceName - The name of the Network Virtual Appliance. // - options - VirtualApplianceConnectionsClientListOptions contains the optional parameters for the VirtualApplianceConnectionsClient.NewListPager @@ -334,7 +334,7 @@ func (client *VirtualApplianceConnectionsClient) listCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/virtualapplianceconnections_client_example_test.go b/sdk/resourcemanager/network/armnetwork/virtualapplianceconnections_client_example_test.go deleted file mode 100644 index 6f14b636a032..000000000000 --- a/sdk/resourcemanager/network/armnetwork/virtualapplianceconnections_client_example_test.go +++ /dev/null @@ -1,237 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkVirtualApplianceConnectionPut.json -func ExampleVirtualApplianceConnectionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualApplianceConnectionsClient().BeginCreateOrUpdate(ctx, "rg1", "nva1", "connection1", armnetwork.VirtualApplianceConnection{ - Properties: &armnetwork.VirtualApplianceConnectionProperties{ - Name: to.Ptr("connection1"), - Asn: to.Ptr[int64](64512), - BgpPeerAddress: []*string{ - to.Ptr("169.254.16.13"), - to.Ptr("169.254.16.14")}, - EnableInternetSecurity: to.Ptr(false), - RoutingConfiguration: &armnetwork.RoutingConfigurationNfv{ - AssociatedRouteTable: &armnetwork.RoutingConfigurationNfvSubResource{ - ResourceURI: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - }, - InboundRouteMap: &armnetwork.RoutingConfigurationNfvSubResource{ - ResourceURI: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1"), - }, - OutboundRouteMap: &armnetwork.RoutingConfigurationNfvSubResource{ - ResourceURI: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap2"), - }, - PropagatedRouteTables: &armnetwork.PropagatedRouteTableNfv{ - IDs: []*armnetwork.RoutingConfigurationNfvSubResource{ - { - ResourceURI: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - }}, - Labels: []*string{ - to.Ptr("label1")}, - }, - }, - TunnelIdentifier: to.Ptr[int64](0), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualApplianceConnection = armnetwork.VirtualApplianceConnection{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva1/networkVirtualApplianceConnections/connection1"), - // Name: to.Ptr("connection1"), - // Properties: &armnetwork.VirtualApplianceConnectionProperties{ - // Name: to.Ptr("connection1"), - // Asn: to.Ptr[int64](64512), - // BgpPeerAddress: []*string{ - // to.Ptr("169.254.16.13"), - // to.Ptr("169.254.16.14")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RoutingConfiguration: &armnetwork.RoutingConfigurationNfv{ - // AssociatedRouteTable: &armnetwork.RoutingConfigurationNfvSubResource{ - // ResourceURI: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - // }, - // InboundRouteMap: &armnetwork.RoutingConfigurationNfvSubResource{ - // ResourceURI: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1"), - // }, - // OutboundRouteMap: &armnetwork.RoutingConfigurationNfvSubResource{ - // ResourceURI: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap2"), - // }, - // PropagatedRouteTables: &armnetwork.PropagatedRouteTableNfv{ - // IDs: []*armnetwork.RoutingConfigurationNfvSubResource{ - // { - // ResourceURI: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - // }}, - // Labels: []*string{ - // to.Ptr("label1")}, - // }, - // }, - // TunnelIdentifier: to.Ptr[int64](0), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkVirtualApplianceConnectionGet.json -func ExampleVirtualApplianceConnectionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualApplianceConnectionsClient().Get(ctx, "rg1", "nva1", "connection1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualApplianceConnection = armnetwork.VirtualApplianceConnection{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/NetworkVirtualAppliances/nva1/NetworkVirtualApplianceConnections/connection1"), - // Name: to.Ptr("connection1"), - // Properties: &armnetwork.VirtualApplianceConnectionProperties{ - // Name: to.Ptr("connection1"), - // Asn: to.Ptr[int64](64512), - // BgpPeerAddress: []*string{ - // to.Ptr("169.254.16.13"), - // to.Ptr("169.254.16.14")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RoutingConfiguration: &armnetwork.RoutingConfigurationNfv{ - // AssociatedRouteTable: &armnetwork.RoutingConfigurationNfvSubResource{ - // ResourceURI: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - // }, - // InboundRouteMap: &armnetwork.RoutingConfigurationNfvSubResource{ - // ResourceURI: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1"), - // }, - // OutboundRouteMap: &armnetwork.RoutingConfigurationNfvSubResource{ - // ResourceURI: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap2"), - // }, - // PropagatedRouteTables: &armnetwork.PropagatedRouteTableNfv{ - // IDs: []*armnetwork.RoutingConfigurationNfvSubResource{ - // { - // ResourceURI: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - // }}, - // Labels: []*string{ - // to.Ptr("label1")}, - // }, - // }, - // TunnelIdentifier: to.Ptr[int64](0), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkVirtualApplianceConnectionDelete.json -func ExampleVirtualApplianceConnectionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualApplianceConnectionsClient().BeginDelete(ctx, "rg1", "nva1", "connection1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkVirtualApplianceConnectionList.json -func ExampleVirtualApplianceConnectionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualApplianceConnectionsClient().NewListPager("rg1", "nva1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualApplianceConnectionList = armnetwork.VirtualApplianceConnectionList{ - // Value: []*armnetwork.VirtualApplianceConnection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/NetworkVirtualAppliances/nva1/NetworkVirtualApplianceConnections/connection1"), - // Name: to.Ptr("connection1"), - // Properties: &armnetwork.VirtualApplianceConnectionProperties{ - // Name: to.Ptr("connection1"), - // Asn: to.Ptr[int64](64512), - // BgpPeerAddress: []*string{ - // to.Ptr("169.254.16.13"), - // to.Ptr("169.254.16.14")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RoutingConfiguration: &armnetwork.RoutingConfigurationNfv{ - // AssociatedRouteTable: &armnetwork.RoutingConfigurationNfvSubResource{ - // ResourceURI: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - // }, - // InboundRouteMap: &armnetwork.RoutingConfigurationNfvSubResource{ - // ResourceURI: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1"), - // }, - // OutboundRouteMap: &armnetwork.RoutingConfigurationNfvSubResource{ - // ResourceURI: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap2"), - // }, - // PropagatedRouteTables: &armnetwork.PropagatedRouteTableNfv{ - // IDs: []*armnetwork.RoutingConfigurationNfvSubResource{ - // { - // ResourceURI: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - // }}, - // Labels: []*string{ - // to.Ptr("label1")}, - // }, - // }, - // TunnelIdentifier: to.Ptr[int64](0), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/virtualappliances_client.go b/sdk/resourcemanager/network/armnetwork/virtualappliances_client.go index c79af689c66a..1b9d0665232f 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualappliances_client.go +++ b/sdk/resourcemanager/network/armnetwork/virtualappliances_client.go @@ -47,7 +47,7 @@ func NewVirtualAppliancesClient(subscriptionID string, credential azcore.TokenCr // BeginCreateOrUpdate - Creates or updates the specified Network Virtual Appliance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkVirtualApplianceName - The name of Network Virtual Appliance. // - parameters - Parameters supplied to the create or update Network Virtual Appliance. @@ -71,7 +71,7 @@ func (client *VirtualAppliancesClient) BeginCreateOrUpdate(ctx context.Context, // CreateOrUpdate - Creates or updates the specified Network Virtual Appliance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VirtualAppliancesClient) createOrUpdate(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, parameters VirtualAppliance, options *VirtualAppliancesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualAppliancesClient.BeginCreateOrUpdate" @@ -113,7 +113,7 @@ func (client *VirtualAppliancesClient) createOrUpdateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -125,7 +125,7 @@ func (client *VirtualAppliancesClient) createOrUpdateCreateRequest(ctx context.C // BeginDelete - Deletes the specified Network Virtual Appliance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkVirtualApplianceName - The name of Network Virtual Appliance. // - options - VirtualAppliancesClientBeginDeleteOptions contains the optional parameters for the VirtualAppliancesClient.BeginDelete @@ -148,7 +148,7 @@ func (client *VirtualAppliancesClient) BeginDelete(ctx context.Context, resource // Delete - Deletes the specified Network Virtual Appliance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VirtualAppliancesClient) deleteOperation(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, options *VirtualAppliancesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualAppliancesClient.BeginDelete" @@ -190,7 +190,7 @@ func (client *VirtualAppliancesClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -199,7 +199,7 @@ func (client *VirtualAppliancesClient) deleteCreateRequest(ctx context.Context, // Get - Gets the specified Network Virtual Appliance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkVirtualApplianceName - The name of Network Virtual Appliance. // - options - VirtualAppliancesClientGetOptions contains the optional parameters for the VirtualAppliancesClient.Get method. @@ -245,7 +245,7 @@ func (client *VirtualAppliancesClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } @@ -265,7 +265,7 @@ func (client *VirtualAppliancesClient) getHandleResponse(resp *http.Response) (V // NewListPager - Gets all Network Virtual Appliances in a subscription. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - options - VirtualAppliancesClientListOptions contains the optional parameters for the VirtualAppliancesClient.NewListPager // method. func (client *VirtualAppliancesClient) NewListPager(options *VirtualAppliancesClientListOptions) *runtime.Pager[VirtualAppliancesClientListResponse] { @@ -310,7 +310,7 @@ func (client *VirtualAppliancesClient) listCreateRequest(ctx context.Context, op return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -327,7 +327,7 @@ func (client *VirtualAppliancesClient) listHandleResponse(resp *http.Response) ( // NewListByResourceGroupPager - Lists all Network Virtual Appliances in a resource group. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - options - VirtualAppliancesClientListByResourceGroupOptions contains the optional parameters for the VirtualAppliancesClient.NewListByResourceGroupPager // method. @@ -377,7 +377,7 @@ func (client *VirtualAppliancesClient) listByResourceGroupCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -395,7 +395,7 @@ func (client *VirtualAppliancesClient) listByResourceGroupHandleResponse(resp *h // UpdateTags - Updates a Network Virtual Appliance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of Network Virtual Appliance. // - networkVirtualApplianceName - The name of Network Virtual Appliance being updated. // - parameters - Parameters supplied to Update Network Virtual Appliance Tags. @@ -443,7 +443,7 @@ func (client *VirtualAppliancesClient) updateTagsCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/virtualappliances_client_example_test.go b/sdk/resourcemanager/network/armnetwork/virtualappliances_client_example_test.go deleted file mode 100644 index 297a1bf5a96c..000000000000 --- a/sdk/resourcemanager/network/armnetwork/virtualappliances_client_example_test.go +++ /dev/null @@ -1,543 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkVirtualApplianceDelete.json -func ExampleVirtualAppliancesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualAppliancesClient().BeginDelete(ctx, "rg1", "nva", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkVirtualApplianceGet.json -func ExampleVirtualAppliancesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualAppliancesClient().Get(ctx, "rg1", "nva", &armnetwork.VirtualAppliancesClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualAppliance = armnetwork.VirtualAppliance{ - // Name: to.Ptr("nva"), - // Type: to.Ptr("Microsoft.Network/networkVirtualAppliances"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Identity: &armnetwork.ManagedServiceIdentity{ - // Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - // "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": &armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - // }, - // }, - // }, - // Properties: &armnetwork.VirtualAppliancePropertiesFormat{ - // AdditionalNics: []*armnetwork.VirtualApplianceAdditionalNicProperties{ - // { - // Name: to.Ptr("exrsdwan"), - // HasPublicIP: to.Ptr(true), - // }}, - // AddressPrefix: to.Ptr("192.168.1.0/16"), - // BootStrapConfigurationBlobs: []*string{ - // to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrbootstrapconfig")}, - // CloudInitConfigurationBlobs: []*string{ - // to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrcloudinitconfig")}, - // InboundSecurityRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva/InboundSecurityRules/rule1"), - // }}, - // NvaSKU: &armnetwork.VirtualApplianceSKUProperties{ - // BundledScaleUnit: to.Ptr("1"), - // MarketPlaceVersion: to.Ptr("12.1"), - // Vendor: to.Ptr("Cisco SDWAN"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualApplianceAsn: to.Ptr[int64](10000), - // VirtualApplianceConnections: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva/networkVirtualApplianceConnections/connection1"), - // }}, - // VirtualApplianceNics: []*armnetwork.VirtualApplianceNicProperties{ - // { - // Name: to.Ptr("publicnicipconfig"), - // InstanceName: to.Ptr("nva_0"), - // PrivateIPAddress: to.Ptr("192.168.12.1"), - // PublicIPAddress: to.Ptr("40.30.2.2"), - // }, - // { - // Name: to.Ptr("privatenicipconfig"), - // InstanceName: to.Ptr("nva_0"), - // PrivateIPAddress: to.Ptr("192.168.12.2"), - // PublicIPAddress: to.Ptr(""), - // }, - // { - // Name: to.Ptr("exrsdwan"), - // InstanceName: to.Ptr("nva_0"), - // PrivateIPAddress: to.Ptr("10.1.113.4"), - // PublicIPAddress: to.Ptr("4.231.25.19"), - // }}, - // VirtualApplianceSites: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networtkVirtualAppliances/nva/virtualApplianceSites/site1"), - // }}, - // VirtualHub: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkVirtualApplianceUpdateTags.json -func ExampleVirtualAppliancesClient_UpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualAppliancesClient().UpdateTags(ctx, "rg1", "nva", armnetwork.TagsObject{ - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - "key2": to.Ptr("value2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualAppliance = armnetwork.VirtualAppliance{ - // Name: to.Ptr("nva"), - // Type: to.Ptr("Microsoft.Network/networkVirtualAppliances"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Identity: &armnetwork.ManagedServiceIdentity{ - // Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - // "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": &armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - // }, - // }, - // }, - // Properties: &armnetwork.VirtualAppliancePropertiesFormat{ - // AddressPrefix: to.Ptr("192.168.1.0/16"), - // BootStrapConfigurationBlobs: []*string{ - // to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrbootstrapconfig")}, - // CloudInitConfigurationBlobs: []*string{ - // to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrcloudinitconfig")}, - // NvaSKU: &armnetwork.VirtualApplianceSKUProperties{ - // BundledScaleUnit: to.Ptr("1"), - // MarketPlaceVersion: to.Ptr("12.1"), - // Vendor: to.Ptr("Cisco SDWAN"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualApplianceAsn: to.Ptr[int64](10000), - // VirtualApplianceNics: []*armnetwork.VirtualApplianceNicProperties{ - // { - // Name: to.Ptr("managementNic"), - // PrivateIPAddress: to.Ptr("192.168.12.1"), - // PublicIPAddress: to.Ptr("40.30.2.2"), - // }, - // { - // Name: to.Ptr("privateNic-1"), - // PrivateIPAddress: to.Ptr("192.168.12.2"), - // }}, - // VirtualApplianceSites: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networtkVirtualAppliances/nva/virtualApplianceSites/site1"), - // }}, - // VirtualHub: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkVirtualAppliancePut.json -func ExampleVirtualAppliancesClient_BeginCreateOrUpdate_createNetworkVirtualAppliance() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualAppliancesClient().BeginCreateOrUpdate(ctx, "rg1", "nva", armnetwork.VirtualAppliance{ - Location: to.Ptr("West US"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, - Identity: &armnetwork.ManagedServiceIdentity{ - Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), - UserAssignedIdentities: map[string]*armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {}, - }, - }, - Properties: &armnetwork.VirtualAppliancePropertiesFormat{ - AdditionalNics: []*armnetwork.VirtualApplianceAdditionalNicProperties{ - { - Name: to.Ptr("exrsdwan"), - HasPublicIP: to.Ptr(true), - }}, - BootStrapConfigurationBlobs: []*string{ - to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrbootstrapconfig")}, - CloudInitConfigurationBlobs: []*string{ - to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrcloudinitconfig")}, - NvaSKU: &armnetwork.VirtualApplianceSKUProperties{ - BundledScaleUnit: to.Ptr("1"), - MarketPlaceVersion: to.Ptr("12.1"), - Vendor: to.Ptr("Cisco SDWAN"), - }, - VirtualApplianceAsn: to.Ptr[int64](10000), - VirtualHub: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualAppliance = armnetwork.VirtualAppliance{ - // Name: to.Ptr("nva"), - // Type: to.Ptr("Microsoft.Network/networkVirtualAppliances"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Identity: &armnetwork.ManagedServiceIdentity{ - // Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - // "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": &armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - // }, - // }, - // }, - // Properties: &armnetwork.VirtualAppliancePropertiesFormat{ - // AddressPrefix: to.Ptr("192.168.1.0/16"), - // BootStrapConfigurationBlobs: []*string{ - // to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrbootstrapconfig")}, - // CloudInitConfigurationBlobs: []*string{ - // to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrcloudinitconfig")}, - // InboundSecurityRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva/InboundSecurityRules/rule1"), - // }}, - // NvaSKU: &armnetwork.VirtualApplianceSKUProperties{ - // BundledScaleUnit: to.Ptr("1"), - // MarketPlaceVersion: to.Ptr("12.1"), - // Vendor: to.Ptr("Cisco SDWAN"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualApplianceAsn: to.Ptr[int64](10000), - // VirtualApplianceNics: []*armnetwork.VirtualApplianceNicProperties{ - // { - // Name: to.Ptr("publicnicipconfig"), - // InstanceName: to.Ptr("nva_0"), - // PrivateIPAddress: to.Ptr("192.168.12.1"), - // PublicIPAddress: to.Ptr("40.30.2.2"), - // }, - // { - // Name: to.Ptr("privatenicipconfig"), - // InstanceName: to.Ptr("nva_0"), - // PrivateIPAddress: to.Ptr("192.168.12.2"), - // PublicIPAddress: to.Ptr(""), - // }, - // { - // Name: to.Ptr("exrsdwan"), - // InstanceName: to.Ptr("nva_0"), - // PrivateIPAddress: to.Ptr("10.1.113.4"), - // PublicIPAddress: to.Ptr("4.231.25.19"), - // }}, - // VirtualApplianceSites: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networtkVirtualAppliances/nva/virtualApplianceSites/site1"), - // }}, - // VirtualHub: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkVirtualApplianceSaaSPut.json -func ExampleVirtualAppliancesClient_BeginCreateOrUpdate_createSaaSNetworkVirtualAppliance() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualAppliancesClient().BeginCreateOrUpdate(ctx, "rg1", "nva", armnetwork.VirtualAppliance{ - Location: to.Ptr("West US"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, - Properties: &armnetwork.VirtualAppliancePropertiesFormat{ - Delegation: &armnetwork.DelegationProperties{ - ServiceName: to.Ptr("PaloAltoNetworks.Cloudngfw/firewalls"), - }, - VirtualHub: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualAppliance = armnetwork.VirtualAppliance{ - // Name: to.Ptr("nva"), - // Type: to.Ptr("Microsoft.Network/networkVirtualAppliances"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VirtualAppliancePropertiesFormat{ - // Delegation: &armnetwork.DelegationProperties{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ServiceName: to.Ptr("PaloAltoNetworks.Cloudngfw/firewalls"), - // }, - // DeploymentType: to.Ptr("PartnerManaged"), - // PartnerManagedResource: &armnetwork.PartnerManagedResourceProperties{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Lifter/firewalls/paloAltoFirewall"), - // InternalLoadBalancerID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/trustILB"), - // StandardLoadBalancerID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/trustSLB"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualHub: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkVirtualApplianceListByResourceGroup.json -func ExampleVirtualAppliancesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualAppliancesClient().NewListByResourceGroupPager("rg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualApplianceListResult = armnetwork.VirtualApplianceListResult{ - // Value: []*armnetwork.VirtualAppliance{ - // { - // Name: to.Ptr("nva"), - // Type: to.Ptr("Microsoft.Network/networkVirtualAppliances"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Identity: &armnetwork.ManagedServiceIdentity{ - // Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - // "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": &armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - // }, - // }, - // }, - // Properties: &armnetwork.VirtualAppliancePropertiesFormat{ - // AddressPrefix: to.Ptr("192.168.1.0/16"), - // BootStrapConfigurationBlobs: []*string{ - // to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrbootstrapconfig")}, - // CloudInitConfigurationBlobs: []*string{ - // to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrcloudinitconfig")}, - // InboundSecurityRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva/InboundSecurityRules/rule1"), - // }}, - // NvaSKU: &armnetwork.VirtualApplianceSKUProperties{ - // BundledScaleUnit: to.Ptr("1"), - // MarketPlaceVersion: to.Ptr("12.1"), - // Vendor: to.Ptr("Cisco SDWAN"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualApplianceAsn: to.Ptr[int64](10000), - // VirtualApplianceNics: []*armnetwork.VirtualApplianceNicProperties{ - // { - // Name: to.Ptr("managementNic"), - // PrivateIPAddress: to.Ptr("192.168.12.1"), - // PublicIPAddress: to.Ptr("40.30.2.2"), - // }, - // { - // Name: to.Ptr("privateNic-1"), - // PrivateIPAddress: to.Ptr("192.168.12.2"), - // }}, - // VirtualApplianceSites: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networtkVirtualAppliances/nva/virtualApplianceSites/site1"), - // }}, - // VirtualHub: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkVirtualApplianceListBySubscription.json -func ExampleVirtualAppliancesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualAppliancesClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualApplianceListResult = armnetwork.VirtualApplianceListResult{ - // Value: []*armnetwork.VirtualAppliance{ - // { - // Name: to.Ptr("nva"), - // Type: to.Ptr("Microsoft.Network/networkVirtualAppliances"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Identity: &armnetwork.ManagedServiceIdentity{ - // Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - // "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": &armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - // }, - // }, - // }, - // Properties: &armnetwork.VirtualAppliancePropertiesFormat{ - // AddressPrefix: to.Ptr("192.168.1.0/16"), - // BootStrapConfigurationBlobs: []*string{ - // to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrbootstrapconfig")}, - // CloudInitConfigurationBlobs: []*string{ - // to.Ptr("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrcloudinitconfig")}, - // InboundSecurityRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva/InboundSecurityRules/rule1"), - // }}, - // NvaSKU: &armnetwork.VirtualApplianceSKUProperties{ - // BundledScaleUnit: to.Ptr("1"), - // MarketPlaceVersion: to.Ptr("12.1"), - // Vendor: to.Ptr("Cisco SDWAN"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualApplianceAsn: to.Ptr[int64](10000), - // VirtualApplianceNics: []*armnetwork.VirtualApplianceNicProperties{ - // { - // Name: to.Ptr("managementNic"), - // PrivateIPAddress: to.Ptr("192.168.12.1"), - // PublicIPAddress: to.Ptr("40.30.2.2"), - // }, - // { - // Name: to.Ptr("privateNic-1"), - // PrivateIPAddress: to.Ptr("192.168.12.2"), - // }}, - // VirtualApplianceSites: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networtkVirtualAppliances/nva/virtualApplianceSites/site1"), - // }}, - // VirtualHub: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1"), - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/virtualappliancesites_client.go b/sdk/resourcemanager/network/armnetwork/virtualappliancesites_client.go index b9e53b3e28fa..8e6b80c38499 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualappliancesites_client.go +++ b/sdk/resourcemanager/network/armnetwork/virtualappliancesites_client.go @@ -47,7 +47,7 @@ func NewVirtualApplianceSitesClient(subscriptionID string, credential azcore.Tok // BeginCreateOrUpdate - Creates or updates the specified Network Virtual Appliance Site. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkVirtualApplianceName - The name of the Network Virtual Appliance. // - siteName - The name of the site. @@ -72,7 +72,7 @@ func (client *VirtualApplianceSitesClient) BeginCreateOrUpdate(ctx context.Conte // CreateOrUpdate - Creates or updates the specified Network Virtual Appliance Site. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VirtualApplianceSitesClient) createOrUpdate(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, siteName string, parameters VirtualApplianceSite, options *VirtualApplianceSitesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualApplianceSitesClient.BeginCreateOrUpdate" @@ -118,7 +118,7 @@ func (client *VirtualApplianceSitesClient) createOrUpdateCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -130,7 +130,7 @@ func (client *VirtualApplianceSitesClient) createOrUpdateCreateRequest(ctx conte // BeginDelete - Deletes the specified site from a Virtual Appliance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkVirtualApplianceName - The name of the Network Virtual Appliance. // - siteName - The name of the site. @@ -154,7 +154,7 @@ func (client *VirtualApplianceSitesClient) BeginDelete(ctx context.Context, reso // Delete - Deletes the specified site from a Virtual Appliance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VirtualApplianceSitesClient) deleteOperation(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, siteName string, options *VirtualApplianceSitesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualApplianceSitesClient.BeginDelete" @@ -200,7 +200,7 @@ func (client *VirtualApplianceSitesClient) deleteCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -209,7 +209,7 @@ func (client *VirtualApplianceSitesClient) deleteCreateRequest(ctx context.Conte // Get - Gets the specified Virtual Appliance Site. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkVirtualApplianceName - The name of the Network Virtual Appliance. // - siteName - The name of the site. @@ -261,7 +261,7 @@ func (client *VirtualApplianceSitesClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -278,7 +278,7 @@ func (client *VirtualApplianceSitesClient) getHandleResponse(resp *http.Response // NewListPager - Lists all Network Virtual Appliance Sites in a Network Virtual Appliance resource. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkVirtualApplianceName - The name of the Network Virtual Appliance. // - options - VirtualApplianceSitesClientListOptions contains the optional parameters for the VirtualApplianceSitesClient.NewListPager @@ -333,7 +333,7 @@ func (client *VirtualApplianceSitesClient) listCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/virtualappliancesites_client_example_test.go b/sdk/resourcemanager/network/armnetwork/virtualappliancesites_client_example_test.go deleted file mode 100644 index 4c0f16030774..000000000000 --- a/sdk/resourcemanager/network/armnetwork/virtualappliancesites_client_example_test.go +++ /dev/null @@ -1,171 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkVirtualApplianceSiteDelete.json -func ExampleVirtualApplianceSitesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualApplianceSitesClient().BeginDelete(ctx, "rg1", "nva", "site1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkVirtualApplianceSiteGet.json -func ExampleVirtualApplianceSitesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualApplianceSitesClient().Get(ctx, "rg1", "nva", "site1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualApplianceSite = armnetwork.VirtualApplianceSite{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva/virtualApplianceSites/site1"), - // Name: to.Ptr("site1"), - // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), - // Properties: &armnetwork.VirtualApplianceSiteProperties{ - // AddressPrefix: to.Ptr("192.168.1.0/24"), - // O365Policy: &armnetwork.Office365PolicyProperties{ - // BreakOutCategories: &armnetwork.BreakOutCategoryPolicies{ - // Default: to.Ptr(true), - // Allow: to.Ptr(true), - // Optimize: to.Ptr(true), - // }, - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkVirtualApplianceSitePut.json -func ExampleVirtualApplianceSitesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualApplianceSitesClient().BeginCreateOrUpdate(ctx, "rg1", "nva", "site1", armnetwork.VirtualApplianceSite{ - Properties: &armnetwork.VirtualApplianceSiteProperties{ - AddressPrefix: to.Ptr("192.168.1.0/24"), - O365Policy: &armnetwork.Office365PolicyProperties{ - BreakOutCategories: &armnetwork.BreakOutCategoryPolicies{ - Default: to.Ptr(true), - Allow: to.Ptr(true), - Optimize: to.Ptr(true), - }, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualApplianceSite = armnetwork.VirtualApplianceSite{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva/virtualApplianceSites/site1"), - // Name: to.Ptr("site1"), - // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), - // Properties: &armnetwork.VirtualApplianceSiteProperties{ - // AddressPrefix: to.Ptr("192.168.1.0/24"), - // O365Policy: &armnetwork.Office365PolicyProperties{ - // BreakOutCategories: &armnetwork.BreakOutCategoryPolicies{ - // Default: to.Ptr(true), - // Allow: to.Ptr(true), - // Optimize: to.Ptr(true), - // }, - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkVirtualApplianceSiteList.json -func ExampleVirtualApplianceSitesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualApplianceSitesClient().NewListPager("rg1", "nva", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualApplianceSiteListResult = armnetwork.VirtualApplianceSiteListResult{ - // Value: []*armnetwork.VirtualApplianceSite{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva/virtualApplianceSites/site1"), - // Name: to.Ptr("site1"), - // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), - // Properties: &armnetwork.VirtualApplianceSiteProperties{ - // AddressPrefix: to.Ptr("192.168.1.0/24"), - // O365Policy: &armnetwork.Office365PolicyProperties{ - // BreakOutCategories: &armnetwork.BreakOutCategoryPolicies{ - // Default: to.Ptr(true), - // Allow: to.Ptr(true), - // Optimize: to.Ptr(true), - // }, - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/virtualapplianceskus_client.go b/sdk/resourcemanager/network/armnetwork/virtualapplianceskus_client.go index fb44da33e96c..331ee0f93037 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualapplianceskus_client.go +++ b/sdk/resourcemanager/network/armnetwork/virtualapplianceskus_client.go @@ -47,7 +47,7 @@ func NewVirtualApplianceSKUsClient(subscriptionID string, credential azcore.Toke // Get - Retrieves a single available sku for network virtual appliance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - skuName - Name of the Sku. // - options - VirtualApplianceSKUsClientGetOptions contains the optional parameters for the VirtualApplianceSKUsClient.Get // method. @@ -89,7 +89,7 @@ func (client *VirtualApplianceSKUsClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -106,7 +106,7 @@ func (client *VirtualApplianceSKUsClient) getHandleResponse(resp *http.Response) // NewListPager - List all SKUs available for a virtual appliance. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - options - VirtualApplianceSKUsClientListOptions contains the optional parameters for the VirtualApplianceSKUsClient.NewListPager // method. func (client *VirtualApplianceSKUsClient) NewListPager(options *VirtualApplianceSKUsClientListOptions) *runtime.Pager[VirtualApplianceSKUsClientListResponse] { @@ -151,7 +151,7 @@ func (client *VirtualApplianceSKUsClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/virtualapplianceskus_client_example_test.go b/sdk/resourcemanager/network/armnetwork/virtualapplianceskus_client_example_test.go deleted file mode 100644 index d2965aeee37d..000000000000 --- a/sdk/resourcemanager/network/armnetwork/virtualapplianceskus_client_example_test.go +++ /dev/null @@ -1,106 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkVirtualApplianceSkuList.json -func ExampleVirtualApplianceSKUsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualApplianceSKUsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualApplianceSKUListResult = armnetwork.VirtualApplianceSKUListResult{ - // Value: []*armnetwork.VirtualApplianceSKU{ - // { - // Name: to.Ptr("ciscoSdwan"), - // Type: to.Ptr("Microsoft.Network/networkVirtualApplianceSkus"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualApplianceSkus/ciscoSdwan"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VirtualApplianceSKUPropertiesFormat{ - // AvailableScaleUnits: []*armnetwork.VirtualApplianceSKUInstances{ - // { - // InstanceCount: to.Ptr[int32](2), - // ScaleUnit: to.Ptr("1"), - // }, - // { - // InstanceCount: to.Ptr[int32](2), - // ScaleUnit: to.Ptr("2"), - // }}, - // AvailableVersions: []*string{ - // to.Ptr("11.12")}, - // Vendor: to.Ptr("Cisco"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkVirtualApplianceSkuGet.json -func ExampleVirtualApplianceSKUsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualApplianceSKUsClient().Get(ctx, "ciscoSdwan", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualApplianceSKU = armnetwork.VirtualApplianceSKU{ - // Name: to.Ptr("ciscoSdwan"), - // Type: to.Ptr("Microsoft.Network/networkVirtualApplianceSkus"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualApplianceSkus/ciscoSdwan"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VirtualApplianceSKUPropertiesFormat{ - // AvailableScaleUnits: []*armnetwork.VirtualApplianceSKUInstances{ - // { - // InstanceCount: to.Ptr[int32](2), - // ScaleUnit: to.Ptr("1"), - // }, - // { - // InstanceCount: to.Ptr[int32](2), - // ScaleUnit: to.Ptr("2"), - // }}, - // AvailableVersions: []*string{ - // to.Ptr("11.12")}, - // Vendor: to.Ptr("Cisco"), - // }, - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/virtualhubbgpconnection_client.go b/sdk/resourcemanager/network/armnetwork/virtualhubbgpconnection_client.go index 8cff9270a754..0e94c90ebb38 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualhubbgpconnection_client.go +++ b/sdk/resourcemanager/network/armnetwork/virtualhubbgpconnection_client.go @@ -47,7 +47,7 @@ func NewVirtualHubBgpConnectionClient(subscriptionID string, credential azcore.T // BeginCreateOrUpdate - Creates a VirtualHubBgpConnection resource if it doesn't exist else updates the existing VirtualHubBgpConnection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the VirtualHub. // - virtualHubName - The name of the VirtualHub. // - connectionName - The name of the connection. @@ -72,7 +72,7 @@ func (client *VirtualHubBgpConnectionClient) BeginCreateOrUpdate(ctx context.Con // CreateOrUpdate - Creates a VirtualHubBgpConnection resource if it doesn't exist else updates the existing VirtualHubBgpConnection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VirtualHubBgpConnectionClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string, parameters BgpConnection, options *VirtualHubBgpConnectionClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualHubBgpConnectionClient.BeginCreateOrUpdate" @@ -118,7 +118,7 @@ func (client *VirtualHubBgpConnectionClient) createOrUpdateCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -130,7 +130,7 @@ func (client *VirtualHubBgpConnectionClient) createOrUpdateCreateRequest(ctx con // BeginDelete - Deletes a VirtualHubBgpConnection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the VirtualHubBgpConnection. // - virtualHubName - The name of the VirtualHub. // - connectionName - The name of the connection. @@ -154,7 +154,7 @@ func (client *VirtualHubBgpConnectionClient) BeginDelete(ctx context.Context, re // Delete - Deletes a VirtualHubBgpConnection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VirtualHubBgpConnectionClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string, options *VirtualHubBgpConnectionClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualHubBgpConnectionClient.BeginDelete" @@ -200,7 +200,7 @@ func (client *VirtualHubBgpConnectionClient) deleteCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -209,7 +209,7 @@ func (client *VirtualHubBgpConnectionClient) deleteCreateRequest(ctx context.Con // Get - Retrieves the details of a Virtual Hub Bgp Connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the VirtualHub. // - virtualHubName - The name of the VirtualHub. // - connectionName - The name of the connection. @@ -261,7 +261,7 @@ func (client *VirtualHubBgpConnectionClient) getCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/virtualhubbgpconnection_client_example_test.go b/sdk/resourcemanager/network/armnetwork/virtualhubbgpconnection_client_example_test.go deleted file mode 100644 index 90e445a31470..000000000000 --- a/sdk/resourcemanager/network/armnetwork/virtualhubbgpconnection_client_example_test.go +++ /dev/null @@ -1,120 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualHubBgpConnectionGet.json -func ExampleVirtualHubBgpConnectionClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualHubBgpConnectionClient().Get(ctx, "rg1", "hub1", "conn1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.BgpConnection = armnetwork.BgpConnection{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/bgpConnections/conn1"), - // Name: to.Ptr("conn1"), - // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), - // Properties: &armnetwork.BgpConnectionProperties{ - // ConnectionState: to.Ptr(armnetwork.HubBgpConnectionStatusConnected), - // HubVirtualNetworkConnection: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubVirtualNetworkConnections/hubVnetConn1"), - // }, - // PeerAsn: to.Ptr[int64](20000), - // PeerIP: to.Ptr("192.168.1.5"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualHubBgpConnectionPut.json -func ExampleVirtualHubBgpConnectionClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualHubBgpConnectionClient().BeginCreateOrUpdate(ctx, "rg1", "hub1", "conn1", armnetwork.BgpConnection{ - Properties: &armnetwork.BgpConnectionProperties{ - HubVirtualNetworkConnection: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubVirtualNetworkConnections/hubVnetConn1"), - }, - PeerAsn: to.Ptr[int64](20000), - PeerIP: to.Ptr("192.168.1.5"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.BgpConnection = armnetwork.BgpConnection{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/bgpConnections/conn1"), - // Name: to.Ptr("conn1"), - // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), - // Properties: &armnetwork.BgpConnectionProperties{ - // ConnectionState: to.Ptr(armnetwork.HubBgpConnectionStatusConnected), - // HubVirtualNetworkConnection: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubVirtualNetworkConnections/hubVnetConn1"), - // }, - // PeerAsn: to.Ptr[int64](20000), - // PeerIP: to.Ptr("192.168.1.5"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualHubBgpConnectionDelete.json -func ExampleVirtualHubBgpConnectionClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualHubBgpConnectionClient().BeginDelete(ctx, "rg1", "hub1", "conn1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/network/armnetwork/virtualhubbgpconnections_client.go b/sdk/resourcemanager/network/armnetwork/virtualhubbgpconnections_client.go index d4f7d757a58b..f6f44da25b5f 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualhubbgpconnections_client.go +++ b/sdk/resourcemanager/network/armnetwork/virtualhubbgpconnections_client.go @@ -46,7 +46,7 @@ func NewVirtualHubBgpConnectionsClient(subscriptionID string, credential azcore. // NewListPager - Retrieves the details of all VirtualHubBgpConnections. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the VirtualHub. // - virtualHubName - The name of the VirtualHub. // - options - VirtualHubBgpConnectionsClientListOptions contains the optional parameters for the VirtualHubBgpConnectionsClient.NewListPager @@ -101,7 +101,7 @@ func (client *VirtualHubBgpConnectionsClient) listCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -119,7 +119,7 @@ func (client *VirtualHubBgpConnectionsClient) listHandleResponse(resp *http.Resp // BeginListAdvertisedRoutes - Retrieves a list of routes the virtual hub bgp connection is advertising to the specified peer. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - hubName - The name of the virtual hub. // - connectionName - The name of the virtual hub bgp connection. @@ -143,7 +143,7 @@ func (client *VirtualHubBgpConnectionsClient) BeginListAdvertisedRoutes(ctx cont // ListAdvertisedRoutes - Retrieves a list of routes the virtual hub bgp connection is advertising to the specified peer. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VirtualHubBgpConnectionsClient) listAdvertisedRoutes(ctx context.Context, resourceGroupName string, hubName string, connectionName string, options *VirtualHubBgpConnectionsClientBeginListAdvertisedRoutesOptions) (*http.Response, error) { var err error const operationName = "VirtualHubBgpConnectionsClient.BeginListAdvertisedRoutes" @@ -189,7 +189,7 @@ func (client *VirtualHubBgpConnectionsClient) listAdvertisedRoutesCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -198,7 +198,7 @@ func (client *VirtualHubBgpConnectionsClient) listAdvertisedRoutesCreateRequest( // BeginListLearnedRoutes - Retrieves a list of routes the virtual hub bgp connection has learned. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - hubName - The name of the virtual hub. // - connectionName - The name of the virtual hub bgp connection. @@ -222,7 +222,7 @@ func (client *VirtualHubBgpConnectionsClient) BeginListLearnedRoutes(ctx context // ListLearnedRoutes - Retrieves a list of routes the virtual hub bgp connection has learned. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VirtualHubBgpConnectionsClient) listLearnedRoutes(ctx context.Context, resourceGroupName string, hubName string, connectionName string, options *VirtualHubBgpConnectionsClientBeginListLearnedRoutesOptions) (*http.Response, error) { var err error const operationName = "VirtualHubBgpConnectionsClient.BeginListLearnedRoutes" @@ -268,7 +268,7 @@ func (client *VirtualHubBgpConnectionsClient) listLearnedRoutesCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/virtualhubbgpconnections_client_example_test.go b/sdk/resourcemanager/network/armnetwork/virtualhubbgpconnections_client_example_test.go deleted file mode 100644 index 52561dbc993c..000000000000 --- a/sdk/resourcemanager/network/armnetwork/virtualhubbgpconnections_client_example_test.go +++ /dev/null @@ -1,206 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualHubBgpConnectionList.json -func ExampleVirtualHubBgpConnectionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualHubBgpConnectionsClient().NewListPager("rg1", "hub1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ListVirtualHubBgpConnectionResults = armnetwork.ListVirtualHubBgpConnectionResults{ - // Value: []*armnetwork.BgpConnection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/bgpConnections/conn1"), - // Name: to.Ptr("conn1"), - // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), - // Properties: &armnetwork.BgpConnectionProperties{ - // ConnectionState: to.Ptr(armnetwork.HubBgpConnectionStatusConnected), - // HubVirtualNetworkConnection: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubVirtualNetworkConnections/hubVnetConn1"), - // }, - // PeerAsn: to.Ptr[int64](20000), - // PeerIP: to.Ptr("192.168.1.5"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualRouterPeerListLearnedRoute.json -func ExampleVirtualHubBgpConnectionsClient_BeginListLearnedRoutes() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualHubBgpConnectionsClient().BeginListLearnedRoutes(ctx, "rg1", "virtualRouter1", "peer1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Value = map[string][]*armnetwork.PeerRoute{ - // "RouteServiceRole_IN_0": []*armnetwork.PeerRoute{ - // { - // AsPath: to.Ptr("65002-65001"), - // LocalAddress: to.Ptr("10.85.3.4"), - // Network: to.Ptr("10.101.0.0/16"), - // NextHop: to.Ptr("10.85.4.4"), - // Origin: to.Ptr("EBgp"), - // SourcePeer: to.Ptr("10.85.4.4"), - // Weight: to.Ptr[int32](32768), - // }, - // { - // AsPath: to.Ptr("65002-65001"), - // LocalAddress: to.Ptr("10.85.3.5"), - // Network: to.Ptr("10.101.0.0/16"), - // NextHop: to.Ptr("10.85.4.4"), - // Origin: to.Ptr("EBgp"), - // SourcePeer: to.Ptr("10.85.4.4"), - // Weight: to.Ptr[int32](32768), - // }}, - // "RouteServiceRole_IN_1": []*armnetwork.PeerRoute{ - // { - // AsPath: to.Ptr("65002-65001"), - // LocalAddress: to.Ptr("10.85.3.4"), - // Network: to.Ptr("10.101.0.0/16"), - // NextHop: to.Ptr("10.85.4.4"), - // Origin: to.Ptr("EBgp"), - // SourcePeer: to.Ptr("10.85.4.4"), - // Weight: to.Ptr[int32](32768), - // }, - // { - // AsPath: to.Ptr("65002-65001"), - // LocalAddress: to.Ptr("10.85.3.5"), - // Network: to.Ptr("10.101.0.0/16"), - // NextHop: to.Ptr("10.85.4.4"), - // Origin: to.Ptr("EBgp"), - // SourcePeer: to.Ptr("10.85.4.4"), - // Weight: to.Ptr[int32](32768), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualRouterPeerListAdvertisedRoute.json -func ExampleVirtualHubBgpConnectionsClient_BeginListAdvertisedRoutes() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualHubBgpConnectionsClient().BeginListAdvertisedRoutes(ctx, "rg1", "virtualRouter1", "peer1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Value = map[string][]*armnetwork.PeerRoute{ - // "RouteServiceRole_IN_0": []*armnetwork.PeerRoute{ - // { - // AsPath: to.Ptr("65515"), - // LocalAddress: to.Ptr("10.85.3.4"), - // Network: to.Ptr("10.45.0.0/16"), - // NextHop: to.Ptr("10.85.3.4"), - // Origin: to.Ptr("Igp"), - // SourcePeer: to.Ptr("10.85.3.4"), - // Weight: to.Ptr[int32](0), - // }, - // { - // AsPath: to.Ptr("65515"), - // LocalAddress: to.Ptr("10.85.3.4"), - // Network: to.Ptr("10.85.0.0/16"), - // NextHop: to.Ptr("10.85.3.4"), - // Origin: to.Ptr("Igp"), - // SourcePeer: to.Ptr("10.85.3.4"), - // Weight: to.Ptr[int32](0), - // }, - // { - // AsPath: to.Ptr("65515"), - // LocalAddress: to.Ptr("10.85.3.4"), - // Network: to.Ptr("10.100.0.0/16"), - // NextHop: to.Ptr("10.85.3.4"), - // Origin: to.Ptr("Igp"), - // SourcePeer: to.Ptr("10.85.3.4"), - // Weight: to.Ptr[int32](0), - // }}, - // "RouteServiceRole_IN_1": []*armnetwork.PeerRoute{ - // { - // AsPath: to.Ptr("65515"), - // LocalAddress: to.Ptr("10.85.3.4"), - // Network: to.Ptr("10.45.0.0/16"), - // NextHop: to.Ptr("10.85.3.4"), - // Origin: to.Ptr("Igp"), - // SourcePeer: to.Ptr("10.85.3.4"), - // Weight: to.Ptr[int32](0), - // }, - // { - // AsPath: to.Ptr("65515"), - // LocalAddress: to.Ptr("10.85.3.4"), - // Network: to.Ptr("10.85.0.0/16"), - // NextHop: to.Ptr("10.85.3.4"), - // Origin: to.Ptr("Igp"), - // SourcePeer: to.Ptr("10.85.3.4"), - // Weight: to.Ptr[int32](0), - // }, - // { - // AsPath: to.Ptr("65515"), - // LocalAddress: to.Ptr("10.85.3.4"), - // Network: to.Ptr("10.100.0.0/16"), - // NextHop: to.Ptr("10.85.3.4"), - // Origin: to.Ptr("Igp"), - // SourcePeer: to.Ptr("10.85.3.4"), - // Weight: to.Ptr[int32](0), - // }}, - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/virtualhubipconfiguration_client.go b/sdk/resourcemanager/network/armnetwork/virtualhubipconfiguration_client.go index c85185f70ed6..9a709a4c6aaa 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualhubipconfiguration_client.go +++ b/sdk/resourcemanager/network/armnetwork/virtualhubipconfiguration_client.go @@ -47,7 +47,7 @@ func NewVirtualHubIPConfigurationClient(subscriptionID string, credential azcore // BeginCreateOrUpdate - Creates a VirtualHubIpConfiguration resource if it doesn't exist else updates the existing VirtualHubIpConfiguration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the VirtualHub. // - virtualHubName - The name of the VirtualHub. // - ipConfigName - The name of the ipconfig. @@ -72,7 +72,7 @@ func (client *VirtualHubIPConfigurationClient) BeginCreateOrUpdate(ctx context.C // CreateOrUpdate - Creates a VirtualHubIpConfiguration resource if it doesn't exist else updates the existing VirtualHubIpConfiguration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VirtualHubIPConfigurationClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, ipConfigName string, parameters HubIPConfiguration, options *VirtualHubIPConfigurationClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualHubIPConfigurationClient.BeginCreateOrUpdate" @@ -118,7 +118,7 @@ func (client *VirtualHubIPConfigurationClient) createOrUpdateCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -130,7 +130,7 @@ func (client *VirtualHubIPConfigurationClient) createOrUpdateCreateRequest(ctx c // BeginDelete - Deletes a VirtualHubIpConfiguration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the VirtualHubBgpConnection. // - virtualHubName - The name of the VirtualHub. // - ipConfigName - The name of the ipconfig. @@ -154,7 +154,7 @@ func (client *VirtualHubIPConfigurationClient) BeginDelete(ctx context.Context, // Delete - Deletes a VirtualHubIpConfiguration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VirtualHubIPConfigurationClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualHubName string, ipConfigName string, options *VirtualHubIPConfigurationClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualHubIPConfigurationClient.BeginDelete" @@ -200,7 +200,7 @@ func (client *VirtualHubIPConfigurationClient) deleteCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -209,7 +209,7 @@ func (client *VirtualHubIPConfigurationClient) deleteCreateRequest(ctx context.C // Get - Retrieves the details of a Virtual Hub Ip configuration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the VirtualHub. // - virtualHubName - The name of the VirtualHub. // - ipConfigName - The name of the ipconfig. @@ -261,7 +261,7 @@ func (client *VirtualHubIPConfigurationClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -278,7 +278,7 @@ func (client *VirtualHubIPConfigurationClient) getHandleResponse(resp *http.Resp // NewListPager - Retrieves the details of all VirtualHubIpConfigurations. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the VirtualHub. // - virtualHubName - The name of the VirtualHub. // - options - VirtualHubIPConfigurationClientListOptions contains the optional parameters for the VirtualHubIPConfigurationClient.NewListPager @@ -333,7 +333,7 @@ func (client *VirtualHubIPConfigurationClient) listCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/virtualhubipconfiguration_client_example_test.go b/sdk/resourcemanager/network/armnetwork/virtualhubipconfiguration_client_example_test.go deleted file mode 100644 index 364d1f629798..000000000000 --- a/sdk/resourcemanager/network/armnetwork/virtualhubipconfiguration_client_example_test.go +++ /dev/null @@ -1,154 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualHubIpConfigurationGet.json -func ExampleVirtualHubIPConfigurationClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualHubIPConfigurationClient().Get(ctx, "rg1", "hub1", "ipconfig1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.HubIPConfiguration = armnetwork.HubIPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/ipConfigurations/ipconfig1"), - // Name: to.Ptr("ipconfig1"), - // Type: to.Ptr("Microsoft.Network/virtualHubs/ipConfigurations"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.HubIPConfigurationPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualHubIpConfigurationPut.json -func ExampleVirtualHubIPConfigurationClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualHubIPConfigurationClient().BeginCreateOrUpdate(ctx, "rg1", "hub1", "ipconfig1", armnetwork.HubIPConfiguration{ - Properties: &armnetwork.HubIPConfigurationPropertiesFormat{ - Subnet: &armnetwork.Subnet{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.HubIPConfiguration = armnetwork.HubIPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/ipConfigurations/ipconfig1"), - // Name: to.Ptr("ipconfig1"), - // Type: to.Ptr("Microsoft.Network/virtualHubs/ipConfigurations"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.HubIPConfigurationPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualHubIpConfigurationDelete.json -func ExampleVirtualHubIPConfigurationClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualHubIPConfigurationClient().BeginDelete(ctx, "rg1", "hub1", "ipconfig1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualHubIpConfigurationList.json -func ExampleVirtualHubIPConfigurationClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualHubIPConfigurationClient().NewListPager("rg1", "hub1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ListVirtualHubIPConfigurationResults = armnetwork.ListVirtualHubIPConfigurationResults{ - // Value: []*armnetwork.HubIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/ipConfigurations/ipconfig1"), - // Name: to.Ptr("ipconfig1"), - // Type: to.Ptr("Microsoft.Network/virtualHubs/ipConfigurations"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.HubIPConfigurationPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/virtualhubroutetablev2s_client.go b/sdk/resourcemanager/network/armnetwork/virtualhubroutetablev2s_client.go index a357ba826334..aca6697ee3e2 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualhubroutetablev2s_client.go +++ b/sdk/resourcemanager/network/armnetwork/virtualhubroutetablev2s_client.go @@ -47,7 +47,7 @@ func NewVirtualHubRouteTableV2SClient(subscriptionID string, credential azcore.T // BeginCreateOrUpdate - Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing VirtualHubRouteTableV2. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the VirtualHub. // - virtualHubName - The name of the VirtualHub. // - routeTableName - The name of the VirtualHubRouteTableV2. @@ -72,7 +72,7 @@ func (client *VirtualHubRouteTableV2SClient) BeginCreateOrUpdate(ctx context.Con // CreateOrUpdate - Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing VirtualHubRouteTableV2. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VirtualHubRouteTableV2SClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string, virtualHubRouteTableV2Parameters VirtualHubRouteTableV2, options *VirtualHubRouteTableV2SClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualHubRouteTableV2SClient.BeginCreateOrUpdate" @@ -118,7 +118,7 @@ func (client *VirtualHubRouteTableV2SClient) createOrUpdateCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, virtualHubRouteTableV2Parameters); err != nil { @@ -130,7 +130,7 @@ func (client *VirtualHubRouteTableV2SClient) createOrUpdateCreateRequest(ctx con // BeginDelete - Deletes a VirtualHubRouteTableV2. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the VirtualHubRouteTableV2. // - virtualHubName - The name of the VirtualHub. // - routeTableName - The name of the VirtualHubRouteTableV2. @@ -154,7 +154,7 @@ func (client *VirtualHubRouteTableV2SClient) BeginDelete(ctx context.Context, re // Delete - Deletes a VirtualHubRouteTableV2. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VirtualHubRouteTableV2SClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string, options *VirtualHubRouteTableV2SClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualHubRouteTableV2SClient.BeginDelete" @@ -200,7 +200,7 @@ func (client *VirtualHubRouteTableV2SClient) deleteCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -209,7 +209,7 @@ func (client *VirtualHubRouteTableV2SClient) deleteCreateRequest(ctx context.Con // Get - Retrieves the details of a VirtualHubRouteTableV2. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the VirtualHubRouteTableV2. // - virtualHubName - The name of the VirtualHub. // - routeTableName - The name of the VirtualHubRouteTableV2. @@ -261,7 +261,7 @@ func (client *VirtualHubRouteTableV2SClient) getCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -278,7 +278,7 @@ func (client *VirtualHubRouteTableV2SClient) getHandleResponse(resp *http.Respon // NewListPager - Retrieves the details of all VirtualHubRouteTableV2s. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the VirtualHub. // - virtualHubName - The name of the VirtualHub. // - options - VirtualHubRouteTableV2SClientListOptions contains the optional parameters for the VirtualHubRouteTableV2SClient.NewListPager @@ -333,7 +333,7 @@ func (client *VirtualHubRouteTableV2SClient) listCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/virtualhubroutetablev2s_client_example_test.go b/sdk/resourcemanager/network/armnetwork/virtualhubroutetablev2s_client_example_test.go deleted file mode 100644 index 6837f2ed0104..000000000000 --- a/sdk/resourcemanager/network/armnetwork/virtualhubroutetablev2s_client_example_test.go +++ /dev/null @@ -1,190 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualHubRouteTableV2Get.json -func ExampleVirtualHubRouteTableV2SClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualHubRouteTableV2SClient().Get(ctx, "rg1", "virtualHub1", "virtualHubRouteTable1a", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualHubRouteTableV2 = armnetwork.VirtualHubRouteTableV2{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeTables/virtualHubRouteTable1a"), - // Name: to.Ptr("virtualHubRouteTable1a"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VirtualHubRouteTableV2Properties{ - // AttachedConnections: []*string{ - // to.Ptr("All_Vnets")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Routes: []*armnetwork.VirtualHubRouteV2{ - // { - // DestinationType: to.Ptr("CIDR"), - // Destinations: []*string{ - // to.Ptr("20.10.0.0/16"), - // to.Ptr("20.20.0.0/16")}, - // NextHopType: to.Ptr("IPAddress"), - // NextHops: []*string{ - // to.Ptr("10.0.0.68")}, - // }, - // { - // DestinationType: to.Ptr("CIDR"), - // Destinations: []*string{ - // to.Ptr("0.0.0.0/0")}, - // NextHopType: to.Ptr("IPAddress"), - // NextHops: []*string{ - // to.Ptr("10.0.0.68")}, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualHubRouteTableV2Put.json -func ExampleVirtualHubRouteTableV2SClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualHubRouteTableV2SClient().BeginCreateOrUpdate(ctx, "rg1", "virtualHub1", "virtualHubRouteTable1a", armnetwork.VirtualHubRouteTableV2{ - Properties: &armnetwork.VirtualHubRouteTableV2Properties{ - AttachedConnections: []*string{ - to.Ptr("All_Vnets")}, - Routes: []*armnetwork.VirtualHubRouteV2{ - { - DestinationType: to.Ptr("CIDR"), - Destinations: []*string{ - to.Ptr("20.10.0.0/16"), - to.Ptr("20.20.0.0/16")}, - NextHopType: to.Ptr("IPAddress"), - NextHops: []*string{ - to.Ptr("10.0.0.68")}, - }, - { - DestinationType: to.Ptr("CIDR"), - Destinations: []*string{ - to.Ptr("0.0.0.0/0")}, - NextHopType: to.Ptr("IPAddress"), - NextHops: []*string{ - to.Ptr("10.0.0.68")}, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualHubRouteTableV2 = armnetwork.VirtualHubRouteTableV2{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeTables/virtualHubRouteTable1a"), - // Name: to.Ptr("virtualHubRouteTable1a"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VirtualHubRouteTableV2Properties{ - // AttachedConnections: []*string{ - // to.Ptr("All_Vnets")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Routes: []*armnetwork.VirtualHubRouteV2{ - // { - // DestinationType: to.Ptr("CIDR"), - // Destinations: []*string{ - // to.Ptr("20.10.0.0/16"), - // to.Ptr("20.20.0.0/16")}, - // NextHopType: to.Ptr("IPAddress"), - // NextHops: []*string{ - // to.Ptr("10.0.0.68")}, - // }, - // { - // DestinationType: to.Ptr("CIDR"), - // Destinations: []*string{ - // to.Ptr("0.0.0.0/0")}, - // NextHopType: to.Ptr("IPAddress"), - // NextHops: []*string{ - // to.Ptr("10.0.0.68")}, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualHubRouteTableV2Delete.json -func ExampleVirtualHubRouteTableV2SClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualHubRouteTableV2SClient().BeginDelete(ctx, "rg1", "virtualHub1", "virtualHubRouteTable1a", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualHubRouteTableV2List.json -func ExampleVirtualHubRouteTableV2SClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualHubRouteTableV2SClient().NewListPager("rg1", "virtualHub1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ListVirtualHubRouteTableV2SResult = armnetwork.ListVirtualHubRouteTableV2SResult{ - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/virtualhubs_client.go b/sdk/resourcemanager/network/armnetwork/virtualhubs_client.go index 155359f550c3..998ce19813c8 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualhubs_client.go +++ b/sdk/resourcemanager/network/armnetwork/virtualhubs_client.go @@ -47,7 +47,7 @@ func NewVirtualHubsClient(subscriptionID string, credential azcore.TokenCredenti // BeginCreateOrUpdate - Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the VirtualHub. // - virtualHubName - The name of the VirtualHub. // - virtualHubParameters - Parameters supplied to create or update VirtualHub. @@ -71,7 +71,7 @@ func (client *VirtualHubsClient) BeginCreateOrUpdate(ctx context.Context, resour // CreateOrUpdate - Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VirtualHubsClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, virtualHubParameters VirtualHub, options *VirtualHubsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualHubsClient.BeginCreateOrUpdate" @@ -113,7 +113,7 @@ func (client *VirtualHubsClient) createOrUpdateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, virtualHubParameters); err != nil { @@ -125,7 +125,7 @@ func (client *VirtualHubsClient) createOrUpdateCreateRequest(ctx context.Context // BeginDelete - Deletes a VirtualHub. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the VirtualHub. // - virtualHubName - The name of the VirtualHub. // - options - VirtualHubsClientBeginDeleteOptions contains the optional parameters for the VirtualHubsClient.BeginDelete method. @@ -147,7 +147,7 @@ func (client *VirtualHubsClient) BeginDelete(ctx context.Context, resourceGroupN // Delete - Deletes a VirtualHub. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VirtualHubsClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualHubName string, options *VirtualHubsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualHubsClient.BeginDelete" @@ -189,7 +189,7 @@ func (client *VirtualHubsClient) deleteCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -198,7 +198,7 @@ func (client *VirtualHubsClient) deleteCreateRequest(ctx context.Context, resour // Get - Retrieves the details of a VirtualHub. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the VirtualHub. // - virtualHubName - The name of the VirtualHub. // - options - VirtualHubsClientGetOptions contains the optional parameters for the VirtualHubsClient.Get method. @@ -244,7 +244,7 @@ func (client *VirtualHubsClient) getCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -263,7 +263,7 @@ func (client *VirtualHubsClient) getHandleResponse(resp *http.Response) (Virtual // resource . // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the VirtualHub. // - virtualHubName - The name of the VirtualHub. // - options - VirtualHubsClientBeginGetEffectiveVirtualHubRoutesOptions contains the optional parameters for the VirtualHubsClient.BeginGetEffectiveVirtualHubRoutes @@ -287,7 +287,7 @@ func (client *VirtualHubsClient) BeginGetEffectiveVirtualHubRoutes(ctx context.C // . // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VirtualHubsClient) getEffectiveVirtualHubRoutes(ctx context.Context, resourceGroupName string, virtualHubName string, options *VirtualHubsClientBeginGetEffectiveVirtualHubRoutesOptions) (*http.Response, error) { var err error const operationName = "VirtualHubsClient.BeginGetEffectiveVirtualHubRoutes" @@ -329,7 +329,7 @@ func (client *VirtualHubsClient) getEffectiveVirtualHubRoutesCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.EffectiveRoutesParameters != nil { @@ -344,7 +344,7 @@ func (client *VirtualHubsClient) getEffectiveVirtualHubRoutesCreateRequest(ctx c // BeginGetInboundRoutes - Gets the inbound routes configured for the Virtual Hub on a particular connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the VirtualHub. // - virtualHubName - The name of the VirtualHub. // - getInboundRoutesParameters - Parameters supplied to get the inbound routes for a connection resource. @@ -368,7 +368,7 @@ func (client *VirtualHubsClient) BeginGetInboundRoutes(ctx context.Context, reso // GetInboundRoutes - Gets the inbound routes configured for the Virtual Hub on a particular connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VirtualHubsClient) getInboundRoutes(ctx context.Context, resourceGroupName string, virtualHubName string, getInboundRoutesParameters GetInboundRoutesParameters, options *VirtualHubsClientBeginGetInboundRoutesOptions) (*http.Response, error) { var err error const operationName = "VirtualHubsClient.BeginGetInboundRoutes" @@ -410,7 +410,7 @@ func (client *VirtualHubsClient) getInboundRoutesCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, getInboundRoutesParameters); err != nil { @@ -422,7 +422,7 @@ func (client *VirtualHubsClient) getInboundRoutesCreateRequest(ctx context.Conte // BeginGetOutboundRoutes - Gets the outbound routes configured for the Virtual Hub on a particular connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the VirtualHub. // - virtualHubName - The name of the VirtualHub. // - getOutboundRoutesParameters - Parameters supplied to get the outbound routes for a connection resource. @@ -446,7 +446,7 @@ func (client *VirtualHubsClient) BeginGetOutboundRoutes(ctx context.Context, res // GetOutboundRoutes - Gets the outbound routes configured for the Virtual Hub on a particular connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VirtualHubsClient) getOutboundRoutes(ctx context.Context, resourceGroupName string, virtualHubName string, getOutboundRoutesParameters GetOutboundRoutesParameters, options *VirtualHubsClientBeginGetOutboundRoutesOptions) (*http.Response, error) { var err error const operationName = "VirtualHubsClient.BeginGetOutboundRoutes" @@ -488,7 +488,7 @@ func (client *VirtualHubsClient) getOutboundRoutesCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, getOutboundRoutesParameters); err != nil { @@ -499,7 +499,7 @@ func (client *VirtualHubsClient) getOutboundRoutesCreateRequest(ctx context.Cont // NewListPager - Lists all the VirtualHubs in a subscription. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - options - VirtualHubsClientListOptions contains the optional parameters for the VirtualHubsClient.NewListPager method. func (client *VirtualHubsClient) NewListPager(options *VirtualHubsClientListOptions) *runtime.Pager[VirtualHubsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[VirtualHubsClientListResponse]{ @@ -543,7 +543,7 @@ func (client *VirtualHubsClient) listCreateRequest(ctx context.Context, options return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -560,7 +560,7 @@ func (client *VirtualHubsClient) listHandleResponse(resp *http.Response) (Virtua // NewListByResourceGroupPager - Lists all the VirtualHubs in a resource group. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the VirtualHub. // - options - VirtualHubsClientListByResourceGroupOptions contains the optional parameters for the VirtualHubsClient.NewListByResourceGroupPager // method. @@ -610,7 +610,7 @@ func (client *VirtualHubsClient) listByResourceGroupCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -628,7 +628,7 @@ func (client *VirtualHubsClient) listByResourceGroupHandleResponse(resp *http.Re // UpdateTags - Updates VirtualHub tags. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the VirtualHub. // - virtualHubName - The name of the VirtualHub. // - virtualHubParameters - Parameters supplied to update VirtualHub tags. @@ -675,7 +675,7 @@ func (client *VirtualHubsClient) updateTagsCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, virtualHubParameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/virtualhubs_client_example_test.go b/sdk/resourcemanager/network/armnetwork/virtualhubs_client_example_test.go deleted file mode 100644 index 47742909c9f9..000000000000 --- a/sdk/resourcemanager/network/armnetwork/virtualhubs_client_example_test.go +++ /dev/null @@ -1,627 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualHubGet.json -func ExampleVirtualHubsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualHubsClient().Get(ctx, "rg1", "virtualHub1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualHub = armnetwork.VirtualHub{ - // Name: to.Ptr("virtualHub1"), - // Type: to.Ptr("Microsoft.Network/virtualHubs"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"), - // Location: to.Ptr("West US"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VirtualHubProperties{ - // AddressPrefix: to.Ptr("10.10.1.0/24"), - // AllowBranchToBranchTraffic: to.Ptr(false), - // HubRoutingPreference: to.Ptr(armnetwork.HubRoutingPreferenceExpressRoute), - // PreferredRoutingGateway: to.Ptr(armnetwork.PreferredRoutingGatewayExpressRoute), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RoutingState: to.Ptr(armnetwork.RoutingStateProvisioned), - // SKU: to.Ptr("Basic"), - // VirtualHubRouteTableV2S: []*armnetwork.VirtualHubRouteTableV2{ - // }, - // VirtualRouterAsn: to.Ptr[int64](65515), - // VirtualRouterAutoScaleConfiguration: &armnetwork.VirtualRouterAutoScaleConfiguration{ - // MinCapacity: to.Ptr[int32](2), - // }, - // VirtualRouterIPs: []*string{ - // to.Ptr("10.10.1.12"), - // to.Ptr("10.10.1.13")}, - // VirtualWan: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualWans/virtualWan1"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualHubPut.json -func ExampleVirtualHubsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualHubsClient().BeginCreateOrUpdate(ctx, "rg1", "virtualHub2", armnetwork.VirtualHub{ - Location: to.Ptr("West US"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, - Properties: &armnetwork.VirtualHubProperties{ - AddressPrefix: to.Ptr("10.168.0.0/24"), - SKU: to.Ptr("Basic"), - VirtualWan: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualWans/virtualWan1"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualHub = armnetwork.VirtualHub{ - // Name: to.Ptr("virtualHub2"), - // Type: to.Ptr("Microsoft.Network/virtualHubs"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub2"), - // Location: to.Ptr("West US"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VirtualHubProperties{ - // AddressPrefix: to.Ptr("10.168.0.0/24"), - // AllowBranchToBranchTraffic: to.Ptr(false), - // HubRoutingPreference: to.Ptr(armnetwork.HubRoutingPreferenceExpressRoute), - // PreferredRoutingGateway: to.Ptr(armnetwork.PreferredRoutingGatewayExpressRoute), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RoutingState: to.Ptr(armnetwork.RoutingStateProvisioned), - // SKU: to.Ptr("Basic"), - // VirtualHubRouteTableV2S: []*armnetwork.VirtualHubRouteTableV2{ - // }, - // VirtualRouterAsn: to.Ptr[int64](65515), - // VirtualRouterAutoScaleConfiguration: &armnetwork.VirtualRouterAutoScaleConfiguration{ - // MinCapacity: to.Ptr[int32](2), - // }, - // VirtualRouterIPs: []*string{ - // to.Ptr("10.10.1.12"), - // to.Ptr("10.10.1.13")}, - // VirtualWan: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualWans/virtualWan1"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualHubUpdateTags.json -func ExampleVirtualHubsClient_UpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualHubsClient().UpdateTags(ctx, "rg1", "virtualHub2", armnetwork.TagsObject{ - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - "key2": to.Ptr("value2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualHub = armnetwork.VirtualHub{ - // Name: to.Ptr("virtualHub2"), - // Type: to.Ptr("Microsoft.Network/virtualHubs"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub2"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VirtualHubProperties{ - // AddressPrefix: to.Ptr("10.168.0.0/24"), - // AllowBranchToBranchTraffic: to.Ptr(false), - // HubRoutingPreference: to.Ptr(armnetwork.HubRoutingPreferenceExpressRoute), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SKU: to.Ptr("Basic"), - // VirtualHubRouteTableV2S: []*armnetwork.VirtualHubRouteTableV2{ - // }, - // VirtualRouterAsn: to.Ptr[int64](65515), - // VirtualRouterAutoScaleConfiguration: &armnetwork.VirtualRouterAutoScaleConfiguration{ - // MinCapacity: to.Ptr[int32](2), - // }, - // VirtualRouterIPs: []*string{ - // to.Ptr("10.10.1.12"), - // to.Ptr("10.10.1.13")}, - // VirtualWan: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualWans/virtualWan1"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualHubDelete.json -func ExampleVirtualHubsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualHubsClient().BeginDelete(ctx, "rg1", "virtualHub1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualHubListByResourceGroup.json -func ExampleVirtualHubsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualHubsClient().NewListByResourceGroupPager("rg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ListVirtualHubsResult = armnetwork.ListVirtualHubsResult{ - // Value: []*armnetwork.VirtualHub{ - // { - // Name: to.Ptr("virtualHub1"), - // Type: to.Ptr("Microsoft.Network/virtualHubs"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"), - // Location: to.Ptr("West US"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VirtualHubProperties{ - // AddressPrefix: to.Ptr("10.10.1.0/24"), - // AllowBranchToBranchTraffic: to.Ptr(false), - // HubRoutingPreference: to.Ptr(armnetwork.HubRoutingPreferenceExpressRoute), - // PreferredRoutingGateway: to.Ptr(armnetwork.PreferredRoutingGatewayExpressRoute), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RoutingState: to.Ptr(armnetwork.RoutingStateProvisioned), - // SKU: to.Ptr("Basic"), - // VirtualHubRouteTableV2S: []*armnetwork.VirtualHubRouteTableV2{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub2/routeTables/virtualHubRouteTable2"), - // Name: to.Ptr("rt2a"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VirtualHubRouteTableV2Properties{ - // AttachedConnections: []*string{ - // to.Ptr("All_Vnets")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Routes: []*armnetwork.VirtualHubRouteV2{ - // { - // DestinationType: to.Ptr("CIDR"), - // Destinations: []*string{ - // to.Ptr("20.10.0.0/16"), - // to.Ptr("20.20.0.0/16")}, - // NextHopType: to.Ptr("IPAddress"), - // NextHops: []*string{ - // to.Ptr("10.0.0.68")}, - // }, - // { - // DestinationType: to.Ptr("CIDR"), - // Destinations: []*string{ - // to.Ptr("0.0.0.0/0")}, - // NextHopType: to.Ptr("IPAddress"), - // NextHops: []*string{ - // to.Ptr("10.0.0.68")}, - // }}, - // }, - // }}, - // VirtualRouterAsn: to.Ptr[int64](65515), - // VirtualRouterAutoScaleConfiguration: &armnetwork.VirtualRouterAutoScaleConfiguration{ - // MinCapacity: to.Ptr[int32](2), - // }, - // VirtualRouterIPs: []*string{ - // to.Ptr("10.10.1.12"), - // to.Ptr("10.10.1.13")}, - // VirtualWan: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualWans/virtualWan1"), - // }, - // }, - // }, - // { - // Name: to.Ptr("virtualHub2"), - // Type: to.Ptr("Microsoft.Network/virtualHubs"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub2"), - // Location: to.Ptr("East US"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VirtualHubProperties{ - // AddressPrefix: to.Ptr("210.10.1.0/24"), - // AllowBranchToBranchTraffic: to.Ptr(false), - // HubRoutingPreference: to.Ptr(armnetwork.HubRoutingPreferenceExpressRoute), - // PreferredRoutingGateway: to.Ptr(armnetwork.PreferredRoutingGatewayExpressRoute), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RoutingState: to.Ptr(armnetwork.RoutingStateProvisioned), - // SKU: to.Ptr("Basic"), - // VirtualHubRouteTableV2S: []*armnetwork.VirtualHubRouteTableV2{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub2/routeTables/virtualHubRouteTable2"), - // Name: to.Ptr("rt2a"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VirtualHubRouteTableV2Properties{ - // AttachedConnections: []*string{ - // to.Ptr("All_Vnets")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Routes: []*armnetwork.VirtualHubRouteV2{ - // { - // DestinationType: to.Ptr("CIDR"), - // Destinations: []*string{ - // to.Ptr("20.10.0.0/16"), - // to.Ptr("20.20.0.0/16")}, - // NextHopType: to.Ptr("IPAddress"), - // NextHops: []*string{ - // to.Ptr("10.0.0.68")}, - // }, - // { - // DestinationType: to.Ptr("CIDR"), - // Destinations: []*string{ - // to.Ptr("0.0.0.0/0")}, - // NextHopType: to.Ptr("IPAddress"), - // NextHops: []*string{ - // to.Ptr("10.0.0.68")}, - // }}, - // }, - // }}, - // VirtualRouterAsn: to.Ptr[int64](65515), - // VirtualRouterAutoScaleConfiguration: &armnetwork.VirtualRouterAutoScaleConfiguration{ - // MinCapacity: to.Ptr[int32](2), - // }, - // VirtualRouterIPs: []*string{ - // to.Ptr("10.10.1.12"), - // to.Ptr("10.10.1.13")}, - // VirtualWan: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualWans/virtualWan1"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualHubList.json -func ExampleVirtualHubsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualHubsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ListVirtualHubsResult = armnetwork.ListVirtualHubsResult{ - // Value: []*armnetwork.VirtualHub{ - // { - // Name: to.Ptr("virtualHub1"), - // Type: to.Ptr("Microsoft.Network/virtualHubs"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"), - // Location: to.Ptr("West US"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VirtualHubProperties{ - // AddressPrefix: to.Ptr("10.10.1.0/24"), - // AllowBranchToBranchTraffic: to.Ptr(false), - // HubRoutingPreference: to.Ptr(armnetwork.HubRoutingPreferenceExpressRoute), - // PreferredRoutingGateway: to.Ptr(armnetwork.PreferredRoutingGatewayExpressRoute), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RoutingState: to.Ptr(armnetwork.RoutingStateProvisioned), - // SKU: to.Ptr("Basic"), - // VirtualHubRouteTableV2S: []*armnetwork.VirtualHubRouteTableV2{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeTables/virtualHubRouteTable1"), - // Name: to.Ptr("rt2a"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VirtualHubRouteTableV2Properties{ - // AttachedConnections: []*string{ - // to.Ptr("All_Vnets")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Routes: []*armnetwork.VirtualHubRouteV2{ - // { - // DestinationType: to.Ptr("CIDR"), - // Destinations: []*string{ - // to.Ptr("20.10.0.0/16"), - // to.Ptr("20.20.0.0/16")}, - // NextHopType: to.Ptr("IPAddress"), - // NextHops: []*string{ - // to.Ptr("10.0.0.68")}, - // }, - // { - // DestinationType: to.Ptr("CIDR"), - // Destinations: []*string{ - // to.Ptr("0.0.0.0/0")}, - // NextHopType: to.Ptr("IPAddress"), - // NextHops: []*string{ - // to.Ptr("10.0.0.68")}, - // }}, - // }, - // }}, - // VirtualRouterAsn: to.Ptr[int64](65515), - // VirtualRouterAutoScaleConfiguration: &armnetwork.VirtualRouterAutoScaleConfiguration{ - // MinCapacity: to.Ptr[int32](2), - // }, - // VirtualRouterIPs: []*string{ - // to.Ptr("10.10.1.12"), - // to.Ptr("10.10.1.13")}, - // VirtualWan: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualWans/virtualWan1"), - // }, - // }, - // }, - // { - // Name: to.Ptr("virtualHub2"), - // Type: to.Ptr("Microsoft.Network/virtualHubs"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub2"), - // Location: to.Ptr("East US"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VirtualHubProperties{ - // AddressPrefix: to.Ptr("210.10.1.0/24"), - // AllowBranchToBranchTraffic: to.Ptr(false), - // HubRoutingPreference: to.Ptr(armnetwork.HubRoutingPreferenceExpressRoute), - // PreferredRoutingGateway: to.Ptr(armnetwork.PreferredRoutingGatewayExpressRoute), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RoutingState: to.Ptr(armnetwork.RoutingStateProvisioned), - // SKU: to.Ptr("Basic"), - // VirtualHubRouteTableV2S: []*armnetwork.VirtualHubRouteTableV2{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub2/routeTables/virtualHubRouteTable2"), - // Name: to.Ptr("rt2a"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VirtualHubRouteTableV2Properties{ - // AttachedConnections: []*string{ - // to.Ptr("All_Vnets")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Routes: []*armnetwork.VirtualHubRouteV2{ - // { - // DestinationType: to.Ptr("CIDR"), - // Destinations: []*string{ - // to.Ptr("20.10.0.0/16"), - // to.Ptr("20.20.0.0/16")}, - // NextHopType: to.Ptr("IPAddress"), - // NextHops: []*string{ - // to.Ptr("10.0.0.68")}, - // }, - // { - // DestinationType: to.Ptr("CIDR"), - // Destinations: []*string{ - // to.Ptr("0.0.0.0/0")}, - // NextHopType: to.Ptr("IPAddress"), - // NextHops: []*string{ - // to.Ptr("10.0.0.68")}, - // }}, - // }, - // }}, - // VirtualRouterAsn: to.Ptr[int64](65515), - // VirtualRouterAutoScaleConfiguration: &armnetwork.VirtualRouterAutoScaleConfiguration{ - // MinCapacity: to.Ptr[int32](2), - // }, - // VirtualRouterIPs: []*string{ - // to.Ptr("10.10.1.12"), - // to.Ptr("10.10.1.13")}, - // VirtualWan: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualWans/virtualWan1"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/EffectiveRoutesListForConnection.json -func ExampleVirtualHubsClient_BeginGetEffectiveVirtualHubRoutes_effectiveRoutesForAConnectionResource() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualHubsClient().BeginGetEffectiveVirtualHubRoutes(ctx, "rg1", "virtualHub1", &armnetwork.VirtualHubsClientBeginGetEffectiveVirtualHubRoutesOptions{EffectiveRoutesParameters: &armnetwork.EffectiveRoutesParameters{ - ResourceID: to.Ptr("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName/expressRouteConnections/connectionName"), - VirtualWanResourceType: to.Ptr("ExpressRouteConnection"), - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualHubEffectiveRouteList = armnetwork.VirtualHubEffectiveRouteList{ - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/EffectiveRoutesListForRouteTable.json -func ExampleVirtualHubsClient_BeginGetEffectiveVirtualHubRoutes_effectiveRoutesForARouteTableResource() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualHubsClient().BeginGetEffectiveVirtualHubRoutes(ctx, "rg1", "virtualHub1", &armnetwork.VirtualHubsClientBeginGetEffectiveVirtualHubRoutesOptions{EffectiveRoutesParameters: &armnetwork.EffectiveRoutesParameters{ - ResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - VirtualWanResourceType: to.Ptr("RouteTable"), - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualHubEffectiveRouteList = armnetwork.VirtualHubEffectiveRouteList{ - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/EffectiveRoutesListForVirtualHub.json -func ExampleVirtualHubsClient_BeginGetEffectiveVirtualHubRoutes_effectiveRoutesForTheVirtualHub() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualHubsClient().BeginGetEffectiveVirtualHubRoutes(ctx, "rg1", "virtualHub1", &armnetwork.VirtualHubsClientBeginGetEffectiveVirtualHubRoutesOptions{EffectiveRoutesParameters: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualHubEffectiveRouteList = armnetwork.VirtualHubEffectiveRouteList{ - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/GetInboundRoutes.json -func ExampleVirtualHubsClient_BeginGetInboundRoutes() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualHubsClient().BeginGetInboundRoutes(ctx, "rg1", "virtualHub1", armnetwork.GetInboundRoutesParameters{ - ConnectionType: to.Ptr("ExpressRouteConnection"), - ResourceURI: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteGateways/exrGw1/expressRouteConnections/exrConn1"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.EffectiveRouteMapRouteList = armnetwork.EffectiveRouteMapRouteList{ - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/GetOutboundRoutes.json -func ExampleVirtualHubsClient_BeginGetOutboundRoutes() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualHubsClient().BeginGetOutboundRoutes(ctx, "rg1", "virtualHub1", armnetwork.GetOutboundRoutesParameters{ - ConnectionType: to.Ptr("ExpressRouteConnection"), - ResourceURI: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteGateways/exrGw1/expressRouteConnections/exrConn1"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.EffectiveRouteMapRouteList = armnetwork.EffectiveRouteMapRouteList{ - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/virtualnetworkgatewayconnections_client.go b/sdk/resourcemanager/network/armnetwork/virtualnetworkgatewayconnections_client.go index c2cc23c69a32..672de07b5c32 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualnetworkgatewayconnections_client.go +++ b/sdk/resourcemanager/network/armnetwork/virtualnetworkgatewayconnections_client.go @@ -47,7 +47,7 @@ func NewVirtualNetworkGatewayConnectionsClient(subscriptionID string, credential // BeginCreateOrUpdate - Creates or updates a virtual network gateway connection in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayConnectionName - The name of the virtual network gateway connection. // - parameters - Parameters supplied to the create or update virtual network gateway connection operation. @@ -71,7 +71,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) BeginCreateOrUpdate(ctx co // CreateOrUpdate - Creates or updates a virtual network gateway connection in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VirtualNetworkGatewayConnectionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters VirtualNetworkGatewayConnection, options *VirtualNetworkGatewayConnectionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewayConnectionsClient.BeginCreateOrUpdate" @@ -113,7 +113,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) createOrUpdateCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -125,7 +125,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) createOrUpdateCreateReques // BeginDelete - Deletes the specified virtual network Gateway connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayConnectionName - The name of the virtual network gateway connection. // - options - VirtualNetworkGatewayConnectionsClientBeginDeleteOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.BeginDelete @@ -148,7 +148,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) BeginDelete(ctx context.Co // Delete - Deletes the specified virtual network Gateway connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VirtualNetworkGatewayConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, options *VirtualNetworkGatewayConnectionsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewayConnectionsClient.BeginDelete" @@ -190,7 +190,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) deleteCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -199,7 +199,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) deleteCreateRequest(ctx co // Get - Gets the specified virtual network gateway connection by resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayConnectionName - The name of the virtual network gateway connection. // - options - VirtualNetworkGatewayConnectionsClientGetOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.Get @@ -246,7 +246,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) getCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -264,7 +264,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) getHandleResponse(resp *ht // BeginGetIkeSas - Lists IKE Security Associations for the virtual network gateway connection in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayConnectionName - The name of the virtual network gateway Connection. // - options - VirtualNetworkGatewayConnectionsClientBeginGetIkeSasOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.BeginGetIkeSas @@ -287,7 +287,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) BeginGetIkeSas(ctx context // GetIkeSas - Lists IKE Security Associations for the virtual network gateway connection in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VirtualNetworkGatewayConnectionsClient) getIkeSas(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, options *VirtualNetworkGatewayConnectionsClientBeginGetIkeSasOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewayConnectionsClient.BeginGetIkeSas" @@ -329,7 +329,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) getIkeSasCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -339,7 +339,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) getIkeSasCreateRequest(ctx // network gateway connection shared key through Network resource provider. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayConnectionName - The virtual network gateway connection shared key name. // - options - VirtualNetworkGatewayConnectionsClientGetSharedKeyOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.GetSharedKey @@ -386,7 +386,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) getSharedKeyCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -404,7 +404,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) getSharedKeyHandleResponse // NewListPager - The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections // created. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - options - VirtualNetworkGatewayConnectionsClientListOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.NewListPager // method. @@ -454,7 +454,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) listCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -472,7 +472,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) listHandleResponse(resp *h // BeginResetConnection - Resets the virtual network gateway connection specified. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayConnectionName - The name of the virtual network gateway Connection. // - options - VirtualNetworkGatewayConnectionsClientBeginResetConnectionOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.BeginResetConnection @@ -495,7 +495,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) BeginResetConnection(ctx c // ResetConnection - Resets the virtual network gateway connection specified. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VirtualNetworkGatewayConnectionsClient) resetConnection(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, options *VirtualNetworkGatewayConnectionsClientBeginResetConnectionOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewayConnectionsClient.BeginResetConnection" @@ -537,7 +537,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) resetConnectionCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -548,7 +548,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) resetConnectionCreateReque // through Network resource provider. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayConnectionName - The virtual network gateway connection reset shared key Name. // - parameters - Parameters supplied to the begin reset virtual network gateway connection shared key operation through network @@ -575,7 +575,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) BeginResetSharedKey(ctx co // through Network resource provider. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VirtualNetworkGatewayConnectionsClient) resetSharedKey(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters ConnectionResetSharedKey, options *VirtualNetworkGatewayConnectionsClientBeginResetSharedKeyOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewayConnectionsClient.BeginResetSharedKey" @@ -617,7 +617,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) resetSharedKeyCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -631,7 +631,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) resetSharedKeyCreateReques // Network resource provider. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayConnectionName - The virtual network gateway connection name. // - parameters - Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation throughNetwork @@ -658,7 +658,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) BeginSetSharedKey(ctx cont // Network resource provider. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VirtualNetworkGatewayConnectionsClient) setSharedKey(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters ConnectionSharedKey, options *VirtualNetworkGatewayConnectionsClientBeginSetSharedKeyOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewayConnectionsClient.BeginSetSharedKey" @@ -700,7 +700,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) setSharedKeyCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -712,7 +712,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) setSharedKeyCreateRequest( // BeginStartPacketCapture - Starts packet capture on virtual network gateway connection in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayConnectionName - The name of the virtual network gateway connection. // - options - VirtualNetworkGatewayConnectionsClientBeginStartPacketCaptureOptions contains the optional parameters for the @@ -735,7 +735,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) BeginStartPacketCapture(ct // StartPacketCapture - Starts packet capture on virtual network gateway connection in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VirtualNetworkGatewayConnectionsClient) startPacketCapture(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, options *VirtualNetworkGatewayConnectionsClientBeginStartPacketCaptureOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewayConnectionsClient.BeginStartPacketCapture" @@ -777,7 +777,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) startPacketCaptureCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Parameters != nil { @@ -792,7 +792,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) startPacketCaptureCreateRe // BeginStopPacketCapture - Stops packet capture on virtual network gateway connection in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayConnectionName - The name of the virtual network gateway Connection. // - parameters - Virtual network gateway packet capture parameters supplied to stop packet capture on gateway connection. @@ -816,7 +816,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) BeginStopPacketCapture(ctx // StopPacketCapture - Stops packet capture on virtual network gateway connection in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VirtualNetworkGatewayConnectionsClient) stopPacketCapture(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters VPNPacketCaptureStopParameters, options *VirtualNetworkGatewayConnectionsClientBeginStopPacketCaptureOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewayConnectionsClient.BeginStopPacketCapture" @@ -858,7 +858,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) stopPacketCaptureCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -870,7 +870,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) stopPacketCaptureCreateReq // BeginUpdateTags - Updates a virtual network gateway connection tags. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayConnectionName - The name of the virtual network gateway connection. // - parameters - Parameters supplied to update virtual network gateway connection tags. @@ -894,7 +894,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) BeginUpdateTags(ctx contex // UpdateTags - Updates a virtual network gateway connection tags. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VirtualNetworkGatewayConnectionsClient) updateTags(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters TagsObject, options *VirtualNetworkGatewayConnectionsClientBeginUpdateTagsOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewayConnectionsClient.BeginUpdateTags" @@ -936,7 +936,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) updateTagsCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/virtualnetworkgatewayconnections_client_example_test.go b/sdk/resourcemanager/network/armnetwork/virtualnetworkgatewayconnections_client_example_test.go deleted file mode 100644 index 32738eaef22c..000000000000 --- a/sdk/resourcemanager/network/armnetwork/virtualnetworkgatewayconnections_client_example_test.go +++ /dev/null @@ -1,689 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkGatewayConnectionCreate.json -func ExampleVirtualNetworkGatewayConnectionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkGatewayConnectionsClient().BeginCreateOrUpdate(ctx, "rg1", "connS2S", armnetwork.VirtualNetworkGatewayConnection{ - Location: to.Ptr("centralus"), - Properties: &armnetwork.VirtualNetworkGatewayConnectionPropertiesFormat{ - ConnectionMode: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionModeDefault), - ConnectionProtocol: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionProtocolIKEv2), - ConnectionType: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionTypeIPsec), - DpdTimeoutSeconds: to.Ptr[int32](30), - EgressNatRules: []*armnetwork.SubResource{ - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/natRules/natRule2"), - }}, - EnableBgp: to.Ptr(false), - GatewayCustomBgpIPAddresses: []*armnetwork.GatewayCustomBgpIPAddressIPConfiguration{ - { - CustomBgpIPAddress: to.Ptr("169.254.21.1"), - IPConfigurationID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/default"), - }, - { - CustomBgpIPAddress: to.Ptr("169.254.21.3"), - IPConfigurationID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/ActiveActive"), - }}, - IngressNatRules: []*armnetwork.SubResource{ - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/natRules/natRule1"), - }}, - IPSecPolicies: []*armnetwork.IPSecPolicy{}, - LocalNetworkGateway2: &armnetwork.LocalNetworkGateway{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/localNetworkGateways/localgw"), - Location: to.Ptr("centralus"), - Tags: map[string]*string{}, - Properties: &armnetwork.LocalNetworkGatewayPropertiesFormat{ - GatewayIPAddress: to.Ptr("x.x.x.x"), - LocalNetworkAddressSpace: &armnetwork.AddressSpace{ - AddressPrefixes: []*string{ - to.Ptr("10.1.0.0/16")}, - }, - }, - }, - RoutingWeight: to.Ptr[int32](0), - SharedKey: to.Ptr("Abc123"), - TrafficSelectorPolicies: []*armnetwork.TrafficSelectorPolicy{}, - UsePolicyBasedTrafficSelectors: to.Ptr(false), - VirtualNetworkGateway1: &armnetwork.VirtualNetworkGateway{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw"), - Location: to.Ptr("centralus"), - Tags: map[string]*string{}, - Properties: &armnetwork.VirtualNetworkGatewayPropertiesFormat{ - Active: to.Ptr(false), - BgpSettings: &armnetwork.BgpSettings{ - Asn: to.Ptr[int64](65514), - BgpPeeringAddress: to.Ptr("10.0.1.30"), - PeerWeight: to.Ptr[int32](0), - }, - EnableBgp: to.Ptr(false), - GatewayType: to.Ptr(armnetwork.VirtualNetworkGatewayTypeVPN), - IPConfigurations: []*armnetwork.VirtualNetworkGatewayIPConfiguration{ - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/gwipconfig1"), - Name: to.Ptr("gwipconfig1"), - Properties: &armnetwork.VirtualNetworkGatewayIPConfigurationPropertiesFormat{ - PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - PublicIPAddress: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/gwpip"), - }, - Subnet: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/GatewaySubnet"), - }, - }, - }}, - SKU: &armnetwork.VirtualNetworkGatewaySKU{ - Name: to.Ptr(armnetwork.VirtualNetworkGatewaySKUNameVPNGw1), - Tier: to.Ptr(armnetwork.VirtualNetworkGatewaySKUTierVPNGw1), - }, - VPNType: to.Ptr(armnetwork.VPNTypeRouteBased), - }, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualNetworkGatewayConnection = armnetwork.VirtualNetworkGatewayConnection{ - // Name: to.Ptr("connS2S"), - // Type: to.Ptr("Microsoft.Network/connections"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/connections/connS2S"), - // Location: to.Ptr("centralus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.VirtualNetworkGatewayConnectionPropertiesFormat{ - // ConnectionMode: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionModeDefault), - // ConnectionProtocol: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionProtocolIKEv2), - // ConnectionType: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionTypeIPsec), - // DpdTimeoutSeconds: to.Ptr[int32](30), - // EgressBytesTransferred: to.Ptr[int64](0), - // EgressNatRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/natRules/natRule2"), - // }}, - // EnableBgp: to.Ptr(false), - // GatewayCustomBgpIPAddresses: []*armnetwork.GatewayCustomBgpIPAddressIPConfiguration{ - // { - // CustomBgpIPAddress: to.Ptr("169.254.21.1"), - // IPConfigurationID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/default"), - // }, - // { - // CustomBgpIPAddress: to.Ptr("169.254.21.3"), - // IPConfigurationID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/ActiveActive"), - // }}, - // IngressBytesTransferred: to.Ptr[int64](0), - // IngressNatRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/natRules/natRule1"), - // }}, - // IPSecPolicies: []*armnetwork.IPSecPolicy{ - // }, - // LocalNetworkGateway2: &armnetwork.LocalNetworkGateway{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/localNetworkGateways/localgw"), - // Properties: &armnetwork.LocalNetworkGatewayPropertiesFormat{ - // }, - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // RoutingWeight: to.Ptr[int32](0), - // SharedKey: to.Ptr("Abc123"), - // UseLocalAzureIPAddress: to.Ptr(false), - // UsePolicyBasedTrafficSelectors: to.Ptr(false), - // VirtualNetworkGateway1: &armnetwork.VirtualNetworkGateway{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw"), - // Properties: &armnetwork.VirtualNetworkGatewayPropertiesFormat{ - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkGatewayConnectionGet.json -func ExampleVirtualNetworkGatewayConnectionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualNetworkGatewayConnectionsClient().Get(ctx, "rg1", "connS2S", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualNetworkGatewayConnection = armnetwork.VirtualNetworkGatewayConnection{ - // Name: to.Ptr("connS2S"), - // Type: to.Ptr("Microsoft.Network/connections"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/connections/connS2S"), - // Location: to.Ptr("centralus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.VirtualNetworkGatewayConnectionPropertiesFormat{ - // ConnectionMode: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionModeDefault), - // ConnectionProtocol: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionProtocolIKEv2), - // ConnectionStatus: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionStatusConnecting), - // ConnectionType: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionTypeIPsec), - // DpdTimeoutSeconds: to.Ptr[int32](30), - // EgressBytesTransferred: to.Ptr[int64](0), - // EgressNatRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/natRules/natRule2"), - // }}, - // EnableBgp: to.Ptr(false), - // GatewayCustomBgpIPAddresses: []*armnetwork.GatewayCustomBgpIPAddressIPConfiguration{ - // { - // CustomBgpIPAddress: to.Ptr("169.254.21.1"), - // IPConfigurationID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/default"), - // }, - // { - // CustomBgpIPAddress: to.Ptr("169.254.21.3"), - // IPConfigurationID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/ActiveActive"), - // }}, - // IngressBytesTransferred: to.Ptr[int64](0), - // IngressNatRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/natRules/natRule1"), - // }}, - // IPSecPolicies: []*armnetwork.IPSecPolicy{ - // }, - // LocalNetworkGateway2: &armnetwork.LocalNetworkGateway{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/localNetworkGateways/localgw"), - // Properties: &armnetwork.LocalNetworkGatewayPropertiesFormat{ - // }, - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // RoutingWeight: to.Ptr[int32](0), - // SharedKey: to.Ptr("Abc123"), - // TrafficSelectorPolicies: []*armnetwork.TrafficSelectorPolicy{ - // }, - // UseLocalAzureIPAddress: to.Ptr(false), - // UsePolicyBasedTrafficSelectors: to.Ptr(false), - // VirtualNetworkGateway1: &armnetwork.VirtualNetworkGateway{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw"), - // Properties: &armnetwork.VirtualNetworkGatewayPropertiesFormat{ - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkGatewayConnectionDelete.json -func ExampleVirtualNetworkGatewayConnectionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkGatewayConnectionsClient().BeginDelete(ctx, "rg1", "conn1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkGatewayConnectionUpdateTags.json -func ExampleVirtualNetworkGatewayConnectionsClient_BeginUpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkGatewayConnectionsClient().BeginUpdateTags(ctx, "rg1", "test", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualNetworkGatewayConnection = armnetwork.VirtualNetworkGatewayConnection{ - // Name: to.Ptr("test"), - // Type: to.Ptr("Microsoft.Network/connections"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/connections/test"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armnetwork.VirtualNetworkGatewayConnectionPropertiesFormat{ - // ConnectionStatus: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionStatusUnknown), - // ConnectionType: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionTypeIPsec), - // EgressBytesTransferred: to.Ptr[int64](0), - // EgressNatRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/natRules/natRule2"), - // }}, - // EnableBgp: to.Ptr(false), - // GatewayCustomBgpIPAddresses: []*armnetwork.GatewayCustomBgpIPAddressIPConfiguration{ - // { - // CustomBgpIPAddress: to.Ptr("169.254.21.1"), - // IPConfigurationID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/default"), - // }, - // { - // CustomBgpIPAddress: to.Ptr("169.254.21.3"), - // IPConfigurationID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/ActiveActive"), - // }}, - // IngressBytesTransferred: to.Ptr[int64](0), - // IngressNatRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/natRules/natRule1"), - // }}, - // IPSecPolicies: []*armnetwork.IPSecPolicy{ - // }, - // LocalNetworkGateway2: &armnetwork.LocalNetworkGateway{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/localNetworkGateways/lgw"), - // Properties: &armnetwork.LocalNetworkGatewayPropertiesFormat{ - // }, - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // RoutingWeight: to.Ptr[int32](0), - // SharedKey: to.Ptr("temp1234"), - // TrafficSelectorPolicies: []*armnetwork.TrafficSelectorPolicy{ - // }, - // UsePolicyBasedTrafficSelectors: to.Ptr(false), - // VirtualNetworkGateway1: &armnetwork.VirtualNetworkGateway{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw"), - // Properties: &armnetwork.VirtualNetworkGatewayPropertiesFormat{ - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkGatewayConnectionSetSharedKey.json -func ExampleVirtualNetworkGatewayConnectionsClient_BeginSetSharedKey() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkGatewayConnectionsClient().BeginSetSharedKey(ctx, "rg1", "connS2S", armnetwork.ConnectionSharedKey{ - Value: to.Ptr("AzureAbc123"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ConnectionSharedKey = armnetwork.ConnectionSharedKey{ - // ID: to.Ptr(""), - // Value: to.Ptr("AzureAbc123"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkGatewayConnectionGetSharedKey.json -func ExampleVirtualNetworkGatewayConnectionsClient_GetSharedKey() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualNetworkGatewayConnectionsClient().GetSharedKey(ctx, "rg1", "connS2S", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ConnectionSharedKey = armnetwork.ConnectionSharedKey{ - // ID: to.Ptr(""), - // Value: to.Ptr("AzureAbc123"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkGatewayConnectionsList.json -func ExampleVirtualNetworkGatewayConnectionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualNetworkGatewayConnectionsClient().NewListPager("rg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualNetworkGatewayConnectionListResult = armnetwork.VirtualNetworkGatewayConnectionListResult{ - // Value: []*armnetwork.VirtualNetworkGatewayConnection{ - // { - // Name: to.Ptr("conn1"), - // Type: to.Ptr("Microsoft.Network/connections"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/connections/conn1"), - // Location: to.Ptr("centralus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.VirtualNetworkGatewayConnectionPropertiesFormat{ - // ConnectionMode: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionModeDefault), - // ConnectionProtocol: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionProtocolIKEv1), - // ConnectionType: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionTypeIPsec), - // DpdTimeoutSeconds: to.Ptr[int32](30), - // EgressBytesTransferred: to.Ptr[int64](0), - // EgressNatRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw1/natRules/natRule2"), - // }}, - // EnableBgp: to.Ptr(false), - // GatewayCustomBgpIPAddresses: []*armnetwork.GatewayCustomBgpIPAddressIPConfiguration{ - // { - // CustomBgpIPAddress: to.Ptr("169.254.21.1"), - // IPConfigurationID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/default"), - // }, - // { - // CustomBgpIPAddress: to.Ptr("169.254.21.3"), - // IPConfigurationID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/ActiveActive"), - // }}, - // IngressBytesTransferred: to.Ptr[int64](0), - // IngressNatRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw1/natRules/natRule1"), - // }}, - // IPSecPolicies: []*armnetwork.IPSecPolicy{ - // }, - // LocalNetworkGateway2: &armnetwork.LocalNetworkGateway{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/localNetworkGateways/localgw1"), - // Properties: &armnetwork.LocalNetworkGatewayPropertiesFormat{ - // }, - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // RoutingWeight: to.Ptr[int32](0), - // TrafficSelectorPolicies: []*armnetwork.TrafficSelectorPolicy{ - // }, - // UseLocalAzureIPAddress: to.Ptr(false), - // UsePolicyBasedTrafficSelectors: to.Ptr(false), - // VirtualNetworkGateway1: &armnetwork.VirtualNetworkGateway{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw1"), - // Properties: &armnetwork.VirtualNetworkGatewayPropertiesFormat{ - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("conn2"), - // Type: to.Ptr("Microsoft.Network/connections"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/connections/conn2"), - // Location: to.Ptr("eastus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.VirtualNetworkGatewayConnectionPropertiesFormat{ - // ConnectionMode: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionModeDefault), - // ConnectionProtocol: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionProtocolIKEv2), - // ConnectionType: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionTypeIPsec), - // DpdTimeoutSeconds: to.Ptr[int32](20), - // EgressBytesTransferred: to.Ptr[int64](0), - // EgressNatRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw2/natRules/natRule2"), - // }}, - // EnableBgp: to.Ptr(false), - // GatewayCustomBgpIPAddresses: []*armnetwork.GatewayCustomBgpIPAddressIPConfiguration{ - // { - // CustomBgpIPAddress: to.Ptr("169.254.21.4"), - // IPConfigurationID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw2/ipConfigurations/default"), - // }, - // { - // CustomBgpIPAddress: to.Ptr("169.254.21.6"), - // IPConfigurationID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw2/ipConfigurations/ActiveActive"), - // }}, - // IngressBytesTransferred: to.Ptr[int64](0), - // IngressNatRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw2/natRules/natRule1"), - // }}, - // IPSecPolicies: []*armnetwork.IPSecPolicy{ - // }, - // LocalNetworkGateway2: &armnetwork.LocalNetworkGateway{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/localNetworkGateways/localgw2"), - // Properties: &armnetwork.LocalNetworkGatewayPropertiesFormat{ - // }, - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // RoutingWeight: to.Ptr[int32](0), - // TrafficSelectorPolicies: []*armnetwork.TrafficSelectorPolicy{ - // }, - // UseLocalAzureIPAddress: to.Ptr(true), - // UsePolicyBasedTrafficSelectors: to.Ptr(false), - // VirtualNetworkGateway1: &armnetwork.VirtualNetworkGateway{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw2"), - // Properties: &armnetwork.VirtualNetworkGatewayPropertiesFormat{ - // }, - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkGatewayConnectionResetSharedKey.json -func ExampleVirtualNetworkGatewayConnectionsClient_BeginResetSharedKey() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkGatewayConnectionsClient().BeginResetSharedKey(ctx, "rg1", "conn1", armnetwork.ConnectionResetSharedKey{ - KeyLength: to.Ptr[int32](128), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ConnectionResetSharedKey = armnetwork.ConnectionResetSharedKey{ - // KeyLength: to.Ptr[int32](128), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkGatewayConnectionStartPacketCaptureFilterData.json -func ExampleVirtualNetworkGatewayConnectionsClient_BeginStartPacketCapture_startPacketCaptureOnVirtualNetworkGatewayConnectionWithFilter() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkGatewayConnectionsClient().BeginStartPacketCapture(ctx, "rg1", "vpngwcn1", &armnetwork.VirtualNetworkGatewayConnectionsClientBeginStartPacketCaptureOptions{Parameters: &armnetwork.VPNPacketCaptureStartParameters{ - FilterData: to.Ptr("{'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}]}"), - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Value = "\"{\"Status\":\"Successful\",\"Data\":null}\"" -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkGatewayConnectionStartPacketCapture.json -func ExampleVirtualNetworkGatewayConnectionsClient_BeginStartPacketCapture_startPacketCaptureOnVirtualNetworkGatewayConnectionWithoutFilter() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkGatewayConnectionsClient().BeginStartPacketCapture(ctx, "rg1", "vpngwcn1", &armnetwork.VirtualNetworkGatewayConnectionsClientBeginStartPacketCaptureOptions{Parameters: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Value = "\"{\"Status\":\"Successful\",\"Data\":null}\"" -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkGatewayConnectionStopPacketCapture.json -func ExampleVirtualNetworkGatewayConnectionsClient_BeginStopPacketCapture() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkGatewayConnectionsClient().BeginStopPacketCapture(ctx, "rg1", "vpngwcn1", armnetwork.VPNPacketCaptureStopParameters{ - SasURL: to.Ptr("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"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Value = "\"{\"Status\":\"Successful\",\"Data\":null}\"" -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkGatewayConnectionGetIkeSas.json -func ExampleVirtualNetworkGatewayConnectionsClient_BeginGetIkeSas() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkGatewayConnectionsClient().BeginGetIkeSas(ctx, "rg1", "vpngwcn1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Value = "\"{\"Status\":\"Successful\",\"Data\":null}\"" -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkGatewayConnectionReset.json -func ExampleVirtualNetworkGatewayConnectionsClient_BeginResetConnection() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkGatewayConnectionsClient().BeginResetConnection(ctx, "rg1", "conn1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/network/armnetwork/virtualnetworkgatewaynatrules_client.go b/sdk/resourcemanager/network/armnetwork/virtualnetworkgatewaynatrules_client.go index 9fa9c41c2f6d..8aece25349e9 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualnetworkgatewaynatrules_client.go +++ b/sdk/resourcemanager/network/armnetwork/virtualnetworkgatewaynatrules_client.go @@ -48,7 +48,7 @@ func NewVirtualNetworkGatewayNatRulesClient(subscriptionID string, credential az // nat rules. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the Virtual Network Gateway. // - virtualNetworkGatewayName - The name of the gateway. // - natRuleName - The name of the nat rule. @@ -74,7 +74,7 @@ func (client *VirtualNetworkGatewayNatRulesClient) BeginCreateOrUpdate(ctx conte // nat rules. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VirtualNetworkGatewayNatRulesClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, natRuleName string, natRuleParameters VirtualNetworkGatewayNatRule, options *VirtualNetworkGatewayNatRulesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewayNatRulesClient.BeginCreateOrUpdate" @@ -120,7 +120,7 @@ func (client *VirtualNetworkGatewayNatRulesClient) createOrUpdateCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, natRuleParameters); err != nil { @@ -132,7 +132,7 @@ func (client *VirtualNetworkGatewayNatRulesClient) createOrUpdateCreateRequest(c // BeginDelete - Deletes a nat rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the Virtual Network Gateway. // - virtualNetworkGatewayName - The name of the gateway. // - natRuleName - The name of the nat rule. @@ -156,7 +156,7 @@ func (client *VirtualNetworkGatewayNatRulesClient) BeginDelete(ctx context.Conte // Delete - Deletes a nat rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VirtualNetworkGatewayNatRulesClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, natRuleName string, options *VirtualNetworkGatewayNatRulesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewayNatRulesClient.BeginDelete" @@ -202,7 +202,7 @@ func (client *VirtualNetworkGatewayNatRulesClient) deleteCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -211,7 +211,7 @@ func (client *VirtualNetworkGatewayNatRulesClient) deleteCreateRequest(ctx conte // Get - Retrieves the details of a nat rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the Virtual Network Gateway. // - virtualNetworkGatewayName - The name of the gateway. // - natRuleName - The name of the nat rule. @@ -263,7 +263,7 @@ func (client *VirtualNetworkGatewayNatRulesClient) getCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -280,7 +280,7 @@ func (client *VirtualNetworkGatewayNatRulesClient) getHandleResponse(resp *http. // NewListByVirtualNetworkGatewayPager - Retrieves all nat rules for a particular virtual network gateway. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the virtual network gateway. // - virtualNetworkGatewayName - The name of the gateway. // - options - VirtualNetworkGatewayNatRulesClientListByVirtualNetworkGatewayOptions contains the optional parameters for the @@ -335,7 +335,7 @@ func (client *VirtualNetworkGatewayNatRulesClient) listByVirtualNetworkGatewayCr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/virtualnetworkgatewaynatrules_client_example_test.go b/sdk/resourcemanager/network/armnetwork/virtualnetworkgatewaynatrules_client_example_test.go deleted file mode 100644 index 96051f0961cb..000000000000 --- a/sdk/resourcemanager/network/armnetwork/virtualnetworkgatewaynatrules_client_example_test.go +++ /dev/null @@ -1,169 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkGatewayNatRuleGet.json -func ExampleVirtualNetworkGatewayNatRulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualNetworkGatewayNatRulesClient().Get(ctx, "rg1", "gateway1", "natRule1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualNetworkGatewayNatRule = armnetwork.VirtualNetworkGatewayNatRule{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/gateway1/natRules/natRule1"), - // Name: to.Ptr("natRule1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VirtualNetworkGatewayNatRuleProperties{ - // Type: to.Ptr(armnetwork.VPNNatRuleTypeStatic), - // ExternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("50.4.0.0/24"), - // PortRange: to.Ptr("200-200"), - // }}, - // InternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("10.4.0.0/24"), - // PortRange: to.Ptr("100-100"), - // }}, - // IPConfigurationID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/gateway1/ipConfigurations/default"), - // Mode: to.Ptr(armnetwork.VPNNatRuleModeEgressSnat), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkGatewayNatRulePut.json -func ExampleVirtualNetworkGatewayNatRulesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkGatewayNatRulesClient().BeginCreateOrUpdate(ctx, "rg1", "gateway1", "natRule1", armnetwork.VirtualNetworkGatewayNatRule{ - Properties: &armnetwork.VirtualNetworkGatewayNatRuleProperties{ - Type: to.Ptr(armnetwork.VPNNatRuleTypeStatic), - ExternalMappings: []*armnetwork.VPNNatRuleMapping{ - { - AddressSpace: to.Ptr("192.168.21.0/24"), - PortRange: to.Ptr("300-400"), - }}, - InternalMappings: []*armnetwork.VPNNatRuleMapping{ - { - AddressSpace: to.Ptr("10.4.0.0/24"), - PortRange: to.Ptr("200-300"), - }}, - IPConfigurationID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/gateway1/ipConfigurations/default"), - Mode: to.Ptr(armnetwork.VPNNatRuleModeEgressSnat), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualNetworkGatewayNatRule = armnetwork.VirtualNetworkGatewayNatRule{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/gateway1/natRules/natRule1"), - // Name: to.Ptr("natRule1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VirtualNetworkGatewayNatRuleProperties{ - // Type: to.Ptr(armnetwork.VPNNatRuleTypeStatic), - // ExternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("192.168.21.0/24"), - // PortRange: to.Ptr("300-400"), - // }}, - // InternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("10.4.0.0/24"), - // PortRange: to.Ptr("200-300"), - // }}, - // IPConfigurationID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/gateway1/ipConfigurations/default"), - // Mode: to.Ptr(armnetwork.VPNNatRuleModeEgressSnat), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkGatewayNatRuleDelete.json -func ExampleVirtualNetworkGatewayNatRulesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkGatewayNatRulesClient().BeginDelete(ctx, "rg1", "gateway1", "natRule1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkGatewayNatRuleList.json -func ExampleVirtualNetworkGatewayNatRulesClient_NewListByVirtualNetworkGatewayPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualNetworkGatewayNatRulesClient().NewListByVirtualNetworkGatewayPager("rg1", "gateway1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ListVirtualNetworkGatewayNatRulesResult = armnetwork.ListVirtualNetworkGatewayNatRulesResult{ - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/virtualnetworkgateways_client.go b/sdk/resourcemanager/network/armnetwork/virtualnetworkgateways_client.go index 67fc6261a113..6f8b4ffb27da 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualnetworkgateways_client.go +++ b/sdk/resourcemanager/network/armnetwork/virtualnetworkgateways_client.go @@ -47,7 +47,7 @@ func NewVirtualNetworkGatewaysClient(subscriptionID string, credential azcore.To // BeginCreateOrUpdate - Creates or updates a virtual network gateway in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - parameters - Parameters supplied to create or update virtual network gateway operation. @@ -71,7 +71,7 @@ func (client *VirtualNetworkGatewaysClient) BeginCreateOrUpdate(ctx context.Cont // CreateOrUpdate - Creates or updates a virtual network gateway in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VirtualNetworkGatewaysClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VirtualNetworkGateway, options *VirtualNetworkGatewaysClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginCreateOrUpdate" @@ -113,7 +113,7 @@ func (client *VirtualNetworkGatewaysClient) createOrUpdateCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -125,7 +125,7 @@ func (client *VirtualNetworkGatewaysClient) createOrUpdateCreateRequest(ctx cont // BeginDelete - Deletes the specified virtual network gateway. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - options - VirtualNetworkGatewaysClientBeginDeleteOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginDelete @@ -148,7 +148,7 @@ func (client *VirtualNetworkGatewaysClient) BeginDelete(ctx context.Context, res // Delete - Deletes the specified virtual network gateway. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VirtualNetworkGatewaysClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginDelete" @@ -190,7 +190,7 @@ func (client *VirtualNetworkGatewaysClient) deleteCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -200,7 +200,7 @@ func (client *VirtualNetworkGatewaysClient) deleteCreateRequest(ctx context.Cont // resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - request - The parameters are supplied to disconnect vpn connections. @@ -225,7 +225,7 @@ func (client *VirtualNetworkGatewaysClient) BeginDisconnectVirtualNetworkGateway // resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VirtualNetworkGatewaysClient) disconnectVirtualNetworkGatewayVPNConnections(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, request P2SVPNConnectionRequest, options *VirtualNetworkGatewaysClientBeginDisconnectVirtualNetworkGatewayVPNConnectionsOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginDisconnectVirtualNetworkGatewayVPNConnections" @@ -267,7 +267,7 @@ func (client *VirtualNetworkGatewaysClient) disconnectVirtualNetworkGatewayVPNCo return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, request); err != nil { @@ -280,7 +280,7 @@ func (client *VirtualNetworkGatewaysClient) disconnectVirtualNetworkGatewayVPNCo // group. Used for IKEV2 and radius based authentication. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - parameters - Parameters supplied to the generate virtual network gateway VPN client package operation. @@ -305,7 +305,7 @@ func (client *VirtualNetworkGatewaysClient) BeginGenerateVPNProfile(ctx context. // Used for IKEV2 and radius based authentication. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VirtualNetworkGatewaysClient) generateVPNProfile(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VPNClientParameters, options *VirtualNetworkGatewaysClientBeginGenerateVPNProfileOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginGenerateVPNProfile" @@ -347,7 +347,7 @@ func (client *VirtualNetworkGatewaysClient) generateVPNProfileCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -360,7 +360,7 @@ func (client *VirtualNetworkGatewaysClient) generateVPNProfileCreateRequest(ctx // resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - parameters - Parameters supplied to the generate virtual network gateway VPN client package operation. @@ -385,7 +385,7 @@ func (client *VirtualNetworkGatewaysClient) BeginGeneratevpnclientpackage(ctx co // resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VirtualNetworkGatewaysClient) generatevpnclientpackage(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VPNClientParameters, options *VirtualNetworkGatewaysClientBeginGeneratevpnclientpackageOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginGeneratevpnclientpackage" @@ -427,7 +427,7 @@ func (client *VirtualNetworkGatewaysClient) generatevpnclientpackageCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -439,7 +439,7 @@ func (client *VirtualNetworkGatewaysClient) generatevpnclientpackageCreateReques // Get - Gets the specified virtual network gateway by resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - options - VirtualNetworkGatewaysClientGetOptions contains the optional parameters for the VirtualNetworkGatewaysClient.Get @@ -486,7 +486,7 @@ func (client *VirtualNetworkGatewaysClient) getCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -505,7 +505,7 @@ func (client *VirtualNetworkGatewaysClient) getHandleResponse(resp *http.Respons // specified peer. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - peer - The IP address of the peer. @@ -530,7 +530,7 @@ func (client *VirtualNetworkGatewaysClient) BeginGetAdvertisedRoutes(ctx context // peer. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VirtualNetworkGatewaysClient) getAdvertisedRoutes(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, peer string, options *VirtualNetworkGatewaysClientBeginGetAdvertisedRoutesOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginGetAdvertisedRoutes" @@ -573,7 +573,7 @@ func (client *VirtualNetworkGatewaysClient) getAdvertisedRoutesCreateRequest(ctx } reqQP := req.Raw().URL.Query() reqQP.Set("peer", peer) - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -582,7 +582,7 @@ func (client *VirtualNetworkGatewaysClient) getAdvertisedRoutesCreateRequest(ctx // BeginGetBgpPeerStatus - The GetBgpPeerStatus operation retrieves the status of all BGP peers. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - options - VirtualNetworkGatewaysClientBeginGetBgpPeerStatusOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginGetBgpPeerStatus @@ -605,7 +605,7 @@ func (client *VirtualNetworkGatewaysClient) BeginGetBgpPeerStatus(ctx context.Co // GetBgpPeerStatus - The GetBgpPeerStatus operation retrieves the status of all BGP peers. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VirtualNetworkGatewaysClient) getBgpPeerStatus(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginGetBgpPeerStatusOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginGetBgpPeerStatus" @@ -650,7 +650,7 @@ func (client *VirtualNetworkGatewaysClient) getBgpPeerStatusCreateRequest(ctx co if options != nil && options.Peer != nil { reqQP.Set("peer", *options.Peer) } - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -660,7 +660,7 @@ func (client *VirtualNetworkGatewaysClient) getBgpPeerStatusCreateRequest(ctx co // learned from BGP peers. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - options - VirtualNetworkGatewaysClientBeginGetLearnedRoutesOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginGetLearnedRoutes @@ -684,7 +684,7 @@ func (client *VirtualNetworkGatewaysClient) BeginGetLearnedRoutes(ctx context.Co // learned from BGP peers. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VirtualNetworkGatewaysClient) getLearnedRoutes(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginGetLearnedRoutesOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginGetLearnedRoutes" @@ -726,7 +726,7 @@ func (client *VirtualNetworkGatewaysClient) getLearnedRoutesCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -736,7 +736,7 @@ func (client *VirtualNetworkGatewaysClient) getLearnedRoutesCreateRequest(ctx co // resource group. The profile needs to be generated first using generateVpnProfile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - options - VirtualNetworkGatewaysClientBeginGetVPNProfilePackageURLOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginGetVPNProfilePackageURL @@ -760,7 +760,7 @@ func (client *VirtualNetworkGatewaysClient) BeginGetVPNProfilePackageURL(ctx con // resource group. The profile needs to be generated first using generateVpnProfile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VirtualNetworkGatewaysClient) getVPNProfilePackageURL(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginGetVPNProfilePackageURLOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginGetVPNProfilePackageURL" @@ -802,7 +802,7 @@ func (client *VirtualNetworkGatewaysClient) getVPNProfilePackageURLCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -812,7 +812,7 @@ func (client *VirtualNetworkGatewaysClient) getVPNProfilePackageURLCreateRequest // gateway in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - options - VirtualNetworkGatewaysClientBeginGetVpnclientConnectionHealthOptions contains the optional parameters for the @@ -836,7 +836,7 @@ func (client *VirtualNetworkGatewaysClient) BeginGetVpnclientConnectionHealth(ct // gateway in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VirtualNetworkGatewaysClient) getVpnclientConnectionHealth(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginGetVpnclientConnectionHealthOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginGetVpnclientConnectionHealth" @@ -878,7 +878,7 @@ func (client *VirtualNetworkGatewaysClient) getVpnclientConnectionHealthCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -889,7 +889,7 @@ func (client *VirtualNetworkGatewaysClient) getVpnclientConnectionHealthCreateRe // provider. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayName - The virtual network gateway name. // - options - VirtualNetworkGatewaysClientBeginGetVpnclientIPSecParametersOptions contains the optional parameters for the @@ -914,7 +914,7 @@ func (client *VirtualNetworkGatewaysClient) BeginGetVpnclientIPSecParameters(ctx // provider. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VirtualNetworkGatewaysClient) getVpnclientIPSecParameters(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginGetVpnclientIPSecParametersOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginGetVpnclientIPSecParameters" @@ -956,7 +956,7 @@ func (client *VirtualNetworkGatewaysClient) getVpnclientIPSecParametersCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -964,7 +964,7 @@ func (client *VirtualNetworkGatewaysClient) getVpnclientIPSecParametersCreateReq // NewListPager - Gets all virtual network gateways by resource group. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - options - VirtualNetworkGatewaysClientListOptions contains the optional parameters for the VirtualNetworkGatewaysClient.NewListPager // method. @@ -1014,7 +1014,7 @@ func (client *VirtualNetworkGatewaysClient) listCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1031,7 +1031,7 @@ func (client *VirtualNetworkGatewaysClient) listHandleResponse(resp *http.Respon // NewListConnectionsPager - Gets all the connections in a virtual network gateway. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - options - VirtualNetworkGatewaysClientListConnectionsOptions contains the optional parameters for the VirtualNetworkGatewaysClient.NewListConnectionsPager @@ -1086,7 +1086,7 @@ func (client *VirtualNetworkGatewaysClient) listConnectionsCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1104,7 +1104,7 @@ func (client *VirtualNetworkGatewaysClient) listConnectionsHandleResponse(resp * // BeginReset - Resets the primary of the virtual network gateway in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - options - VirtualNetworkGatewaysClientBeginResetOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginReset @@ -1127,7 +1127,7 @@ func (client *VirtualNetworkGatewaysClient) BeginReset(ctx context.Context, reso // Reset - Resets the primary of the virtual network gateway in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VirtualNetworkGatewaysClient) reset(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginResetOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginReset" @@ -1172,7 +1172,7 @@ func (client *VirtualNetworkGatewaysClient) resetCreateRequest(ctx context.Conte if options != nil && options.GatewayVip != nil { reqQP.Set("gatewayVip", *options.GatewayVip) } - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1182,7 +1182,7 @@ func (client *VirtualNetworkGatewaysClient) resetCreateRequest(ctx context.Conte // group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - options - VirtualNetworkGatewaysClientBeginResetVPNClientSharedKeyOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginResetVPNClientSharedKey @@ -1205,7 +1205,7 @@ func (client *VirtualNetworkGatewaysClient) BeginResetVPNClientSharedKey(ctx con // ResetVPNClientSharedKey - Resets the VPN client shared key of the virtual network gateway in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VirtualNetworkGatewaysClient) resetVPNClientSharedKey(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginResetVPNClientSharedKeyOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginResetVPNClientSharedKey" @@ -1247,7 +1247,7 @@ func (client *VirtualNetworkGatewaysClient) resetVPNClientSharedKeyCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1257,7 +1257,7 @@ func (client *VirtualNetworkGatewaysClient) resetVPNClientSharedKeyCreateRequest // of virtual network gateway in the specified resource group through Network resource provider. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - vpnclientIPSecParams - Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network Gateway P2S client @@ -1283,7 +1283,7 @@ func (client *VirtualNetworkGatewaysClient) BeginSetVpnclientIPSecParameters(ctx // of virtual network gateway in the specified resource group through Network resource provider. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VirtualNetworkGatewaysClient) setVpnclientIPSecParameters(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, vpnclientIPSecParams VPNClientIPsecParameters, options *VirtualNetworkGatewaysClientBeginSetVpnclientIPSecParametersOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginSetVpnclientIPSecParameters" @@ -1325,7 +1325,7 @@ func (client *VirtualNetworkGatewaysClient) setVpnclientIPSecParametersCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, vpnclientIPSecParams); err != nil { @@ -1337,7 +1337,7 @@ func (client *VirtualNetworkGatewaysClient) setVpnclientIPSecParametersCreateReq // BeginStartPacketCapture - Starts packet capture on virtual network gateway in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - options - VirtualNetworkGatewaysClientBeginStartPacketCaptureOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginStartPacketCapture @@ -1360,7 +1360,7 @@ func (client *VirtualNetworkGatewaysClient) BeginStartPacketCapture(ctx context. // StartPacketCapture - Starts packet capture on virtual network gateway in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VirtualNetworkGatewaysClient) startPacketCapture(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginStartPacketCaptureOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginStartPacketCapture" @@ -1402,7 +1402,7 @@ func (client *VirtualNetworkGatewaysClient) startPacketCaptureCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Parameters != nil { @@ -1417,7 +1417,7 @@ func (client *VirtualNetworkGatewaysClient) startPacketCaptureCreateRequest(ctx // BeginStopPacketCapture - Stops packet capture on virtual network gateway in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - parameters - Virtual network gateway packet capture parameters supplied to stop packet capture on gateway. @@ -1441,7 +1441,7 @@ func (client *VirtualNetworkGatewaysClient) BeginStopPacketCapture(ctx context.C // StopPacketCapture - Stops packet capture on virtual network gateway in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VirtualNetworkGatewaysClient) stopPacketCapture(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VPNPacketCaptureStopParameters, options *VirtualNetworkGatewaysClientBeginStopPacketCaptureOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginStopPacketCapture" @@ -1483,7 +1483,7 @@ func (client *VirtualNetworkGatewaysClient) stopPacketCaptureCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -1495,7 +1495,7 @@ func (client *VirtualNetworkGatewaysClient) stopPacketCaptureCreateRequest(ctx c // SupportedVPNDevices - Gets a xml format representation for supported vpn devices. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - options - VirtualNetworkGatewaysClientSupportedVPNDevicesOptions contains the optional parameters for the VirtualNetworkGatewaysClient.SupportedVPNDevices @@ -1542,7 +1542,7 @@ func (client *VirtualNetworkGatewaysClient) supportedVPNDevicesCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1560,7 +1560,7 @@ func (client *VirtualNetworkGatewaysClient) supportedVPNDevicesHandleResponse(re // BeginUpdateTags - Updates a virtual network gateway tags. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - parameters - Parameters supplied to update virtual network gateway tags. @@ -1584,7 +1584,7 @@ func (client *VirtualNetworkGatewaysClient) BeginUpdateTags(ctx context.Context, // UpdateTags - Updates a virtual network gateway tags. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VirtualNetworkGatewaysClient) updateTags(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters TagsObject, options *VirtualNetworkGatewaysClientBeginUpdateTagsOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginUpdateTags" @@ -1626,7 +1626,7 @@ func (client *VirtualNetworkGatewaysClient) updateTagsCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -1638,7 +1638,7 @@ func (client *VirtualNetworkGatewaysClient) updateTagsCreateRequest(ctx context. // VPNDeviceConfigurationScript - Gets a xml format representation for vpn device configuration script. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayConnectionName - The name of the virtual network gateway connection for which the configuration script // is generated. @@ -1687,7 +1687,7 @@ func (client *VirtualNetworkGatewaysClient) vpnDeviceConfigurationScriptCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/virtualnetworkgateways_client_example_test.go b/sdk/resourcemanager/network/armnetwork/virtualnetworkgateways_client_example_test.go deleted file mode 100644 index 08d7c5843c19..000000000000 --- a/sdk/resourcemanager/network/armnetwork/virtualnetworkgateways_client_example_test.go +++ /dev/null @@ -1,1305 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkGatewayUpdate.json -func ExampleVirtualNetworkGatewaysClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginCreateOrUpdate(ctx, "rg1", "vpngw", armnetwork.VirtualNetworkGateway{ - Location: to.Ptr("centralus"), - Properties: &armnetwork.VirtualNetworkGatewayPropertiesFormat{ - Active: to.Ptr(false), - AllowRemoteVnetTraffic: to.Ptr(false), - AllowVirtualWanTraffic: to.Ptr(false), - BgpSettings: &armnetwork.BgpSettings{ - Asn: to.Ptr[int64](65515), - BgpPeeringAddress: to.Ptr("10.0.1.30"), - PeerWeight: to.Ptr[int32](0), - }, - CustomRoutes: &armnetwork.AddressSpace{ - AddressPrefixes: []*string{ - to.Ptr("101.168.0.6/32")}, - }, - DisableIPSecReplayProtection: to.Ptr(false), - EnableBgp: to.Ptr(false), - EnableBgpRouteTranslationForNat: to.Ptr(false), - EnableDNSForwarding: to.Ptr(true), - GatewayType: to.Ptr(armnetwork.VirtualNetworkGatewayTypeVPN), - IPConfigurations: []*armnetwork.VirtualNetworkGatewayIPConfiguration{ - { - Name: to.Ptr("gwipconfig1"), - Properties: &armnetwork.VirtualNetworkGatewayIPConfigurationPropertiesFormat{ - PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - PublicIPAddress: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/gwpip"), - }, - Subnet: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/GatewaySubnet"), - }, - }, - }}, - NatRules: []*armnetwork.VirtualNetworkGatewayNatRule{ - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/natRules/natRule1"), - Name: to.Ptr("natRule1"), - Properties: &armnetwork.VirtualNetworkGatewayNatRuleProperties{ - Type: to.Ptr(armnetwork.VPNNatRuleTypeStatic), - ExternalMappings: []*armnetwork.VPNNatRuleMapping{ - { - AddressSpace: to.Ptr("50.0.0.0/24"), - }}, - InternalMappings: []*armnetwork.VPNNatRuleMapping{ - { - AddressSpace: to.Ptr("10.10.0.0/24"), - }}, - IPConfigurationID: to.Ptr(""), - Mode: to.Ptr(armnetwork.VPNNatRuleModeEgressSnat), - }, - }, - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/natRules/natRule2"), - Name: to.Ptr("natRule2"), - Properties: &armnetwork.VirtualNetworkGatewayNatRuleProperties{ - Type: to.Ptr(armnetwork.VPNNatRuleTypeStatic), - ExternalMappings: []*armnetwork.VPNNatRuleMapping{ - { - AddressSpace: to.Ptr("30.0.0.0/24"), - }}, - InternalMappings: []*armnetwork.VPNNatRuleMapping{ - { - AddressSpace: to.Ptr("20.10.0.0/24"), - }}, - IPConfigurationID: to.Ptr(""), - Mode: to.Ptr(armnetwork.VPNNatRuleModeIngressSnat), - }, - }}, - SKU: &armnetwork.VirtualNetworkGatewaySKU{ - Name: to.Ptr(armnetwork.VirtualNetworkGatewaySKUNameVPNGw1), - Tier: to.Ptr(armnetwork.VirtualNetworkGatewaySKUTierVPNGw1), - }, - VPNClientConfiguration: &armnetwork.VPNClientConfiguration{ - RadiusServers: []*armnetwork.RadiusServer{ - { - RadiusServerAddress: to.Ptr("10.2.0.0"), - RadiusServerScore: to.Ptr[int64](20), - RadiusServerSecret: to.Ptr("radiusServerSecret"), - }}, - VPNClientProtocols: []*armnetwork.VPNClientProtocol{ - to.Ptr(armnetwork.VPNClientProtocolOpenVPN)}, - VPNClientRevokedCertificates: []*armnetwork.VPNClientRevokedCertificate{}, - VPNClientRootCertificates: []*armnetwork.VPNClientRootCertificate{}, - }, - VPNType: to.Ptr(armnetwork.VPNTypeRouteBased), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualNetworkGateway = armnetwork.VirtualNetworkGateway{ - // Name: to.Ptr("vpngw"), - // Type: to.Ptr("Microsoft.Network/virtualNetworkGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw"), - // Location: to.Ptr("centralus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.VirtualNetworkGatewayPropertiesFormat{ - // Active: to.Ptr(false), - // AllowRemoteVnetTraffic: to.Ptr(false), - // AllowVirtualWanTraffic: to.Ptr(false), - // BgpSettings: &armnetwork.BgpSettings{ - // Asn: to.Ptr[int64](65515), - // BgpPeeringAddress: to.Ptr("10.0.1.30"), - // BgpPeeringAddresses: []*armnetwork.IPConfigurationBgpPeeringAddress{ - // { - // CustomBgpIPAddresses: []*string{ - // to.Ptr("169.254.21.10")}, - // DefaultBgpIPAddresses: []*string{ - // to.Ptr("10.3.1.254")}, - // IPConfigurationID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/gwipconfig1"), - // TunnelIPAddresses: []*string{ - // to.Ptr("52.161.10.135")}, - // }}, - // PeerWeight: to.Ptr[int32](0), - // }, - // CustomRoutes: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("101.168.0.6/32")}, - // }, - // DisableIPSecReplayProtection: to.Ptr(false), - // EnableBgp: to.Ptr(false), - // EnableBgpRouteTranslationForNat: to.Ptr(false), - // EnableDNSForwarding: to.Ptr(true), - // GatewayType: to.Ptr(armnetwork.VirtualNetworkGatewayTypeVPN), - // InboundDNSForwardingEndpoint: to.Ptr("10.0.1.14"), - // IPConfigurations: []*armnetwork.VirtualNetworkGatewayIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/gwipconfig1"), - // Name: to.Ptr("gwipconfig1"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.VirtualNetworkGatewayIPConfigurationPropertiesFormat{ - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/gwpip"), - // }, - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/GatewaySubnet"), - // }, - // }, - // }}, - // NatRules: []*armnetwork.VirtualNetworkGatewayNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/natRules/natRule1"), - // Name: to.Ptr("natRule1"), - // Properties: &armnetwork.VirtualNetworkGatewayNatRuleProperties{ - // Type: to.Ptr(armnetwork.VPNNatRuleTypeStatic), - // ExternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("50.0.0.0/24"), - // }}, - // InternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("10.10.0.0/24"), - // }}, - // IPConfigurationID: to.Ptr(""), - // Mode: to.Ptr(armnetwork.VPNNatRuleModeEgressSnat), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/natRules/natRule2"), - // Name: to.Ptr("natRule2"), - // Properties: &armnetwork.VirtualNetworkGatewayNatRuleProperties{ - // Type: to.Ptr(armnetwork.VPNNatRuleTypeStatic), - // ExternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("30.0.0.0/24"), - // }}, - // InternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("20.10.0.0/24"), - // }}, - // IPConfigurationID: to.Ptr(""), - // Mode: to.Ptr(armnetwork.VPNNatRuleModeIngressSnat), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // SKU: &armnetwork.VirtualNetworkGatewaySKU{ - // Name: to.Ptr(armnetwork.VirtualNetworkGatewaySKUNameVPNGw1), - // Capacity: to.Ptr[int32](0), - // Tier: to.Ptr(armnetwork.VirtualNetworkGatewaySKUTierVPNGw1), - // }, - // VPNClientConfiguration: &armnetwork.VPNClientConfiguration{ - // RadiusServers: []*armnetwork.RadiusServer{ - // { - // RadiusServerAddress: to.Ptr("10.2.0.0"), - // RadiusServerScore: to.Ptr[int64](20), - // }}, - // VPNClientProtocols: []*armnetwork.VPNClientProtocol{ - // to.Ptr(armnetwork.VPNClientProtocolOpenVPN)}, - // VPNClientRevokedCertificates: []*armnetwork.VPNClientRevokedCertificate{ - // }, - // VPNClientRootCertificates: []*armnetwork.VPNClientRootCertificate{ - // }, - // }, - // VPNGatewayGeneration: to.Ptr(armnetwork.VPNGatewayGenerationNone), - // VPNType: to.Ptr(armnetwork.VPNTypeRouteBased), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkGatewayGet.json -func ExampleVirtualNetworkGatewaysClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualNetworkGatewaysClient().Get(ctx, "rg1", "vpngw", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualNetworkGateway = armnetwork.VirtualNetworkGateway{ - // Name: to.Ptr("vpngw"), - // Type: to.Ptr("Microsoft.Network/virtualNetworkGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw"), - // Location: to.Ptr("centralus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.VirtualNetworkGatewayPropertiesFormat{ - // Active: to.Ptr(false), - // AllowRemoteVnetTraffic: to.Ptr(false), - // AllowVirtualWanTraffic: to.Ptr(false), - // BgpSettings: &armnetwork.BgpSettings{ - // Asn: to.Ptr[int64](65514), - // BgpPeeringAddress: to.Ptr("10.0.1.30"), - // BgpPeeringAddresses: []*armnetwork.IPConfigurationBgpPeeringAddress{ - // { - // CustomBgpIPAddresses: []*string{ - // to.Ptr("169.254.21.10")}, - // DefaultBgpIPAddresses: []*string{ - // to.Ptr("10.3.1.254")}, - // IPConfigurationID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/gwipconfig1"), - // TunnelIPAddresses: []*string{ - // to.Ptr("52.161.10.135")}, - // }}, - // PeerWeight: to.Ptr[int32](0), - // }, - // CustomRoutes: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("101.168.0.6/32")}, - // }, - // DisableIPSecReplayProtection: to.Ptr(false), - // EnableBgp: to.Ptr(false), - // EnableBgpRouteTranslationForNat: to.Ptr(false), - // EnablePrivateIPAddress: to.Ptr(false), - // GatewayType: to.Ptr(armnetwork.VirtualNetworkGatewayTypeVPN), - // IPConfigurations: []*armnetwork.VirtualNetworkGatewayIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/gwipconfig1"), - // Name: to.Ptr("gwipconfig1"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.VirtualNetworkGatewayIPConfigurationPropertiesFormat{ - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/gwpip"), - // }, - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/GatewaySubnet"), - // }, - // }, - // }}, - // NatRules: []*armnetwork.VirtualNetworkGatewayNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/natRules/natRule1"), - // Name: to.Ptr("natRule1"), - // Etag: to.Ptr("W/\"00ae2b69-88e7-4b3a-b66a-cfa2244e0801\""), - // Properties: &armnetwork.VirtualNetworkGatewayNatRuleProperties{ - // Type: to.Ptr(armnetwork.VPNNatRuleTypeStatic), - // ExternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("50.0.0.0/24"), - // }}, - // InternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("10.10.0.0/24"), - // }}, - // Mode: to.Ptr(armnetwork.VPNNatRuleModeEgressSnat), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/natRules/natRule2"), - // Name: to.Ptr("natRule2"), - // Etag: to.Ptr("W/\"00ae2b69-88e7-4b3a-b66a-cfa2244e0801\""), - // Properties: &armnetwork.VirtualNetworkGatewayNatRuleProperties{ - // Type: to.Ptr(armnetwork.VPNNatRuleTypeStatic), - // ExternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("30.0.0.0/24"), - // }}, - // InternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("20.10.0.0/24"), - // }}, - // Mode: to.Ptr(armnetwork.VPNNatRuleModeIngressSnat), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // SKU: &armnetwork.VirtualNetworkGatewaySKU{ - // Name: to.Ptr(armnetwork.VirtualNetworkGatewaySKUNameVPNGw1), - // Capacity: to.Ptr[int32](0), - // Tier: to.Ptr(armnetwork.VirtualNetworkGatewaySKUTierVPNGw1), - // }, - // VPNClientConfiguration: &armnetwork.VPNClientConfiguration{ - // RadiusServers: []*armnetwork.RadiusServer{ - // { - // RadiusServerAddress: to.Ptr("10.1.0.0"), - // RadiusServerScore: to.Ptr[int64](20), - // }}, - // VPNClientProtocols: []*armnetwork.VPNClientProtocol{ - // to.Ptr(armnetwork.VPNClientProtocolOpenVPN)}, - // VPNClientRevokedCertificates: []*armnetwork.VPNClientRevokedCertificate{ - // }, - // VPNClientRootCertificates: []*armnetwork.VPNClientRootCertificate{ - // }, - // }, - // VPNGatewayGeneration: to.Ptr(armnetwork.VPNGatewayGenerationNone), - // VPNType: to.Ptr(armnetwork.VPNTypeRouteBased), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkGatewayDelete.json -func ExampleVirtualNetworkGatewaysClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginDelete(ctx, "rg1", "vpngw", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkGatewayUpdateTags.json -func ExampleVirtualNetworkGatewaysClient_BeginUpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginUpdateTags(ctx, "rg1", "vpngw", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualNetworkGateway = armnetwork.VirtualNetworkGateway{ - // Name: to.Ptr("vpngw"), - // Type: to.Ptr("Microsoft.Network/virtualNetworkGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armnetwork.VirtualNetworkGatewayPropertiesFormat{ - // Active: to.Ptr(false), - // AllowRemoteVnetTraffic: to.Ptr(false), - // AllowVirtualWanTraffic: to.Ptr(false), - // BgpSettings: &armnetwork.BgpSettings{ - // Asn: to.Ptr[int64](65515), - // BgpPeeringAddress: to.Ptr("10.0.0.254"), - // BgpPeeringAddresses: []*armnetwork.IPConfigurationBgpPeeringAddress{ - // { - // CustomBgpIPAddresses: []*string{ - // to.Ptr("169.254.21.10")}, - // DefaultBgpIPAddresses: []*string{ - // to.Ptr("10.3.1.254")}, - // IPConfigurationID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/gwipconfig1"), - // TunnelIPAddresses: []*string{ - // to.Ptr("52.161.10.135")}, - // }}, - // PeerWeight: to.Ptr[int32](0), - // }, - // CustomRoutes: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("101.168.0.6/32")}, - // }, - // DisableIPSecReplayProtection: to.Ptr(false), - // EnableBgp: to.Ptr(false), - // EnableBgpRouteTranslationForNat: to.Ptr(false), - // GatewayType: to.Ptr(armnetwork.VirtualNetworkGatewayTypeVPN), - // IPConfigurations: []*armnetwork.VirtualNetworkGatewayIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/default"), - // Name: to.Ptr("default"), - // Properties: &armnetwork.VirtualNetworkGatewayIPConfigurationPropertiesFormat{ - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/testpub1"), - // }, - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/GatewaySubnet"), - // }, - // }, - // }}, - // NatRules: []*armnetwork.VirtualNetworkGatewayNatRule{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // SKU: &armnetwork.VirtualNetworkGatewaySKU{ - // Name: to.Ptr(armnetwork.VirtualNetworkGatewaySKUNameVPNGw1), - // Capacity: to.Ptr[int32](2), - // Tier: to.Ptr(armnetwork.VirtualNetworkGatewaySKUTierVPNGw1), - // }, - // VPNGatewayGeneration: to.Ptr(armnetwork.VPNGatewayGenerationNone), - // VPNType: to.Ptr(armnetwork.VPNTypeRouteBased), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkGatewayList.json -func ExampleVirtualNetworkGatewaysClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualNetworkGatewaysClient().NewListPager("rg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualNetworkGatewayListResult = armnetwork.VirtualNetworkGatewayListResult{ - // Value: []*armnetwork.VirtualNetworkGateway{ - // { - // Name: to.Ptr("vpngw1"), - // Type: to.Ptr("Microsoft.Network/virtualNetworkGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw1"), - // Location: to.Ptr("loc1"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.VirtualNetworkGatewayPropertiesFormat{ - // Active: to.Ptr(false), - // AllowRemoteVnetTraffic: to.Ptr(false), - // AllowVirtualWanTraffic: to.Ptr(false), - // BgpSettings: &armnetwork.BgpSettings{ - // Asn: to.Ptr[int64](65515), - // BgpPeeringAddress: to.Ptr("10.0.0.14"), - // PeerWeight: to.Ptr[int32](0), - // }, - // CustomRoutes: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("101.168.0.6/32")}, - // }, - // DisableIPSecReplayProtection: to.Ptr(false), - // EnableBgp: to.Ptr(false), - // EnableBgpRouteTranslationForNat: to.Ptr(false), - // EnablePrivateIPAddress: to.Ptr(false), - // GatewayType: to.Ptr(armnetwork.VirtualNetworkGatewayTypeVPN), - // IPConfigurations: []*armnetwork.VirtualNetworkGatewayIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw1/ipConfigurations/default"), - // Name: to.Ptr("default"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.VirtualNetworkGatewayIPConfigurationPropertiesFormat{ - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/vpngw1-ip"), - // }, - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/GatewaySubnet"), - // }, - // }, - // }}, - // NatRules: []*armnetwork.VirtualNetworkGatewayNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw1/natRules/natRule1"), - // Name: to.Ptr("natRule1"), - // Etag: to.Ptr("W/\"00ae2b69-88e7-4b3a-b66a-cfa2244e0801\""), - // Properties: &armnetwork.VirtualNetworkGatewayNatRuleProperties{ - // Type: to.Ptr(armnetwork.VPNNatRuleTypeStatic), - // ExternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("50.0.0.0/24"), - // }}, - // InternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("10.10.0.0/24"), - // }}, - // Mode: to.Ptr(armnetwork.VPNNatRuleModeEgressSnat), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw1/natRules/natRule2"), - // Name: to.Ptr("natRule2"), - // Etag: to.Ptr("W/\"00ae2b69-88e7-4b3a-b66a-cfa2244e0801\""), - // Properties: &armnetwork.VirtualNetworkGatewayNatRuleProperties{ - // Type: to.Ptr(armnetwork.VPNNatRuleTypeStatic), - // ExternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("30.0.0.0/24"), - // }}, - // InternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("20.10.0.0/24"), - // }}, - // Mode: to.Ptr(armnetwork.VPNNatRuleModeIngressSnat), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // SKU: &armnetwork.VirtualNetworkGatewaySKU{ - // Name: to.Ptr(armnetwork.VirtualNetworkGatewaySKUNameVPNGw1), - // Capacity: to.Ptr[int32](2), - // Tier: to.Ptr(armnetwork.VirtualNetworkGatewaySKUTierVPNGw1), - // }, - // VPNClientConfiguration: &armnetwork.VPNClientConfiguration{ - // VPNClientProtocols: []*armnetwork.VPNClientProtocol{ - // }, - // VPNClientRevokedCertificates: []*armnetwork.VPNClientRevokedCertificate{ - // }, - // VPNClientRootCertificates: []*armnetwork.VPNClientRootCertificate{ - // }, - // }, - // VPNGatewayGeneration: to.Ptr(armnetwork.VPNGatewayGenerationNone), - // VPNType: to.Ptr(armnetwork.VPNTypeRouteBased), - // }, - // }, - // { - // Name: to.Ptr("vpngw2"), - // Type: to.Ptr("Microsoft.Network/virtualNetworkGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw2"), - // Location: to.Ptr("loc2"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.VirtualNetworkGatewayPropertiesFormat{ - // Active: to.Ptr(false), - // AllowRemoteVnetTraffic: to.Ptr(false), - // AllowVirtualWanTraffic: to.Ptr(false), - // BgpSettings: &armnetwork.BgpSettings{ - // Asn: to.Ptr[int64](65515), - // BgpPeeringAddress: to.Ptr("10.1.0.46"), - // PeerWeight: to.Ptr[int32](0), - // }, - // CustomRoutes: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("101.168.0.6/32")}, - // }, - // DisableIPSecReplayProtection: to.Ptr(false), - // EnableBgp: to.Ptr(false), - // EnableBgpRouteTranslationForNat: to.Ptr(false), - // EnablePrivateIPAddress: to.Ptr(true), - // GatewayType: to.Ptr(armnetwork.VirtualNetworkGatewayTypeVPN), - // IPConfigurations: []*armnetwork.VirtualNetworkGatewayIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw2/ipConfigurations/default"), - // Name: to.Ptr("default"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.VirtualNetworkGatewayIPConfigurationPropertiesFormat{ - // PrivateIPAddress: to.Ptr("10.1.0.7"), - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/vpngw2-ip"), - // }, - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/GatewaySubnet"), - // }, - // }, - // }}, - // NatRules: []*armnetwork.VirtualNetworkGatewayNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw2/natRules/natRule1"), - // Name: to.Ptr("natRule1"), - // Etag: to.Ptr("W/\"00ae2b69-88e7-4b3a-b66a-cfa2244e0801\""), - // Properties: &armnetwork.VirtualNetworkGatewayNatRuleProperties{ - // Type: to.Ptr(armnetwork.VPNNatRuleTypeStatic), - // ExternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("50.0.0.0/24"), - // }}, - // InternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("10.10.0.0/24"), - // }}, - // Mode: to.Ptr(armnetwork.VPNNatRuleModeEgressSnat), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw2/natRules/natRule2"), - // Name: to.Ptr("natRule2"), - // Etag: to.Ptr("W/\"00ae2b69-88e7-4b3a-b66a-cfa2244e0801\""), - // Properties: &armnetwork.VirtualNetworkGatewayNatRuleProperties{ - // Type: to.Ptr(armnetwork.VPNNatRuleTypeStatic), - // ExternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("30.0.0.0/24"), - // }}, - // InternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("20.10.0.0/24"), - // }}, - // Mode: to.Ptr(armnetwork.VPNNatRuleModeIngressSnat), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // SKU: &armnetwork.VirtualNetworkGatewaySKU{ - // Name: to.Ptr(armnetwork.VirtualNetworkGatewaySKUNameVPNGw1), - // Capacity: to.Ptr[int32](2), - // Tier: to.Ptr(armnetwork.VirtualNetworkGatewaySKUTierVPNGw1), - // }, - // VPNClientConfiguration: &armnetwork.VPNClientConfiguration{ - // RadiusServers: []*armnetwork.RadiusServer{ - // { - // RadiusServerAddress: to.Ptr("10.2.0.0"), - // RadiusServerScore: to.Ptr[int64](20), - // }}, - // VPNClientProtocols: []*armnetwork.VPNClientProtocol{ - // to.Ptr(armnetwork.VPNClientProtocolOpenVPN)}, - // VPNClientRevokedCertificates: []*armnetwork.VPNClientRevokedCertificate{ - // }, - // VPNClientRootCertificates: []*armnetwork.VPNClientRootCertificate{ - // }, - // }, - // VPNGatewayGeneration: to.Ptr(armnetwork.VPNGatewayGenerationNone), - // VPNType: to.Ptr(armnetwork.VPNTypeRouteBased), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkGatewaysListConnections.json -func ExampleVirtualNetworkGatewaysClient_NewListConnectionsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualNetworkGatewaysClient().NewListConnectionsPager("testrg", "test-vpn-gateway-1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualNetworkGatewayListConnectionsResult = armnetwork.VirtualNetworkGatewayListConnectionsResult{ - // Value: []*armnetwork.VirtualNetworkGatewayConnectionListEntity{ - // { - // Name: to.Ptr("test-vpn-connection"), - // Type: to.Ptr("Microsoft.Network/connections"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/connections/test-vpn-connection"), - // Location: to.Ptr("eastus"), - // Etag: to.Ptr("W/\\\"00000000-0000-0000-0000-000000000000\\\""), - // Properties: &armnetwork.VirtualNetworkGatewayConnectionListEntityPropertiesFormat{ - // ConnectionType: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionTypeVnet2Vnet), - // EgressBytesTransferred: to.Ptr[int64](0), - // EnableBgp: to.Ptr(true), - // IngressBytesTransferred: to.Ptr[int64](0), - // IPSecPolicies: []*armnetwork.IPSecPolicy{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // RoutingWeight: to.Ptr[int32](22), - // TrafficSelectorPolicies: []*armnetwork.TrafficSelectorPolicy{ - // }, - // UsePolicyBasedTrafficSelectors: to.Ptr(false), - // VirtualNetworkGateway1: &armnetwork.VirtualNetworkConnectionGatewayReference{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworkGateways/test-vpn-gateway-1"), - // }, - // VirtualNetworkGateway2: &armnetwork.VirtualNetworkConnectionGatewayReference{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg-2/providers/Microsoft.Network/virtualNetworkGateways/test-vpn-gateway-2"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkGatewayReset.json -func ExampleVirtualNetworkGatewaysClient_BeginReset() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginReset(ctx, "rg1", "vpngw", &armnetwork.VirtualNetworkGatewaysClientBeginResetOptions{GatewayVip: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualNetworkGateway = armnetwork.VirtualNetworkGateway{ - // Name: to.Ptr("vpngw"), - // Type: to.Ptr("Microsoft.Network/virtualNetworkGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw"), - // Location: to.Ptr("centralus"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.VirtualNetworkGatewayPropertiesFormat{ - // Active: to.Ptr(false), - // BgpSettings: &armnetwork.BgpSettings{ - // Asn: to.Ptr[int64](65514), - // BgpPeeringAddress: to.Ptr("10.0.1.30"), - // BgpPeeringAddresses: []*armnetwork.IPConfigurationBgpPeeringAddress{ - // { - // CustomBgpIPAddresses: []*string{ - // to.Ptr("169.254.21.10")}, - // DefaultBgpIPAddresses: []*string{ - // to.Ptr("10.3.1.254")}, - // IPConfigurationID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/gwipconfig1"), - // TunnelIPAddresses: []*string{ - // to.Ptr("52.161.10.135")}, - // }}, - // PeerWeight: to.Ptr[int32](0), - // }, - // CustomRoutes: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("101.168.0.6/32")}, - // }, - // DisableIPSecReplayProtection: to.Ptr(false), - // EnableBgp: to.Ptr(false), - // EnableBgpRouteTranslationForNat: to.Ptr(false), - // GatewayType: to.Ptr(armnetwork.VirtualNetworkGatewayTypeVPN), - // IPConfigurations: []*armnetwork.VirtualNetworkGatewayIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/gwipconfig1"), - // Name: to.Ptr("gwipconfig1"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.VirtualNetworkGatewayIPConfigurationPropertiesFormat{ - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // PublicIPAddress: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/gwpip"), - // }, - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/GatewaySubnet"), - // }, - // }, - // }}, - // NatRules: []*armnetwork.VirtualNetworkGatewayNatRule{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // SKU: &armnetwork.VirtualNetworkGatewaySKU{ - // Name: to.Ptr(armnetwork.VirtualNetworkGatewaySKUNameVPNGw1), - // Capacity: to.Ptr[int32](0), - // Tier: to.Ptr(armnetwork.VirtualNetworkGatewaySKUTierVPNGw1), - // }, - // VPNType: to.Ptr(armnetwork.VPNTypeRouteBased), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkGatewayResetVpnClientSharedKey.json -func ExampleVirtualNetworkGatewaysClient_BeginResetVPNClientSharedKey() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginResetVPNClientSharedKey(ctx, "rg1", "vpngw", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkGatewayGenerateVpnClientPackage.json -func ExampleVirtualNetworkGatewaysClient_BeginGeneratevpnclientpackage() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginGeneratevpnclientpackage(ctx, "rg1", "vpngw", armnetwork.VPNClientParameters{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Value = "" -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkGatewayGenerateVpnProfile.json -func ExampleVirtualNetworkGatewaysClient_BeginGenerateVPNProfile() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginGenerateVPNProfile(ctx, "rg1", "vpngw", armnetwork.VPNClientParameters{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Value = "" -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkGatewayGetVpnProfilePackageUrl.json -func ExampleVirtualNetworkGatewaysClient_BeginGetVPNProfilePackageURL() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginGetVPNProfilePackageURL(ctx, "rg1", "vpngw", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Value = "" -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkGatewayGetBGPPeerStatus.json -func ExampleVirtualNetworkGatewaysClient_BeginGetBgpPeerStatus() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginGetBgpPeerStatus(ctx, "rg1", "vpngw", &armnetwork.VirtualNetworkGatewaysClientBeginGetBgpPeerStatusOptions{Peer: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.BgpPeerStatusListResult = armnetwork.BgpPeerStatusListResult{ - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkGatewaySupportedVpnDevice.json -func ExampleVirtualNetworkGatewaysClient_SupportedVPNDevices() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualNetworkGatewaysClient().SupportedVPNDevices(ctx, "rg1", "vpngw", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Value = "" -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkGatewayLearnedRoutes.json -func ExampleVirtualNetworkGatewaysClient_BeginGetLearnedRoutes() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginGetLearnedRoutes(ctx, "rg1", "vpngw", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GatewayRouteListResult = armnetwork.GatewayRouteListResult{ - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkGatewayGetAdvertisedRoutes.json -func ExampleVirtualNetworkGatewaysClient_BeginGetAdvertisedRoutes() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginGetAdvertisedRoutes(ctx, "rg1", "vpngw", "test", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GatewayRouteListResult = armnetwork.GatewayRouteListResult{ - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkGatewaySetVpnClientIpsecParameters.json -func ExampleVirtualNetworkGatewaysClient_BeginSetVpnclientIPSecParameters() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginSetVpnclientIPSecParameters(ctx, "rg1", "vpngw", armnetwork.VPNClientIPsecParameters{ - DhGroup: to.Ptr(armnetwork.DhGroupDHGroup2), - IkeEncryption: to.Ptr(armnetwork.IkeEncryptionAES256), - IkeIntegrity: to.Ptr(armnetwork.IkeIntegritySHA384), - IPSecEncryption: to.Ptr(armnetwork.IPSecEncryptionAES256), - IPSecIntegrity: to.Ptr(armnetwork.IPSecIntegritySHA256), - PfsGroup: to.Ptr(armnetwork.PfsGroupPFS2), - SaDataSizeKilobytes: to.Ptr[int32](429497), - SaLifeTimeSeconds: to.Ptr[int32](86473), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VPNClientIPsecParameters = armnetwork.VPNClientIPsecParameters{ - // DhGroup: to.Ptr(armnetwork.DhGroupDHGroup2), - // IkeEncryption: to.Ptr(armnetwork.IkeEncryptionAES256), - // IkeIntegrity: to.Ptr(armnetwork.IkeIntegritySHA384), - // IPSecEncryption: to.Ptr(armnetwork.IPSecEncryptionAES256), - // IPSecIntegrity: to.Ptr(armnetwork.IPSecIntegritySHA256), - // PfsGroup: to.Ptr(armnetwork.PfsGroupPFS2), - // SaDataSizeKilobytes: to.Ptr[int32](429497), - // SaLifeTimeSeconds: to.Ptr[int32](86473), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkGatewayGetVpnClientIpsecParameters.json -func ExampleVirtualNetworkGatewaysClient_BeginGetVpnclientIPSecParameters() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginGetVpnclientIPSecParameters(ctx, "rg1", "vpngw", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VPNClientIPsecParameters = armnetwork.VPNClientIPsecParameters{ - // DhGroup: to.Ptr(armnetwork.DhGroupDHGroup2), - // IkeEncryption: to.Ptr(armnetwork.IkeEncryptionAES256), - // IkeIntegrity: to.Ptr(armnetwork.IkeIntegritySHA384), - // IPSecEncryption: to.Ptr(armnetwork.IPSecEncryptionAES256), - // IPSecIntegrity: to.Ptr(armnetwork.IPSecIntegritySHA256), - // PfsGroup: to.Ptr(armnetwork.PfsGroupPFS2), - // SaDataSizeKilobytes: to.Ptr[int32](429497), - // SaLifeTimeSeconds: to.Ptr[int32](86473), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkGatewayVpnDeviceConfigurationScript.json -func ExampleVirtualNetworkGatewaysClient_VPNDeviceConfigurationScript() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualNetworkGatewaysClient().VPNDeviceConfigurationScript(ctx, "rg1", "vpngw", armnetwork.VPNDeviceScriptParameters{ - DeviceFamily: to.Ptr("ISR"), - FirmwareVersion: to.Ptr("IOS 15.1 (Preview)"), - Vendor: to.Ptr("Cisco"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Value = "! Microsoft Corporation\r\n! ---------------------------------------------------------------------------------------------------------------------\r\n! Sample VPN tunnel configuration template for IOS-based devices\r\n!\r\n! This configuration template applies to Cisco VPN devices running IOS 15.1 or beyond (ISR or ASR)\r\n!\r\n\r\n\r\n \r\n\r\n! ---------------------------------------------------------------------------------------------------------------------\r\n! ACL rules\r\n!\r\n! Some VPN devices require explicit ACL rules to allow cross-premises traffic:\r\n!\r\n! 1. Allow traffic between on premises address ranges and VNet address ranges\r\n! 2. Allow IKE traffic (UDP:500) between on premises VPN devices and Azure VPN gateway\r\n! 3. Allow IPsec traffic (Proto:ESP) between on premises VPN devices and Azure VPN gateway\r\n!\r\n \r\naccess-list 101 permit ip 10.1.0.0 0.0.255.255 10.0.0.0 0.0.255.255\r\n\r\n! ---------------------------------------------------------------------------------------------------------------------\r\n! Internet Key Exchange (IKE) configuration\r\n!\r\n! This section specifies the authentication, encryption, hashing, and Diffie-Hellman group parameters for IKE\r\n! main mode or phase 1\r\n!\r\n\r\ncrypto ikev2 proposal SwaggerS2S-proposal\r\n encryption DES3\r\n integrity SHA384\r\n group DHGroup24\r\n lifetime 3600\r\n exit\r\n\r\ncrypto ikev2 policy SwaggerS2S-policy\r\n proposal SwaggerS2S-proposal\r\n exit\r\n\r\ncrypto ikev2 keyring SwaggerBranch-keyring\r\n \r\n peer 52.173.199.254\r\n address 52.173.199.254\r\n pre-shared-key lALEHuppeopJmA94exRNiRr2QzuZ6lOsvzu5IlJUEA6LthbTc8g5MTT86MCsGNMzGkTAaLuLnEJoD1Cn4cIlr94qKZm9drsgllzWvsPNezS71stAkaW1Bb7h6GBnDlDP\r\n exit\r\n\r\ncrypto ikev2 profile SwaggerS2S-profile\r\n match address local 10.3.0.0\r\n match identity remote address 52.173.199.254 255.255.255.255\r\n \r\n authentication remote pre-share\r\n authentication local pre-share\r\n keyring SwaggerBranch-keyring\r\n exit\r\n\r\n! ---------------------------------------------------------------------------------------------------------------------\r\n! IPsec configuration\r\n!\r\n! This section specifies encryption, authentication, tunnel mode properties for the Phase 2 negotiation\r\n!\r\ncrypto ipsec transform-set SwaggerS2S-TransformSet DES3 DES3\r\n mode tunnel\r\n exit\r\n\r\n! ---------------------------------------------------------------------------------------------------------------------\r\n! Crypto map configuration\r\n!\r\n! This section defines a crypto profile that binds the cross-premises network traffic to the IPsec and IKE\r\n! policy profiles for this connection. Then defines the VTI (virtual tunnel interface) with the crypto\r\n! profile. A random interface number (tunnel 1) was used with a random link local address (169.254.0.1/28)\r\n! for the tunnel interface. If either selection is already used in the VPN device, please select another\r\n! interface number or address. The only requirement is that they must not overlap with another interface\r\n! on the same VPN device.\r\n!\r\ncrypto ipsec profile SwaggerS2S-IPsecProfile\r\n set transform-set SwaggerS2S-TransformSet\r\n set ikev2-profile SwaggerS2S-profile\r\n set pfs None\r\n set security-association lifetime 3600\r\n exit\r\n\r\n\r\nint tunnel 52.173.199.254\r\n ip address 169.254.0.1 255.255.255.252\r\n ip tcp adjust-mss 1350\r\n tunnel source 10.3.0.0\r\n tunnel mode ipsec ipv4\r\n tunnel destination 52.173.199.254\r\n tunnel protection ipsec profile SwaggerS2S-IPsecProfile\r\n exit\r\n\r\n ip route 10.0.0.0 255.255.0.0 tunnel 52.173.199.254 " -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkGatewayStartPacketCaptureFilterData.json -func ExampleVirtualNetworkGatewaysClient_BeginStartPacketCapture_startPacketCaptureOnVirtualNetworkGatewayWithFilter() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginStartPacketCapture(ctx, "rg1", "vpngw", &armnetwork.VirtualNetworkGatewaysClientBeginStartPacketCaptureOptions{Parameters: &armnetwork.VPNPacketCaptureStartParameters{ - FilterData: to.Ptr("{'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}]}"), - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Value = "\"{\"Status\":\"Successful\",\"Data\":null}\"" -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkGatewayStartPacketCapture.json -func ExampleVirtualNetworkGatewaysClient_BeginStartPacketCapture_startPacketCaptureOnVirtualNetworkGatewayWithoutFilter() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginStartPacketCapture(ctx, "rg1", "vpngw", &armnetwork.VirtualNetworkGatewaysClientBeginStartPacketCaptureOptions{Parameters: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Value = "\"{\"Status\":\"Successful\",\"Data\":null}\"" -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkGatewayStopPacketCapture.json -func ExampleVirtualNetworkGatewaysClient_BeginStopPacketCapture() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginStopPacketCapture(ctx, "rg1", "vpngw", armnetwork.VPNPacketCaptureStopParameters{ - SasURL: to.Ptr("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"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Value = "\"{\"Status\":\"Successful\",\"Data\":null}\"" -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkGatewayGetVpnclientConnectionHealth.json -func ExampleVirtualNetworkGatewaysClient_BeginGetVpnclientConnectionHealth() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginGetVpnclientConnectionHealth(ctx, "p2s-vnet-test", "vpnp2sgw", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VPNClientConnectionHealthDetailListResult = armnetwork.VPNClientConnectionHealthDetailListResult{ - // Value: []*armnetwork.VPNClientConnectionHealthDetail{ - // { - // EgressBytesTransferred: to.Ptr[int64](33420), - // EgressPacketsTransferred: to.Ptr[int64](557), - // IngressBytesTransferred: to.Ptr[int64](33420), - // IngressPacketsTransferred: to.Ptr[int64](557), - // MaxBandwidth: to.Ptr[int64](240000000), - // MaxPacketsPerSecond: to.Ptr[int64](4), - // PrivateIPAddress: to.Ptr("192.168.210.2"), - // PublicIPAddress: to.Ptr("167.220.2.232:45522"), - // VPNConnectionDuration: to.Ptr[int64](900), - // VPNConnectionID: to.Ptr("IKEv2_1e1cfe59-5c7c-4315-a876-b11fbfdfeed4"), - // VPNConnectionTime: to.Ptr("2019-05-02T22:26:22"), - // VPNUserName: to.Ptr("gwp2schildcert"), - // }, - // { - // EgressBytesTransferred: to.Ptr[int64](23420), - // EgressPacketsTransferred: to.Ptr[int64](357), - // IngressBytesTransferred: to.Ptr[int64](23420), - // IngressPacketsTransferred: to.Ptr[int64](357), - // MaxBandwidth: to.Ptr[int64](220000000), - // MaxPacketsPerSecond: to.Ptr[int64](4), - // PrivateIPAddress: to.Ptr("192.168.210.1"), - // PublicIPAddress: to.Ptr("167.220.2.232:45213"), - // VPNConnectionDuration: to.Ptr[int64](800), - // VPNConnectionID: to.Ptr("IKEv2_571cfe59-2c7d-1415-e813-c51fbfdfea16"), - // VPNConnectionTime: to.Ptr("2019-05-01T21:06:12"), - // VPNUserName: to.Ptr("gwp2schildcert"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkGatewaysDisconnectP2sVpnConnections.json -func ExampleVirtualNetworkGatewaysClient_BeginDisconnectVirtualNetworkGatewayVPNConnections() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginDisconnectVirtualNetworkGatewayVPNConnections(ctx, "vpn-gateway-test", "vpngateway", armnetwork.P2SVPNConnectionRequest{ - VPNConnectionIDs: []*string{ - to.Ptr("vpnconnId1"), - to.Ptr("vpnconnId2")}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/network/armnetwork/virtualnetworkpeerings_client.go b/sdk/resourcemanager/network/armnetwork/virtualnetworkpeerings_client.go index 0f1331326f95..7834e622be08 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualnetworkpeerings_client.go +++ b/sdk/resourcemanager/network/armnetwork/virtualnetworkpeerings_client.go @@ -47,7 +47,7 @@ func NewVirtualNetworkPeeringsClient(subscriptionID string, credential azcore.To // BeginCreateOrUpdate - Creates or updates a peering in the specified virtual network. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkName - The name of the virtual network. // - virtualNetworkPeeringName - The name of the peering. @@ -72,7 +72,7 @@ func (client *VirtualNetworkPeeringsClient) BeginCreateOrUpdate(ctx context.Cont // CreateOrUpdate - Creates or updates a peering in the specified virtual network. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VirtualNetworkPeeringsClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkName string, virtualNetworkPeeringName string, virtualNetworkPeeringParameters VirtualNetworkPeering, options *VirtualNetworkPeeringsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkPeeringsClient.BeginCreateOrUpdate" @@ -121,7 +121,7 @@ func (client *VirtualNetworkPeeringsClient) createOrUpdateCreateRequest(ctx cont if options != nil && options.SyncRemoteAddressSpace != nil { reqQP.Set("syncRemoteAddressSpace", string(*options.SyncRemoteAddressSpace)) } - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, virtualNetworkPeeringParameters); err != nil { @@ -133,7 +133,7 @@ func (client *VirtualNetworkPeeringsClient) createOrUpdateCreateRequest(ctx cont // BeginDelete - Deletes the specified virtual network peering. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkName - The name of the virtual network. // - virtualNetworkPeeringName - The name of the virtual network peering. @@ -157,7 +157,7 @@ func (client *VirtualNetworkPeeringsClient) BeginDelete(ctx context.Context, res // Delete - Deletes the specified virtual network peering. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VirtualNetworkPeeringsClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualNetworkName string, virtualNetworkPeeringName string, options *VirtualNetworkPeeringsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkPeeringsClient.BeginDelete" @@ -203,7 +203,7 @@ func (client *VirtualNetworkPeeringsClient) deleteCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -212,7 +212,7 @@ func (client *VirtualNetworkPeeringsClient) deleteCreateRequest(ctx context.Cont // Get - Gets the specified virtual network peering. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkName - The name of the virtual network. // - virtualNetworkPeeringName - The name of the virtual network peering. @@ -264,7 +264,7 @@ func (client *VirtualNetworkPeeringsClient) getCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -281,7 +281,7 @@ func (client *VirtualNetworkPeeringsClient) getHandleResponse(resp *http.Respons // NewListPager - Gets all virtual network peerings in a virtual network. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkName - The name of the virtual network. // - options - VirtualNetworkPeeringsClientListOptions contains the optional parameters for the VirtualNetworkPeeringsClient.NewListPager @@ -336,7 +336,7 @@ func (client *VirtualNetworkPeeringsClient) listCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/virtualnetworkpeerings_client_example_test.go b/sdk/resourcemanager/network/armnetwork/virtualnetworkpeerings_client_example_test.go deleted file mode 100644 index 5463a2073465..000000000000 --- a/sdk/resourcemanager/network/armnetwork/virtualnetworkpeerings_client_example_test.go +++ /dev/null @@ -1,486 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkPeeringDelete.json -func ExampleVirtualNetworkPeeringsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkPeeringsClient().BeginDelete(ctx, "peerTest", "vnet1", "peer", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkPeeringGet.json -func ExampleVirtualNetworkPeeringsClient_Get_getPeering() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualNetworkPeeringsClient().Get(ctx, "peerTest", "vnet1", "peer", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualNetworkPeering = armnetwork.VirtualNetworkPeering{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet1/virtualNetworkPeerings/peer"), - // Name: to.Ptr("peer"), - // Properties: &armnetwork.VirtualNetworkPeeringPropertiesFormat{ - // AllowForwardedTraffic: to.Ptr(true), - // AllowGatewayTransit: to.Ptr(false), - // AllowVirtualNetworkAccess: to.Ptr(true), - // PeeringState: to.Ptr(armnetwork.VirtualNetworkPeeringStateInitiated), - // PeeringSyncLevel: to.Ptr(armnetwork.VirtualNetworkPeeringLevelFullyInSync), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RemoteAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("12.0.0.0/8")}, - // }, - // RemoteBgpCommunities: &armnetwork.VirtualNetworkBgpCommunities{ - // RegionalCommunity: to.Ptr("12076:50004"), - // VirtualNetworkCommunity: to.Ptr("12076:20002"), - // }, - // RemoteVirtualNetwork: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2"), - // }, - // RemoteVirtualNetworkAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("12.0.0.0/8")}, - // }, - // UseRemoteGateways: to.Ptr(false), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkPeeringGetWithRemoteVirtualNetworkEncryption.json -func ExampleVirtualNetworkPeeringsClient_Get_getPeeringWithRemoteVirtualNetworkEncryption() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualNetworkPeeringsClient().Get(ctx, "peerTest", "vnet1", "peer", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualNetworkPeering = armnetwork.VirtualNetworkPeering{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet1/virtualNetworkPeerings/peer"), - // Name: to.Ptr("peer"), - // Properties: &armnetwork.VirtualNetworkPeeringPropertiesFormat{ - // AllowForwardedTraffic: to.Ptr(true), - // AllowGatewayTransit: to.Ptr(false), - // AllowVirtualNetworkAccess: to.Ptr(true), - // PeeringState: to.Ptr(armnetwork.VirtualNetworkPeeringStateInitiated), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RemoteAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("12.0.0.0/8")}, - // }, - // RemoteBgpCommunities: &armnetwork.VirtualNetworkBgpCommunities{ - // RegionalCommunity: to.Ptr("12076:50004"), - // VirtualNetworkCommunity: to.Ptr("12076:20002"), - // }, - // RemoteVirtualNetwork: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2"), - // }, - // RemoteVirtualNetworkEncryption: &armnetwork.VirtualNetworkEncryption{ - // Enabled: to.Ptr(true), - // Enforcement: to.Ptr(armnetwork.VirtualNetworkEncryptionEnforcementAllowUnencrypted), - // }, - // UseRemoteGateways: to.Ptr(false), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkPeeringCreate.json -func ExampleVirtualNetworkPeeringsClient_BeginCreateOrUpdate_createPeering() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkPeeringsClient().BeginCreateOrUpdate(ctx, "peerTest", "vnet1", "peer", armnetwork.VirtualNetworkPeering{ - Properties: &armnetwork.VirtualNetworkPeeringPropertiesFormat{ - AllowForwardedTraffic: to.Ptr(true), - AllowGatewayTransit: to.Ptr(false), - AllowVirtualNetworkAccess: to.Ptr(true), - RemoteVirtualNetwork: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2"), - }, - UseRemoteGateways: to.Ptr(false), - }, - }, &armnetwork.VirtualNetworkPeeringsClientBeginCreateOrUpdateOptions{SyncRemoteAddressSpace: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualNetworkPeering = armnetwork.VirtualNetworkPeering{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet1/virtualNetworkPeerings/peer"), - // Name: to.Ptr("peer"), - // Properties: &armnetwork.VirtualNetworkPeeringPropertiesFormat{ - // AllowForwardedTraffic: to.Ptr(true), - // AllowGatewayTransit: to.Ptr(false), - // AllowVirtualNetworkAccess: to.Ptr(true), - // PeeringState: to.Ptr(armnetwork.VirtualNetworkPeeringStateInitiated), - // PeeringSyncLevel: to.Ptr(armnetwork.VirtualNetworkPeeringLevelFullyInSync), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RemoteAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("12.0.0.0/8")}, - // }, - // RemoteBgpCommunities: &armnetwork.VirtualNetworkBgpCommunities{ - // RegionalCommunity: to.Ptr("12076:50004"), - // VirtualNetworkCommunity: to.Ptr("12076:20002"), - // }, - // RemoteVirtualNetwork: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2"), - // }, - // RemoteVirtualNetworkAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("12.0.0.0/8")}, - // }, - // UseRemoteGateways: to.Ptr(false), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkPeeringCreateWithRemoteVirtualNetworkEncryption.json -func ExampleVirtualNetworkPeeringsClient_BeginCreateOrUpdate_createPeeringWithRemoteVirtualNetworkEncryption() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkPeeringsClient().BeginCreateOrUpdate(ctx, "peerTest", "vnet1", "peer", armnetwork.VirtualNetworkPeering{ - Properties: &armnetwork.VirtualNetworkPeeringPropertiesFormat{ - AllowForwardedTraffic: to.Ptr(true), - AllowGatewayTransit: to.Ptr(false), - AllowVirtualNetworkAccess: to.Ptr(true), - RemoteVirtualNetwork: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2"), - }, - UseRemoteGateways: to.Ptr(false), - }, - }, &armnetwork.VirtualNetworkPeeringsClientBeginCreateOrUpdateOptions{SyncRemoteAddressSpace: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualNetworkPeering = armnetwork.VirtualNetworkPeering{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet1/virtualNetworkPeerings/peer"), - // Name: to.Ptr("peer"), - // Properties: &armnetwork.VirtualNetworkPeeringPropertiesFormat{ - // AllowForwardedTraffic: to.Ptr(true), - // AllowGatewayTransit: to.Ptr(false), - // AllowVirtualNetworkAccess: to.Ptr(true), - // PeeringState: to.Ptr(armnetwork.VirtualNetworkPeeringStateInitiated), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RemoteAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("12.0.0.0/8")}, - // }, - // RemoteBgpCommunities: &armnetwork.VirtualNetworkBgpCommunities{ - // RegionalCommunity: to.Ptr("12076:50004"), - // VirtualNetworkCommunity: to.Ptr("12076:20002"), - // }, - // RemoteVirtualNetwork: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2"), - // }, - // RemoteVirtualNetworkEncryption: &armnetwork.VirtualNetworkEncryption{ - // Enabled: to.Ptr(true), - // Enforcement: to.Ptr(armnetwork.VirtualNetworkEncryptionEnforcementAllowUnencrypted), - // }, - // UseRemoteGateways: to.Ptr(false), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkPeeringSync.json -func ExampleVirtualNetworkPeeringsClient_BeginCreateOrUpdate_syncPeering() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkPeeringsClient().BeginCreateOrUpdate(ctx, "peerTest", "vnet1", "peer", armnetwork.VirtualNetworkPeering{ - Properties: &armnetwork.VirtualNetworkPeeringPropertiesFormat{ - AllowForwardedTraffic: to.Ptr(true), - AllowGatewayTransit: to.Ptr(false), - AllowVirtualNetworkAccess: to.Ptr(true), - RemoteVirtualNetwork: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2"), - }, - UseRemoteGateways: to.Ptr(false), - }, - }, &armnetwork.VirtualNetworkPeeringsClientBeginCreateOrUpdateOptions{SyncRemoteAddressSpace: to.Ptr(armnetwork.SyncRemoteAddressSpaceTrue)}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualNetworkPeering = armnetwork.VirtualNetworkPeering{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet1/virtualNetworkPeerings/peer"), - // Name: to.Ptr("peer"), - // Properties: &armnetwork.VirtualNetworkPeeringPropertiesFormat{ - // AllowForwardedTraffic: to.Ptr(true), - // AllowGatewayTransit: to.Ptr(false), - // AllowVirtualNetworkAccess: to.Ptr(true), - // PeeringState: to.Ptr(armnetwork.VirtualNetworkPeeringStateInitiated), - // PeeringSyncLevel: to.Ptr(armnetwork.VirtualNetworkPeeringLevelFullyInSync), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RemoteAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("12.0.0.0/8")}, - // }, - // RemoteBgpCommunities: &armnetwork.VirtualNetworkBgpCommunities{ - // RegionalCommunity: to.Ptr("12076:50004"), - // VirtualNetworkCommunity: to.Ptr("12076:20002"), - // }, - // RemoteVirtualNetwork: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2"), - // }, - // RemoteVirtualNetworkAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("12.0.0.0/8")}, - // }, - // UseRemoteGateways: to.Ptr(false), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkPeeringList.json -func ExampleVirtualNetworkPeeringsClient_NewListPager_listPeerings() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualNetworkPeeringsClient().NewListPager("peerTest", "vnet1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualNetworkPeeringListResult = armnetwork.VirtualNetworkPeeringListResult{ - // Value: []*armnetwork.VirtualNetworkPeering{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet1/virtualNetworkPeerings/peer"), - // Name: to.Ptr("peer"), - // Properties: &armnetwork.VirtualNetworkPeeringPropertiesFormat{ - // AllowForwardedTraffic: to.Ptr(true), - // AllowGatewayTransit: to.Ptr(false), - // AllowVirtualNetworkAccess: to.Ptr(true), - // PeeringState: to.Ptr(armnetwork.VirtualNetworkPeeringStateInitiated), - // PeeringSyncLevel: to.Ptr(armnetwork.VirtualNetworkPeeringLevelFullyInSync), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RemoteAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("12.0.0.0/8")}, - // }, - // RemoteBgpCommunities: &armnetwork.VirtualNetworkBgpCommunities{ - // RegionalCommunity: to.Ptr("12076:50004"), - // VirtualNetworkCommunity: to.Ptr("12076:20002"), - // }, - // RemoteVirtualNetwork: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2"), - // }, - // RemoteVirtualNetworkAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("12.0.0.0/8")}, - // }, - // UseRemoteGateways: to.Ptr(false), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet1/virtualNetworkPeerings/peer2"), - // Name: to.Ptr("peer"), - // Properties: &armnetwork.VirtualNetworkPeeringPropertiesFormat{ - // AllowForwardedTraffic: to.Ptr(false), - // AllowGatewayTransit: to.Ptr(false), - // AllowVirtualNetworkAccess: to.Ptr(true), - // PeeringState: to.Ptr(armnetwork.VirtualNetworkPeeringStateInitiated), - // PeeringSyncLevel: to.Ptr(armnetwork.VirtualNetworkPeeringLevelFullyInSync), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RemoteAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("13.0.0.0/8")}, - // }, - // RemoteBgpCommunities: &armnetwork.VirtualNetworkBgpCommunities{ - // RegionalCommunity: to.Ptr("12076:50004"), - // VirtualNetworkCommunity: to.Ptr("12076:20003"), - // }, - // RemoteVirtualNetwork: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet3"), - // }, - // RemoteVirtualNetworkAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("13.0.0.0/8")}, - // }, - // UseRemoteGateways: to.Ptr(false), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkPeeringListWithRemoteVirtualNetworkEncryption.json -func ExampleVirtualNetworkPeeringsClient_NewListPager_listPeeringsWithRemoteVirtualNetworkEncryption() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualNetworkPeeringsClient().NewListPager("peerTest", "vnet1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualNetworkPeeringListResult = armnetwork.VirtualNetworkPeeringListResult{ - // Value: []*armnetwork.VirtualNetworkPeering{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet1/virtualNetworkPeerings/peer"), - // Name: to.Ptr("peer"), - // Properties: &armnetwork.VirtualNetworkPeeringPropertiesFormat{ - // AllowForwardedTraffic: to.Ptr(true), - // AllowGatewayTransit: to.Ptr(false), - // AllowVirtualNetworkAccess: to.Ptr(true), - // PeeringState: to.Ptr(armnetwork.VirtualNetworkPeeringStateInitiated), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RemoteAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("12.0.0.0/8")}, - // }, - // RemoteBgpCommunities: &armnetwork.VirtualNetworkBgpCommunities{ - // RegionalCommunity: to.Ptr("12076:50004"), - // VirtualNetworkCommunity: to.Ptr("12076:20002"), - // }, - // RemoteVirtualNetwork: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2"), - // }, - // RemoteVirtualNetworkEncryption: &armnetwork.VirtualNetworkEncryption{ - // Enabled: to.Ptr(true), - // Enforcement: to.Ptr(armnetwork.VirtualNetworkEncryptionEnforcementAllowUnencrypted), - // }, - // UseRemoteGateways: to.Ptr(false), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet1/virtualNetworkPeerings/peer2"), - // Name: to.Ptr("peer"), - // Properties: &armnetwork.VirtualNetworkPeeringPropertiesFormat{ - // AllowForwardedTraffic: to.Ptr(false), - // AllowGatewayTransit: to.Ptr(false), - // AllowVirtualNetworkAccess: to.Ptr(true), - // PeeringState: to.Ptr(armnetwork.VirtualNetworkPeeringStateInitiated), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RemoteAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("13.0.0.0/8")}, - // }, - // RemoteBgpCommunities: &armnetwork.VirtualNetworkBgpCommunities{ - // RegionalCommunity: to.Ptr("12076:50004"), - // VirtualNetworkCommunity: to.Ptr("12076:20003"), - // }, - // RemoteVirtualNetwork: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet3"), - // }, - // RemoteVirtualNetworkEncryption: &armnetwork.VirtualNetworkEncryption{ - // Enabled: to.Ptr(true), - // Enforcement: to.Ptr(armnetwork.VirtualNetworkEncryptionEnforcementAllowUnencrypted), - // }, - // UseRemoteGateways: to.Ptr(false), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/virtualnetworks_client.go b/sdk/resourcemanager/network/armnetwork/virtualnetworks_client.go index c105d88ef592..6d2ad292c0a4 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualnetworks_client.go +++ b/sdk/resourcemanager/network/armnetwork/virtualnetworks_client.go @@ -48,7 +48,7 @@ func NewVirtualNetworksClient(subscriptionID string, credential azcore.TokenCred // CheckIPAddressAvailability - Checks whether a private IP address is available for use. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkName - The name of the virtual network. // - ipAddress - The private IP address to be verified. @@ -97,7 +97,7 @@ func (client *VirtualNetworksClient) checkIPAddressAvailabilityCreateRequest(ctx } reqQP := req.Raw().URL.Query() reqQP.Set("ipAddress", ipAddress) - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -115,7 +115,7 @@ func (client *VirtualNetworksClient) checkIPAddressAvailabilityHandleResponse(re // BeginCreateOrUpdate - Creates or updates a virtual network in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkName - The name of the virtual network. // - parameters - Parameters supplied to the create or update virtual network operation. @@ -139,7 +139,7 @@ func (client *VirtualNetworksClient) BeginCreateOrUpdate(ctx context.Context, re // CreateOrUpdate - Creates or updates a virtual network in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VirtualNetworksClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkName string, parameters VirtualNetwork, options *VirtualNetworksClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworksClient.BeginCreateOrUpdate" @@ -181,7 +181,7 @@ func (client *VirtualNetworksClient) createOrUpdateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -193,7 +193,7 @@ func (client *VirtualNetworksClient) createOrUpdateCreateRequest(ctx context.Con // BeginDelete - Deletes the specified virtual network. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkName - The name of the virtual network. // - options - VirtualNetworksClientBeginDeleteOptions contains the optional parameters for the VirtualNetworksClient.BeginDelete @@ -216,7 +216,7 @@ func (client *VirtualNetworksClient) BeginDelete(ctx context.Context, resourceGr // Delete - Deletes the specified virtual network. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VirtualNetworksClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualNetworkName string, options *VirtualNetworksClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworksClient.BeginDelete" @@ -258,7 +258,7 @@ func (client *VirtualNetworksClient) deleteCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -267,7 +267,7 @@ func (client *VirtualNetworksClient) deleteCreateRequest(ctx context.Context, re // Get - Gets the specified virtual network by resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkName - The name of the virtual network. // - options - VirtualNetworksClientGetOptions contains the optional parameters for the VirtualNetworksClient.Get method. @@ -313,7 +313,7 @@ func (client *VirtualNetworksClient) getCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } @@ -333,7 +333,7 @@ func (client *VirtualNetworksClient) getHandleResponse(resp *http.Response) (Vir // NewListPager - Gets all virtual networks in a resource group. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - options - VirtualNetworksClientListOptions contains the optional parameters for the VirtualNetworksClient.NewListPager // method. @@ -383,7 +383,7 @@ func (client *VirtualNetworksClient) listCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -400,7 +400,7 @@ func (client *VirtualNetworksClient) listHandleResponse(resp *http.Response) (Vi // NewListAllPager - Gets all virtual networks in a subscription. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - options - VirtualNetworksClientListAllOptions contains the optional parameters for the VirtualNetworksClient.NewListAllPager // method. func (client *VirtualNetworksClient) NewListAllPager(options *VirtualNetworksClientListAllOptions) *runtime.Pager[VirtualNetworksClientListAllResponse] { @@ -445,7 +445,7 @@ func (client *VirtualNetworksClient) listAllCreateRequest(ctx context.Context, o return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -462,7 +462,7 @@ func (client *VirtualNetworksClient) listAllHandleResponse(resp *http.Response) // BeginListDdosProtectionStatus - Gets the Ddos Protection Status of all IP Addresses under the Virtual Network // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkName - The name of the virtual network. // - options - VirtualNetworksClientBeginListDdosProtectionStatusOptions contains the optional parameters for the VirtualNetworksClient.BeginListDdosProtectionStatus @@ -508,7 +508,7 @@ func (client *VirtualNetworksClient) BeginListDdosProtectionStatus(ctx context.C // ListDdosProtectionStatus - Gets the Ddos Protection Status of all IP Addresses under the Virtual Network // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VirtualNetworksClient) listDdosProtectionStatus(ctx context.Context, resourceGroupName string, virtualNetworkName string, options *VirtualNetworksClientBeginListDdosProtectionStatusOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworksClient.BeginListDdosProtectionStatus" @@ -556,7 +556,7 @@ func (client *VirtualNetworksClient) listDdosProtectionStatusCreateRequest(ctx c if options != nil && options.SkipToken != nil { reqQP.Set("skipToken", *options.SkipToken) } - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -573,7 +573,7 @@ func (client *VirtualNetworksClient) listDdosProtectionStatusHandleResponse(resp // NewListUsagePager - Lists usage stats. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkName - The name of the virtual network. // - options - VirtualNetworksClientListUsageOptions contains the optional parameters for the VirtualNetworksClient.NewListUsagePager @@ -628,7 +628,7 @@ func (client *VirtualNetworksClient) listUsageCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -646,7 +646,7 @@ func (client *VirtualNetworksClient) listUsageHandleResponse(resp *http.Response // UpdateTags - Updates a virtual network tags. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkName - The name of the virtual network. // - parameters - Parameters supplied to update virtual network tags. @@ -694,7 +694,7 @@ func (client *VirtualNetworksClient) updateTagsCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/virtualnetworks_client_example_test.go b/sdk/resourcemanager/network/armnetwork/virtualnetworks_client_example_test.go deleted file mode 100644 index 5a9917ab7372..000000000000 --- a/sdk/resourcemanager/network/armnetwork/virtualnetworks_client_example_test.go +++ /dev/null @@ -1,1116 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkDelete.json -func ExampleVirtualNetworksClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworksClient().BeginDelete(ctx, "rg1", "test-vnet", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkGet.json -func ExampleVirtualNetworksClient_Get_getVirtualNetwork() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualNetworksClient().Get(ctx, "rg1", "test-vnet", &armnetwork.VirtualNetworksClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualNetwork = armnetwork.VirtualNetwork{ - // Name: to.Ptr("test-vnet"), - // Type: to.Ptr("Microsoft.Network/virtualNetworks"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.VirtualNetworkPropertiesFormat{ - // AddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/16")}, - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnets: []*armnetwork.Subnet{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1"), - // Name: to.Ptr("subnet1"), - // Properties: &armnetwork.SubnetPropertiesFormat{ - // AddressPrefix: to.Ptr("10.0.1.0/24"), - // IPConfigurations: []*armnetwork.IPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // VirtualNetworkPeerings: []*armnetwork.VirtualNetworkPeering{ - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkGetWithSubnetDelegation.json -func ExampleVirtualNetworksClient_Get_getVirtualNetworkWithADelegatedSubnet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualNetworksClient().Get(ctx, "rg1", "test-vnet", &armnetwork.VirtualNetworksClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualNetwork = armnetwork.VirtualNetwork{ - // Name: to.Ptr("test-vnet"), - // Type: to.Ptr("Microsoft.Network/virtualNetworks"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.VirtualNetworkPropertiesFormat{ - // AddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/16")}, - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnets: []*armnetwork.Subnet{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1"), - // Name: to.Ptr("subnet1"), - // Properties: &armnetwork.SubnetPropertiesFormat{ - // AddressPrefix: to.Ptr("10.0.1.0/24"), - // Delegations: []*armnetwork.Delegation{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1/delegations/myDelegation"), - // Name: to.Ptr("myDelegation"), - // Properties: &armnetwork.ServiceDelegationPropertiesFormat{ - // Actions: []*string{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ServiceName: to.Ptr("Microsoft.Provider/resourceType"), - // }, - // }}, - // IPConfigurations: []*armnetwork.IPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Purpose: to.Ptr(""), - // }, - // }}, - // VirtualNetworkPeerings: []*armnetwork.VirtualNetworkPeering{ - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkGetWithServiceAssociationLink.json -func ExampleVirtualNetworksClient_Get_getVirtualNetworkWithServiceAssociationLinks() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualNetworksClient().Get(ctx, "rg1", "test-vnet", &armnetwork.VirtualNetworksClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualNetwork = armnetwork.VirtualNetwork{ - // Name: to.Ptr("test-vnet"), - // Type: to.Ptr("Microsoft.Network/virtualNetworks"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.VirtualNetworkPropertiesFormat{ - // AddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/16")}, - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnets: []*armnetwork.Subnet{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1"), - // Name: to.Ptr("subnet1"), - // Etag: to.Ptr("W/\"4d3e91b4-f67f-48be-880b-e4a8abdd019e\""), - // Properties: &armnetwork.SubnetPropertiesFormat{ - // AddressPrefix: to.Ptr("10.0.214.0/24"), - // Delegations: []*armnetwork.Delegation{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1/delegations/aciDelegation"), - // Name: to.Ptr("aciDelegation"), - // Etag: to.Ptr("W/\"4d3e91b4-f67f-48be-880b-e4a8abdd019e\""), - // Properties: &armnetwork.ServiceDelegationPropertiesFormat{ - // Actions: []*string{ - // to.Ptr("Microsoft.Network/virtualNetworks/subnets/action")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ServiceName: to.Ptr("Microsoft.Provider/resourceType"), - // }, - // }}, - // IPConfigurationProfiles: []*armnetwork.IPConfigurationProfile{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkProfiles/networkProfile1/containerNetworkInterfaceConfigurations/eth0/ipConfigurations/ipconfigprofile1"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ServiceAssociationLinks: []*armnetwork.ServiceAssociationLink{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1/serviceAssociationLinks/serviceAssociationLink1"), - // Name: to.Ptr("serviceAssociationLink1"), - // Etag: to.Ptr("W/\"4d3e91b4-f67f-48be-880b-e4a8abdd019e\""), - // Properties: &armnetwork.ServiceAssociationLinkPropertiesFormat{ - // LinkedResourceType: to.Ptr("Microsoft.Provider/resourceType"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // ServiceEndpoints: []*armnetwork.ServiceEndpointPropertiesFormat{ - // }, - // }, - // }}, - // VirtualNetworkPeerings: []*armnetwork.VirtualNetworkPeering{ - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkCreate.json -func ExampleVirtualNetworksClient_BeginCreateOrUpdate_createVirtualNetwork() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworksClient().BeginCreateOrUpdate(ctx, "rg1", "test-vnet", armnetwork.VirtualNetwork{ - Location: to.Ptr("eastus"), - Properties: &armnetwork.VirtualNetworkPropertiesFormat{ - AddressSpace: &armnetwork.AddressSpace{ - AddressPrefixes: []*string{ - to.Ptr("10.0.0.0/16")}, - }, - FlowTimeoutInMinutes: to.Ptr[int32](10), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualNetwork = armnetwork.VirtualNetwork{ - // Name: to.Ptr("test-vnet"), - // Type: to.Ptr("Microsoft.Network/virtualNetworks"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.VirtualNetworkPropertiesFormat{ - // AddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/16")}, - // }, - // FlowTimeoutInMinutes: to.Ptr[int32](10), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnets: []*armnetwork.Subnet{ - // }, - // VirtualNetworkPeerings: []*armnetwork.VirtualNetworkPeering{ - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkCreateWithBgpCommunities.json -func ExampleVirtualNetworksClient_BeginCreateOrUpdate_createVirtualNetworkWithBgpCommunities() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworksClient().BeginCreateOrUpdate(ctx, "rg1", "test-vnet", armnetwork.VirtualNetwork{ - Location: to.Ptr("eastus"), - Properties: &armnetwork.VirtualNetworkPropertiesFormat{ - AddressSpace: &armnetwork.AddressSpace{ - AddressPrefixes: []*string{ - to.Ptr("10.0.0.0/16")}, - }, - BgpCommunities: &armnetwork.VirtualNetworkBgpCommunities{ - VirtualNetworkCommunity: to.Ptr("12076:20000"), - }, - Subnets: []*armnetwork.Subnet{ - { - Name: to.Ptr("test-1"), - Properties: &armnetwork.SubnetPropertiesFormat{ - AddressPrefix: to.Ptr("10.0.0.0/24"), - }, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualNetwork = armnetwork.VirtualNetwork{ - // Name: to.Ptr("test-vnet"), - // Type: to.Ptr("Microsoft.Network/virtualNetworks"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.VirtualNetworkPropertiesFormat{ - // AddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/16")}, - // }, - // BgpCommunities: &armnetwork.VirtualNetworkBgpCommunities{ - // RegionalCommunity: to.Ptr("12076:50004"), - // VirtualNetworkCommunity: to.Ptr("12076:20000"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnets: []*armnetwork.Subnet{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-1"), - // Name: to.Ptr("test-1"), - // Properties: &armnetwork.SubnetPropertiesFormat{ - // AddressPrefix: to.Ptr("10.0.0.0/24"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // VirtualNetworkPeerings: []*armnetwork.VirtualNetworkPeering{ - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkCreateSubnetWithDelegation.json -func ExampleVirtualNetworksClient_BeginCreateOrUpdate_createVirtualNetworkWithDelegatedSubnets() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworksClient().BeginCreateOrUpdate(ctx, "rg1", "test-vnet", armnetwork.VirtualNetwork{ - Location: to.Ptr("westcentralus"), - Properties: &armnetwork.VirtualNetworkPropertiesFormat{ - AddressSpace: &armnetwork.AddressSpace{ - AddressPrefixes: []*string{ - to.Ptr("10.0.0.0/16")}, - }, - Subnets: []*armnetwork.Subnet{ - { - Name: to.Ptr("test-1"), - Properties: &armnetwork.SubnetPropertiesFormat{ - AddressPrefix: to.Ptr("10.0.0.0/24"), - Delegations: []*armnetwork.Delegation{ - { - Name: to.Ptr("myDelegation"), - Properties: &armnetwork.ServiceDelegationPropertiesFormat{ - ServiceName: to.Ptr("Microsoft.Sql/managedInstances"), - }, - }}, - }, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualNetwork = armnetwork.VirtualNetwork{ - // Name: to.Ptr("test-vnet"), - // Type: to.Ptr("Microsoft.Network/virtualNetworks"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet"), - // Location: to.Ptr("westcentralus"), - // Properties: &armnetwork.VirtualNetworkPropertiesFormat{ - // AddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/16")}, - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnets: []*armnetwork.Subnet{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-1"), - // Name: to.Ptr("test-1"), - // Properties: &armnetwork.SubnetPropertiesFormat{ - // AddressPrefix: to.Ptr("10.0.0.0/24"), - // Delegations: []*armnetwork.Delegation{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-1/delegations/myDelegation"), - // Name: to.Ptr("myDelegation"), - // Properties: &armnetwork.ServiceDelegationPropertiesFormat{ - // Actions: []*string{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ServiceName: to.Ptr("Microsoft.Sql/managedInstances"), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Purpose: to.Ptr(""), - // }, - // }}, - // VirtualNetworkPeerings: []*armnetwork.VirtualNetworkPeering{ - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkCreateWithEncryption.json -func ExampleVirtualNetworksClient_BeginCreateOrUpdate_createVirtualNetworkWithEncryption() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworksClient().BeginCreateOrUpdate(ctx, "rg1", "test-vnet", armnetwork.VirtualNetwork{ - Location: to.Ptr("eastus"), - Properties: &armnetwork.VirtualNetworkPropertiesFormat{ - AddressSpace: &armnetwork.AddressSpace{ - AddressPrefixes: []*string{ - to.Ptr("10.0.0.0/16")}, - }, - Encryption: &armnetwork.VirtualNetworkEncryption{ - Enabled: to.Ptr(true), - Enforcement: to.Ptr(armnetwork.VirtualNetworkEncryptionEnforcementAllowUnencrypted), - }, - Subnets: []*armnetwork.Subnet{ - { - Name: to.Ptr("test-1"), - Properties: &armnetwork.SubnetPropertiesFormat{ - AddressPrefix: to.Ptr("10.0.0.0/24"), - }, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualNetwork = armnetwork.VirtualNetwork{ - // Name: to.Ptr("test-vnet"), - // Type: to.Ptr("Microsoft.Network/virtualNetworks"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.VirtualNetworkPropertiesFormat{ - // AddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/16")}, - // }, - // Encryption: &armnetwork.VirtualNetworkEncryption{ - // Enabled: to.Ptr(true), - // Enforcement: to.Ptr(armnetwork.VirtualNetworkEncryptionEnforcementAllowUnencrypted), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnets: []*armnetwork.Subnet{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-1"), - // Name: to.Ptr("test-1"), - // Properties: &armnetwork.SubnetPropertiesFormat{ - // AddressPrefix: to.Ptr("10.0.0.0/24"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // VirtualNetworkPeerings: []*armnetwork.VirtualNetworkPeering{ - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkCreateServiceEndpoints.json -func ExampleVirtualNetworksClient_BeginCreateOrUpdate_createVirtualNetworkWithServiceEndpoints() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworksClient().BeginCreateOrUpdate(ctx, "vnetTest", "vnet1", armnetwork.VirtualNetwork{ - Location: to.Ptr("eastus"), - Properties: &armnetwork.VirtualNetworkPropertiesFormat{ - AddressSpace: &armnetwork.AddressSpace{ - AddressPrefixes: []*string{ - to.Ptr("10.0.0.0/16")}, - }, - Subnets: []*armnetwork.Subnet{ - { - Name: to.Ptr("test-1"), - Properties: &armnetwork.SubnetPropertiesFormat{ - AddressPrefix: to.Ptr("10.0.0.0/16"), - ServiceEndpoints: []*armnetwork.ServiceEndpointPropertiesFormat{ - { - Service: to.Ptr("Microsoft.Storage"), - }}, - }, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualNetwork = armnetwork.VirtualNetwork{ - // Name: to.Ptr("vnet1"), - // Type: to.Ptr("Microsoft.Network/virtualNetworks"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/vnetTest/providers/Microsoft.Network/virtualNetworks/vnet1"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.VirtualNetworkPropertiesFormat{ - // AddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/16")}, - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnets: []*armnetwork.Subnet{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/vnetTest/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/test-1"), - // Name: to.Ptr("test-1"), - // Properties: &armnetwork.SubnetPropertiesFormat{ - // AddressPrefix: to.Ptr("10.0.0.0/16"), - // IPConfigurations: []*armnetwork.IPConfiguration{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceNavigationLinks: []*armnetwork.ResourceNavigationLink{ - // }, - // ServiceEndpoints: []*armnetwork.ServiceEndpointPropertiesFormat{ - // { - // Locations: []*string{ - // to.Ptr("eastus2(stage)"), - // to.Ptr("usnorth(stage)")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Service: to.Ptr("Microsoft.Storage"), - // }}, - // }, - // }}, - // VirtualNetworkPeerings: []*armnetwork.VirtualNetworkPeering{ - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkCreateServiceEndpointPolicy.json -func ExampleVirtualNetworksClient_BeginCreateOrUpdate_createVirtualNetworkWithServiceEndpointsAndServiceEndpointPolicy() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworksClient().BeginCreateOrUpdate(ctx, "vnetTest", "vnet1", armnetwork.VirtualNetwork{ - Location: to.Ptr("eastus2euap"), - Properties: &armnetwork.VirtualNetworkPropertiesFormat{ - AddressSpace: &armnetwork.AddressSpace{ - AddressPrefixes: []*string{ - to.Ptr("10.0.0.0/16")}, - }, - Subnets: []*armnetwork.Subnet{ - { - Name: to.Ptr("test-1"), - Properties: &armnetwork.SubnetPropertiesFormat{ - AddressPrefix: to.Ptr("10.0.0.0/16"), - ServiceEndpointPolicies: []*armnetwork.ServiceEndpointPolicy{ - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/vnetTest/providers/Microsoft.Network/serviceEndpointPolicies/ServiceEndpointPolicy1"), - }}, - ServiceEndpoints: []*armnetwork.ServiceEndpointPropertiesFormat{ - { - Service: to.Ptr("Microsoft.Storage"), - }}, - }, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualNetwork = armnetwork.VirtualNetwork{ - // Name: to.Ptr("vnet1"), - // Type: to.Ptr("Microsoft.Network/virtualNetworks"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/vnetTest/providers/Microsoft.Network/virtualNetworks/vnet1"), - // Location: to.Ptr("eastus2euap"), - // Properties: &armnetwork.VirtualNetworkPropertiesFormat{ - // AddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/16")}, - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnets: []*armnetwork.Subnet{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/vnetTest/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/test-1"), - // Name: to.Ptr("test-1"), - // Properties: &armnetwork.SubnetPropertiesFormat{ - // AddressPrefix: to.Ptr("10.0.0.0/16"), - // IPConfigurations: []*armnetwork.IPConfiguration{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceNavigationLinks: []*armnetwork.ResourceNavigationLink{ - // }, - // ServiceEndpointPolicies: []*armnetwork.ServiceEndpointPolicy{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/vnetTest/providers/Microsoft.Network/serviceEndpointPolicies/ServiceEndpointPolicy1"), - // }}, - // ServiceEndpoints: []*armnetwork.ServiceEndpointPropertiesFormat{ - // { - // Locations: []*string{ - // to.Ptr("eastus2(stage)"), - // to.Ptr("usnorth(stage)")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Service: to.Ptr("Microsoft.Storage"), - // }}, - // }, - // }}, - // VirtualNetworkPeerings: []*armnetwork.VirtualNetworkPeering{ - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkCreateSubnet.json -func ExampleVirtualNetworksClient_BeginCreateOrUpdate_createVirtualNetworkWithSubnet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworksClient().BeginCreateOrUpdate(ctx, "rg1", "test-vnet", armnetwork.VirtualNetwork{ - Location: to.Ptr("eastus"), - Properties: &armnetwork.VirtualNetworkPropertiesFormat{ - AddressSpace: &armnetwork.AddressSpace{ - AddressPrefixes: []*string{ - to.Ptr("10.0.0.0/16")}, - }, - Subnets: []*armnetwork.Subnet{ - { - Name: to.Ptr("test-1"), - Properties: &armnetwork.SubnetPropertiesFormat{ - AddressPrefix: to.Ptr("10.0.0.0/24"), - }, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualNetwork = armnetwork.VirtualNetwork{ - // Name: to.Ptr("test-vnet"), - // Type: to.Ptr("Microsoft.Network/virtualNetworks"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.VirtualNetworkPropertiesFormat{ - // AddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/16")}, - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnets: []*armnetwork.Subnet{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-1"), - // Name: to.Ptr("test-1"), - // Properties: &armnetwork.SubnetPropertiesFormat{ - // AddressPrefix: to.Ptr("10.0.0.0/24"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // VirtualNetworkPeerings: []*armnetwork.VirtualNetworkPeering{ - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkCreateSubnetWithAddressPrefixes.json -func ExampleVirtualNetworksClient_BeginCreateOrUpdate_createVirtualNetworkWithSubnetContainingAddressPrefixes() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworksClient().BeginCreateOrUpdate(ctx, "rg1", "test-vnet", armnetwork.VirtualNetwork{ - Location: to.Ptr("eastus"), - Properties: &armnetwork.VirtualNetworkPropertiesFormat{ - AddressSpace: &armnetwork.AddressSpace{ - AddressPrefixes: []*string{ - to.Ptr("10.0.0.0/16")}, - }, - Subnets: []*armnetwork.Subnet{ - { - Name: to.Ptr("test-2"), - Properties: &armnetwork.SubnetPropertiesFormat{ - AddressPrefixes: []*string{ - to.Ptr("10.0.0.0/28"), - to.Ptr("10.0.1.0/28")}, - }, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualNetwork = armnetwork.VirtualNetwork{ - // Name: to.Ptr("test-vnet"), - // Type: to.Ptr("Microsoft.Network/virtualNetworks"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet"), - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.VirtualNetworkPropertiesFormat{ - // AddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/16")}, - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnets: []*armnetwork.Subnet{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-2"), - // Name: to.Ptr("test-2"), - // Properties: &armnetwork.SubnetPropertiesFormat{ - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/28"), - // to.Ptr("10.1.0.0/28")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // VirtualNetworkPeerings: []*armnetwork.VirtualNetworkPeering{ - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkUpdateTags.json -func ExampleVirtualNetworksClient_UpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualNetworksClient().UpdateTags(ctx, "rg1", "test-vnet", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualNetwork = armnetwork.VirtualNetwork{ - // Name: to.Ptr("test-vnet"), - // Type: to.Ptr("Microsoft.Network/virtualNetworks"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armnetwork.VirtualNetworkPropertiesFormat{ - // AddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/16")}, - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnets: []*armnetwork.Subnet{ - // }, - // VirtualNetworkPeerings: []*armnetwork.VirtualNetworkPeering{ - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkListAll.json -func ExampleVirtualNetworksClient_NewListAllPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualNetworksClient().NewListAllPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualNetworkListResult = armnetwork.VirtualNetworkListResult{ - // Value: []*armnetwork.VirtualNetwork{ - // { - // Name: to.Ptr("vnet1"), - // Type: to.Ptr("Microsoft.Network/virtualNetworks"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.VirtualNetworkPropertiesFormat{ - // AddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/8")}, - // }, - // DhcpOptions: &armnetwork.DhcpOptions{ - // DNSServers: []*string{ - // }, - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnets: []*armnetwork.Subnet{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/test-1"), - // Name: to.Ptr("test-1"), - // Properties: &armnetwork.SubnetPropertiesFormat{ - // AddressPrefix: to.Ptr("10.0.0.0/24"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // VirtualNetworkPeerings: []*armnetwork.VirtualNetworkPeering{ - // }, - // }, - // }, - // { - // Name: to.Ptr("vnet2"), - // Type: to.Ptr("Microsoft.Network/virtualNetworks"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/vnet2"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.VirtualNetworkPropertiesFormat{ - // AddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/16")}, - // }, - // DhcpOptions: &armnetwork.DhcpOptions{ - // DNSServers: []*string{ - // to.Ptr("8.8.8.8")}, - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnets: []*armnetwork.Subnet{ - // }, - // VirtualNetworkPeerings: []*armnetwork.VirtualNetworkPeering{ - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkList.json -func ExampleVirtualNetworksClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualNetworksClient().NewListPager("rg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualNetworkListResult = armnetwork.VirtualNetworkListResult{ - // Value: []*armnetwork.VirtualNetwork{ - // { - // Name: to.Ptr("vnet1"), - // Type: to.Ptr("Microsoft.Network/virtualNetworks"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.VirtualNetworkPropertiesFormat{ - // AddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/8")}, - // }, - // DhcpOptions: &armnetwork.DhcpOptions{ - // DNSServers: []*string{ - // }, - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnets: []*armnetwork.Subnet{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/test-1"), - // Name: to.Ptr("test-1"), - // Properties: &armnetwork.SubnetPropertiesFormat{ - // AddressPrefix: to.Ptr("10.0.0.0/24"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // VirtualNetworkPeerings: []*armnetwork.VirtualNetworkPeering{ - // }, - // }, - // }, - // { - // Name: to.Ptr("vnet2"), - // Type: to.Ptr("Microsoft.Network/virtualNetworks"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2"), - // Location: to.Ptr("westus"), - // Properties: &armnetwork.VirtualNetworkPropertiesFormat{ - // AddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/16")}, - // }, - // DhcpOptions: &armnetwork.DhcpOptions{ - // DNSServers: []*string{ - // to.Ptr("8.8.8.8")}, - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnets: []*armnetwork.Subnet{ - // }, - // VirtualNetworkPeerings: []*armnetwork.VirtualNetworkPeering{ - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkCheckIPAddressAvailability.json -func ExampleVirtualNetworksClient_CheckIPAddressAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualNetworksClient().CheckIPAddressAvailability(ctx, "rg1", "test-vnet", "10.0.1.4", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.IPAddressAvailabilityResult = armnetwork.IPAddressAvailabilityResult{ - // Available: to.Ptr(false), - // AvailableIPAddresses: []*string{ - // to.Ptr("10.0.1.5"), - // to.Ptr("10.0.1.6"), - // to.Ptr("10.0.1.7"), - // to.Ptr("10.0.1.8"), - // to.Ptr("10.0.1.9")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkListUsage.json -func ExampleVirtualNetworksClient_NewListUsagePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualNetworksClient().NewListUsagePager("rg1", "vnetName", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualNetworkListUsageResult = armnetwork.VirtualNetworkListUsageResult{ - // Value: []*armnetwork.VirtualNetworkUsage{ - // { - // Name: &armnetwork.VirtualNetworkUsageName{ - // LocalizedValue: to.Ptr("Subnet size and usage"), - // Value: to.Ptr("SubnetSpace"), - // }, - // CurrentValue: to.Ptr[float64](-1), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetName/subnets/GatewaySubnet"), - // Limit: to.Ptr[float64](-1), - // Unit: to.Ptr("Count"), - // }, - // { - // Name: &armnetwork.VirtualNetworkUsageName{ - // LocalizedValue: to.Ptr("Subnet size and usage"), - // Value: to.Ptr("SubnetSpace"), - // }, - // CurrentValue: to.Ptr[float64](2), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetName/subnets/newSubnet"), - // Limit: to.Ptr[float64](3), - // Unit: to.Ptr("Count"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkGetDdosProtectionStatus.json -func ExampleVirtualNetworksClient_BeginListDdosProtectionStatus() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworksClient().BeginListDdosProtectionStatus(ctx, "rg1", "test-vnet", &armnetwork.VirtualNetworksClientBeginListDdosProtectionStatusOptions{Top: to.Ptr[int32](75), - SkipToken: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - for res.More() { - page, err := res.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualNetworkDdosProtectionStatusResult = armnetwork.VirtualNetworkDdosProtectionStatusResult{ - // Value: []*armnetwork.PublicIPDdosProtectionStatusResult{ - // { - // DdosProtectionPlanID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/ddosProtectionPlans/test-plan"), - // IsWorkloadProtected: to.Ptr(armnetwork.IsWorkloadProtectedTrue), - // PublicIPAddress: to.Ptr("10.0.1.5"), - // PublicIPAddressID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-pip"), - // }, - // { - // IsWorkloadProtected: to.Ptr(armnetwork.IsWorkloadProtectedFalse), - // PublicIPAddress: to.Ptr("10.0.1.6"), - // PublicIPAddressID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-pip2"), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/virtualnetworktaps_client.go b/sdk/resourcemanager/network/armnetwork/virtualnetworktaps_client.go index 0ab0b4ad3cb9..a03b2aa64291 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualnetworktaps_client.go +++ b/sdk/resourcemanager/network/armnetwork/virtualnetworktaps_client.go @@ -47,7 +47,7 @@ func NewVirtualNetworkTapsClient(subscriptionID string, credential azcore.TokenC // BeginCreateOrUpdate - Creates or updates a Virtual Network Tap. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - tapName - The name of the virtual network tap. // - parameters - Parameters supplied to the create or update virtual network tap operation. @@ -71,7 +71,7 @@ func (client *VirtualNetworkTapsClient) BeginCreateOrUpdate(ctx context.Context, // CreateOrUpdate - Creates or updates a Virtual Network Tap. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VirtualNetworkTapsClient) createOrUpdate(ctx context.Context, resourceGroupName string, tapName string, parameters VirtualNetworkTap, options *VirtualNetworkTapsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkTapsClient.BeginCreateOrUpdate" @@ -113,7 +113,7 @@ func (client *VirtualNetworkTapsClient) createOrUpdateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -125,7 +125,7 @@ func (client *VirtualNetworkTapsClient) createOrUpdateCreateRequest(ctx context. // BeginDelete - Deletes the specified virtual network tap. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - tapName - The name of the virtual network tap. // - options - VirtualNetworkTapsClientBeginDeleteOptions contains the optional parameters for the VirtualNetworkTapsClient.BeginDelete @@ -148,7 +148,7 @@ func (client *VirtualNetworkTapsClient) BeginDelete(ctx context.Context, resourc // Delete - Deletes the specified virtual network tap. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VirtualNetworkTapsClient) deleteOperation(ctx context.Context, resourceGroupName string, tapName string, options *VirtualNetworkTapsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkTapsClient.BeginDelete" @@ -190,7 +190,7 @@ func (client *VirtualNetworkTapsClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -199,7 +199,7 @@ func (client *VirtualNetworkTapsClient) deleteCreateRequest(ctx context.Context, // Get - Gets information about the specified virtual network tap. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - tapName - The name of virtual network tap. // - options - VirtualNetworkTapsClientGetOptions contains the optional parameters for the VirtualNetworkTapsClient.Get method. @@ -245,7 +245,7 @@ func (client *VirtualNetworkTapsClient) getCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -262,7 +262,7 @@ func (client *VirtualNetworkTapsClient) getHandleResponse(resp *http.Response) ( // NewListAllPager - Gets all the VirtualNetworkTaps in a subscription. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - options - VirtualNetworkTapsClientListAllOptions contains the optional parameters for the VirtualNetworkTapsClient.NewListAllPager // method. func (client *VirtualNetworkTapsClient) NewListAllPager(options *VirtualNetworkTapsClientListAllOptions) *runtime.Pager[VirtualNetworkTapsClientListAllResponse] { @@ -307,7 +307,7 @@ func (client *VirtualNetworkTapsClient) listAllCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -324,7 +324,7 @@ func (client *VirtualNetworkTapsClient) listAllHandleResponse(resp *http.Respons // NewListByResourceGroupPager - Gets all the VirtualNetworkTaps in a subscription. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - options - VirtualNetworkTapsClientListByResourceGroupOptions contains the optional parameters for the VirtualNetworkTapsClient.NewListByResourceGroupPager // method. @@ -374,7 +374,7 @@ func (client *VirtualNetworkTapsClient) listByResourceGroupCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -392,7 +392,7 @@ func (client *VirtualNetworkTapsClient) listByResourceGroupHandleResponse(resp * // UpdateTags - Updates an VirtualNetworkTap tags. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - tapName - The name of the tap. // - tapParameters - Parameters supplied to update VirtualNetworkTap tags. @@ -440,7 +440,7 @@ func (client *VirtualNetworkTapsClient) updateTagsCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, tapParameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/virtualnetworktaps_client_example_test.go b/sdk/resourcemanager/network/armnetwork/virtualnetworktaps_client_example_test.go deleted file mode 100644 index cbfc5916231e..000000000000 --- a/sdk/resourcemanager/network/armnetwork/virtualnetworktaps_client_example_test.go +++ /dev/null @@ -1,307 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkTapDelete.json -func ExampleVirtualNetworkTapsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkTapsClient().BeginDelete(ctx, "rg1", "test-vtap", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkTapGet.json -func ExampleVirtualNetworkTapsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualNetworkTapsClient().Get(ctx, "rg1", "testvtap", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualNetworkTap = armnetwork.VirtualNetworkTap{ - // Name: to.Ptr("testvtap"), - // Type: to.Ptr("Microsoft.Network/virtualNetworkTaps"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkTaps/testvtap"), - // Location: to.Ptr("centraluseuap"), - // Etag: to.Ptr("etag"), - // Properties: &armnetwork.VirtualNetworkTapPropertiesFormat{ - // DestinationNetworkInterfaceIPConfiguration: &armnetwork.InterfaceIPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testNetworkInterface/ipConfigurations/testIPConfig1"), - // }, - // DestinationPort: to.Ptr[int32](4789), - // NetworkInterfaceTapConfigurations: []*armnetwork.InterfaceTapConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testNetworkInterface2/tapConfigurations/testtapConfiguration"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("6A7C139D-8B8D-499B-B7CB-4F3F02A8A44F"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkTapCreate.json -func ExampleVirtualNetworkTapsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkTapsClient().BeginCreateOrUpdate(ctx, "rg1", "test-vtap", armnetwork.VirtualNetworkTap{ - Location: to.Ptr("centraluseuap"), - Properties: &armnetwork.VirtualNetworkTapPropertiesFormat{ - DestinationNetworkInterfaceIPConfiguration: &armnetwork.InterfaceIPConfiguration{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testNetworkInterface/ipConfigurations/ipconfig1"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualNetworkTap = armnetwork.VirtualNetworkTap{ - // Name: to.Ptr("testvtap"), - // Type: to.Ptr("Microsoft.Network/virtualNetworkTaps"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkTaps/testvtap"), - // Location: to.Ptr("centraluseuap"), - // Etag: to.Ptr("etag"), - // Properties: &armnetwork.VirtualNetworkTapPropertiesFormat{ - // DestinationNetworkInterfaceIPConfiguration: &armnetwork.InterfaceIPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testNetworkInterface/ipConfigurations/testIPConfig1"), - // }, - // DestinationPort: to.Ptr[int32](4789), - // NetworkInterfaceTapConfigurations: []*armnetwork.InterfaceTapConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testNetworkInterface2/tapConfigurations/testtapConfiguration"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("6A7C139D-8B8D-499B-B7CB-4F3F02A8A44F"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkTapUpdateTags.json -func ExampleVirtualNetworkTapsClient_UpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualNetworkTapsClient().UpdateTags(ctx, "rg1", "test-vtap", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualNetworkTap = armnetwork.VirtualNetworkTap{ - // Name: to.Ptr("test-vtap"), - // Type: to.Ptr("Microsoft.Network/virtualNetworkTaps"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkTaps/test-vtap"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armnetwork.VirtualNetworkTapPropertiesFormat{ - // DestinationNetworkInterfaceIPConfiguration: &armnetwork.InterfaceIPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testNetworkInterface/ipConfigurations/testIPConfig1"), - // }, - // DestinationPort: to.Ptr[int32](4789), - // NetworkInterfaceTapConfigurations: []*armnetwork.InterfaceTapConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testNetworkInterface2/tapConfigurations/testtapConfiguration"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkTapListAll.json -func ExampleVirtualNetworkTapsClient_NewListAllPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualNetworkTapsClient().NewListAllPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualNetworkTapListResult = armnetwork.VirtualNetworkTapListResult{ - // Value: []*armnetwork.VirtualNetworkTap{ - // { - // Name: to.Ptr("testvtap"), - // Type: to.Ptr("Microsoft.Network/virtualNetworkTaps"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkTaps/testvtap"), - // Location: to.Ptr("centraluseuap"), - // Etag: to.Ptr("etag"), - // Properties: &armnetwork.VirtualNetworkTapPropertiesFormat{ - // DestinationNetworkInterfaceIPConfiguration: &armnetwork.InterfaceIPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testNetworkInterface/ipConfigurations/testIPConfig1"), - // }, - // DestinationPort: to.Ptr[int32](4789), - // NetworkInterfaceTapConfigurations: []*armnetwork.InterfaceTapConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testNetworkInterface2/tapConfigurations/testtapConfiguration"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("6A7C139D-8B8D-499B-B7CB-4F3F02A8A44F"), - // }, - // }, - // { - // Name: to.Ptr("testvtap2"), - // Type: to.Ptr("Microsoft.Network/virtualNetworkTaps"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkTaps/testvtap2"), - // Location: to.Ptr("centraluseuap"), - // Etag: to.Ptr("etag"), - // Properties: &armnetwork.VirtualNetworkTapPropertiesFormat{ - // DestinationNetworkInterfaceIPConfiguration: &armnetwork.InterfaceIPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testNetworkInterface/ipConfigurations/testIPConfig1"), - // }, - // DestinationPort: to.Ptr[int32](4789), - // NetworkInterfaceTapConfigurations: []*armnetwork.InterfaceTapConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testNetworkInterface3/tapConfigurations/testtapConfiguration"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("6A7C139D-8B8D-499B-B7CB-4F3F02A8A44F"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualNetworkTapList.json -func ExampleVirtualNetworkTapsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualNetworkTapsClient().NewListByResourceGroupPager("rg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualNetworkTapListResult = armnetwork.VirtualNetworkTapListResult{ - // Value: []*armnetwork.VirtualNetworkTap{ - // { - // Name: to.Ptr("testvtap"), - // Type: to.Ptr("Microsoft.Network/virtualNetworkTaps"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkTaps/testvtap"), - // Location: to.Ptr("centraluseuap"), - // Etag: to.Ptr("etag"), - // Properties: &armnetwork.VirtualNetworkTapPropertiesFormat{ - // DestinationNetworkInterfaceIPConfiguration: &armnetwork.InterfaceIPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testNetworkInterface/ipConfigurations/testIPConfig1"), - // }, - // DestinationPort: to.Ptr[int32](4789), - // NetworkInterfaceTapConfigurations: []*armnetwork.InterfaceTapConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testNetworkInterface2/tapConfigurations/testtapConfiguration"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("6A7C139D-8B8D-499B-B7CB-4F3F02A8A44F"), - // }, - // }, - // { - // Name: to.Ptr("testvtap2"), - // Type: to.Ptr("Microsoft.Network/virtualNetworkTaps"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkTaps/testvtap2"), - // Location: to.Ptr("centraluseuap"), - // Etag: to.Ptr("etag"), - // Properties: &armnetwork.VirtualNetworkTapPropertiesFormat{ - // DestinationNetworkInterfaceIPConfiguration: &armnetwork.InterfaceIPConfiguration{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testNetworkInterface/ipConfigurations/testIPConfig1"), - // }, - // DestinationPort: to.Ptr[int32](4789), - // NetworkInterfaceTapConfigurations: []*armnetwork.InterfaceTapConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testNetworkInterface3/tapConfigurations/testtapConfiguration"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("6A7C139D-8B8D-499B-B7CB-4F3F02A8A44F"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/virtualrouterpeerings_client.go b/sdk/resourcemanager/network/armnetwork/virtualrouterpeerings_client.go index 7f5fad52e5a1..f65306beeb32 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualrouterpeerings_client.go +++ b/sdk/resourcemanager/network/armnetwork/virtualrouterpeerings_client.go @@ -47,7 +47,7 @@ func NewVirtualRouterPeeringsClient(subscriptionID string, credential azcore.Tok // BeginCreateOrUpdate - Creates or updates the specified Virtual Router Peering. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - virtualRouterName - The name of the Virtual Router. // - peeringName - The name of the Virtual Router Peering. @@ -72,7 +72,7 @@ func (client *VirtualRouterPeeringsClient) BeginCreateOrUpdate(ctx context.Conte // CreateOrUpdate - Creates or updates the specified Virtual Router Peering. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VirtualRouterPeeringsClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualRouterName string, peeringName string, parameters VirtualRouterPeering, options *VirtualRouterPeeringsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualRouterPeeringsClient.BeginCreateOrUpdate" @@ -118,7 +118,7 @@ func (client *VirtualRouterPeeringsClient) createOrUpdateCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -130,7 +130,7 @@ func (client *VirtualRouterPeeringsClient) createOrUpdateCreateRequest(ctx conte // BeginDelete - Deletes the specified peering from a Virtual Router. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - virtualRouterName - The name of the Virtual Router. // - peeringName - The name of the peering. @@ -154,7 +154,7 @@ func (client *VirtualRouterPeeringsClient) BeginDelete(ctx context.Context, reso // Delete - Deletes the specified peering from a Virtual Router. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VirtualRouterPeeringsClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualRouterName string, peeringName string, options *VirtualRouterPeeringsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualRouterPeeringsClient.BeginDelete" @@ -200,7 +200,7 @@ func (client *VirtualRouterPeeringsClient) deleteCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -209,7 +209,7 @@ func (client *VirtualRouterPeeringsClient) deleteCreateRequest(ctx context.Conte // Get - Gets the specified Virtual Router Peering. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - virtualRouterName - The name of the Virtual Router. // - peeringName - The name of the Virtual Router Peering. @@ -261,7 +261,7 @@ func (client *VirtualRouterPeeringsClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -278,7 +278,7 @@ func (client *VirtualRouterPeeringsClient) getHandleResponse(resp *http.Response // NewListPager - Lists all Virtual Router Peerings in a Virtual Router resource. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - virtualRouterName - The name of the Virtual Router. // - options - VirtualRouterPeeringsClientListOptions contains the optional parameters for the VirtualRouterPeeringsClient.NewListPager @@ -333,7 +333,7 @@ func (client *VirtualRouterPeeringsClient) listCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/virtualrouterpeerings_client_example_test.go b/sdk/resourcemanager/network/armnetwork/virtualrouterpeerings_client_example_test.go deleted file mode 100644 index b447df8dfb41..000000000000 --- a/sdk/resourcemanager/network/armnetwork/virtualrouterpeerings_client_example_test.go +++ /dev/null @@ -1,147 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualRouterPeeringDelete.json -func ExampleVirtualRouterPeeringsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualRouterPeeringsClient().BeginDelete(ctx, "rg1", "virtualRouter", "peering1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualRouterPeeringGet.json -func ExampleVirtualRouterPeeringsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualRouterPeeringsClient().Get(ctx, "rg1", "virtualRouter", "peering1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualRouterPeering = armnetwork.VirtualRouterPeering{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualRouters/virtualRouter/peerings/peering1"), - // Name: to.Ptr("peering1"), - // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), - // Properties: &armnetwork.VirtualRouterPeeringProperties{ - // PeerAsn: to.Ptr[int64](20000), - // PeerIP: to.Ptr("192.168.1.5"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualRouterPeeringPut.json -func ExampleVirtualRouterPeeringsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualRouterPeeringsClient().BeginCreateOrUpdate(ctx, "rg1", "virtualRouter", "peering1", armnetwork.VirtualRouterPeering{ - Properties: &armnetwork.VirtualRouterPeeringProperties{ - PeerAsn: to.Ptr[int64](20000), - PeerIP: to.Ptr("192.168.1.5"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualRouterPeering = armnetwork.VirtualRouterPeering{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualRouters/virtualRouter/peerings/peering1"), - // Name: to.Ptr("peering1"), - // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), - // Properties: &armnetwork.VirtualRouterPeeringProperties{ - // PeerAsn: to.Ptr[int64](20000), - // PeerIP: to.Ptr("192.168.1.5"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualRouterPeeringList.json -func ExampleVirtualRouterPeeringsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualRouterPeeringsClient().NewListPager("rg1", "virtualRouter", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualRouterPeeringListResult = armnetwork.VirtualRouterPeeringListResult{ - // Value: []*armnetwork.VirtualRouterPeering{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualRouters/virtualRouter/peerings/peering1"), - // Name: to.Ptr("peering1"), - // Etag: to.Ptr("W/\"72090554-7e3b-43f2-80ad-99a9020dcb11\""), - // Properties: &armnetwork.VirtualRouterPeeringProperties{ - // PeerAsn: to.Ptr[int64](20000), - // PeerIP: to.Ptr("192.168.1.5"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/virtualrouters_client.go b/sdk/resourcemanager/network/armnetwork/virtualrouters_client.go index f3ea5eaf1f4f..09612659cf1d 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualrouters_client.go +++ b/sdk/resourcemanager/network/armnetwork/virtualrouters_client.go @@ -47,7 +47,7 @@ func NewVirtualRoutersClient(subscriptionID string, credential azcore.TokenCrede // BeginCreateOrUpdate - Creates or updates the specified Virtual Router. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - virtualRouterName - The name of the Virtual Router. // - parameters - Parameters supplied to the create or update Virtual Router. @@ -71,7 +71,7 @@ func (client *VirtualRoutersClient) BeginCreateOrUpdate(ctx context.Context, res // CreateOrUpdate - Creates or updates the specified Virtual Router. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VirtualRoutersClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualRouterName string, parameters VirtualRouter, options *VirtualRoutersClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualRoutersClient.BeginCreateOrUpdate" @@ -113,7 +113,7 @@ func (client *VirtualRoutersClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -125,7 +125,7 @@ func (client *VirtualRoutersClient) createOrUpdateCreateRequest(ctx context.Cont // BeginDelete - Deletes the specified Virtual Router. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - virtualRouterName - The name of the Virtual Router. // - options - VirtualRoutersClientBeginDeleteOptions contains the optional parameters for the VirtualRoutersClient.BeginDelete @@ -148,7 +148,7 @@ func (client *VirtualRoutersClient) BeginDelete(ctx context.Context, resourceGro // Delete - Deletes the specified Virtual Router. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VirtualRoutersClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualRouterName string, options *VirtualRoutersClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualRoutersClient.BeginDelete" @@ -190,7 +190,7 @@ func (client *VirtualRoutersClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -199,7 +199,7 @@ func (client *VirtualRoutersClient) deleteCreateRequest(ctx context.Context, res // Get - Gets the specified Virtual Router. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - virtualRouterName - The name of the Virtual Router. // - options - VirtualRoutersClientGetOptions contains the optional parameters for the VirtualRoutersClient.Get method. @@ -245,7 +245,7 @@ func (client *VirtualRoutersClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } @@ -265,7 +265,7 @@ func (client *VirtualRoutersClient) getHandleResponse(resp *http.Response) (Virt // NewListPager - Gets all the Virtual Routers in a subscription. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - options - VirtualRoutersClientListOptions contains the optional parameters for the VirtualRoutersClient.NewListPager method. func (client *VirtualRoutersClient) NewListPager(options *VirtualRoutersClientListOptions) *runtime.Pager[VirtualRoutersClientListResponse] { return runtime.NewPager(runtime.PagingHandler[VirtualRoutersClientListResponse]{ @@ -309,7 +309,7 @@ func (client *VirtualRoutersClient) listCreateRequest(ctx context.Context, optio return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -326,7 +326,7 @@ func (client *VirtualRoutersClient) listHandleResponse(resp *http.Response) (Vir // NewListByResourceGroupPager - Lists all Virtual Routers in a resource group. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - options - VirtualRoutersClientListByResourceGroupOptions contains the optional parameters for the VirtualRoutersClient.NewListByResourceGroupPager // method. @@ -376,7 +376,7 @@ func (client *VirtualRoutersClient) listByResourceGroupCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/virtualrouters_client_example_test.go b/sdk/resourcemanager/network/armnetwork/virtualrouters_client_example_test.go deleted file mode 100644 index e00089beebbb..000000000000 --- a/sdk/resourcemanager/network/armnetwork/virtualrouters_client_example_test.go +++ /dev/null @@ -1,246 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualRouterDelete.json -func ExampleVirtualRoutersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualRoutersClient().BeginDelete(ctx, "rg1", "virtualRouter", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualRouterGet.json -func ExampleVirtualRoutersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualRoutersClient().Get(ctx, "rg1", "virtualRouter", &armnetwork.VirtualRoutersClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualRouter = armnetwork.VirtualRouter{ - // Name: to.Ptr("virtualRouter"), - // Type: to.Ptr("Microsoft.Network/virtualRouters"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualRouters/virtualRouter"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VirtualRouterPropertiesFormat{ - // HostedGateway: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vnetGateway"), - // }, - // Peerings: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualRouters/virtualRouter/peerings/peering1"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualRouterAsn: to.Ptr[int64](10000), - // VirtualRouterIPs: []*string{ - // to.Ptr("192.168.1.1"), - // to.Ptr("192.168.1.2")}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualRouterPut.json -func ExampleVirtualRoutersClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualRoutersClient().BeginCreateOrUpdate(ctx, "rg1", "virtualRouter", armnetwork.VirtualRouter{ - Location: to.Ptr("West US"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, - Properties: &armnetwork.VirtualRouterPropertiesFormat{ - HostedGateway: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vnetGateway"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualRouter = armnetwork.VirtualRouter{ - // Name: to.Ptr("virtualRouter"), - // Type: to.Ptr("Microsoft.Network/virtualRouters"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualRouters/virtualRouter"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VirtualRouterPropertiesFormat{ - // HostedGateway: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vnetGateway"), - // }, - // Peerings: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualRouters/virtualRouter/peerings/peering1"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualRouterAsn: to.Ptr[int64](10000), - // VirtualRouterIPs: []*string{ - // to.Ptr("192.168.1.1"), - // to.Ptr("192.168.1.2")}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualRouterListByResourceGroup.json -func ExampleVirtualRoutersClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualRoutersClient().NewListByResourceGroupPager("rg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualRouterListResult = armnetwork.VirtualRouterListResult{ - // Value: []*armnetwork.VirtualRouter{ - // { - // Name: to.Ptr("virtualRouter"), - // Type: to.Ptr("Microsoft.Network/virtualRouters"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualRouters/virtualRouter"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VirtualRouterPropertiesFormat{ - // HostedGateway: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vnetGateway"), - // }, - // Peerings: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualRouters/virtualRouter/peerings/peering1"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualRouterAsn: to.Ptr[int64](10000), - // VirtualRouterIPs: []*string{ - // to.Ptr("192.168.1.1"), - // to.Ptr("192.168.1.2")}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualRouterListBySubscription.json -func ExampleVirtualRoutersClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualRoutersClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualRouterListResult = armnetwork.VirtualRouterListResult{ - // Value: []*armnetwork.VirtualRouter{ - // { - // Name: to.Ptr("virtualRouter"), - // Type: to.Ptr("Microsoft.Network/virtualRouters"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualRouters/virtualRouter"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VirtualRouterPropertiesFormat{ - // HostedGateway: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vnetGateway"), - // }, - // Peerings: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualRouters/virtualRouter/peerings/peering1"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualRouterAsn: to.Ptr[int64](10000), - // VirtualRouterIPs: []*string{ - // to.Ptr("192.168.1.1"), - // to.Ptr("192.168.1.2")}, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/virtualwans_client.go b/sdk/resourcemanager/network/armnetwork/virtualwans_client.go index 469a693a26d0..c41280c06c27 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualwans_client.go +++ b/sdk/resourcemanager/network/armnetwork/virtualwans_client.go @@ -47,7 +47,7 @@ func NewVirtualWansClient(subscriptionID string, credential azcore.TokenCredenti // BeginCreateOrUpdate - Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the VirtualWan. // - virtualWANName - The name of the VirtualWAN being created or updated. // - wanParameters - Parameters supplied to create or update VirtualWAN. @@ -71,7 +71,7 @@ func (client *VirtualWansClient) BeginCreateOrUpdate(ctx context.Context, resour // CreateOrUpdate - Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VirtualWansClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualWANName string, wanParameters VirtualWAN, options *VirtualWansClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualWansClient.BeginCreateOrUpdate" @@ -113,7 +113,7 @@ func (client *VirtualWansClient) createOrUpdateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, wanParameters); err != nil { @@ -125,7 +125,7 @@ func (client *VirtualWansClient) createOrUpdateCreateRequest(ctx context.Context // BeginDelete - Deletes a VirtualWAN. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the VirtualWan. // - virtualWANName - The name of the VirtualWAN being deleted. // - options - VirtualWansClientBeginDeleteOptions contains the optional parameters for the VirtualWansClient.BeginDelete method. @@ -147,7 +147,7 @@ func (client *VirtualWansClient) BeginDelete(ctx context.Context, resourceGroupN // Delete - Deletes a VirtualWAN. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VirtualWansClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualWANName string, options *VirtualWansClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualWansClient.BeginDelete" @@ -189,7 +189,7 @@ func (client *VirtualWansClient) deleteCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -198,7 +198,7 @@ func (client *VirtualWansClient) deleteCreateRequest(ctx context.Context, resour // Get - Retrieves the details of a VirtualWAN. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the VirtualWan. // - virtualWANName - The name of the VirtualWAN being retrieved. // - options - VirtualWansClientGetOptions contains the optional parameters for the VirtualWansClient.Get method. @@ -244,7 +244,7 @@ func (client *VirtualWansClient) getCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -261,7 +261,7 @@ func (client *VirtualWansClient) getHandleResponse(resp *http.Response) (Virtual // NewListPager - Lists all the VirtualWANs in a subscription. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - options - VirtualWansClientListOptions contains the optional parameters for the VirtualWansClient.NewListPager method. func (client *VirtualWansClient) NewListPager(options *VirtualWansClientListOptions) *runtime.Pager[VirtualWansClientListResponse] { return runtime.NewPager(runtime.PagingHandler[VirtualWansClientListResponse]{ @@ -305,7 +305,7 @@ func (client *VirtualWansClient) listCreateRequest(ctx context.Context, options return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -322,7 +322,7 @@ func (client *VirtualWansClient) listHandleResponse(resp *http.Response) (Virtua // NewListByResourceGroupPager - Lists all the VirtualWANs in a resource group. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the VirtualWan. // - options - VirtualWansClientListByResourceGroupOptions contains the optional parameters for the VirtualWansClient.NewListByResourceGroupPager // method. @@ -372,7 +372,7 @@ func (client *VirtualWansClient) listByResourceGroupCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -390,7 +390,7 @@ func (client *VirtualWansClient) listByResourceGroupHandleResponse(resp *http.Re // UpdateTags - Updates a VirtualWAN tags. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the VirtualWan. // - virtualWANName - The name of the VirtualWAN being updated. // - wanParameters - Parameters supplied to Update VirtualWAN tags. @@ -437,7 +437,7 @@ func (client *VirtualWansClient) updateTagsCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, wanParameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/virtualwans_client_example_test.go b/sdk/resourcemanager/network/armnetwork/virtualwans_client_example_test.go deleted file mode 100644 index f970d1865452..000000000000 --- a/sdk/resourcemanager/network/armnetwork/virtualwans_client_example_test.go +++ /dev/null @@ -1,350 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualWANGet.json -func ExampleVirtualWansClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualWansClient().Get(ctx, "rg1", "wan1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualWAN = armnetwork.VirtualWAN{ - // Name: to.Ptr("wan1"), - // Type: to.Ptr("Microsoft.Network/virtualWANs"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualWANs/wan1"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VirtualWanProperties{ - // Type: to.Ptr("Basic"), - // DisableVPNEncryption: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualHubs: []*armnetwork.SubResource{ - // { - // }, - // { - // }}, - // VPNSites: []*armnetwork.SubResource{ - // { - // }, - // { - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualWANPut.json -func ExampleVirtualWansClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualWansClient().BeginCreateOrUpdate(ctx, "rg1", "wan1", armnetwork.VirtualWAN{ - Location: to.Ptr("West US"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, - Properties: &armnetwork.VirtualWanProperties{ - Type: to.Ptr("Basic"), - DisableVPNEncryption: to.Ptr(false), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualWAN = armnetwork.VirtualWAN{ - // Name: to.Ptr("wan1"), - // Type: to.Ptr("Microsoft.Network/virtualWANs"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualWANs/wan1"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VirtualWanProperties{ - // Type: to.Ptr("Basic"), - // DisableVPNEncryption: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualHubs: []*armnetwork.SubResource{ - // { - // }, - // { - // }}, - // VPNSites: []*armnetwork.SubResource{ - // { - // }, - // { - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualWANUpdateTags.json -func ExampleVirtualWansClient_UpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualWansClient().UpdateTags(ctx, "rg1", "wan1", armnetwork.TagsObject{ - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - "key2": to.Ptr("value2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualWAN = armnetwork.VirtualWAN{ - // Name: to.Ptr("wan1"), - // Type: to.Ptr("Microsoft.Network/virtualWANs"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualWANs/wan1"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VirtualWanProperties{ - // Type: to.Ptr("Basic"), - // DisableVPNEncryption: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualHubs: []*armnetwork.SubResource{ - // { - // }, - // { - // }}, - // VPNSites: []*armnetwork.SubResource{ - // { - // }, - // { - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualWANDelete.json -func ExampleVirtualWansClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualWansClient().BeginDelete(ctx, "rg1", "virtualWan1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualWANListByResourceGroup.json -func ExampleVirtualWansClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualWansClient().NewListByResourceGroupPager("rg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ListVirtualWANsResult = armnetwork.ListVirtualWANsResult{ - // Value: []*armnetwork.VirtualWAN{ - // { - // Name: to.Ptr("wan1"), - // Type: to.Ptr("Microsoft.Network/virtualWANs"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualWANs/wan1"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VirtualWanProperties{ - // Type: to.Ptr("Basic"), - // DisableVPNEncryption: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualHubs: []*armnetwork.SubResource{ - // { - // }, - // { - // }}, - // VPNSites: []*armnetwork.SubResource{ - // { - // }, - // { - // }}, - // }, - // }, - // { - // Name: to.Ptr("wan2"), - // Type: to.Ptr("Microsoft.Network/virtualWANs"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualWANs/wan2"), - // Location: to.Ptr("East US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VirtualWanProperties{ - // Type: to.Ptr("Basic"), - // DisableVPNEncryption: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualHubs: []*armnetwork.SubResource{ - // { - // }, - // { - // }}, - // VPNSites: []*armnetwork.SubResource{ - // { - // }, - // { - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VirtualWANList.json -func ExampleVirtualWansClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualWansClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ListVirtualWANsResult = armnetwork.ListVirtualWANsResult{ - // Value: []*armnetwork.VirtualWAN{ - // { - // Name: to.Ptr("wan1"), - // Type: to.Ptr("Microsoft.Network/virtualWANs"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualWANs/wan1"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VirtualWanProperties{ - // Type: to.Ptr("Basic"), - // DisableVPNEncryption: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualHubs: []*armnetwork.SubResource{ - // { - // }, - // { - // }}, - // VPNSites: []*armnetwork.SubResource{ - // { - // }, - // { - // }}, - // }, - // }, - // { - // Name: to.Ptr("wan2"), - // Type: to.Ptr("Microsoft.Network/virtualWANs"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualWANs/wan2"), - // Location: to.Ptr("East US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VirtualWanProperties{ - // Type: to.Ptr("Basic"), - // DisableVPNEncryption: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualHubs: []*armnetwork.SubResource{ - // { - // }, - // { - // }}, - // VPNSites: []*armnetwork.SubResource{ - // { - // }, - // { - // }}, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/vpnconnections_client.go b/sdk/resourcemanager/network/armnetwork/vpnconnections_client.go index 9d27e518b141..410c51fff2df 100644 --- a/sdk/resourcemanager/network/armnetwork/vpnconnections_client.go +++ b/sdk/resourcemanager/network/armnetwork/vpnconnections_client.go @@ -48,7 +48,7 @@ func NewVPNConnectionsClient(subscriptionID string, credential azcore.TokenCrede // connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the VpnGateway. // - gatewayName - The name of the gateway. // - connectionName - The name of the connection. @@ -73,7 +73,7 @@ func (client *VPNConnectionsClient) BeginCreateOrUpdate(ctx context.Context, res // CreateOrUpdate - Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VPNConnectionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, vpnConnectionParameters VPNConnection, options *VPNConnectionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "VPNConnectionsClient.BeginCreateOrUpdate" @@ -119,7 +119,7 @@ func (client *VPNConnectionsClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, vpnConnectionParameters); err != nil { @@ -131,7 +131,7 @@ func (client *VPNConnectionsClient) createOrUpdateCreateRequest(ctx context.Cont // BeginDelete - Deletes a vpn connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the VpnGateway. // - gatewayName - The name of the gateway. // - connectionName - The name of the connection. @@ -155,7 +155,7 @@ func (client *VPNConnectionsClient) BeginDelete(ctx context.Context, resourceGro // Delete - Deletes a vpn connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VPNConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, options *VPNConnectionsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VPNConnectionsClient.BeginDelete" @@ -201,7 +201,7 @@ func (client *VPNConnectionsClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -210,7 +210,7 @@ func (client *VPNConnectionsClient) deleteCreateRequest(ctx context.Context, res // Get - Retrieves the details of a vpn connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the VpnGateway. // - gatewayName - The name of the gateway. // - connectionName - The name of the vpn connection. @@ -261,7 +261,7 @@ func (client *VPNConnectionsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -278,7 +278,7 @@ func (client *VPNConnectionsClient) getHandleResponse(resp *http.Response) (VPNC // NewListByVPNGatewayPager - Retrieves all vpn connections for a particular virtual wan vpn gateway. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the VpnGateway. // - gatewayName - The name of the gateway. // - options - VPNConnectionsClientListByVPNGatewayOptions contains the optional parameters for the VPNConnectionsClient.NewListByVPNGatewayPager @@ -333,7 +333,7 @@ func (client *VPNConnectionsClient) listByVPNGatewayCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -351,7 +351,7 @@ func (client *VPNConnectionsClient) listByVPNGatewayHandleResponse(resp *http.Re // BeginStartPacketCapture - Starts packet capture on Vpn connection in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - gatewayName - The name of the gateway. // - vpnConnectionName - The name of the vpn connection. @@ -375,7 +375,7 @@ func (client *VPNConnectionsClient) BeginStartPacketCapture(ctx context.Context, // StartPacketCapture - Starts packet capture on Vpn connection in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VPNConnectionsClient) startPacketCapture(ctx context.Context, resourceGroupName string, gatewayName string, vpnConnectionName string, options *VPNConnectionsClientBeginStartPacketCaptureOptions) (*http.Response, error) { var err error const operationName = "VPNConnectionsClient.BeginStartPacketCapture" @@ -421,7 +421,7 @@ func (client *VPNConnectionsClient) startPacketCaptureCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Parameters != nil { @@ -436,7 +436,7 @@ func (client *VPNConnectionsClient) startPacketCaptureCreateRequest(ctx context. // BeginStopPacketCapture - Stops packet capture on Vpn connection in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - gatewayName - The name of the gateway. // - vpnConnectionName - The name of the vpn connection. @@ -460,7 +460,7 @@ func (client *VPNConnectionsClient) BeginStopPacketCapture(ctx context.Context, // StopPacketCapture - Stops packet capture on Vpn connection in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VPNConnectionsClient) stopPacketCapture(ctx context.Context, resourceGroupName string, gatewayName string, vpnConnectionName string, options *VPNConnectionsClientBeginStopPacketCaptureOptions) (*http.Response, error) { var err error const operationName = "VPNConnectionsClient.BeginStopPacketCapture" @@ -506,7 +506,7 @@ func (client *VPNConnectionsClient) stopPacketCaptureCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Parameters != nil { diff --git a/sdk/resourcemanager/network/armnetwork/vpnconnections_client_example_test.go b/sdk/resourcemanager/network/armnetwork/vpnconnections_client_example_test.go deleted file mode 100644 index 83c9d7a5d245..000000000000 --- a/sdk/resourcemanager/network/armnetwork/vpnconnections_client_example_test.go +++ /dev/null @@ -1,411 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VpnConnectionGet.json -func ExampleVPNConnectionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVPNConnectionsClient().Get(ctx, "rg1", "gateway1", "vpnConnection1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VPNConnection = armnetwork.VPNConnection{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1"), - // Name: to.Ptr("vpnConnection1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNConnectionProperties{ - // EgressBytesTransferred: to.Ptr[int64](0), - // EnableInternetSecurity: to.Ptr(false), - // IngressBytesTransferred: to.Ptr[int64](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RemoteVPNSite: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1"), - // }, - // RoutingConfiguration: &armnetwork.RoutingConfiguration{ - // AssociatedRouteTable: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable1"), - // }, - // InboundRouteMap: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1"), - // }, - // OutboundRouteMap: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap2"), - // }, - // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ - // IDs: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable2"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable3"), - // }}, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, - // }, - // }, - // TrafficSelectorPolicies: []*armnetwork.TrafficSelectorPolicy{ - // }, - // VPNLinkConnections: []*armnetwork.VPNSiteLinkConnection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/VpnSiteLinkConnections/Connection-Link1"), - // Name: to.Ptr("Connection-Link1"), - // Type: to.Ptr("Microsoft.Network/vpnGateways/vpnConnections/VpnSiteLinkConnections"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNSiteLinkConnectionProperties{ - // ConnectionBandwidth: to.Ptr[int32](200), - // EgressBytesTransferred: to.Ptr[int64](0), - // EnableBgp: to.Ptr(false), - // EnableRateLimiting: to.Ptr(false), - // IngressBytesTransferred: to.Ptr[int64](0), - // IPSecPolicies: []*armnetwork.IPSecPolicy{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RoutingWeight: to.Ptr[int32](0), - // SharedKey: to.Ptr("key"), - // UseLocalAzureIPAddress: to.Ptr(false), - // UsePolicyBasedTrafficSelectors: to.Ptr(false), - // VPNConnectionProtocolType: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionProtocolIKEv2), - // VPNLinkConnectionMode: to.Ptr(armnetwork.VPNLinkConnectionModeResponderOnly), - // VPNSiteLink: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/siteLink1"), - // }, - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/VpnSiteLinkConnections/Connection-Link2"), - // Name: to.Ptr("Connection-Link2"), - // Type: to.Ptr("Microsoft.Network/vpnGateways/vpnConnections/VpnSiteLinkConnections"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNSiteLinkConnectionProperties{ - // ConnectionBandwidth: to.Ptr[int32](200), - // EgressBytesTransferred: to.Ptr[int64](0), - // EnableBgp: to.Ptr(false), - // EnableRateLimiting: to.Ptr(false), - // IngressBytesTransferred: to.Ptr[int64](0), - // IPSecPolicies: []*armnetwork.IPSecPolicy{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RoutingWeight: to.Ptr[int32](0), - // SharedKey: to.Ptr("key"), - // UseLocalAzureIPAddress: to.Ptr(false), - // UsePolicyBasedTrafficSelectors: to.Ptr(false), - // VPNConnectionProtocolType: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionProtocolIKEv2), - // VPNLinkConnectionMode: to.Ptr(armnetwork.VPNLinkConnectionModeInitiatorOnly), - // VPNSiteLink: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/siteLink2"), - // }, - // }, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VpnConnectionPut.json -func ExampleVPNConnectionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVPNConnectionsClient().BeginCreateOrUpdate(ctx, "rg1", "gateway1", "vpnConnection1", armnetwork.VPNConnection{ - Properties: &armnetwork.VPNConnectionProperties{ - RemoteVPNSite: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1"), - }, - RoutingConfiguration: &armnetwork.RoutingConfiguration{ - AssociatedRouteTable: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable1"), - }, - InboundRouteMap: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1"), - }, - OutboundRouteMap: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap2"), - }, - PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ - IDs: []*armnetwork.SubResource{ - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable1"), - }, - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable2"), - }, - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable3"), - }}, - Labels: []*string{ - to.Ptr("label1"), - to.Ptr("label2")}, - }, - }, - TrafficSelectorPolicies: []*armnetwork.TrafficSelectorPolicy{}, - VPNLinkConnections: []*armnetwork.VPNSiteLinkConnection{ - { - Name: to.Ptr("Connection-Link1"), - Properties: &armnetwork.VPNSiteLinkConnectionProperties{ - ConnectionBandwidth: to.Ptr[int32](200), - SharedKey: to.Ptr("key"), - UsePolicyBasedTrafficSelectors: to.Ptr(false), - VPNConnectionProtocolType: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionProtocolIKEv2), - VPNLinkConnectionMode: to.Ptr(armnetwork.VPNLinkConnectionModeDefault), - VPNSiteLink: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/siteLink1"), - }, - }, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VPNConnection = armnetwork.VPNConnection{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1"), - // Name: to.Ptr("vpnConnection1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNConnectionProperties{ - // EgressBytesTransferred: to.Ptr[int64](0), - // EnableInternetSecurity: to.Ptr(false), - // IngressBytesTransferred: to.Ptr[int64](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RemoteVPNSite: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1"), - // }, - // RoutingConfiguration: &armnetwork.RoutingConfiguration{ - // AssociatedRouteTable: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable1"), - // }, - // InboundRouteMap: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1"), - // }, - // OutboundRouteMap: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap2"), - // }, - // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ - // IDs: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable2"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable3"), - // }}, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, - // }, - // }, - // TrafficSelectorPolicies: []*armnetwork.TrafficSelectorPolicy{ - // }, - // VPNLinkConnections: []*armnetwork.VPNSiteLinkConnection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/VpnSiteLinkConnections/Connection-Link1"), - // Name: to.Ptr("Connection-Link1"), - // Type: to.Ptr("Microsoft.Network/vpnGateways/vpnConnections/VpnSiteLinkConnections"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNSiteLinkConnectionProperties{ - // ConnectionBandwidth: to.Ptr[int32](200), - // EgressBytesTransferred: to.Ptr[int64](0), - // EnableBgp: to.Ptr(false), - // EnableRateLimiting: to.Ptr(false), - // IngressBytesTransferred: to.Ptr[int64](0), - // IPSecPolicies: []*armnetwork.IPSecPolicy{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RoutingWeight: to.Ptr[int32](0), - // SharedKey: to.Ptr("key"), - // UseLocalAzureIPAddress: to.Ptr(false), - // UsePolicyBasedTrafficSelectors: to.Ptr(false), - // VPNConnectionProtocolType: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionProtocolIKEv2), - // VPNLinkConnectionMode: to.Ptr(armnetwork.VPNLinkConnectionModeDefault), - // VPNSiteLink: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/siteLink1"), - // }, - // }, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VpnConnectionDelete.json -func ExampleVPNConnectionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVPNConnectionsClient().BeginDelete(ctx, "rg1", "gateway1", "vpnConnection1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VpnConnectionStartPacketCaptureFilterData.json -func ExampleVPNConnectionsClient_BeginStartPacketCapture_startPacketCaptureOnVpnConnectionWithFilter() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVPNConnectionsClient().BeginStartPacketCapture(ctx, "rg1", "gateway1", "vpnConnection1", &armnetwork.VPNConnectionsClientBeginStartPacketCaptureOptions{Parameters: &armnetwork.VPNConnectionPacketCaptureStartParameters{ - FilterData: to.Ptr("{'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}]}"), - LinkConnectionNames: []*string{ - to.Ptr("siteLink1"), - to.Ptr("siteLink2")}, - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Value = "\"{\"Status\":\"Successful\",\"Data\":null}\"" -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VpnConnectionStartPacketCapture.json -func ExampleVPNConnectionsClient_BeginStartPacketCapture_startPacketCaptureOnVpnConnectionWithoutFilter() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVPNConnectionsClient().BeginStartPacketCapture(ctx, "rg1", "gateway1", "vpnConnection1", &armnetwork.VPNConnectionsClientBeginStartPacketCaptureOptions{Parameters: &armnetwork.VPNConnectionPacketCaptureStartParameters{ - LinkConnectionNames: []*string{ - to.Ptr("siteLink1"), - to.Ptr("siteLink2")}, - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Value = "\"{\"Status\":\"Successful\",\"Data\":null}\"" -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VpnConnectionStopPacketCapture.json -func ExampleVPNConnectionsClient_BeginStopPacketCapture() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVPNConnectionsClient().BeginStopPacketCapture(ctx, "rg1", "gateway1", "vpnConnection1", &armnetwork.VPNConnectionsClientBeginStopPacketCaptureOptions{Parameters: &armnetwork.VPNConnectionPacketCaptureStopParameters{ - LinkConnectionNames: []*string{ - to.Ptr("vpnSiteLink1"), - to.Ptr("vpnSiteLink2")}, - SasURL: to.Ptr("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"), - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Value = "\"{\"Status\":\"Successful\",\"Data\":null}\"" -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VpnConnectionList.json -func ExampleVPNConnectionsClient_NewListByVPNGatewayPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVPNConnectionsClient().NewListByVPNGatewayPager("rg1", "gateway1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ListVPNConnectionsResult = armnetwork.ListVPNConnectionsResult{ - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/vpngateways_client.go b/sdk/resourcemanager/network/armnetwork/vpngateways_client.go index aad46c170711..7fc5fa18a7ac 100644 --- a/sdk/resourcemanager/network/armnetwork/vpngateways_client.go +++ b/sdk/resourcemanager/network/armnetwork/vpngateways_client.go @@ -47,7 +47,7 @@ func NewVPNGatewaysClient(subscriptionID string, credential azcore.TokenCredenti // BeginCreateOrUpdate - Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the VpnGateway. // - gatewayName - The name of the gateway. // - vpnGatewayParameters - Parameters supplied to create or Update a virtual wan vpn gateway. @@ -71,7 +71,7 @@ func (client *VPNGatewaysClient) BeginCreateOrUpdate(ctx context.Context, resour // CreateOrUpdate - Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VPNGatewaysClient) createOrUpdate(ctx context.Context, resourceGroupName string, gatewayName string, vpnGatewayParameters VPNGateway, options *VPNGatewaysClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "VPNGatewaysClient.BeginCreateOrUpdate" @@ -113,7 +113,7 @@ func (client *VPNGatewaysClient) createOrUpdateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, vpnGatewayParameters); err != nil { @@ -125,7 +125,7 @@ func (client *VPNGatewaysClient) createOrUpdateCreateRequest(ctx context.Context // BeginDelete - Deletes a virtual wan vpn gateway. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the VpnGateway. // - gatewayName - The name of the gateway. // - options - VPNGatewaysClientBeginDeleteOptions contains the optional parameters for the VPNGatewaysClient.BeginDelete method. @@ -147,7 +147,7 @@ func (client *VPNGatewaysClient) BeginDelete(ctx context.Context, resourceGroupN // Delete - Deletes a virtual wan vpn gateway. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VPNGatewaysClient) deleteOperation(ctx context.Context, resourceGroupName string, gatewayName string, options *VPNGatewaysClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VPNGatewaysClient.BeginDelete" @@ -189,7 +189,7 @@ func (client *VPNGatewaysClient) deleteCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -198,7 +198,7 @@ func (client *VPNGatewaysClient) deleteCreateRequest(ctx context.Context, resour // Get - Retrieves the details of a virtual wan vpn gateway. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the VpnGateway. // - gatewayName - The name of the gateway. // - options - VPNGatewaysClientGetOptions contains the optional parameters for the VPNGatewaysClient.Get method. @@ -244,7 +244,7 @@ func (client *VPNGatewaysClient) getCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -261,7 +261,7 @@ func (client *VPNGatewaysClient) getHandleResponse(resp *http.Response) (VPNGate // NewListPager - Lists all the VpnGateways in a subscription. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - options - VPNGatewaysClientListOptions contains the optional parameters for the VPNGatewaysClient.NewListPager method. func (client *VPNGatewaysClient) NewListPager(options *VPNGatewaysClientListOptions) *runtime.Pager[VPNGatewaysClientListResponse] { return runtime.NewPager(runtime.PagingHandler[VPNGatewaysClientListResponse]{ @@ -305,7 +305,7 @@ func (client *VPNGatewaysClient) listCreateRequest(ctx context.Context, options return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -322,7 +322,7 @@ func (client *VPNGatewaysClient) listHandleResponse(resp *http.Response) (VPNGat // NewListByResourceGroupPager - Lists all the VpnGateways in a resource group. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the VpnGateway. // - options - VPNGatewaysClientListByResourceGroupOptions contains the optional parameters for the VPNGatewaysClient.NewListByResourceGroupPager // method. @@ -372,7 +372,7 @@ func (client *VPNGatewaysClient) listByResourceGroupCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -390,7 +390,7 @@ func (client *VPNGatewaysClient) listByResourceGroupHandleResponse(resp *http.Re // BeginReset - Resets the primary of the vpn gateway in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the VpnGateway. // - gatewayName - The name of the gateway. // - options - VPNGatewaysClientBeginResetOptions contains the optional parameters for the VPNGatewaysClient.BeginReset method. @@ -412,7 +412,7 @@ func (client *VPNGatewaysClient) BeginReset(ctx context.Context, resourceGroupNa // Reset - Resets the primary of the vpn gateway in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VPNGatewaysClient) reset(ctx context.Context, resourceGroupName string, gatewayName string, options *VPNGatewaysClientBeginResetOptions) (*http.Response, error) { var err error const operationName = "VPNGatewaysClient.BeginReset" @@ -457,7 +457,7 @@ func (client *VPNGatewaysClient) resetCreateRequest(ctx context.Context, resourc if options != nil && options.IPConfigurationID != nil { reqQP.Set("ipConfigurationId", *options.IPConfigurationID) } - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -466,7 +466,7 @@ func (client *VPNGatewaysClient) resetCreateRequest(ctx context.Context, resourc // BeginStartPacketCapture - Starts packet capture on vpn gateway in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the VpnGateway. // - gatewayName - The name of the gateway. // - options - VPNGatewaysClientBeginStartPacketCaptureOptions contains the optional parameters for the VPNGatewaysClient.BeginStartPacketCapture @@ -489,7 +489,7 @@ func (client *VPNGatewaysClient) BeginStartPacketCapture(ctx context.Context, re // StartPacketCapture - Starts packet capture on vpn gateway in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VPNGatewaysClient) startPacketCapture(ctx context.Context, resourceGroupName string, gatewayName string, options *VPNGatewaysClientBeginStartPacketCaptureOptions) (*http.Response, error) { var err error const operationName = "VPNGatewaysClient.BeginStartPacketCapture" @@ -531,7 +531,7 @@ func (client *VPNGatewaysClient) startPacketCaptureCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Parameters != nil { @@ -546,7 +546,7 @@ func (client *VPNGatewaysClient) startPacketCaptureCreateRequest(ctx context.Con // BeginStopPacketCapture - Stops packet capture on vpn gateway in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the VpnGateway. // - gatewayName - The name of the gateway. // - options - VPNGatewaysClientBeginStopPacketCaptureOptions contains the optional parameters for the VPNGatewaysClient.BeginStopPacketCapture @@ -569,7 +569,7 @@ func (client *VPNGatewaysClient) BeginStopPacketCapture(ctx context.Context, res // StopPacketCapture - Stops packet capture on vpn gateway in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VPNGatewaysClient) stopPacketCapture(ctx context.Context, resourceGroupName string, gatewayName string, options *VPNGatewaysClientBeginStopPacketCaptureOptions) (*http.Response, error) { var err error const operationName = "VPNGatewaysClient.BeginStopPacketCapture" @@ -611,7 +611,7 @@ func (client *VPNGatewaysClient) stopPacketCaptureCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Parameters != nil { @@ -626,7 +626,7 @@ func (client *VPNGatewaysClient) stopPacketCaptureCreateRequest(ctx context.Cont // BeginUpdateTags - Updates virtual wan vpn gateway tags. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the VpnGateway. // - gatewayName - The name of the gateway. // - vpnGatewayParameters - Parameters supplied to update a virtual wan vpn gateway tags. @@ -650,7 +650,7 @@ func (client *VPNGatewaysClient) BeginUpdateTags(ctx context.Context, resourceGr // UpdateTags - Updates virtual wan vpn gateway tags. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VPNGatewaysClient) updateTags(ctx context.Context, resourceGroupName string, gatewayName string, vpnGatewayParameters TagsObject, options *VPNGatewaysClientBeginUpdateTagsOptions) (*http.Response, error) { var err error const operationName = "VPNGatewaysClient.BeginUpdateTags" @@ -692,7 +692,7 @@ func (client *VPNGatewaysClient) updateTagsCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, vpnGatewayParameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/vpngateways_client_example_test.go b/sdk/resourcemanager/network/armnetwork/vpngateways_client_example_test.go deleted file mode 100644 index df9aaa2d94ef..000000000000 --- a/sdk/resourcemanager/network/armnetwork/vpngateways_client_example_test.go +++ /dev/null @@ -1,1334 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VpnGatewayGet.json -func ExampleVPNGatewaysClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVPNGatewaysClient().Get(ctx, "rg1", "gateway1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VPNGateway = armnetwork.VPNGateway{ - // Name: to.Ptr("gateway1"), - // Type: to.Ptr("Microsoft.Network/vpnGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1"), - // Location: to.Ptr("West US"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNGatewayProperties{ - // BgpSettings: &armnetwork.BgpSettings{ - // Asn: to.Ptr[int64](65514), - // BgpPeeringAddress: to.Ptr("10.0.1.30"), - // BgpPeeringAddresses: []*armnetwork.IPConfigurationBgpPeeringAddress{ - // { - // CustomBgpIPAddresses: []*string{ - // to.Ptr("169.254.21.5")}, - // DefaultBgpIPAddresses: []*string{ - // to.Ptr("10.30.0.4")}, - // IPConfigurationID: to.Ptr("Instance0"), - // TunnelIPAddresses: []*string{ - // to.Ptr("104.208.48.178")}, - // }, - // { - // CustomBgpIPAddresses: []*string{ - // to.Ptr("169.254.21.10")}, - // DefaultBgpIPAddresses: []*string{ - // to.Ptr("10.30.0.5")}, - // IPConfigurationID: to.Ptr("Instance1"), - // TunnelIPAddresses: []*string{ - // to.Ptr("104.208.48.179")}, - // }}, - // PeerWeight: to.Ptr[int32](0), - // }, - // Connections: []*armnetwork.VPNConnection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1"), - // Name: to.Ptr("vpnConnection1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNConnectionProperties{ - // EgressBytesTransferred: to.Ptr[int64](0), - // EnableInternetSecurity: to.Ptr(false), - // IngressBytesTransferred: to.Ptr[int64](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RemoteVPNSite: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1"), - // }, - // RoutingConfiguration: &armnetwork.RoutingConfiguration{ - // AssociatedRouteTable: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - // }, - // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ - // IDs: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable2"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable3"), - // }}, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, - // }, - // VnetRoutes: &armnetwork.VnetRoute{ - // StaticRoutes: []*armnetwork.StaticRoute{ - // }, - // }, - // }, - // VPNLinkConnections: []*armnetwork.VPNSiteLinkConnection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/VpnSiteLinkConnections/Connection-Link1"), - // Name: to.Ptr("Connection-Link1"), - // Type: to.Ptr("Microsoft.Network/vpnGateways/vpnConnections/VpnSiteLinkConnections"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNSiteLinkConnectionProperties{ - // ConnectionBandwidth: to.Ptr[int32](200), - // EgressBytesTransferred: to.Ptr[int64](0), - // EnableBgp: to.Ptr(false), - // EnableRateLimiting: to.Ptr(false), - // IngressBytesTransferred: to.Ptr[int64](0), - // IngressNatRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/natRules/nat03"), - // }}, - // IPSecPolicies: []*armnetwork.IPSecPolicy{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RoutingWeight: to.Ptr[int32](0), - // SharedKey: to.Ptr("key"), - // UseLocalAzureIPAddress: to.Ptr(false), - // UsePolicyBasedTrafficSelectors: to.Ptr(false), - // VPNConnectionProtocolType: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionProtocolIKEv2), - // VPNSiteLink: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/siteLink1"), - // }, - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/VpnSiteLinkConnections/Connection-Link2"), - // Name: to.Ptr("Connection-Link2"), - // Type: to.Ptr("Microsoft.Network/vpnGateways/vpnConnections/VpnSiteLinkConnections"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNSiteLinkConnectionProperties{ - // ConnectionBandwidth: to.Ptr[int32](200), - // EgressBytesTransferred: to.Ptr[int64](0), - // EgressNatRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/natRules/nat04"), - // }}, - // EnableBgp: to.Ptr(false), - // EnableRateLimiting: to.Ptr(false), - // IngressBytesTransferred: to.Ptr[int64](0), - // IPSecPolicies: []*armnetwork.IPSecPolicy{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RoutingWeight: to.Ptr[int32](0), - // SharedKey: to.Ptr("key"), - // UseLocalAzureIPAddress: to.Ptr(false), - // UsePolicyBasedTrafficSelectors: to.Ptr(false), - // VPNConnectionProtocolType: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionProtocolIKEv2), - // VPNSiteLink: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/siteLink2"), - // }, - // }, - // }}, - // }, - // }}, - // EnableBgpRouteTranslationForNat: to.Ptr(false), - // IsRoutingPreferenceInternet: to.Ptr(false), - // NatRules: []*armnetwork.VPNGatewayNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/natRules/nat03"), - // Name: to.Ptr("nat03"), - // Type: to.Ptr("Microsoft.Network/vpnGateways/natRules"), - // Properties: &armnetwork.VPNGatewayNatRuleProperties{ - // Type: to.Ptr(armnetwork.VPNNatRuleTypeDynamic), - // ExternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("192.168.0.0/26"), - // }}, - // IngressVPNSiteLinkConnections: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/vpnLinkConnections/Connection-Link1"), - // }}, - // InternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("0.0.0.0/26"), - // }}, - // Mode: to.Ptr(armnetwork.VPNNatRuleMode("IgressSnat")), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/natRules/nat04"), - // Name: to.Ptr("nat04"), - // Type: to.Ptr("Microsoft.Network/vpnGateways/natRules"), - // Properties: &armnetwork.VPNGatewayNatRuleProperties{ - // Type: to.Ptr(armnetwork.VPNNatRuleTypeStatic), - // EgressVPNSiteLinkConnections: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/vpnLinkConnections/Connection-Link2"), - // }}, - // ExternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("192.168.0.0/26"), - // }}, - // InternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("0.0.0.0/26"), - // }}, - // Mode: to.Ptr(armnetwork.VPNNatRuleModeEgressSnat), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualHub: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VpnGatewayPut.json -func ExampleVPNGatewaysClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVPNGatewaysClient().BeginCreateOrUpdate(ctx, "rg1", "gateway1", armnetwork.VPNGateway{ - Location: to.Ptr("westcentralus"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, - Properties: &armnetwork.VPNGatewayProperties{ - BgpSettings: &armnetwork.BgpSettings{ - Asn: to.Ptr[int64](65515), - BgpPeeringAddresses: []*armnetwork.IPConfigurationBgpPeeringAddress{ - { - CustomBgpIPAddresses: []*string{ - to.Ptr("169.254.21.5")}, - IPConfigurationID: to.Ptr("Instance0"), - }, - { - CustomBgpIPAddresses: []*string{ - to.Ptr("169.254.21.10")}, - IPConfigurationID: to.Ptr("Instance1"), - }}, - PeerWeight: to.Ptr[int32](0), - }, - Connections: []*armnetwork.VPNConnection{ - { - Name: to.Ptr("vpnConnection1"), - Properties: &armnetwork.VPNConnectionProperties{ - RemoteVPNSite: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1"), - }, - VPNLinkConnections: []*armnetwork.VPNSiteLinkConnection{ - { - Name: to.Ptr("Connection-Link1"), - Properties: &armnetwork.VPNSiteLinkConnectionProperties{ - ConnectionBandwidth: to.Ptr[int32](200), - EgressNatRules: []*armnetwork.SubResource{ - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/natRules/nat03"), - }}, - SharedKey: to.Ptr("key"), - VPNConnectionProtocolType: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionProtocolIKEv2), - VPNSiteLink: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/siteLink1"), - }, - }, - }}, - }, - }}, - EnableBgpRouteTranslationForNat: to.Ptr(false), - IsRoutingPreferenceInternet: to.Ptr(false), - NatRules: []*armnetwork.VPNGatewayNatRule{ - { - Name: to.Ptr("nat03"), - Properties: &armnetwork.VPNGatewayNatRuleProperties{ - Type: to.Ptr(armnetwork.VPNNatRuleTypeStatic), - ExternalMappings: []*armnetwork.VPNNatRuleMapping{ - { - AddressSpace: to.Ptr("192.168.0.0/26"), - }}, - InternalMappings: []*armnetwork.VPNNatRuleMapping{ - { - AddressSpace: to.Ptr("0.0.0.0/26"), - }}, - IPConfigurationID: to.Ptr(""), - Mode: to.Ptr(armnetwork.VPNNatRuleModeEgressSnat), - }, - }}, - VirtualHub: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VPNGateway = armnetwork.VPNGateway{ - // Name: to.Ptr("gateway1"), - // Type: to.Ptr("Microsoft.Network/vpnGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1"), - // Location: to.Ptr("West US"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNGatewayProperties{ - // BgpSettings: &armnetwork.BgpSettings{ - // Asn: to.Ptr[int64](65514), - // BgpPeeringAddress: to.Ptr("10.0.1.30"), - // BgpPeeringAddresses: []*armnetwork.IPConfigurationBgpPeeringAddress{ - // { - // CustomBgpIPAddresses: []*string{ - // to.Ptr("169.254.21.5")}, - // DefaultBgpIPAddresses: []*string{ - // to.Ptr("10.30.0.4")}, - // IPConfigurationID: to.Ptr("Instance0"), - // TunnelIPAddresses: []*string{ - // to.Ptr("104.208.48.178")}, - // }, - // { - // CustomBgpIPAddresses: []*string{ - // to.Ptr("169.254.21.10")}, - // DefaultBgpIPAddresses: []*string{ - // to.Ptr("10.30.0.5")}, - // IPConfigurationID: to.Ptr("Instance1"), - // TunnelIPAddresses: []*string{ - // to.Ptr("104.208.48.179")}, - // }}, - // PeerWeight: to.Ptr[int32](0), - // }, - // Connections: []*armnetwork.VPNConnection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1"), - // Name: to.Ptr("vpnConnection1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNConnectionProperties{ - // EgressBytesTransferred: to.Ptr[int64](0), - // EnableInternetSecurity: to.Ptr(false), - // IngressBytesTransferred: to.Ptr[int64](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RemoteVPNSite: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1"), - // }, - // RoutingConfiguration: &armnetwork.RoutingConfiguration{ - // AssociatedRouteTable: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - // }, - // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ - // IDs: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable2"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable3"), - // }}, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, - // }, - // VnetRoutes: &armnetwork.VnetRoute{ - // StaticRoutes: []*armnetwork.StaticRoute{ - // }, - // }, - // }, - // VPNLinkConnections: []*armnetwork.VPNSiteLinkConnection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/VpnSiteLinkConnections/Connection-Link1"), - // Name: to.Ptr("Connection-Link1"), - // Type: to.Ptr("Microsoft.Network/vpnGateways/vpnConnections/VpnSiteLinkConnections"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNSiteLinkConnectionProperties{ - // ConnectionBandwidth: to.Ptr[int32](200), - // EgressBytesTransferred: to.Ptr[int64](0), - // EgressNatRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/natRules/nat03"), - // }}, - // EnableBgp: to.Ptr(false), - // EnableRateLimiting: to.Ptr(false), - // IngressBytesTransferred: to.Ptr[int64](0), - // IPSecPolicies: []*armnetwork.IPSecPolicy{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RoutingWeight: to.Ptr[int32](0), - // SharedKey: to.Ptr("key"), - // UseLocalAzureIPAddress: to.Ptr(false), - // UsePolicyBasedTrafficSelectors: to.Ptr(false), - // VPNConnectionProtocolType: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionProtocolIKEv2), - // VPNSiteLink: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/siteLink1"), - // }, - // }, - // }}, - // }, - // }}, - // IsRoutingPreferenceInternet: to.Ptr(false), - // NatRules: []*armnetwork.VPNGatewayNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/natRules/nat03"), - // Name: to.Ptr("nat03"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNGatewayNatRuleProperties{ - // Type: to.Ptr(armnetwork.VPNNatRuleTypeStatic), - // EgressVPNSiteLinkConnections: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/vpnLinkConnections/Connection-Link1"), - // }}, - // ExternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("192.168.0.0/26"), - // }}, - // InternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("0.0.0.0/26"), - // }}, - // Mode: to.Ptr(armnetwork.VPNNatRuleModeEgressSnat), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualHub: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VpnGatewayUpdateTags.json -func ExampleVPNGatewaysClient_BeginUpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVPNGatewaysClient().BeginUpdateTags(ctx, "rg1", "gateway1", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VPNGateway = armnetwork.VPNGateway{ - // Name: to.Ptr("gateway1"), - // Type: to.Ptr("Microsoft.Network/vpnGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNGatewayProperties{ - // BgpSettings: &armnetwork.BgpSettings{ - // Asn: to.Ptr[int64](65515), - // BgpPeeringAddress: to.Ptr("10.0.1.30"), - // BgpPeeringAddresses: []*armnetwork.IPConfigurationBgpPeeringAddress{ - // { - // CustomBgpIPAddresses: []*string{ - // to.Ptr("169.254.21.5")}, - // DefaultBgpIPAddresses: []*string{ - // to.Ptr("10.30.0.4")}, - // IPConfigurationID: to.Ptr("Instance0"), - // TunnelIPAddresses: []*string{ - // to.Ptr("104.208.48.178")}, - // }, - // { - // CustomBgpIPAddresses: []*string{ - // to.Ptr("169.254.21.10")}, - // DefaultBgpIPAddresses: []*string{ - // to.Ptr("10.30.0.5")}, - // IPConfigurationID: to.Ptr("Instance1"), - // TunnelIPAddresses: []*string{ - // to.Ptr("104.208.48.179")}, - // }}, - // PeerWeight: to.Ptr[int32](0), - // }, - // Connections: []*armnetwork.VPNConnection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1"), - // Name: to.Ptr("vpnConnection1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNConnectionProperties{ - // ConnectionStatus: to.Ptr(armnetwork.VPNConnectionStatusConnected), - // EgressBytesTransferred: to.Ptr[int64](0), - // EnableBgp: to.Ptr(false), - // IngressBytesTransferred: to.Ptr[int64](0), - // IPSecPolicies: []*armnetwork.IPSecPolicy{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RemoteVPNSite: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1"), - // }, - // RoutingConfiguration: &armnetwork.RoutingConfiguration{ - // AssociatedRouteTable: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - // }, - // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ - // IDs: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable2"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable3"), - // }}, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, - // }, - // VnetRoutes: &armnetwork.VnetRoute{ - // StaticRoutes: []*armnetwork.StaticRoute{ - // }, - // }, - // }, - // RoutingWeight: to.Ptr[int32](0), - // SharedKey: to.Ptr("key"), - // }, - // }}, - // EnableBgpRouteTranslationForNat: to.Ptr(false), - // IsRoutingPreferenceInternet: to.Ptr(false), - // NatRules: []*armnetwork.VPNGatewayNatRule{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualHub: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VpnGatewayDelete.json -func ExampleVPNGatewaysClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVPNGatewaysClient().BeginDelete(ctx, "rg1", "gateway1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VpnGatewayReset.json -func ExampleVPNGatewaysClient_BeginReset() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVPNGatewaysClient().BeginReset(ctx, "rg1", "vpngw", &armnetwork.VPNGatewaysClientBeginResetOptions{IPConfigurationID: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VPNGateway = armnetwork.VPNGateway{ - // Name: to.Ptr("vpngw"), - // Type: to.Ptr("Microsoft.Network/vpnGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/vpngw"), - // Location: to.Ptr("West US"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNGatewayProperties{ - // BgpSettings: &armnetwork.BgpSettings{ - // Asn: to.Ptr[int64](65514), - // BgpPeeringAddress: to.Ptr("10.0.1.30"), - // BgpPeeringAddresses: []*armnetwork.IPConfigurationBgpPeeringAddress{ - // { - // CustomBgpIPAddresses: []*string{ - // to.Ptr("169.254.21.5")}, - // DefaultBgpIPAddresses: []*string{ - // to.Ptr("10.30.0.4")}, - // IPConfigurationID: to.Ptr("Instance0"), - // TunnelIPAddresses: []*string{ - // to.Ptr("104.208.48.178")}, - // }, - // { - // CustomBgpIPAddresses: []*string{ - // to.Ptr("169.254.21.10")}, - // DefaultBgpIPAddresses: []*string{ - // to.Ptr("10.30.0.5")}, - // IPConfigurationID: to.Ptr("Instance1"), - // TunnelIPAddresses: []*string{ - // to.Ptr("104.208.48.179")}, - // }}, - // PeerWeight: to.Ptr[int32](0), - // }, - // Connections: []*armnetwork.VPNConnection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/vpngw/vpnConnections/vpnConnection1"), - // Name: to.Ptr("vpnConnection1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNConnectionProperties{ - // ConnectionBandwidth: to.Ptr[int32](100), - // ConnectionStatus: to.Ptr(armnetwork.VPNConnectionStatusConnected), - // EgressBytesTransferred: to.Ptr[int64](0), - // EnableBgp: to.Ptr(false), - // IngressBytesTransferred: to.Ptr[int64](0), - // IPSecPolicies: []*armnetwork.IPSecPolicy{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RemoteVPNSite: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1"), - // }, - // RoutingConfiguration: &armnetwork.RoutingConfiguration{ - // AssociatedRouteTable: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - // }, - // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ - // IDs: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable2"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable3"), - // }}, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, - // }, - // VnetRoutes: &armnetwork.VnetRoute{ - // StaticRoutes: []*armnetwork.StaticRoute{ - // }, - // }, - // }, - // RoutingWeight: to.Ptr[int32](0), - // SharedKey: to.Ptr("key"), - // UseLocalAzureIPAddress: to.Ptr(false), - // }, - // }}, - // EnableBgpRouteTranslationForNat: to.Ptr(false), - // IsRoutingPreferenceInternet: to.Ptr(false), - // NatRules: []*armnetwork.VPNGatewayNatRule{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualHub: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VpnGatewayStartPacketCaptureFilterData.json -func ExampleVPNGatewaysClient_BeginStartPacketCapture_startPacketCaptureOnVpnGatewayWithFilter() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVPNGatewaysClient().BeginStartPacketCapture(ctx, "rg1", "vpngw", &armnetwork.VPNGatewaysClientBeginStartPacketCaptureOptions{Parameters: &armnetwork.VPNGatewayPacketCaptureStartParameters{ - FilterData: to.Ptr("{'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}]}"), - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Value = "\"{\"Status\":\"Successful\",\"Data\":null}\"" -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VpnGatewayStartPacketCapture.json -func ExampleVPNGatewaysClient_BeginStartPacketCapture_startPacketCaptureOnVpnGatewayWithoutFilter() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVPNGatewaysClient().BeginStartPacketCapture(ctx, "rg1", "vpngw", &armnetwork.VPNGatewaysClientBeginStartPacketCaptureOptions{Parameters: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Value = "\"{\"Status\":\"Successful\",\"Data\":null}\"" -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VpnGatewayStopPacketCapture.json -func ExampleVPNGatewaysClient_BeginStopPacketCapture() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVPNGatewaysClient().BeginStopPacketCapture(ctx, "rg1", "vpngw", &armnetwork.VPNGatewaysClientBeginStopPacketCaptureOptions{Parameters: &armnetwork.VPNGatewayPacketCaptureStopParameters{ - SasURL: to.Ptr("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"), - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Value = "\"{\"Status\":\"Successful\",\"Data\":null}\"" -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VpnGatewayListByResourceGroup.json -func ExampleVPNGatewaysClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVPNGatewaysClient().NewListByResourceGroupPager("rg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ListVPNGatewaysResult = armnetwork.ListVPNGatewaysResult{ - // Value: []*armnetwork.VPNGateway{ - // { - // Name: to.Ptr("gateway1"), - // Type: to.Ptr("Microsoft.Network/vpnGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1"), - // Location: to.Ptr("West US"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNGatewayProperties{ - // BgpSettings: &armnetwork.BgpSettings{ - // Asn: to.Ptr[int64](65514), - // BgpPeeringAddress: to.Ptr("10.0.1.30"), - // BgpPeeringAddresses: []*armnetwork.IPConfigurationBgpPeeringAddress{ - // { - // CustomBgpIPAddresses: []*string{ - // to.Ptr("169.254.21.5")}, - // DefaultBgpIPAddresses: []*string{ - // to.Ptr("10.30.0.4")}, - // IPConfigurationID: to.Ptr("Instance0"), - // TunnelIPAddresses: []*string{ - // to.Ptr("104.208.48.178")}, - // }, - // { - // CustomBgpIPAddresses: []*string{ - // to.Ptr("169.254.21.10")}, - // DefaultBgpIPAddresses: []*string{ - // to.Ptr("10.30.0.5")}, - // IPConfigurationID: to.Ptr("Instance1"), - // TunnelIPAddresses: []*string{ - // to.Ptr("104.208.48.179")}, - // }}, - // PeerWeight: to.Ptr[int32](0), - // }, - // Connections: []*armnetwork.VPNConnection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1"), - // Name: to.Ptr("vpnConnection1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNConnectionProperties{ - // EgressBytesTransferred: to.Ptr[int64](0), - // EnableInternetSecurity: to.Ptr(false), - // IngressBytesTransferred: to.Ptr[int64](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RemoteVPNSite: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1"), - // }, - // RoutingConfiguration: &armnetwork.RoutingConfiguration{ - // AssociatedRouteTable: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - // }, - // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ - // IDs: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable2"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable3"), - // }}, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, - // }, - // VnetRoutes: &armnetwork.VnetRoute{ - // StaticRoutes: []*armnetwork.StaticRoute{ - // }, - // }, - // }, - // VPNLinkConnections: []*armnetwork.VPNSiteLinkConnection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/VpnSiteLinkConnections/Connection-Link1"), - // Name: to.Ptr("Connection-Link1"), - // Type: to.Ptr("Microsoft.Network/vpnGateways/vpnConnections/VpnSiteLinkConnections"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNSiteLinkConnectionProperties{ - // ConnectionBandwidth: to.Ptr[int32](200), - // EgressBytesTransferred: to.Ptr[int64](0), - // EgressNatRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/natRules/nat03"), - // }}, - // EnableBgp: to.Ptr(false), - // EnableRateLimiting: to.Ptr(false), - // IngressBytesTransferred: to.Ptr[int64](0), - // IPSecPolicies: []*armnetwork.IPSecPolicy{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RoutingWeight: to.Ptr[int32](0), - // SharedKey: to.Ptr("key"), - // UseLocalAzureIPAddress: to.Ptr(false), - // UsePolicyBasedTrafficSelectors: to.Ptr(false), - // VPNConnectionProtocolType: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionProtocolIKEv2), - // VPNSiteLink: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/siteLink1"), - // }, - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/VpnSiteLinkConnections/Connection-Link2"), - // Name: to.Ptr("Connection-Link2"), - // Type: to.Ptr("Microsoft.Network/vpnGateways/vpnConnections/VpnSiteLinkConnections"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNSiteLinkConnectionProperties{ - // ConnectionBandwidth: to.Ptr[int32](200), - // EgressBytesTransferred: to.Ptr[int64](0), - // EgressNatRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/natRules/nat03"), - // }}, - // EnableBgp: to.Ptr(false), - // EnableRateLimiting: to.Ptr(false), - // IngressBytesTransferred: to.Ptr[int64](0), - // IPSecPolicies: []*armnetwork.IPSecPolicy{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RoutingWeight: to.Ptr[int32](0), - // SharedKey: to.Ptr("key"), - // UseLocalAzureIPAddress: to.Ptr(false), - // UsePolicyBasedTrafficSelectors: to.Ptr(false), - // VPNConnectionProtocolType: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionProtocolIKEv2), - // VPNSiteLink: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/siteLink2"), - // }, - // }, - // }}, - // }, - // }}, - // EnableBgpRouteTranslationForNat: to.Ptr(false), - // IsRoutingPreferenceInternet: to.Ptr(false), - // NatRules: []*armnetwork.VPNGatewayNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/natRules/nat03"), - // Name: to.Ptr("nat03"), - // Type: to.Ptr("Microsoft.Network/vpnGateways/natRules"), - // Properties: &armnetwork.VPNGatewayNatRuleProperties{ - // Type: to.Ptr(armnetwork.VPNNatRuleTypeStatic), - // EgressVPNSiteLinkConnections: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/vpnLinkConnections/Connection-Link1"), - // }}, - // ExternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("192.168.0.0/26"), - // }}, - // InternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("0.0.0.0/26"), - // }}, - // Mode: to.Ptr(armnetwork.VPNNatRuleModeEgressSnat), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualHub: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"), - // }, - // }, - // }, - // { - // Name: to.Ptr("gateway2"), - // Type: to.Ptr("Microsoft.Network/vpnGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/vpnGateways/gateway2"), - // Location: to.Ptr("West US"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNGatewayProperties{ - // BgpSettings: &armnetwork.BgpSettings{ - // Asn: to.Ptr[int64](65514), - // BgpPeeringAddress: to.Ptr("10.0.1.30"), - // BgpPeeringAddresses: []*armnetwork.IPConfigurationBgpPeeringAddress{ - // { - // CustomBgpIPAddresses: []*string{ - // to.Ptr("169.254.21.5")}, - // DefaultBgpIPAddresses: []*string{ - // to.Ptr("10.30.0.4")}, - // IPConfigurationID: to.Ptr("Instance0"), - // TunnelIPAddresses: []*string{ - // to.Ptr("104.208.48.178")}, - // }, - // { - // CustomBgpIPAddresses: []*string{ - // to.Ptr("169.254.21.10")}, - // DefaultBgpIPAddresses: []*string{ - // to.Ptr("10.30.0.5")}, - // IPConfigurationID: to.Ptr("Instance1"), - // TunnelIPAddresses: []*string{ - // to.Ptr("104.208.48.179")}, - // }}, - // PeerWeight: to.Ptr[int32](0), - // }, - // Connections: []*armnetwork.VPNConnection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/vpnGateways/gateway2/vpnConnections/vpnConnection2"), - // Name: to.Ptr("vpnConnection1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNConnectionProperties{ - // ConnectionBandwidth: to.Ptr[int32](100), - // ConnectionStatus: to.Ptr(armnetwork.VPNConnectionStatusConnected), - // EgressBytesTransferred: to.Ptr[int64](0), - // EnableBgp: to.Ptr(false), - // IngressBytesTransferred: to.Ptr[int64](0), - // IPSecPolicies: []*armnetwork.IPSecPolicy{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RemoteVPNSite: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/vpnSites/vpnSite2"), - // }, - // RoutingConfiguration: &armnetwork.RoutingConfiguration{ - // AssociatedRouteTable: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualHubs/virtualHub2/hubRouteTables/hubRouteTable1"), - // }, - // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ - // IDs: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualHubs/virtualHub2/hubRouteTables/hubRouteTable1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualHubs/virtualHub2/hubRouteTables/hubRouteTable2"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualHubs/virtualHub2/hubRouteTables/hubRouteTable3"), - // }}, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, - // }, - // VnetRoutes: &armnetwork.VnetRoute{ - // StaticRoutes: []*armnetwork.StaticRoute{ - // }, - // }, - // }, - // RoutingWeight: to.Ptr[int32](0), - // SharedKey: to.Ptr("key"), - // UseLocalAzureIPAddress: to.Ptr(false), - // }, - // }}, - // EnableBgpRouteTranslationForNat: to.Ptr(false), - // IsRoutingPreferenceInternet: to.Ptr(false), - // NatRules: []*armnetwork.VPNGatewayNatRule{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualHub: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualHubs/virtualHub2"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VpnGatewayList.json -func ExampleVPNGatewaysClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVPNGatewaysClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ListVPNGatewaysResult = armnetwork.ListVPNGatewaysResult{ - // Value: []*armnetwork.VPNGateway{ - // { - // Name: to.Ptr("gateway1"), - // Type: to.Ptr("Microsoft.Network/vpnGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1"), - // Location: to.Ptr("West US"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNGatewayProperties{ - // BgpSettings: &armnetwork.BgpSettings{ - // Asn: to.Ptr[int64](65514), - // BgpPeeringAddress: to.Ptr("10.0.1.30"), - // BgpPeeringAddresses: []*armnetwork.IPConfigurationBgpPeeringAddress{ - // { - // CustomBgpIPAddresses: []*string{ - // to.Ptr("169.254.21.5")}, - // DefaultBgpIPAddresses: []*string{ - // to.Ptr("10.30.0.4")}, - // IPConfigurationID: to.Ptr("Instance0"), - // TunnelIPAddresses: []*string{ - // to.Ptr("104.208.48.178")}, - // }, - // { - // CustomBgpIPAddresses: []*string{ - // to.Ptr("169.254.21.10")}, - // DefaultBgpIPAddresses: []*string{ - // to.Ptr("10.30.0.5")}, - // IPConfigurationID: to.Ptr("Instance1"), - // TunnelIPAddresses: []*string{ - // to.Ptr("104.208.48.179")}, - // }}, - // PeerWeight: to.Ptr[int32](0), - // }, - // Connections: []*armnetwork.VPNConnection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1"), - // Name: to.Ptr("vpnConnection1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNConnectionProperties{ - // EgressBytesTransferred: to.Ptr[int64](0), - // EnableInternetSecurity: to.Ptr(false), - // IngressBytesTransferred: to.Ptr[int64](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RemoteVPNSite: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1"), - // }, - // RoutingConfiguration: &armnetwork.RoutingConfiguration{ - // AssociatedRouteTable: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - // }, - // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ - // IDs: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable2"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable3"), - // }}, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, - // }, - // VnetRoutes: &armnetwork.VnetRoute{ - // StaticRoutes: []*armnetwork.StaticRoute{ - // }, - // }, - // }, - // VPNLinkConnections: []*armnetwork.VPNSiteLinkConnection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/VpnSiteLinkConnections/Connection-Link1"), - // Name: to.Ptr("Connection-Link1"), - // Type: to.Ptr("Microsoft.Network/vpnGateways/vpnConnections/VpnSiteLinkConnections"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNSiteLinkConnectionProperties{ - // ConnectionBandwidth: to.Ptr[int32](200), - // EgressBytesTransferred: to.Ptr[int64](0), - // EnableBgp: to.Ptr(false), - // EnableRateLimiting: to.Ptr(false), - // IngressBytesTransferred: to.Ptr[int64](0), - // IngressNatRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/natRules/nat03"), - // }}, - // IPSecPolicies: []*armnetwork.IPSecPolicy{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RoutingWeight: to.Ptr[int32](0), - // SharedKey: to.Ptr("key"), - // UseLocalAzureIPAddress: to.Ptr(false), - // UsePolicyBasedTrafficSelectors: to.Ptr(false), - // VPNConnectionProtocolType: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionProtocolIKEv2), - // VPNSiteLink: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/siteLink1"), - // }, - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/VpnSiteLinkConnections/Connection-Link2"), - // Name: to.Ptr("Connection-Link2"), - // Type: to.Ptr("Microsoft.Network/vpnGateways/vpnConnections/VpnSiteLinkConnections"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNSiteLinkConnectionProperties{ - // ConnectionBandwidth: to.Ptr[int32](200), - // EgressBytesTransferred: to.Ptr[int64](0), - // EgressNatRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/natRules/nat04"), - // }}, - // EnableBgp: to.Ptr(false), - // EnableRateLimiting: to.Ptr(false), - // IngressBytesTransferred: to.Ptr[int64](0), - // IPSecPolicies: []*armnetwork.IPSecPolicy{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RoutingWeight: to.Ptr[int32](0), - // SharedKey: to.Ptr("key"), - // UseLocalAzureIPAddress: to.Ptr(false), - // UsePolicyBasedTrafficSelectors: to.Ptr(false), - // VPNConnectionProtocolType: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionProtocolIKEv2), - // VPNSiteLink: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/siteLink2"), - // }, - // }, - // }}, - // }, - // }}, - // EnableBgpRouteTranslationForNat: to.Ptr(false), - // IsRoutingPreferenceInternet: to.Ptr(false), - // NatRules: []*armnetwork.VPNGatewayNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/natRules/nat03"), - // Name: to.Ptr("nat03"), - // Type: to.Ptr("Microsoft.Network/vpnGateways/natRules"), - // Properties: &armnetwork.VPNGatewayNatRuleProperties{ - // Type: to.Ptr(armnetwork.VPNNatRuleTypeDynamic), - // ExternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("192.168.0.0/26"), - // }}, - // IngressVPNSiteLinkConnections: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/vpnLinkConnections/Connection-Link1"), - // }}, - // InternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("0.0.0.0/26"), - // }}, - // Mode: to.Ptr(armnetwork.VPNNatRuleMode("IgressSnat")), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/natRules/nat04"), - // Name: to.Ptr("nat04"), - // Type: to.Ptr("Microsoft.Network/vpnGateways/natRules"), - // Properties: &armnetwork.VPNGatewayNatRuleProperties{ - // Type: to.Ptr(armnetwork.VPNNatRuleTypeStatic), - // EgressVPNSiteLinkConnections: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/vpnLinkConnections/Connection-Link2"), - // }}, - // ExternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("192.168.0.0/26"), - // }}, - // InternalMappings: []*armnetwork.VPNNatRuleMapping{ - // { - // AddressSpace: to.Ptr("0.0.0.0/26"), - // }}, - // Mode: to.Ptr(armnetwork.VPNNatRuleModeEgressSnat), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualHub: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"), - // }, - // }, - // }, - // { - // Name: to.Ptr("gateway2"), - // Type: to.Ptr("Microsoft.Network/vpnGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/vpnGateways/gateway2"), - // Location: to.Ptr("West US"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNGatewayProperties{ - // BgpSettings: &armnetwork.BgpSettings{ - // Asn: to.Ptr[int64](65514), - // BgpPeeringAddress: to.Ptr("10.0.1.30"), - // BgpPeeringAddresses: []*armnetwork.IPConfigurationBgpPeeringAddress{ - // { - // CustomBgpIPAddresses: []*string{ - // to.Ptr("169.254.21.5")}, - // DefaultBgpIPAddresses: []*string{ - // to.Ptr("10.30.0.4")}, - // IPConfigurationID: to.Ptr("Instance0"), - // TunnelIPAddresses: []*string{ - // to.Ptr("104.208.48.178")}, - // }, - // { - // CustomBgpIPAddresses: []*string{ - // to.Ptr("169.254.21.10")}, - // DefaultBgpIPAddresses: []*string{ - // to.Ptr("10.30.0.5")}, - // IPConfigurationID: to.Ptr("Instance1"), - // TunnelIPAddresses: []*string{ - // to.Ptr("104.208.48.179")}, - // }}, - // PeerWeight: to.Ptr[int32](0), - // }, - // Connections: []*armnetwork.VPNConnection{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/vpnGateways/gateway2/vpnConnections/vpnConnection2"), - // Name: to.Ptr("vpnConnection1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNConnectionProperties{ - // ConnectionBandwidth: to.Ptr[int32](100), - // ConnectionStatus: to.Ptr(armnetwork.VPNConnectionStatusConnected), - // EgressBytesTransferred: to.Ptr[int64](0), - // EnableBgp: to.Ptr(false), - // IngressBytesTransferred: to.Ptr[int64](0), - // IPSecPolicies: []*armnetwork.IPSecPolicy{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RemoteVPNSite: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/vpnSites/vpnSite2"), - // }, - // RoutingConfiguration: &armnetwork.RoutingConfiguration{ - // AssociatedRouteTable: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualHubs/virtualHub2/hubRouteTables/hubRouteTable1"), - // }, - // PropagatedRouteTables: &armnetwork.PropagatedRouteTable{ - // IDs: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualHubs/virtualHub2/hubRouteTables/hubRouteTable1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualHubs/virtualHub2/hubRouteTables/hubRouteTable2"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualHubs/virtualHub2/hubRouteTables/hubRouteTable3"), - // }}, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, - // }, - // VnetRoutes: &armnetwork.VnetRoute{ - // StaticRoutes: []*armnetwork.StaticRoute{ - // }, - // }, - // }, - // RoutingWeight: to.Ptr[int32](0), - // SharedKey: to.Ptr("key"), - // UseLocalAzureIPAddress: to.Ptr(false), - // }, - // }}, - // EnableBgpRouteTranslationForNat: to.Ptr(false), - // IsRoutingPreferenceInternet: to.Ptr(false), - // NatRules: []*armnetwork.VPNGatewayNatRule{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualHub: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualHubs/virtualHub2"), - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/vpnlinkconnections_client.go b/sdk/resourcemanager/network/armnetwork/vpnlinkconnections_client.go index 88a73a49e5ff..4bca11770184 100644 --- a/sdk/resourcemanager/network/armnetwork/vpnlinkconnections_client.go +++ b/sdk/resourcemanager/network/armnetwork/vpnlinkconnections_client.go @@ -47,7 +47,7 @@ func NewVPNLinkConnectionsClient(subscriptionID string, credential azcore.TokenC // BeginGetIkeSas - Lists IKE Security Associations for Vpn Site Link Connection in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - gatewayName - The name of the gateway. // - connectionName - The name of the vpn connection. @@ -72,7 +72,7 @@ func (client *VPNLinkConnectionsClient) BeginGetIkeSas(ctx context.Context, reso // GetIkeSas - Lists IKE Security Associations for Vpn Site Link Connection in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VPNLinkConnectionsClient) getIkeSas(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, linkConnectionName string, options *VPNLinkConnectionsClientBeginGetIkeSasOptions) (*http.Response, error) { var err error const operationName = "VPNLinkConnectionsClient.BeginGetIkeSas" @@ -122,7 +122,7 @@ func (client *VPNLinkConnectionsClient) getIkeSasCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -130,7 +130,7 @@ func (client *VPNLinkConnectionsClient) getIkeSasCreateRequest(ctx context.Conte // NewListByVPNConnectionPager - Retrieves all vpn site link connections for a particular virtual wan vpn gateway vpn connection. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the vpn gateway. // - gatewayName - The name of the gateway. // - connectionName - The name of the vpn connection. @@ -190,7 +190,7 @@ func (client *VPNLinkConnectionsClient) listByVPNConnectionCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -208,7 +208,7 @@ func (client *VPNLinkConnectionsClient) listByVPNConnectionHandleResponse(resp * // BeginResetConnection - Resets the VpnLink connection specified. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - gatewayName - The name of the gateway. // - connectionName - The name of the vpn connection. @@ -233,7 +233,7 @@ func (client *VPNLinkConnectionsClient) BeginResetConnection(ctx context.Context // ResetConnection - Resets the VpnLink connection specified. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VPNLinkConnectionsClient) resetConnection(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, linkConnectionName string, options *VPNLinkConnectionsClientBeginResetConnectionOptions) (*http.Response, error) { var err error const operationName = "VPNLinkConnectionsClient.BeginResetConnection" @@ -283,7 +283,7 @@ func (client *VPNLinkConnectionsClient) resetConnectionCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/vpnlinkconnections_client_example_test.go b/sdk/resourcemanager/network/armnetwork/vpnlinkconnections_client_example_test.go deleted file mode 100644 index d9ef90bb8141..000000000000 --- a/sdk/resourcemanager/network/armnetwork/vpnlinkconnections_client_example_test.go +++ /dev/null @@ -1,91 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VpnSiteLinkConnectionReset.json -func ExampleVPNLinkConnectionsClient_BeginResetConnection() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVPNLinkConnectionsClient().BeginResetConnection(ctx, "rg1", "gateway1", "vpnConnection1", "Connection-Link1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VpnSiteLinkConnectionGetIkeSas.json -func ExampleVPNLinkConnectionsClient_BeginGetIkeSas() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVPNLinkConnectionsClient().BeginGetIkeSas(ctx, "rg1", "gateway1", "vpnConnection1", "Connection-Link1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Value = "\"{\"Status\":\"Successful\",\"Data\":null}\"" -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VpnSiteLinkConnectionList.json -func ExampleVPNLinkConnectionsClient_NewListByVPNConnectionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVPNLinkConnectionsClient().NewListByVPNConnectionPager("rg1", "gateway1", "vpnConnection1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ListVPNSiteLinkConnectionsResult = armnetwork.ListVPNSiteLinkConnectionsResult{ - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/vpnserverconfigurations_client.go b/sdk/resourcemanager/network/armnetwork/vpnserverconfigurations_client.go index d5ba237690a0..e5f12158ce69 100644 --- a/sdk/resourcemanager/network/armnetwork/vpnserverconfigurations_client.go +++ b/sdk/resourcemanager/network/armnetwork/vpnserverconfigurations_client.go @@ -47,7 +47,7 @@ func NewVPNServerConfigurationsClient(subscriptionID string, credential azcore.T // BeginCreateOrUpdate - Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing VpnServerConfiguration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the VpnServerConfiguration. // - vpnServerConfigurationName - The name of the VpnServerConfiguration being created or updated. // - vpnServerConfigurationParameters - Parameters supplied to create or update VpnServerConfiguration. @@ -71,7 +71,7 @@ func (client *VPNServerConfigurationsClient) BeginCreateOrUpdate(ctx context.Con // CreateOrUpdate - Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing VpnServerConfiguration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VPNServerConfigurationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, vpnServerConfigurationParameters VPNServerConfiguration, options *VPNServerConfigurationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "VPNServerConfigurationsClient.BeginCreateOrUpdate" @@ -113,7 +113,7 @@ func (client *VPNServerConfigurationsClient) createOrUpdateCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, vpnServerConfigurationParameters); err != nil { @@ -125,7 +125,7 @@ func (client *VPNServerConfigurationsClient) createOrUpdateCreateRequest(ctx con // BeginDelete - Deletes a VpnServerConfiguration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the VpnServerConfiguration. // - vpnServerConfigurationName - The name of the VpnServerConfiguration being deleted. // - options - VPNServerConfigurationsClientBeginDeleteOptions contains the optional parameters for the VPNServerConfigurationsClient.BeginDelete @@ -148,7 +148,7 @@ func (client *VPNServerConfigurationsClient) BeginDelete(ctx context.Context, re // Delete - Deletes a VpnServerConfiguration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VPNServerConfigurationsClient) deleteOperation(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, options *VPNServerConfigurationsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VPNServerConfigurationsClient.BeginDelete" @@ -190,7 +190,7 @@ func (client *VPNServerConfigurationsClient) deleteCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -199,7 +199,7 @@ func (client *VPNServerConfigurationsClient) deleteCreateRequest(ctx context.Con // Get - Retrieves the details of a VpnServerConfiguration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the VpnServerConfiguration. // - vpnServerConfigurationName - The name of the VpnServerConfiguration being retrieved. // - options - VPNServerConfigurationsClientGetOptions contains the optional parameters for the VPNServerConfigurationsClient.Get @@ -246,7 +246,7 @@ func (client *VPNServerConfigurationsClient) getCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -263,7 +263,7 @@ func (client *VPNServerConfigurationsClient) getHandleResponse(resp *http.Respon // NewListPager - Lists all the VpnServerConfigurations in a subscription. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - options - VPNServerConfigurationsClientListOptions contains the optional parameters for the VPNServerConfigurationsClient.NewListPager // method. func (client *VPNServerConfigurationsClient) NewListPager(options *VPNServerConfigurationsClientListOptions) *runtime.Pager[VPNServerConfigurationsClientListResponse] { @@ -308,7 +308,7 @@ func (client *VPNServerConfigurationsClient) listCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -325,7 +325,7 @@ func (client *VPNServerConfigurationsClient) listHandleResponse(resp *http.Respo // NewListByResourceGroupPager - Lists all the vpnServerConfigurations in a resource group. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the VpnServerConfiguration. // - options - VPNServerConfigurationsClientListByResourceGroupOptions contains the optional parameters for the VPNServerConfigurationsClient.NewListByResourceGroupPager // method. @@ -375,7 +375,7 @@ func (client *VPNServerConfigurationsClient) listByResourceGroupCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -393,7 +393,7 @@ func (client *VPNServerConfigurationsClient) listByResourceGroupHandleResponse(r // UpdateTags - Updates VpnServerConfiguration tags. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the VpnServerConfiguration. // - vpnServerConfigurationName - The name of the VpnServerConfiguration being updated. // - vpnServerConfigurationParameters - Parameters supplied to update VpnServerConfiguration tags. @@ -441,7 +441,7 @@ func (client *VPNServerConfigurationsClient) updateTagsCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, vpnServerConfigurationParameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/vpnserverconfigurations_client_example_test.go b/sdk/resourcemanager/network/armnetwork/vpnserverconfigurations_client_example_test.go deleted file mode 100644 index c493c3da1ef7..000000000000 --- a/sdk/resourcemanager/network/armnetwork/vpnserverconfigurations_client_example_test.go +++ /dev/null @@ -1,855 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VpnServerConfigurationGet.json -func ExampleVPNServerConfigurationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVPNServerConfigurationsClient().Get(ctx, "rg1", "vpnServerConfiguration1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VPNServerConfiguration = armnetwork.VPNServerConfiguration{ - // Name: to.Ptr("vpnServerConfiguration1"), - // Type: to.Ptr("Microsoft.Network/vpnServerConfigurations"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNServerConfigurationProperties{ - // ConfigurationPolicyGroups: []*armnetwork.VPNServerConfigurationPolicyGroup{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"), - // Name: to.Ptr("policyGroup1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ - // IsDefault: to.Ptr(true), - // P2SConnectionConfigurations: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"), - // }}, - // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ - // { - // Name: to.Ptr("policy1"), - // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID), - // AttributeValue: to.Ptr("6ad1bd08"), - // }}, - // Priority: to.Ptr[int32](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup2"), - // Name: to.Ptr("policyGroup2"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ - // IsDefault: to.Ptr(true), - // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ - // { - // Name: to.Ptr("policy2"), - // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeCertificateGroupID), - // AttributeValue: to.Ptr("red.com"), - // }}, - // Priority: to.Ptr[int32](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // ProvisioningState: to.Ptr("Succeeded"), - // RadiusClientRootCertificates: []*armnetwork.VPNServerConfigRadiusClientRootCertificate{ - // { - // Name: to.Ptr("vpnServerConfigRadiusClientRootCert1"), - // Thumbprint: to.Ptr("83FFBFC8848B5A5836C94D0112367E16148A286F"), - // }}, - // RadiusServerRootCertificates: []*armnetwork.VPNServerConfigRadiusServerRootCertificate{ - // { - // Name: to.Ptr("vpnServerConfigRadiusServerRootCer1"), - // PublicCertData: to.Ptr("MIIC5zCCAc+gAwIBAgIQErQ0Hk4aDJxIA+Q5RagB+jANBgkqhkiG9w0BAQsFADAWMRQwEgYDVQQDDAtQMlNSb290Q2VydDAeFw0xNzEyMTQyMTA3MzhaFw0xODEyMTQyMTI3MzhaMBYxFDASBgNVBAMMC1AyU1Jvb3RDZXJ0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArP7/NQXmW7cQ/ZR1mv3Y3I29Lt7HTOqzo/1KUOoVH3NItbQIRAQbwKy3UWrOFz4eGNX2GWtNRMdCyWsKeqy9Ltsdfcm1IbKXkl84DFeU/ZacXu4Dl3xX3gV5du4TLZjEowJELyur11Ea2YcjPRQ/FzAF9/hGuboS1HZQEPLx4FdUs9OxCYOtc0MxBCwLfVTTRqarb0Ne+arNYd4kCzIhAke1nOyKAJBda5ZL+VHy3S5S8qGlD46jm8HXugmAkUygS4oIIXOmj/1O9sNAi3LN60zufSzCmP8Rm/iUGX+DHAGGiXxwZOKQLEDaZXKqoHjMPP0XudmSWwOIbyeQVrLhkwIDAQABozEwLzAOBgNVHQ8BAf8EBAMCAgQwHQYDVR0OBBYEFEfeNU2trYxNLF9ONmuJUsT13pKDMA0GCSqGSIb3DQEBCwUAA4IBAQBmM6RJzsGGipxyMhimHKN2xlkejhVsgBoTAhOU0llW9aUSwINJ9zFUGgI8IzUFy1VG776fchHp0LMRmPSIUYk5btEPxbsrPtumPuMH8EQGrS+Rt4pD+78c8H1fEPkq5CmDl/PKu4JoFGv+aFcE+Od0hlILstIF10Qysf++QXDolKfzJa/56bgMeYKFiju73loiRM57ns8ddXpfLl792UVpRkFU62LNns6Y1LKTwapmUF4IvIuAIzd6LZNOQng64LAKXtKnViJ1JQiXwf4CEzhgvAti3/ejpb3U90hsrUcyZi6wBv9bZLcAJRWpz61JNYliM1d1grSwQDKGXNQE4xuM"), - // }}, - // RadiusServers: []*armnetwork.RadiusServer{ - // { - // RadiusServerAddress: to.Ptr("10.0.0.0"), - // RadiusServerScore: to.Ptr[int64](25), - // }}, - // VPNAuthenticationTypes: []*armnetwork.VPNAuthenticationType{ - // to.Ptr(armnetwork.VPNAuthenticationTypeCertificate)}, - // VPNClientIPSecPolicies: []*armnetwork.IPSecPolicy{ - // { - // DhGroup: to.Ptr(armnetwork.DhGroupDHGroup14), - // IkeEncryption: to.Ptr(armnetwork.IkeEncryptionAES256), - // IkeIntegrity: to.Ptr(armnetwork.IkeIntegritySHA384), - // IPSecEncryption: to.Ptr(armnetwork.IPSecEncryptionAES256), - // IPSecIntegrity: to.Ptr(armnetwork.IPSecIntegritySHA256), - // PfsGroup: to.Ptr(armnetwork.PfsGroupPFS14), - // SaDataSizeKilobytes: to.Ptr[int32](429497), - // SaLifeTimeSeconds: to.Ptr[int32](86472), - // }}, - // VPNClientRevokedCertificates: []*armnetwork.VPNServerConfigVPNClientRevokedCertificate{ - // { - // Name: to.Ptr("vpnServerConfigVpnClientRevokedCert1"), - // Thumbprint: to.Ptr("83FFBFC8848B5A5836C94D0112367E16148A286F"), - // }}, - // VPNClientRootCertificates: []*armnetwork.VPNServerConfigVPNClientRootCertificate{ - // { - // Name: to.Ptr("vpnServerConfigVpnClientRootCert1"), - // PublicCertData: to.Ptr("MIIC5zCCAc+gAwIBAgIQErQ0Hk4aDJxIA+Q5RagB+jANBgkqhkiG9w0BAQsFADAWMRQwEgYDVQQDDAtQMlNSb290Q2VydDAeFw0xNzEyMTQyMTA3MzhaFw0xODEyMTQyMTI3MzhaMBYxFDASBgNVBAMMC1AyU1Jvb3RDZXJ0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArP7/NQXmW7cQ/ZR1mv3Y3I29Lt7HTOqzo/1KUOoVH3NItbQIRAQbwKy3UWrOFz4eGNX2GWtNRMdCyWsKeqy9Ltsdfcm1IbKXkl84DFeU/ZacXu4Dl3xX3gV5du4TLZjEowJELyur11Ea2YcjPRQ/FzAF9/hGuboS1HZQEPLx4FdUs9OxCYOtc0MxBCwLfVTTRqarb0Ne+arNYd4kCzIhAke1nOyKAJBda5ZL+VHy3S5S8qGlD46jm8HXugmAkUygS4oIIXOmj/1O9sNAi3LN60zufSzCmP8Rm/iUGX+DHAGGiXxwZOKQLEDaZXKqoHjMPP0XudmSWwOIbyeQVrLhkwIDAQABozEwLzAOBgNVHQ8BAf8EBAMCAgQwHQYDVR0OBBYEFEfeNU2trYxNLF9ONmuJUsT13pKDMA0GCSqGSIb3DQEBCwUAA4IBAQBmM6RJzsGGipxyMhimHKN2xlkejhVsgBoTAhOU0llW9aUSwINJ9zFUGgI8IzUFy1VG776fchHp0LMRmPSIUYk5btEPxbsrPtumPuMH8EQGrS+Rt4pD+78c8H1fEPkq5CmDl/PKu4JoFGv+aFcE+Od0hlILstIF10Qysf++QXDolKfzJa/56bgMeYKFiju73loiRM57ns8ddXpfLl792UVpRkFU62LNns6Y1LKTwapmUF4IvIuAIzd6LZNOQng64LAKXtKnViJ1JQiXwf4CEzhgvAti3/ejpb3U90hsrUcyZi6wBv9bZLcAJRWpz61JNYliM1d1grSwQDKGXNQE4xuN"), - // }}, - // VPNProtocols: []*armnetwork.VPNGatewayTunnelingProtocol{ - // to.Ptr(armnetwork.VPNGatewayTunnelingProtocolIkeV2)}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VpnServerConfigurationPut.json -func ExampleVPNServerConfigurationsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVPNServerConfigurationsClient().BeginCreateOrUpdate(ctx, "rg1", "vpnServerConfiguration1", armnetwork.VPNServerConfiguration{ - Location: to.Ptr("West US"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, - Properties: &armnetwork.VPNServerConfigurationProperties{ - ConfigurationPolicyGroups: []*armnetwork.VPNServerConfigurationPolicyGroup{ - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"), - Name: to.Ptr("policyGroup1"), - Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ - IsDefault: to.Ptr(true), - PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ - { - Name: to.Ptr("policy1"), - AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID), - AttributeValue: to.Ptr("6ad1bd08"), - }}, - Priority: to.Ptr[int32](0), - }, - }, - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup2"), - Name: to.Ptr("policyGroup2"), - Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ - IsDefault: to.Ptr(true), - PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ - { - Name: to.Ptr("policy2"), - AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeCertificateGroupID), - AttributeValue: to.Ptr("red.com"), - }}, - Priority: to.Ptr[int32](0), - }, - }}, - RadiusClientRootCertificates: []*armnetwork.VPNServerConfigRadiusClientRootCertificate{ - { - Name: to.Ptr("vpnServerConfigRadiusClientRootCert1"), - Thumbprint: to.Ptr("83FFBFC8848B5A5836C94D0112367E16148A286F"), - }}, - RadiusServerRootCertificates: []*armnetwork.VPNServerConfigRadiusServerRootCertificate{ - { - Name: to.Ptr("vpnServerConfigRadiusServerRootCer1"), - PublicCertData: to.Ptr("MIIC5zCCAc+gAwIBAgIQErQ0Hk4aDJxIA+Q5RagB+jANBgkqhkiG9w0BAQsFADAWMRQwEgYDVQQDDAtQMlNSb290Q2VydDAeFw0xNzEyMTQyMTA3MzhaFw0xODEyMTQyMTI3MzhaMBYxFDASBgNVBAMMC1AyU1Jvb3RDZXJ0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArP7/NQXmW7cQ/ZR1mv3Y3I29Lt7HTOqzo/1KUOoVH3NItbQIRAQbwKy3UWrOFz4eGNX2GWtNRMdCyWsKeqy9Ltsdfcm1IbKXkl84DFeU/ZacXu4Dl3xX3gV5du4TLZjEowJELyur11Ea2YcjPRQ/FzAF9/hGuboS1HZQEPLx4FdUs9OxCYOtc0MxBCwLfVTTRqarb0Ne+arNYd4kCzIhAke1nOyKAJBda5ZL+VHy3S5S8qGlD46jm8HXugmAkUygS4oIIXOmj/1O9sNAi3LN60zufSzCmP8Rm/iUGX+DHAGGiXxwZOKQLEDaZXKqoHjMPP0XudmSWwOIbyeQVrLhkwIDAQABozEwLzAOBgNVHQ8BAf8EBAMCAgQwHQYDVR0OBBYEFEfeNU2trYxNLF9ONmuJUsT13pKDMA0GCSqGSIb3DQEBCwUAA4IBAQBmM6RJzsGGipxyMhimHKN2xlkejhVsgBoTAhOU0llW9aUSwINJ9zFUGgI8IzUFy1VG776fchHp0LMRmPSIUYk5btEPxbsrPtumPuMH8EQGrS+Rt4pD+78c8H1fEPkq5CmDl/PKu4JoFGv+aFcE+Od0hlILstIF10Qysf++QXDolKfzJa/56bgMeYKFiju73loiRM57ns8ddXpfLl792UVpRkFU62LNns6Y1LKTwapmUF4IvIuAIzd6LZNOQng64LAKXtKnViJ1JQiXwf4CEzhgvAti3/ejpb3U90hsrUcyZi6wBv9bZLcAJRWpz61JNYliM1d1grSwQDKGXNQE4xuM"), - }}, - RadiusServers: []*armnetwork.RadiusServer{ - { - RadiusServerAddress: to.Ptr("10.0.0.0"), - RadiusServerScore: to.Ptr[int64](25), - RadiusServerSecret: to.Ptr("radiusServerSecret"), - }}, - VPNClientIPSecPolicies: []*armnetwork.IPSecPolicy{ - { - DhGroup: to.Ptr(armnetwork.DhGroupDHGroup14), - IkeEncryption: to.Ptr(armnetwork.IkeEncryptionAES256), - IkeIntegrity: to.Ptr(armnetwork.IkeIntegritySHA384), - IPSecEncryption: to.Ptr(armnetwork.IPSecEncryptionAES256), - IPSecIntegrity: to.Ptr(armnetwork.IPSecIntegritySHA256), - PfsGroup: to.Ptr(armnetwork.PfsGroupPFS14), - SaDataSizeKilobytes: to.Ptr[int32](429497), - SaLifeTimeSeconds: to.Ptr[int32](86472), - }}, - VPNClientRevokedCertificates: []*armnetwork.VPNServerConfigVPNClientRevokedCertificate{ - { - Name: to.Ptr("vpnServerConfigVpnClientRevokedCert1"), - Thumbprint: to.Ptr("83FFBFC8848B5A5836C94D0112367E16148A286F"), - }}, - VPNClientRootCertificates: []*armnetwork.VPNServerConfigVPNClientRootCertificate{ - { - Name: to.Ptr("vpnServerConfigVpnClientRootCert1"), - PublicCertData: to.Ptr("MIIC5zCCAc+gAwIBAgIQErQ0Hk4aDJxIA+Q5RagB+jANBgkqhkiG9w0BAQsFADAWMRQwEgYDVQQDDAtQMlNSb290Q2VydDAeFw0xNzEyMTQyMTA3MzhaFw0xODEyMTQyMTI3MzhaMBYxFDASBgNVBAMMC1AyU1Jvb3RDZXJ0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArP7/NQXmW7cQ/ZR1mv3Y3I29Lt7HTOqzo/1KUOoVH3NItbQIRAQbwKy3UWrOFz4eGNX2GWtNRMdCyWsKeqy9Ltsdfcm1IbKXkl84DFeU/ZacXu4Dl3xX3gV5du4TLZjEowJELyur11Ea2YcjPRQ/FzAF9/hGuboS1HZQEPLx4FdUs9OxCYOtc0MxBCwLfVTTRqarb0Ne+arNYd4kCzIhAke1nOyKAJBda5ZL+VHy3S5S8qGlD46jm8HXugmAkUygS4oIIXOmj/1O9sNAi3LN60zufSzCmP8Rm/iUGX+DHAGGiXxwZOKQLEDaZXKqoHjMPP0XudmSWwOIbyeQVrLhkwIDAQABozEwLzAOBgNVHQ8BAf8EBAMCAgQwHQYDVR0OBBYEFEfeNU2trYxNLF9ONmuJUsT13pKDMA0GCSqGSIb3DQEBCwUAA4IBAQBmM6RJzsGGipxyMhimHKN2xlkejhVsgBoTAhOU0llW9aUSwINJ9zFUGgI8IzUFy1VG776fchHp0LMRmPSIUYk5btEPxbsrPtumPuMH8EQGrS+Rt4pD+78c8H1fEPkq5CmDl/PKu4JoFGv+aFcE+Od0hlILstIF10Qysf++QXDolKfzJa/56bgMeYKFiju73loiRM57ns8ddXpfLl792UVpRkFU62LNns6Y1LKTwapmUF4IvIuAIzd6LZNOQng64LAKXtKnViJ1JQiXwf4CEzhgvAti3/ejpb3U90hsrUcyZi6wBv9bZLcAJRWpz61JNYliM1d1grSwQDKGXNQE4xuN"), - }}, - VPNProtocols: []*armnetwork.VPNGatewayTunnelingProtocol{ - to.Ptr(armnetwork.VPNGatewayTunnelingProtocolIkeV2)}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VPNServerConfiguration = armnetwork.VPNServerConfiguration{ - // Name: to.Ptr("vpnServerConfiguration1"), - // Type: to.Ptr("Microsoft.Network/vpnServerConfigurations"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNServerConfigurationProperties{ - // ConfigurationPolicyGroups: []*armnetwork.VPNServerConfigurationPolicyGroup{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"), - // Name: to.Ptr("policyGroup1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ - // IsDefault: to.Ptr(true), - // P2SConnectionConfigurations: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"), - // }}, - // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ - // { - // Name: to.Ptr("policy1"), - // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID), - // AttributeValue: to.Ptr("6ad1bd08"), - // }}, - // Priority: to.Ptr[int32](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup2"), - // Name: to.Ptr("policyGroup2"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ - // IsDefault: to.Ptr(true), - // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ - // { - // Name: to.Ptr("policy2"), - // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeCertificateGroupID), - // AttributeValue: to.Ptr("red.com"), - // }}, - // Priority: to.Ptr[int32](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // ProvisioningState: to.Ptr("Succeeded"), - // RadiusClientRootCertificates: []*armnetwork.VPNServerConfigRadiusClientRootCertificate{ - // { - // Name: to.Ptr("vpnServerConfigRadiusClientRootCert1"), - // Thumbprint: to.Ptr("83FFBFC8848B5A5836C94D0112367E16148A286F"), - // }}, - // RadiusServerRootCertificates: []*armnetwork.VPNServerConfigRadiusServerRootCertificate{ - // { - // Name: to.Ptr("vpnServerConfigRadiusServerRootCer1"), - // PublicCertData: to.Ptr("MIIC5zCCAc+gAwIBAgIQErQ0Hk4aDJxIA+Q5RagB+jANBgkqhkiG9w0BAQsFADAWMRQwEgYDVQQDDAtQMlNSb290Q2VydDAeFw0xNzEyMTQyMTA3MzhaFw0xODEyMTQyMTI3MzhaMBYxFDASBgNVBAMMC1AyU1Jvb3RDZXJ0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArP7/NQXmW7cQ/ZR1mv3Y3I29Lt7HTOqzo/1KUOoVH3NItbQIRAQbwKy3UWrOFz4eGNX2GWtNRMdCyWsKeqy9Ltsdfcm1IbKXkl84DFeU/ZacXu4Dl3xX3gV5du4TLZjEowJELyur11Ea2YcjPRQ/FzAF9/hGuboS1HZQEPLx4FdUs9OxCYOtc0MxBCwLfVTTRqarb0Ne+arNYd4kCzIhAke1nOyKAJBda5ZL+VHy3S5S8qGlD46jm8HXugmAkUygS4oIIXOmj/1O9sNAi3LN60zufSzCmP8Rm/iUGX+DHAGGiXxwZOKQLEDaZXKqoHjMPP0XudmSWwOIbyeQVrLhkwIDAQABozEwLzAOBgNVHQ8BAf8EBAMCAgQwHQYDVR0OBBYEFEfeNU2trYxNLF9ONmuJUsT13pKDMA0GCSqGSIb3DQEBCwUAA4IBAQBmM6RJzsGGipxyMhimHKN2xlkejhVsgBoTAhOU0llW9aUSwINJ9zFUGgI8IzUFy1VG776fchHp0LMRmPSIUYk5btEPxbsrPtumPuMH8EQGrS+Rt4pD+78c8H1fEPkq5CmDl/PKu4JoFGv+aFcE+Od0hlILstIF10Qysf++QXDolKfzJa/56bgMeYKFiju73loiRM57ns8ddXpfLl792UVpRkFU62LNns6Y1LKTwapmUF4IvIuAIzd6LZNOQng64LAKXtKnViJ1JQiXwf4CEzhgvAti3/ejpb3U90hsrUcyZi6wBv9bZLcAJRWpz61JNYliM1d1grSwQDKGXNQE4xuM"), - // }}, - // RadiusServers: []*armnetwork.RadiusServer{ - // { - // RadiusServerAddress: to.Ptr("10.0.0.0"), - // RadiusServerScore: to.Ptr[int64](25), - // }}, - // VPNAuthenticationTypes: []*armnetwork.VPNAuthenticationType{ - // to.Ptr(armnetwork.VPNAuthenticationTypeCertificate)}, - // VPNClientIPSecPolicies: []*armnetwork.IPSecPolicy{ - // { - // DhGroup: to.Ptr(armnetwork.DhGroupDHGroup14), - // IkeEncryption: to.Ptr(armnetwork.IkeEncryptionAES256), - // IkeIntegrity: to.Ptr(armnetwork.IkeIntegritySHA384), - // IPSecEncryption: to.Ptr(armnetwork.IPSecEncryptionAES256), - // IPSecIntegrity: to.Ptr(armnetwork.IPSecIntegritySHA256), - // PfsGroup: to.Ptr(armnetwork.PfsGroupPFS14), - // SaDataSizeKilobytes: to.Ptr[int32](429497), - // SaLifeTimeSeconds: to.Ptr[int32](86472), - // }}, - // VPNClientRevokedCertificates: []*armnetwork.VPNServerConfigVPNClientRevokedCertificate{ - // { - // Name: to.Ptr("vpnServerConfigVpnClientRevokedCert1"), - // Thumbprint: to.Ptr("83FFBFC8848B5A5836C94D0112367E16148A286F"), - // }}, - // VPNClientRootCertificates: []*armnetwork.VPNServerConfigVPNClientRootCertificate{ - // { - // Name: to.Ptr("vpnServerConfigVpnClientRootCert1"), - // PublicCertData: to.Ptr("MIIC5zCCAc+gAwIBAgIQErQ0Hk4aDJxIA+Q5RagB+jANBgkqhkiG9w0BAQsFADAWMRQwEgYDVQQDDAtQMlNSb290Q2VydDAeFw0xNzEyMTQyMTA3MzhaFw0xODEyMTQyMTI3MzhaMBYxFDASBgNVBAMMC1AyU1Jvb3RDZXJ0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArP7/NQXmW7cQ/ZR1mv3Y3I29Lt7HTOqzo/1KUOoVH3NItbQIRAQbwKy3UWrOFz4eGNX2GWtNRMdCyWsKeqy9Ltsdfcm1IbKXkl84DFeU/ZacXu4Dl3xX3gV5du4TLZjEowJELyur11Ea2YcjPRQ/FzAF9/hGuboS1HZQEPLx4FdUs9OxCYOtc0MxBCwLfVTTRqarb0Ne+arNYd4kCzIhAke1nOyKAJBda5ZL+VHy3S5S8qGlD46jm8HXugmAkUygS4oIIXOmj/1O9sNAi3LN60zufSzCmP8Rm/iUGX+DHAGGiXxwZOKQLEDaZXKqoHjMPP0XudmSWwOIbyeQVrLhkwIDAQABozEwLzAOBgNVHQ8BAf8EBAMCAgQwHQYDVR0OBBYEFEfeNU2trYxNLF9ONmuJUsT13pKDMA0GCSqGSIb3DQEBCwUAA4IBAQBmM6RJzsGGipxyMhimHKN2xlkejhVsgBoTAhOU0llW9aUSwINJ9zFUGgI8IzUFy1VG776fchHp0LMRmPSIUYk5btEPxbsrPtumPuMH8EQGrS+Rt4pD+78c8H1fEPkq5CmDl/PKu4JoFGv+aFcE+Od0hlILstIF10Qysf++QXDolKfzJa/56bgMeYKFiju73loiRM57ns8ddXpfLl792UVpRkFU62LNns6Y1LKTwapmUF4IvIuAIzd6LZNOQng64LAKXtKnViJ1JQiXwf4CEzhgvAti3/ejpb3U90hsrUcyZi6wBv9bZLcAJRWpz61JNYliM1d1grSwQDKGXNQE4xuN"), - // }}, - // VPNProtocols: []*armnetwork.VPNGatewayTunnelingProtocol{ - // to.Ptr(armnetwork.VPNGatewayTunnelingProtocolIkeV2)}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VpnServerConfigurationUpdateTags.json -func ExampleVPNServerConfigurationsClient_UpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVPNServerConfigurationsClient().UpdateTags(ctx, "rg1", "vpnServerConfiguration1", armnetwork.TagsObject{ - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - "key2": to.Ptr("value2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VPNServerConfiguration = armnetwork.VPNServerConfiguration{ - // Name: to.Ptr("vpnServerConfiguration1"), - // Type: to.Ptr("Microsoft.Network/vpnServerConfigurations"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNServerConfigurationProperties{ - // ConfigurationPolicyGroups: []*armnetwork.VPNServerConfigurationPolicyGroup{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"), - // Name: to.Ptr("policyGroup1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ - // IsDefault: to.Ptr(true), - // P2SConnectionConfigurations: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"), - // }}, - // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ - // { - // Name: to.Ptr("policy1"), - // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID), - // AttributeValue: to.Ptr("6ad1bd08"), - // }}, - // Priority: to.Ptr[int32](0), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup2"), - // Name: to.Ptr("policyGroup2"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ - // IsDefault: to.Ptr(true), - // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ - // { - // Name: to.Ptr("policy2"), - // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeCertificateGroupID), - // AttributeValue: to.Ptr("red.com"), - // }}, - // Priority: to.Ptr[int32](0), - // }, - // }}, - // ProvisioningState: to.Ptr("Succeeded"), - // RadiusClientRootCertificates: []*armnetwork.VPNServerConfigRadiusClientRootCertificate{ - // { - // Name: to.Ptr("vpnServerConfigRadiusClientRootCert1"), - // Thumbprint: to.Ptr("83FFBFC8848B5A5836C94D0112367E16148A286F"), - // }}, - // RadiusServerAddress: to.Ptr("8.9.9.9"), - // RadiusServerRootCertificates: []*armnetwork.VPNServerConfigRadiusServerRootCertificate{ - // { - // Name: to.Ptr("vpnServerConfigRadiusServerRootCer1"), - // PublicCertData: to.Ptr("MIIC5zCCAc+gAwIBAgIQErQ0Hk4aDJxIA+Q5RagB+jANBgkqhkiG9w0BAQsFADAWMRQwEgYDVQQDDAtQMlNSb290Q2VydDAeFw0xNzEyMTQyMTA3MzhaFw0xODEyMTQyMTI3MzhaMBYxFDASBgNVBAMMC1AyU1Jvb3RDZXJ0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArP7/NQXmW7cQ/ZR1mv3Y3I29Lt7HTOqzo/1KUOoVH3NItbQIRAQbwKy3UWrOFz4eGNX2GWtNRMdCyWsKeqy9Ltsdfcm1IbKXkl84DFeU/ZacXu4Dl3xX3gV5du4TLZjEowJELyur11Ea2YcjPRQ/FzAF9/hGuboS1HZQEPLx4FdUs9OxCYOtc0MxBCwLfVTTRqarb0Ne+arNYd4kCzIhAke1nOyKAJBda5ZL+VHy3S5S8qGlD46jm8HXugmAkUygS4oIIXOmj/1O9sNAi3LN60zufSzCmP8Rm/iUGX+DHAGGiXxwZOKQLEDaZXKqoHjMPP0XudmSWwOIbyeQVrLhkwIDAQABozEwLzAOBgNVHQ8BAf8EBAMCAgQwHQYDVR0OBBYEFEfeNU2trYxNLF9ONmuJUsT13pKDMA0GCSqGSIb3DQEBCwUAA4IBAQBmM6RJzsGGipxyMhimHKN2xlkejhVsgBoTAhOU0llW9aUSwINJ9zFUGgI8IzUFy1VG776fchHp0LMRmPSIUYk5btEPxbsrPtumPuMH8EQGrS+Rt4pD+78c8H1fEPkq5CmDl/PKu4JoFGv+aFcE+Od0hlILstIF10Qysf++QXDolKfzJa/56bgMeYKFiju73loiRM57ns8ddXpfLl792UVpRkFU62LNns6Y1LKTwapmUF4IvIuAIzd6LZNOQng64LAKXtKnViJ1JQiXwf4CEzhgvAti3/ejpb3U90hsrUcyZi6wBv9bZLcAJRWpz61JNYliM1d1grSwQDKGXNQE4xuM"), - // }}, - // RadiusServerSecret: to.Ptr(""), - // VPNClientIPSecPolicies: []*armnetwork.IPSecPolicy{ - // { - // DhGroup: to.Ptr(armnetwork.DhGroupDHGroup14), - // IkeEncryption: to.Ptr(armnetwork.IkeEncryptionAES256), - // IkeIntegrity: to.Ptr(armnetwork.IkeIntegritySHA384), - // IPSecEncryption: to.Ptr(armnetwork.IPSecEncryptionAES256), - // IPSecIntegrity: to.Ptr(armnetwork.IPSecIntegritySHA256), - // PfsGroup: to.Ptr(armnetwork.PfsGroupPFS14), - // SaDataSizeKilobytes: to.Ptr[int32](429497), - // SaLifeTimeSeconds: to.Ptr[int32](86472), - // }}, - // VPNClientRevokedCertificates: []*armnetwork.VPNServerConfigVPNClientRevokedCertificate{ - // { - // Name: to.Ptr("vpnServerConfigVpnClientRevokedCert1"), - // Thumbprint: to.Ptr("83FFBFC8848B5A5836C94D0112367E16148A286F"), - // }}, - // VPNClientRootCertificates: []*armnetwork.VPNServerConfigVPNClientRootCertificate{ - // { - // Name: to.Ptr("vpnServerConfigVpnClientRootCert1"), - // PublicCertData: to.Ptr("MIIC5zCCAc+gAwIBAgIQErQ0Hk4aDJxIA+Q5RagB+jANBgkqhkiG9w0BAQsFADAWMRQwEgYDVQQDDAtQMlNSb290Q2VydDAeFw0xNzEyMTQyMTA3MzhaFw0xODEyMTQyMTI3MzhaMBYxFDASBgNVBAMMC1AyU1Jvb3RDZXJ0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArP7/NQXmW7cQ/ZR1mv3Y3I29Lt7HTOqzo/1KUOoVH3NItbQIRAQbwKy3UWrOFz4eGNX2GWtNRMdCyWsKeqy9Ltsdfcm1IbKXkl84DFeU/ZacXu4Dl3xX3gV5du4TLZjEowJELyur11Ea2YcjPRQ/FzAF9/hGuboS1HZQEPLx4FdUs9OxCYOtc0MxBCwLfVTTRqarb0Ne+arNYd4kCzIhAke1nOyKAJBda5ZL+VHy3S5S8qGlD46jm8HXugmAkUygS4oIIXOmj/1O9sNAi3LN60zufSzCmP8Rm/iUGX+DHAGGiXxwZOKQLEDaZXKqoHjMPP0XudmSWwOIbyeQVrLhkwIDAQABozEwLzAOBgNVHQ8BAf8EBAMCAgQwHQYDVR0OBBYEFEfeNU2trYxNLF9ONmuJUsT13pKDMA0GCSqGSIb3DQEBCwUAA4IBAQBmM6RJzsGGipxyMhimHKN2xlkejhVsgBoTAhOU0llW9aUSwINJ9zFUGgI8IzUFy1VG776fchHp0LMRmPSIUYk5btEPxbsrPtumPuMH8EQGrS+Rt4pD+78c8H1fEPkq5CmDl/PKu4JoFGv+aFcE+Od0hlILstIF10Qysf++QXDolKfzJa/56bgMeYKFiju73loiRM57ns8ddXpfLl792UVpRkFU62LNns6Y1LKTwapmUF4IvIuAIzd6LZNOQng64LAKXtKnViJ1JQiXwf4CEzhgvAti3/ejpb3U90hsrUcyZi6wBv9bZLcAJRWpz61JNYliM1d1grSwQDKGXNQE4xuN"), - // }}, - // VPNProtocols: []*armnetwork.VPNGatewayTunnelingProtocol{ - // to.Ptr(armnetwork.VPNGatewayTunnelingProtocolIkeV2)}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VpnServerConfigurationDelete.json -func ExampleVPNServerConfigurationsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVPNServerConfigurationsClient().BeginDelete(ctx, "rg1", "vpnServerConfiguration1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VpnServerConfigurationListByResourceGroup.json -func ExampleVPNServerConfigurationsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVPNServerConfigurationsClient().NewListByResourceGroupPager("rg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ListVPNServerConfigurationsResult = armnetwork.ListVPNServerConfigurationsResult{ - // Value: []*armnetwork.VPNServerConfiguration{ - // { - // Name: to.Ptr("vpnServerConfiguration1"), - // Type: to.Ptr("Microsoft.Network/vpnServerConfigurations"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNServerConfigurationProperties{ - // ConfigurationPolicyGroups: []*armnetwork.VPNServerConfigurationPolicyGroup{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"), - // Name: to.Ptr("policyGroup1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ - // IsDefault: to.Ptr(true), - // P2SConnectionConfigurations: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"), - // }}, - // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ - // { - // Name: to.Ptr("policy1"), - // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID), - // AttributeValue: to.Ptr("6ad1bd08"), - // }}, - // Priority: to.Ptr[int32](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup2"), - // Name: to.Ptr("policyGroup2"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ - // IsDefault: to.Ptr(true), - // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ - // { - // Name: to.Ptr("policy2"), - // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeCertificateGroupID), - // AttributeValue: to.Ptr("red.com"), - // }}, - // Priority: to.Ptr[int32](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // ProvisioningState: to.Ptr("Succeeded"), - // RadiusClientRootCertificates: []*armnetwork.VPNServerConfigRadiusClientRootCertificate{ - // { - // Name: to.Ptr("vpnServerConfigRadiusClientRootCert1"), - // Thumbprint: to.Ptr("83FFBFC8848B5A5836C94D0112367E16148A286F"), - // }}, - // RadiusServerAddress: to.Ptr("8.9.9.9"), - // RadiusServerRootCertificates: []*armnetwork.VPNServerConfigRadiusServerRootCertificate{ - // { - // Name: to.Ptr("vpnServerConfigRadiusServerRootCer1"), - // PublicCertData: to.Ptr("MIIC5zCCAc+gAwIBAgIQErQ0Hk4aDJxIA+Q5RagB+jANBgkqhkiG9w0BAQsFADAWMRQwEgYDVQQDDAtQMlNSb290Q2VydDAeFw0xNzEyMTQyMTA3MzhaFw0xODEyMTQyMTI3MzhaMBYxFDASBgNVBAMMC1AyU1Jvb3RDZXJ0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArP7/NQXmW7cQ/ZR1mv3Y3I29Lt7HTOqzo/1KUOoVH3NItbQIRAQbwKy3UWrOFz4eGNX2GWtNRMdCyWsKeqy9Ltsdfcm1IbKXkl84DFeU/ZacXu4Dl3xX3gV5du4TLZjEowJELyur11Ea2YcjPRQ/FzAF9/hGuboS1HZQEPLx4FdUs9OxCYOtc0MxBCwLfVTTRqarb0Ne+arNYd4kCzIhAke1nOyKAJBda5ZL+VHy3S5S8qGlD46jm8HXugmAkUygS4oIIXOmj/1O9sNAi3LN60zufSzCmP8Rm/iUGX+DHAGGiXxwZOKQLEDaZXKqoHjMPP0XudmSWwOIbyeQVrLhkwIDAQABozEwLzAOBgNVHQ8BAf8EBAMCAgQwHQYDVR0OBBYEFEfeNU2trYxNLF9ONmuJUsT13pKDMA0GCSqGSIb3DQEBCwUAA4IBAQBmM6RJzsGGipxyMhimHKN2xlkejhVsgBoTAhOU0llW9aUSwINJ9zFUGgI8IzUFy1VG776fchHp0LMRmPSIUYk5btEPxbsrPtumPuMH8EQGrS+Rt4pD+78c8H1fEPkq5CmDl/PKu4JoFGv+aFcE+Od0hlILstIF10Qysf++QXDolKfzJa/56bgMeYKFiju73loiRM57ns8ddXpfLl792UVpRkFU62LNns6Y1LKTwapmUF4IvIuAIzd6LZNOQng64LAKXtKnViJ1JQiXwf4CEzhgvAti3/ejpb3U90hsrUcyZi6wBv9bZLcAJRWpz61JNYliM1d1grSwQDKGXNQE4xuM"), - // }}, - // RadiusServerSecret: to.Ptr(""), - // VPNAuthenticationTypes: []*armnetwork.VPNAuthenticationType{ - // to.Ptr(armnetwork.VPNAuthenticationTypeCertificate)}, - // VPNClientIPSecPolicies: []*armnetwork.IPSecPolicy{ - // { - // DhGroup: to.Ptr(armnetwork.DhGroupDHGroup14), - // IkeEncryption: to.Ptr(armnetwork.IkeEncryptionAES256), - // IkeIntegrity: to.Ptr(armnetwork.IkeIntegritySHA384), - // IPSecEncryption: to.Ptr(armnetwork.IPSecEncryptionAES256), - // IPSecIntegrity: to.Ptr(armnetwork.IPSecIntegritySHA256), - // PfsGroup: to.Ptr(armnetwork.PfsGroupPFS14), - // SaDataSizeKilobytes: to.Ptr[int32](429497), - // SaLifeTimeSeconds: to.Ptr[int32](86472), - // }}, - // VPNClientRevokedCertificates: []*armnetwork.VPNServerConfigVPNClientRevokedCertificate{ - // { - // Name: to.Ptr("vpnServerConfigVpnClientRevokedCert1"), - // Thumbprint: to.Ptr("83FFBFC8848B5A5836C94D0112367E16148A286F"), - // }}, - // VPNClientRootCertificates: []*armnetwork.VPNServerConfigVPNClientRootCertificate{ - // { - // Name: to.Ptr("vpnServerConfigVpnClientRootCert1"), - // PublicCertData: to.Ptr("MIIC5zCCAc+gAwIBAgIQErQ0Hk4aDJxIA+Q5RagB+jANBgkqhkiG9w0BAQsFADAWMRQwEgYDVQQDDAtQMlNSb290Q2VydDAeFw0xNzEyMTQyMTA3MzhaFw0xODEyMTQyMTI3MzhaMBYxFDASBgNVBAMMC1AyU1Jvb3RDZXJ0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArP7/NQXmW7cQ/ZR1mv3Y3I29Lt7HTOqzo/1KUOoVH3NItbQIRAQbwKy3UWrOFz4eGNX2GWtNRMdCyWsKeqy9Ltsdfcm1IbKXkl84DFeU/ZacXu4Dl3xX3gV5du4TLZjEowJELyur11Ea2YcjPRQ/FzAF9/hGuboS1HZQEPLx4FdUs9OxCYOtc0MxBCwLfVTTRqarb0Ne+arNYd4kCzIhAke1nOyKAJBda5ZL+VHy3S5S8qGlD46jm8HXugmAkUygS4oIIXOmj/1O9sNAi3LN60zufSzCmP8Rm/iUGX+DHAGGiXxwZOKQLEDaZXKqoHjMPP0XudmSWwOIbyeQVrLhkwIDAQABozEwLzAOBgNVHQ8BAf8EBAMCAgQwHQYDVR0OBBYEFEfeNU2trYxNLF9ONmuJUsT13pKDMA0GCSqGSIb3DQEBCwUAA4IBAQBmM6RJzsGGipxyMhimHKN2xlkejhVsgBoTAhOU0llW9aUSwINJ9zFUGgI8IzUFy1VG776fchHp0LMRmPSIUYk5btEPxbsrPtumPuMH8EQGrS+Rt4pD+78c8H1fEPkq5CmDl/PKu4JoFGv+aFcE+Od0hlILstIF10Qysf++QXDolKfzJa/56bgMeYKFiju73loiRM57ns8ddXpfLl792UVpRkFU62LNns6Y1LKTwapmUF4IvIuAIzd6LZNOQng64LAKXtKnViJ1JQiXwf4CEzhgvAti3/ejpb3U90hsrUcyZi6wBv9bZLcAJRWpz61JNYliM1d1grSwQDKGXNQE4xuN"), - // }}, - // VPNProtocols: []*armnetwork.VPNGatewayTunnelingProtocol{ - // to.Ptr(armnetwork.VPNGatewayTunnelingProtocolIkeV2)}, - // }, - // }, - // { - // Name: to.Ptr("vpnServerConfiguration2"), - // Type: to.Ptr("Microsoft.Network/vpnServerConfigurations"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration2"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNServerConfigurationProperties{ - // ConfigurationPolicyGroups: []*armnetwork.VPNServerConfigurationPolicyGroup{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"), - // Name: to.Ptr("policyGroup1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ - // IsDefault: to.Ptr(true), - // P2SConnectionConfigurations: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"), - // }}, - // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ - // { - // Name: to.Ptr("policy1"), - // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID), - // AttributeValue: to.Ptr("6ad1bd08"), - // }}, - // Priority: to.Ptr[int32](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup2"), - // Name: to.Ptr("policyGroup2"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ - // IsDefault: to.Ptr(true), - // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ - // { - // Name: to.Ptr("policy2"), - // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeCertificateGroupID), - // AttributeValue: to.Ptr("red.com"), - // }}, - // Priority: to.Ptr[int32](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // ProvisioningState: to.Ptr("Succeeded"), - // RadiusClientRootCertificates: []*armnetwork.VPNServerConfigRadiusClientRootCertificate{ - // { - // Name: to.Ptr("vpnServerConfigRadiusClientRootCert1"), - // Thumbprint: to.Ptr("83FFBFC8848B5A5836C94D0112367E16148A286F"), - // }}, - // RadiusServerAddress: to.Ptr("8.9.9.9"), - // RadiusServerRootCertificates: []*armnetwork.VPNServerConfigRadiusServerRootCertificate{ - // { - // Name: to.Ptr("vpnServerConfigRadiusServerRootCer1"), - // PublicCertData: to.Ptr("MIIC5zCCAc+gAwIBAgIQErQ0Hk4aDJxIA+Q5RagB+jANBgkqhkiG9w0BAQsFADAWMRQwEgYDVQQDDAtQMlNSb290Q2VydDAeFw0xNzEyMTQyMTA3MzhaFw0xODEyMTQyMTI3MzhaMBYxFDASBgNVBAMMC1AyU1Jvb3RDZXJ0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArP7/NQXmW7cQ/ZR1mv3Y3I29Lt7HTOqzo/1KUOoVH3NItbQIRAQbwKy3UWrOFz4eGNX2GWtNRMdCyWsKeqy9Ltsdfcm1IbKXkl84DFeU/ZacXu4Dl3xX3gV5du4TLZjEowJELyur11Ea2YcjPRQ/FzAF9/hGuboS1HZQEPLx4FdUs9OxCYOtc0MxBCwLfVTTRqarb0Ne+arNYd4kCzIhAke1nOyKAJBda5ZL+VHy3S5S8qGlD46jm8HXugmAkUygS4oIIXOmj/1O9sNAi3LN60zufSzCmP8Rm/iUGX+DHAGGiXxwZOKQLEDaZXKqoHjMPP0XudmSWwOIbyeQVrLhkwIDAQABozEwLzAOBgNVHQ8BAf8EBAMCAgQwHQYDVR0OBBYEFEfeNU2trYxNLF9ONmuJUsT13pKDMA0GCSqGSIb3DQEBCwUAA4IBAQBmM6RJzsGGipxyMhimHKN2xlkejhVsgBoTAhOU0llW9aUSwINJ9zFUGgI8IzUFy1VG776fchHp0LMRmPSIUYk5btEPxbsrPtumPuMH8EQGrS+Rt4pD+78c8H1fEPkq5CmDl/PKu4JoFGv+aFcE+Od0hlILstIF10Qysf++QXDolKfzJa/56bgMeYKFiju73loiRM57ns8ddXpfLl792UVpRkFU62LNns6Y1LKTwapmUF4IvIuAIzd6LZNOQng64LAKXtKnViJ1JQiXwf4CEzhgvAti3/ejpb3U90hsrUcyZi6wBv9bZLcAJRWpz61JNYliM1d1grSwQDKGXNQE4xuM"), - // }}, - // RadiusServerSecret: to.Ptr(""), - // VPNAuthenticationTypes: []*armnetwork.VPNAuthenticationType{ - // to.Ptr(armnetwork.VPNAuthenticationTypeCertificate)}, - // VPNClientIPSecPolicies: []*armnetwork.IPSecPolicy{ - // { - // DhGroup: to.Ptr(armnetwork.DhGroupDHGroup14), - // IkeEncryption: to.Ptr(armnetwork.IkeEncryptionAES256), - // IkeIntegrity: to.Ptr(armnetwork.IkeIntegritySHA384), - // IPSecEncryption: to.Ptr(armnetwork.IPSecEncryptionAES256), - // IPSecIntegrity: to.Ptr(armnetwork.IPSecIntegritySHA256), - // PfsGroup: to.Ptr(armnetwork.PfsGroupPFS14), - // SaDataSizeKilobytes: to.Ptr[int32](429497), - // SaLifeTimeSeconds: to.Ptr[int32](86472), - // }}, - // VPNClientRevokedCertificates: []*armnetwork.VPNServerConfigVPNClientRevokedCertificate{ - // { - // Name: to.Ptr("vpnServerConfigVpnClientRevokedCert1"), - // Thumbprint: to.Ptr("83FFBFC8848B5A5836C94D0112367E16148A286F"), - // }}, - // VPNClientRootCertificates: []*armnetwork.VPNServerConfigVPNClientRootCertificate{ - // { - // Name: to.Ptr("vpnServerConfigVpnClientRootCert1"), - // PublicCertData: to.Ptr("MIIC5zCCAc+gAwIBAgIQErQ0Hk4aDJxIA+Q5RagB+jANBgkqhkiG9w0BAQsFADAWMRQwEgYDVQQDDAtQMlNSb290Q2VydDAeFw0xNzEyMTQyMTA3MzhaFw0xODEyMTQyMTI3MzhaMBYxFDASBgNVBAMMC1AyU1Jvb3RDZXJ0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArP7/NQXmW7cQ/ZR1mv3Y3I29Lt7HTOqzo/1KUOoVH3NItbQIRAQbwKy3UWrOFz4eGNX2GWtNRMdCyWsKeqy9Ltsdfcm1IbKXkl84DFeU/ZacXu4Dl3xX3gV5du4TLZjEowJELyur11Ea2YcjPRQ/FzAF9/hGuboS1HZQEPLx4FdUs9OxCYOtc0MxBCwLfVTTRqarb0Ne+arNYd4kCzIhAke1nOyKAJBda5ZL+VHy3S5S8qGlD46jm8HXugmAkUygS4oIIXOmj/1O9sNAi3LN60zufSzCmP8Rm/iUGX+DHAGGiXxwZOKQLEDaZXKqoHjMPP0XudmSWwOIbyeQVrLhkwIDAQABozEwLzAOBgNVHQ8BAf8EBAMCAgQwHQYDVR0OBBYEFEfeNU2trYxNLF9ONmuJUsT13pKDMA0GCSqGSIb3DQEBCwUAA4IBAQBmM6RJzsGGipxyMhimHKN2xlkejhVsgBoTAhOU0llW9aUSwINJ9zFUGgI8IzUFy1VG776fchHp0LMRmPSIUYk5btEPxbsrPtumPuMH8EQGrS+Rt4pD+78c8H1fEPkq5CmDl/PKu4JoFGv+aFcE+Od0hlILstIF10Qysf++QXDolKfzJa/56bgMeYKFiju73loiRM57ns8ddXpfLl792UVpRkFU62LNns6Y1LKTwapmUF4IvIuAIzd6LZNOQng64LAKXtKnViJ1JQiXwf4CEzhgvAti3/ejpb3U90hsrUcyZi6wBv9bZLcAJRWpz61JNYliM1d1grSwQDKGXNQE4xuN"), - // }}, - // VPNProtocols: []*armnetwork.VPNGatewayTunnelingProtocol{ - // to.Ptr(armnetwork.VPNGatewayTunnelingProtocolIkeV2)}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VpnServerConfigurationList.json -func ExampleVPNServerConfigurationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVPNServerConfigurationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ListVPNServerConfigurationsResult = armnetwork.ListVPNServerConfigurationsResult{ - // Value: []*armnetwork.VPNServerConfiguration{ - // { - // Name: to.Ptr("vpnServerConfiguration1"), - // Type: to.Ptr("Microsoft.Network/vpnServerConfigurations"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNServerConfigurationProperties{ - // ConfigurationPolicyGroups: []*armnetwork.VPNServerConfigurationPolicyGroup{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"), - // Name: to.Ptr("policyGroup1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ - // IsDefault: to.Ptr(true), - // P2SConnectionConfigurations: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"), - // }}, - // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ - // { - // Name: to.Ptr("policy1"), - // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID), - // AttributeValue: to.Ptr("6ad1bd08"), - // }}, - // Priority: to.Ptr[int32](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup2"), - // Name: to.Ptr("policyGroup2"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ - // IsDefault: to.Ptr(true), - // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ - // { - // Name: to.Ptr("policy2"), - // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeCertificateGroupID), - // AttributeValue: to.Ptr("red.com"), - // }}, - // Priority: to.Ptr[int32](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // ProvisioningState: to.Ptr("Succeeded"), - // RadiusClientRootCertificates: []*armnetwork.VPNServerConfigRadiusClientRootCertificate{ - // { - // Name: to.Ptr("vpnServerConfigRadiusClientRootCert1"), - // Thumbprint: to.Ptr("83FFBFC8848B5A5836C94D0112367E16148A286F"), - // }}, - // RadiusServerAddress: to.Ptr("8.9.9.9"), - // RadiusServerRootCertificates: []*armnetwork.VPNServerConfigRadiusServerRootCertificate{ - // { - // Name: to.Ptr("vpnServerConfigRadiusServerRootCer1"), - // PublicCertData: to.Ptr("MIIC5zCCAc+gAwIBAgIQErQ0Hk4aDJxIA+Q5RagB+jANBgkqhkiG9w0BAQsFADAWMRQwEgYDVQQDDAtQMlNSb290Q2VydDAeFw0xNzEyMTQyMTA3MzhaFw0xODEyMTQyMTI3MzhaMBYxFDASBgNVBAMMC1AyU1Jvb3RDZXJ0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArP7/NQXmW7cQ/ZR1mv3Y3I29Lt7HTOqzo/1KUOoVH3NItbQIRAQbwKy3UWrOFz4eGNX2GWtNRMdCyWsKeqy9Ltsdfcm1IbKXkl84DFeU/ZacXu4Dl3xX3gV5du4TLZjEowJELyur11Ea2YcjPRQ/FzAF9/hGuboS1HZQEPLx4FdUs9OxCYOtc0MxBCwLfVTTRqarb0Ne+arNYd4kCzIhAke1nOyKAJBda5ZL+VHy3S5S8qGlD46jm8HXugmAkUygS4oIIXOmj/1O9sNAi3LN60zufSzCmP8Rm/iUGX+DHAGGiXxwZOKQLEDaZXKqoHjMPP0XudmSWwOIbyeQVrLhkwIDAQABozEwLzAOBgNVHQ8BAf8EBAMCAgQwHQYDVR0OBBYEFEfeNU2trYxNLF9ONmuJUsT13pKDMA0GCSqGSIb3DQEBCwUAA4IBAQBmM6RJzsGGipxyMhimHKN2xlkejhVsgBoTAhOU0llW9aUSwINJ9zFUGgI8IzUFy1VG776fchHp0LMRmPSIUYk5btEPxbsrPtumPuMH8EQGrS+Rt4pD+78c8H1fEPkq5CmDl/PKu4JoFGv+aFcE+Od0hlILstIF10Qysf++QXDolKfzJa/56bgMeYKFiju73loiRM57ns8ddXpfLl792UVpRkFU62LNns6Y1LKTwapmUF4IvIuAIzd6LZNOQng64LAKXtKnViJ1JQiXwf4CEzhgvAti3/ejpb3U90hsrUcyZi6wBv9bZLcAJRWpz61JNYliM1d1grSwQDKGXNQE4xuM"), - // }}, - // RadiusServerSecret: to.Ptr(""), - // VPNAuthenticationTypes: []*armnetwork.VPNAuthenticationType{ - // to.Ptr(armnetwork.VPNAuthenticationTypeCertificate)}, - // VPNClientIPSecPolicies: []*armnetwork.IPSecPolicy{ - // { - // DhGroup: to.Ptr(armnetwork.DhGroupDHGroup14), - // IkeEncryption: to.Ptr(armnetwork.IkeEncryptionAES256), - // IkeIntegrity: to.Ptr(armnetwork.IkeIntegritySHA384), - // IPSecEncryption: to.Ptr(armnetwork.IPSecEncryptionAES256), - // IPSecIntegrity: to.Ptr(armnetwork.IPSecIntegritySHA256), - // PfsGroup: to.Ptr(armnetwork.PfsGroupPFS14), - // SaDataSizeKilobytes: to.Ptr[int32](429497), - // SaLifeTimeSeconds: to.Ptr[int32](86472), - // }}, - // VPNClientRevokedCertificates: []*armnetwork.VPNServerConfigVPNClientRevokedCertificate{ - // { - // Name: to.Ptr("vpnServerConfigVpnClientRevokedCert1"), - // Thumbprint: to.Ptr("83FFBFC8848B5A5836C94D0112367E16148A286F"), - // }}, - // VPNClientRootCertificates: []*armnetwork.VPNServerConfigVPNClientRootCertificate{ - // { - // Name: to.Ptr("vpnServerConfigVpnClientRootCert1"), - // PublicCertData: to.Ptr("MIIC5zCCAc+gAwIBAgIQErQ0Hk4aDJxIA+Q5RagB+jANBgkqhkiG9w0BAQsFADAWMRQwEgYDVQQDDAtQMlNSb290Q2VydDAeFw0xNzEyMTQyMTA3MzhaFw0xODEyMTQyMTI3MzhaMBYxFDASBgNVBAMMC1AyU1Jvb3RDZXJ0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArP7/NQXmW7cQ/ZR1mv3Y3I29Lt7HTOqzo/1KUOoVH3NItbQIRAQbwKy3UWrOFz4eGNX2GWtNRMdCyWsKeqy9Ltsdfcm1IbKXkl84DFeU/ZacXu4Dl3xX3gV5du4TLZjEowJELyur11Ea2YcjPRQ/FzAF9/hGuboS1HZQEPLx4FdUs9OxCYOtc0MxBCwLfVTTRqarb0Ne+arNYd4kCzIhAke1nOyKAJBda5ZL+VHy3S5S8qGlD46jm8HXugmAkUygS4oIIXOmj/1O9sNAi3LN60zufSzCmP8Rm/iUGX+DHAGGiXxwZOKQLEDaZXKqoHjMPP0XudmSWwOIbyeQVrLhkwIDAQABozEwLzAOBgNVHQ8BAf8EBAMCAgQwHQYDVR0OBBYEFEfeNU2trYxNLF9ONmuJUsT13pKDMA0GCSqGSIb3DQEBCwUAA4IBAQBmM6RJzsGGipxyMhimHKN2xlkejhVsgBoTAhOU0llW9aUSwINJ9zFUGgI8IzUFy1VG776fchHp0LMRmPSIUYk5btEPxbsrPtumPuMH8EQGrS+Rt4pD+78c8H1fEPkq5CmDl/PKu4JoFGv+aFcE+Od0hlILstIF10Qysf++QXDolKfzJa/56bgMeYKFiju73loiRM57ns8ddXpfLl792UVpRkFU62LNns6Y1LKTwapmUF4IvIuAIzd6LZNOQng64LAKXtKnViJ1JQiXwf4CEzhgvAti3/ejpb3U90hsrUcyZi6wBv9bZLcAJRWpz61JNYliM1d1grSwQDKGXNQE4xuN"), - // }}, - // VPNProtocols: []*armnetwork.VPNGatewayTunnelingProtocol{ - // to.Ptr(armnetwork.VPNGatewayTunnelingProtocolIkeV2)}, - // }, - // }, - // { - // Name: to.Ptr("vpnServerConfiguration2"), - // Type: to.Ptr("Microsoft.Network/vpnServerConfigurations"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration2"), - // Location: to.Ptr("East US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNServerConfigurationProperties{ - // ConfigurationPolicyGroups: []*armnetwork.VPNServerConfigurationPolicyGroup{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"), - // Name: to.Ptr("policyGroup1"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ - // IsDefault: to.Ptr(true), - // P2SConnectionConfigurations: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"), - // }}, - // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ - // { - // Name: to.Ptr("policy1"), - // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID), - // AttributeValue: to.Ptr("6ad1bd08"), - // }}, - // Priority: to.Ptr[int32](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup2"), - // Name: to.Ptr("policyGroup2"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{ - // IsDefault: to.Ptr(true), - // PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{ - // { - // Name: to.Ptr("policy2"), - // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeCertificateGroupID), - // AttributeValue: to.Ptr("red.com"), - // }}, - // Priority: to.Ptr[int32](0), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // ProvisioningState: to.Ptr("Succeeded"), - // RadiusClientRootCertificates: []*armnetwork.VPNServerConfigRadiusClientRootCertificate{ - // { - // Name: to.Ptr("vpnServerConfigRadiusClientRootCert1"), - // Thumbprint: to.Ptr("83FFBFC8848B5A5836C94D0112367E16148A286F"), - // }}, - // RadiusServerRootCertificates: []*armnetwork.VPNServerConfigRadiusServerRootCertificate{ - // { - // Name: to.Ptr("vpnServerConfigRadiusServerRootCer1"), - // PublicCertData: to.Ptr("MIIC5zCCAc+gAwIBAgIQErQ0Hk4aDJxIA+Q5RagB+jANBgkqhkiG9w0BAQsFADAWMRQwEgYDVQQDDAtQMlNSb290Q2VydDAeFw0xNzEyMTQyMTA3MzhaFw0xODEyMTQyMTI3MzhaMBYxFDASBgNVBAMMC1AyU1Jvb3RDZXJ0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArP7/NQXmW7cQ/ZR1mv3Y3I29Lt7HTOqzo/1KUOoVH3NItbQIRAQbwKy3UWrOFz4eGNX2GWtNRMdCyWsKeqy9Ltsdfcm1IbKXkl84DFeU/ZacXu4Dl3xX3gV5du4TLZjEowJELyur11Ea2YcjPRQ/FzAF9/hGuboS1HZQEPLx4FdUs9OxCYOtc0MxBCwLfVTTRqarb0Ne+arNYd4kCzIhAke1nOyKAJBda5ZL+VHy3S5S8qGlD46jm8HXugmAkUygS4oIIXOmj/1O9sNAi3LN60zufSzCmP8Rm/iUGX+DHAGGiXxwZOKQLEDaZXKqoHjMPP0XudmSWwOIbyeQVrLhkwIDAQABozEwLzAOBgNVHQ8BAf8EBAMCAgQwHQYDVR0OBBYEFEfeNU2trYxNLF9ONmuJUsT13pKDMA0GCSqGSIb3DQEBCwUAA4IBAQBmM6RJzsGGipxyMhimHKN2xlkejhVsgBoTAhOU0llW9aUSwINJ9zFUGgI8IzUFy1VG776fchHp0LMRmPSIUYk5btEPxbsrPtumPuMH8EQGrS+Rt4pD+78c8H1fEPkq5CmDl/PKu4JoFGv+aFcE+Od0hlILstIF10Qysf++QXDolKfzJa/56bgMeYKFiju73loiRM57ns8ddXpfLl792UVpRkFU62LNns6Y1LKTwapmUF4IvIuAIzd6LZNOQng64LAKXtKnViJ1JQiXwf4CEzhgvAti3/ejpb3U90hsrUcyZi6wBv9bZLcAJRWpz61JNYliM1d1grSwQDKGXNQE4xuM"), - // }}, - // RadiusServers: []*armnetwork.RadiusServer{ - // { - // RadiusServerAddress: to.Ptr("10.0.0.0"), - // RadiusServerScore: to.Ptr[int64](25), - // }}, - // VPNAuthenticationTypes: []*armnetwork.VPNAuthenticationType{ - // to.Ptr(armnetwork.VPNAuthenticationTypeCertificate)}, - // VPNClientIPSecPolicies: []*armnetwork.IPSecPolicy{ - // { - // DhGroup: to.Ptr(armnetwork.DhGroupDHGroup14), - // IkeEncryption: to.Ptr(armnetwork.IkeEncryptionAES256), - // IkeIntegrity: to.Ptr(armnetwork.IkeIntegritySHA384), - // IPSecEncryption: to.Ptr(armnetwork.IPSecEncryptionAES256), - // IPSecIntegrity: to.Ptr(armnetwork.IPSecIntegritySHA256), - // PfsGroup: to.Ptr(armnetwork.PfsGroupPFS14), - // SaDataSizeKilobytes: to.Ptr[int32](429497), - // SaLifeTimeSeconds: to.Ptr[int32](86472), - // }}, - // VPNClientRevokedCertificates: []*armnetwork.VPNServerConfigVPNClientRevokedCertificate{ - // { - // Name: to.Ptr("vpnServerConfigVpnClientRevokedCert1"), - // Thumbprint: to.Ptr("83FFBFC8848B5A5836C94D0112367E16148A286F"), - // }}, - // VPNClientRootCertificates: []*armnetwork.VPNServerConfigVPNClientRootCertificate{ - // { - // Name: to.Ptr("vpnServerConfigVpnClientRootCert1"), - // PublicCertData: to.Ptr("MIIC5zCCAc+gAwIBAgIQErQ0Hk4aDJxIA+Q5RagB+jANBgkqhkiG9w0BAQsFADAWMRQwEgYDVQQDDAtQMlNSb290Q2VydDAeFw0xNzEyMTQyMTA3MzhaFw0xODEyMTQyMTI3MzhaMBYxFDASBgNVBAMMC1AyU1Jvb3RDZXJ0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArP7/NQXmW7cQ/ZR1mv3Y3I29Lt7HTOqzo/1KUOoVH3NItbQIRAQbwKy3UWrOFz4eGNX2GWtNRMdCyWsKeqy9Ltsdfcm1IbKXkl84DFeU/ZacXu4Dl3xX3gV5du4TLZjEowJELyur11Ea2YcjPRQ/FzAF9/hGuboS1HZQEPLx4FdUs9OxCYOtc0MxBCwLfVTTRqarb0Ne+arNYd4kCzIhAke1nOyKAJBda5ZL+VHy3S5S8qGlD46jm8HXugmAkUygS4oIIXOmj/1O9sNAi3LN60zufSzCmP8Rm/iUGX+DHAGGiXxwZOKQLEDaZXKqoHjMPP0XudmSWwOIbyeQVrLhkwIDAQABozEwLzAOBgNVHQ8BAf8EBAMCAgQwHQYDVR0OBBYEFEfeNU2trYxNLF9ONmuJUsT13pKDMA0GCSqGSIb3DQEBCwUAA4IBAQBmM6RJzsGGipxyMhimHKN2xlkejhVsgBoTAhOU0llW9aUSwINJ9zFUGgI8IzUFy1VG776fchHp0LMRmPSIUYk5btEPxbsrPtumPuMH8EQGrS+Rt4pD+78c8H1fEPkq5CmDl/PKu4JoFGv+aFcE+Od0hlILstIF10Qysf++QXDolKfzJa/56bgMeYKFiju73loiRM57ns8ddXpfLl792UVpRkFU62LNns6Y1LKTwapmUF4IvIuAIzd6LZNOQng64LAKXtKnViJ1JQiXwf4CEzhgvAti3/ejpb3U90hsrUcyZi6wBv9bZLcAJRWpz61JNYliM1d1grSwQDKGXNQE4xuN"), - // }}, - // VPNProtocols: []*armnetwork.VPNGatewayTunnelingProtocol{ - // to.Ptr(armnetwork.VPNGatewayTunnelingProtocolIkeV2)}, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/vpnserverconfigurationsassociatedwithvirtualwan_client.go b/sdk/resourcemanager/network/armnetwork/vpnserverconfigurationsassociatedwithvirtualwan_client.go index 487a1404fea4..c63565668ff4 100644 --- a/sdk/resourcemanager/network/armnetwork/vpnserverconfigurationsassociatedwithvirtualwan_client.go +++ b/sdk/resourcemanager/network/armnetwork/vpnserverconfigurationsassociatedwithvirtualwan_client.go @@ -47,7 +47,7 @@ func NewVPNServerConfigurationsAssociatedWithVirtualWanClient(subscriptionID str // BeginList - Gives the list of VpnServerConfigurations associated with Virtual Wan in a resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name. // - virtualWANName - The name of the VirtualWAN whose associated VpnServerConfigurations is needed. // - options - VPNServerConfigurationsAssociatedWithVirtualWanClientBeginListOptions contains the optional parameters for the @@ -70,7 +70,7 @@ func (client *VPNServerConfigurationsAssociatedWithVirtualWanClient) BeginList(c // List - Gives the list of VpnServerConfigurations associated with Virtual Wan in a resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VPNServerConfigurationsAssociatedWithVirtualWanClient) listOperation(ctx context.Context, resourceGroupName string, virtualWANName string, options *VPNServerConfigurationsAssociatedWithVirtualWanClientBeginListOptions) (*http.Response, error) { var err error const operationName = "VPNServerConfigurationsAssociatedWithVirtualWanClient.BeginList" @@ -112,7 +112,7 @@ func (client *VPNServerConfigurationsAssociatedWithVirtualWanClient) listCreateR return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/vpnserverconfigurationsassociatedwithvirtualwan_client_example_test.go b/sdk/resourcemanager/network/armnetwork/vpnserverconfigurationsassociatedwithvirtualwan_client_example_test.go deleted file mode 100644 index 75ece12aed6b..000000000000 --- a/sdk/resourcemanager/network/armnetwork/vpnserverconfigurationsassociatedwithvirtualwan_client_example_test.go +++ /dev/null @@ -1,47 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/GetVirtualWanVpnServerConfigurations.json -func ExampleVPNServerConfigurationsAssociatedWithVirtualWanClient_BeginList() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVPNServerConfigurationsAssociatedWithVirtualWanClient().BeginList(ctx, "rg1", "wan1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VPNServerConfigurationsResponse = armnetwork.VPNServerConfigurationsResponse{ - // VPNServerConfigurationResourceIDs: []*string{ - // to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnconfig1"), - // to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnconfig2")}, - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/vpnsitelinkconnections_client.go b/sdk/resourcemanager/network/armnetwork/vpnsitelinkconnections_client.go index 92cb4430c4d6..38464ec08310 100644 --- a/sdk/resourcemanager/network/armnetwork/vpnsitelinkconnections_client.go +++ b/sdk/resourcemanager/network/armnetwork/vpnsitelinkconnections_client.go @@ -47,7 +47,7 @@ func NewVPNSiteLinkConnectionsClient(subscriptionID string, credential azcore.To // Get - Retrieves the details of a vpn site link connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the VpnGateway. // - gatewayName - The name of the gateway. // - connectionName - The name of the vpn connection. @@ -104,7 +104,7 @@ func (client *VPNSiteLinkConnectionsClient) getCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/vpnsitelinkconnections_client_example_test.go b/sdk/resourcemanager/network/armnetwork/vpnsitelinkconnections_client_example_test.go deleted file mode 100644 index e8416692a1f5..000000000000 --- a/sdk/resourcemanager/network/armnetwork/vpnsitelinkconnections_client_example_test.go +++ /dev/null @@ -1,71 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VpnSiteLinkConnectionGet.json -func ExampleVPNSiteLinkConnectionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVPNSiteLinkConnectionsClient().Get(ctx, "rg1", "gateway1", "vpnConnection1", "Connection-Link1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VPNSiteLinkConnection = armnetwork.VPNSiteLinkConnection{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/VpnSiteLinkConnections/Connection-Link1"), - // Name: to.Ptr("Connection-Link1"), - // Type: to.Ptr("Microsoft.Network/vpnGateways/vpnConnections/VpnSiteLinkConnections"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNSiteLinkConnectionProperties{ - // ConnectionBandwidth: to.Ptr[int32](200), - // EgressBytesTransferred: to.Ptr[int64](0), - // EnableBgp: to.Ptr(false), - // EnableRateLimiting: to.Ptr(false), - // IngressBytesTransferred: to.Ptr[int64](0), - // IPSecPolicies: []*armnetwork.IPSecPolicy{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RoutingWeight: to.Ptr[int32](0), - // SharedKey: to.Ptr("key"), - // UseLocalAzureIPAddress: to.Ptr(false), - // UsePolicyBasedTrafficSelectors: to.Ptr(false), - // VPNConnectionProtocolType: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionProtocolIKEv2), - // VPNGatewayCustomBgpAddresses: []*armnetwork.GatewayCustomBgpIPAddressIPConfiguration{ - // { - // CustomBgpIPAddress: to.Ptr("169.254.21.1"), - // IPConfigurationID: to.Ptr("Instance0"), - // }, - // { - // CustomBgpIPAddress: to.Ptr("169.254.21.3"), - // IPConfigurationID: to.Ptr("Instance1"), - // }}, - // VPNSiteLink: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/siteLink1"), - // }, - // }, - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/vpnsitelinks_client.go b/sdk/resourcemanager/network/armnetwork/vpnsitelinks_client.go index bbf9e3161e41..07feadec0796 100644 --- a/sdk/resourcemanager/network/armnetwork/vpnsitelinks_client.go +++ b/sdk/resourcemanager/network/armnetwork/vpnsitelinks_client.go @@ -47,7 +47,7 @@ func NewVPNSiteLinksClient(subscriptionID string, credential azcore.TokenCredent // Get - Retrieves the details of a VPN site link. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the VpnSite. // - vpnSiteName - The name of the VpnSite. // - vpnSiteLinkName - The name of the VpnSiteLink being retrieved. @@ -98,7 +98,7 @@ func (client *VPNSiteLinksClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -115,7 +115,7 @@ func (client *VPNSiteLinksClient) getHandleResponse(resp *http.Response) (VPNSit // NewListByVPNSitePager - Lists all the vpnSiteLinks in a resource group for a vpn site. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the VpnSite. // - vpnSiteName - The name of the VpnSite. // - options - VPNSiteLinksClientListByVPNSiteOptions contains the optional parameters for the VPNSiteLinksClient.NewListByVPNSitePager @@ -170,7 +170,7 @@ func (client *VPNSiteLinksClient) listByVPNSiteCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/vpnsitelinks_client_example_test.go b/sdk/resourcemanager/network/armnetwork/vpnsitelinks_client_example_test.go deleted file mode 100644 index b30704debe4a..000000000000 --- a/sdk/resourcemanager/network/armnetwork/vpnsitelinks_client_example_test.go +++ /dev/null @@ -1,117 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VpnSiteLinkGet.json -func ExampleVPNSiteLinksClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVPNSiteLinksClient().Get(ctx, "rg1", "vpnSite1", "vpnSiteLink1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VPNSiteLink = armnetwork.VPNSiteLink{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/vpnSiteLink1"), - // Name: to.Ptr("vpnSiteLink1"), - // Type: to.Ptr("Microsoft.Network/vpnSites/vpnSiteLinks"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.VPNSiteLinkProperties{ - // BgpProperties: &armnetwork.VPNLinkBgpSettings{ - // Asn: to.Ptr[int64](1234), - // BgpPeeringAddress: to.Ptr("192.168.0.0"), - // }, - // IPAddress: to.Ptr("50.50.50.56"), - // LinkProperties: &armnetwork.VPNLinkProviderProperties{ - // LinkSpeedInMbps: to.Ptr[int32](0), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VpnSiteLinkListByVpnSite.json -func ExampleVPNSiteLinksClient_NewListByVPNSitePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVPNSiteLinksClient().NewListByVPNSitePager("rg1", "vpnSite1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ListVPNSiteLinksResult = armnetwork.ListVPNSiteLinksResult{ - // Value: []*armnetwork.VPNSiteLink{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/vpnSiteLink1"), - // Name: to.Ptr("vpnSiteLink1"), - // Type: to.Ptr("Microsoft.Network/vpnSites/vpnSiteLinks"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.VPNSiteLinkProperties{ - // BgpProperties: &armnetwork.VPNLinkBgpSettings{ - // Asn: to.Ptr[int64](1234), - // BgpPeeringAddress: to.Ptr("192.168.0.0"), - // }, - // IPAddress: to.Ptr("50.50.50.56"), - // LinkProperties: &armnetwork.VPNLinkProviderProperties{ - // LinkSpeedInMbps: to.Ptr[int32](200), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/vpnSiteLink2"), - // Name: to.Ptr("vpnSiteLink2"), - // Type: to.Ptr("Microsoft.Network/vpnSites/vpnSiteLinks"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.VPNSiteLinkProperties{ - // BgpProperties: &armnetwork.VPNLinkBgpSettings{ - // Asn: to.Ptr[int64](1234), - // BgpPeeringAddress: to.Ptr("192.168.0.1"), - // }, - // IPAddress: to.Ptr("40.40.40.46"), - // LinkProperties: &armnetwork.VPNLinkProviderProperties{ - // LinkSpeedInMbps: to.Ptr[int32](200), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/vpnsites_client.go b/sdk/resourcemanager/network/armnetwork/vpnsites_client.go index 4779f6cbe4c7..256b0da5c6bb 100644 --- a/sdk/resourcemanager/network/armnetwork/vpnsites_client.go +++ b/sdk/resourcemanager/network/armnetwork/vpnsites_client.go @@ -47,7 +47,7 @@ func NewVPNSitesClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreateOrUpdate - Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the VpnSite. // - vpnSiteName - The name of the VpnSite being created or updated. // - vpnSiteParameters - Parameters supplied to create or update VpnSite. @@ -71,7 +71,7 @@ func (client *VPNSitesClient) BeginCreateOrUpdate(ctx context.Context, resourceG // CreateOrUpdate - Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VPNSitesClient) createOrUpdate(ctx context.Context, resourceGroupName string, vpnSiteName string, vpnSiteParameters VPNSite, options *VPNSitesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "VPNSitesClient.BeginCreateOrUpdate" @@ -113,7 +113,7 @@ func (client *VPNSitesClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, vpnSiteParameters); err != nil { @@ -125,7 +125,7 @@ func (client *VPNSitesClient) createOrUpdateCreateRequest(ctx context.Context, r // BeginDelete - Deletes a VpnSite. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the VpnSite. // - vpnSiteName - The name of the VpnSite being deleted. // - options - VPNSitesClientBeginDeleteOptions contains the optional parameters for the VPNSitesClient.BeginDelete method. @@ -147,7 +147,7 @@ func (client *VPNSitesClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Deletes a VpnSite. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VPNSitesClient) deleteOperation(ctx context.Context, resourceGroupName string, vpnSiteName string, options *VPNSitesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VPNSitesClient.BeginDelete" @@ -189,7 +189,7 @@ func (client *VPNSitesClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -198,7 +198,7 @@ func (client *VPNSitesClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Retrieves the details of a VPN site. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the VpnSite. // - vpnSiteName - The name of the VpnSite being retrieved. // - options - VPNSitesClientGetOptions contains the optional parameters for the VPNSitesClient.Get method. @@ -244,7 +244,7 @@ func (client *VPNSitesClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -261,7 +261,7 @@ func (client *VPNSitesClient) getHandleResponse(resp *http.Response) (VPNSitesCl // NewListPager - Lists all the VpnSites in a subscription. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - options - VPNSitesClientListOptions contains the optional parameters for the VPNSitesClient.NewListPager method. func (client *VPNSitesClient) NewListPager(options *VPNSitesClientListOptions) *runtime.Pager[VPNSitesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[VPNSitesClientListResponse]{ @@ -305,7 +305,7 @@ func (client *VPNSitesClient) listCreateRequest(ctx context.Context, options *VP return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -322,7 +322,7 @@ func (client *VPNSitesClient) listHandleResponse(resp *http.Response) (VPNSitesC // NewListByResourceGroupPager - Lists all the vpnSites in a resource group. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the VpnSite. // - options - VPNSitesClientListByResourceGroupOptions contains the optional parameters for the VPNSitesClient.NewListByResourceGroupPager // method. @@ -372,7 +372,7 @@ func (client *VPNSitesClient) listByResourceGroupCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -390,7 +390,7 @@ func (client *VPNSitesClient) listByResourceGroupHandleResponse(resp *http.Respo // UpdateTags - Updates VpnSite tags. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name of the VpnSite. // - vpnSiteName - The name of the VpnSite being updated. // - vpnSiteParameters - Parameters supplied to update VpnSite tags. @@ -437,7 +437,7 @@ func (client *VPNSitesClient) updateTagsCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, vpnSiteParameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/vpnsites_client_example_test.go b/sdk/resourcemanager/network/armnetwork/vpnsites_client_example_test.go deleted file mode 100644 index adf4408ba45f..000000000000 --- a/sdk/resourcemanager/network/armnetwork/vpnsites_client_example_test.go +++ /dev/null @@ -1,462 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VpnSiteGet.json -func ExampleVPNSitesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVPNSitesClient().Get(ctx, "rg1", "vpnSite1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VPNSite = armnetwork.VPNSite{ - // Name: to.Ptr("vpnSite1"), - // Type: to.Ptr("Microsoft.Network/vpnSites"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNSiteProperties{ - // AddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/16")}, - // }, - // DeviceProperties: &armnetwork.DeviceProperties{ - // LinkSpeedInMbps: to.Ptr[int32](0), - // }, - // IsSecuritySite: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualWan: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualWANs/wan1"), - // }, - // VPNSiteLinks: []*armnetwork.VPNSiteLink{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/vpnSiteLink1"), - // Name: to.Ptr("vpnSiteLink1"), - // Type: to.Ptr("Microsoft.Network/vpnSites/vpnSiteLinks"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.VPNSiteLinkProperties{ - // BgpProperties: &armnetwork.VPNLinkBgpSettings{ - // Asn: to.Ptr[int64](1234), - // BgpPeeringAddress: to.Ptr("192.168.0.0"), - // }, - // IPAddress: to.Ptr("50.50.50.56"), - // LinkProperties: &armnetwork.VPNLinkProviderProperties{ - // LinkProviderName: to.Ptr("vendor1"), - // LinkSpeedInMbps: to.Ptr[int32](0), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VpnSitePut.json -func ExampleVPNSitesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVPNSitesClient().BeginCreateOrUpdate(ctx, "rg1", "vpnSite1", armnetwork.VPNSite{ - Location: to.Ptr("West US"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, - Properties: &armnetwork.VPNSiteProperties{ - AddressSpace: &armnetwork.AddressSpace{ - AddressPrefixes: []*string{ - to.Ptr("10.0.0.0/16")}, - }, - IsSecuritySite: to.Ptr(false), - O365Policy: &armnetwork.O365PolicyProperties{ - BreakOutCategories: &armnetwork.O365BreakOutCategoryPolicies{ - Default: to.Ptr(false), - Allow: to.Ptr(true), - Optimize: to.Ptr(true), - }, - }, - VirtualWan: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualWANs/wan1"), - }, - VPNSiteLinks: []*armnetwork.VPNSiteLink{ - { - Name: to.Ptr("vpnSiteLink1"), - Properties: &armnetwork.VPNSiteLinkProperties{ - BgpProperties: &armnetwork.VPNLinkBgpSettings{ - Asn: to.Ptr[int64](1234), - BgpPeeringAddress: to.Ptr("192.168.0.0"), - }, - Fqdn: to.Ptr("link1.vpnsite1.contoso.com"), - IPAddress: to.Ptr("50.50.50.56"), - LinkProperties: &armnetwork.VPNLinkProviderProperties{ - LinkProviderName: to.Ptr("vendor1"), - LinkSpeedInMbps: to.Ptr[int32](0), - }, - }, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VPNSite = armnetwork.VPNSite{ - // Name: to.Ptr("vpnSite1"), - // Type: to.Ptr("Microsoft.Network/vpnSites"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNSiteProperties{ - // AddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/16")}, - // }, - // DeviceProperties: &armnetwork.DeviceProperties{ - // LinkSpeedInMbps: to.Ptr[int32](0), - // }, - // IsSecuritySite: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualWan: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualWANs/wan1"), - // }, - // VPNSiteLinks: []*armnetwork.VPNSiteLink{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/vpnSiteLink1"), - // Name: to.Ptr("vpnSiteLink1"), - // Type: to.Ptr("Microsoft.Network/vpnSites/vpnSiteLinks"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.VPNSiteLinkProperties{ - // BgpProperties: &armnetwork.VPNLinkBgpSettings{ - // Asn: to.Ptr[int64](1234), - // BgpPeeringAddress: to.Ptr("192.168.0.0"), - // }, - // IPAddress: to.Ptr("50.50.50.56"), - // LinkProperties: &armnetwork.VPNLinkProviderProperties{ - // LinkProviderName: to.Ptr("vendor1"), - // LinkSpeedInMbps: to.Ptr[int32](0), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VpnSiteUpdateTags.json -func ExampleVPNSitesClient_UpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVPNSitesClient().UpdateTags(ctx, "rg1", "vpnSite1", armnetwork.TagsObject{ - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - "key2": to.Ptr("value2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VPNSite = armnetwork.VPNSite{ - // Name: to.Ptr("vpnSite1"), - // Type: to.Ptr("Microsoft.Network/vpnSites"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNSiteProperties{ - // AddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/16")}, - // }, - // BgpProperties: &armnetwork.BgpSettings{ - // Asn: to.Ptr[int64](1234), - // BgpPeeringAddress: to.Ptr("192.168.0.0"), - // }, - // DeviceProperties: &armnetwork.DeviceProperties{ - // DeviceModel: to.Ptr("model01"), - // DeviceVendor: to.Ptr("vendor1"), - // LinkSpeedInMbps: to.Ptr[int32](200), - // }, - // IPAddress: to.Ptr("10.0.0.0"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualWan: &armnetwork.SubResource{ - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VpnSiteDelete.json -func ExampleVPNSitesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVPNSitesClient().BeginDelete(ctx, "rg1", "vpnSite1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VpnSiteListByResourceGroup.json -func ExampleVPNSitesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVPNSitesClient().NewListByResourceGroupPager("rg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ListVPNSitesResult = armnetwork.ListVPNSitesResult{ - // Value: []*armnetwork.VPNSite{ - // { - // Name: to.Ptr("vpnSite1"), - // Type: to.Ptr("Microsoft.Network/vpnSites"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNSiteProperties{ - // AddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/16")}, - // }, - // DeviceProperties: &armnetwork.DeviceProperties{ - // LinkSpeedInMbps: to.Ptr[int32](0), - // }, - // IsSecuritySite: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualWan: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualWANs/wan1"), - // }, - // VPNSiteLinks: []*armnetwork.VPNSiteLink{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/vpnSiteLink1"), - // Name: to.Ptr("vpnSiteLink1"), - // Type: to.Ptr("Microsoft.Network/vpnSites/vpnSiteLinks"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.VPNSiteLinkProperties{ - // BgpProperties: &armnetwork.VPNLinkBgpSettings{ - // Asn: to.Ptr[int64](1234), - // BgpPeeringAddress: to.Ptr("192.168.0.0"), - // }, - // IPAddress: to.Ptr("50.50.50.56"), - // LinkProperties: &armnetwork.VPNLinkProviderProperties{ - // LinkSpeedInMbps: to.Ptr[int32](0), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // }, - // }, - // { - // Name: to.Ptr("vpnSite2"), - // Type: to.Ptr("Microsoft.Network/vpnSites"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite2"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNSiteProperties{ - // AddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/16")}, - // }, - // BgpProperties: &armnetwork.BgpSettings{ - // Asn: to.Ptr[int64](1234), - // BgpPeeringAddress: to.Ptr("192.168.0.0"), - // }, - // DeviceProperties: &armnetwork.DeviceProperties{ - // DeviceModel: to.Ptr("model01"), - // DeviceVendor: to.Ptr("vendor1"), - // LinkSpeedInMbps: to.Ptr[int32](200), - // }, - // IPAddress: to.Ptr("10.1.0.0"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualWan: &armnetwork.SubResource{ - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VpnSiteList.json -func ExampleVPNSitesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVPNSitesClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ListVPNSitesResult = armnetwork.ListVPNSitesResult{ - // Value: []*armnetwork.VPNSite{ - // { - // Name: to.Ptr("vpnSite1"), - // Type: to.Ptr("Microsoft.Network/vpnSites"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNSiteProperties{ - // AddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/16")}, - // }, - // DeviceProperties: &armnetwork.DeviceProperties{ - // LinkSpeedInMbps: to.Ptr[int32](0), - // }, - // IsSecuritySite: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualWan: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualWANs/wan1"), - // }, - // VPNSiteLinks: []*armnetwork.VPNSiteLink{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/vpnSiteLink1"), - // Name: to.Ptr("vpnSiteLink1"), - // Type: to.Ptr("Microsoft.Network/vpnSites/vpnSiteLinks"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.VPNSiteLinkProperties{ - // BgpProperties: &armnetwork.VPNLinkBgpSettings{ - // Asn: to.Ptr[int64](1234), - // BgpPeeringAddress: to.Ptr("192.168.0.0"), - // }, - // IPAddress: to.Ptr("50.50.50.56"), - // LinkProperties: &armnetwork.VPNLinkProviderProperties{ - // LinkSpeedInMbps: to.Ptr[int32](0), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // }, - // }, - // { - // Name: to.Ptr("vpnSite2"), - // Type: to.Ptr("Microsoft.Network/vpnSites"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/vpnSites/vpnSite2"), - // Location: to.Ptr("East US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.VPNSiteProperties{ - // AddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/16")}, - // }, - // BgpProperties: &armnetwork.BgpSettings{ - // Asn: to.Ptr[int64](1234), - // BgpPeeringAddress: to.Ptr("192.168.0.0"), - // }, - // DeviceProperties: &armnetwork.DeviceProperties{ - // DeviceModel: to.Ptr("model01"), - // DeviceVendor: to.Ptr("vendor1"), - // LinkSpeedInMbps: to.Ptr[int32](200), - // }, - // IPAddress: to.Ptr("10.1.0.0"), - // IsSecuritySite: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualWan: &armnetwork.SubResource{ - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/vpnsitesconfiguration_client.go b/sdk/resourcemanager/network/armnetwork/vpnsitesconfiguration_client.go index d70f77ee3711..0314d820c386 100644 --- a/sdk/resourcemanager/network/armnetwork/vpnsitesconfiguration_client.go +++ b/sdk/resourcemanager/network/armnetwork/vpnsitesconfiguration_client.go @@ -47,7 +47,7 @@ func NewVPNSitesConfigurationClient(subscriptionID string, credential azcore.Tok // BeginDownload - Gives the sas-url to download the configurations for vpn-sites in a resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The resource group name. // - virtualWANName - The name of the VirtualWAN for which configuration of all vpn-sites is needed. // - request - Parameters supplied to download vpn-sites configuration. @@ -71,7 +71,7 @@ func (client *VPNSitesConfigurationClient) BeginDownload(ctx context.Context, re // Download - Gives the sas-url to download the configurations for vpn-sites in a resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *VPNSitesConfigurationClient) download(ctx context.Context, resourceGroupName string, virtualWANName string, request GetVPNSitesConfigurationRequest, options *VPNSitesConfigurationClientBeginDownloadOptions) (*http.Response, error) { var err error const operationName = "VPNSitesConfigurationClient.BeginDownload" @@ -113,7 +113,7 @@ func (client *VPNSitesConfigurationClient) downloadCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, request); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/vpnsitesconfiguration_client_example_test.go b/sdk/resourcemanager/network/armnetwork/vpnsitesconfiguration_client_example_test.go deleted file mode 100644 index a6cae55464ca..000000000000 --- a/sdk/resourcemanager/network/armnetwork/vpnsitesconfiguration_client_example_test.go +++ /dev/null @@ -1,44 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/VpnSitesConfigurationDownload.json -func ExampleVPNSitesConfigurationClient_BeginDownload() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVPNSitesConfigurationClient().BeginDownload(ctx, "rg1", "wan1", armnetwork.GetVPNSitesConfigurationRequest{ - OutputBlobSasURL: to.Ptr("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"), - VPNSites: []*string{ - to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/abc")}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/network/armnetwork/watchers_client.go b/sdk/resourcemanager/network/armnetwork/watchers_client.go index 006cf4425501..2017388dfe6b 100644 --- a/sdk/resourcemanager/network/armnetwork/watchers_client.go +++ b/sdk/resourcemanager/network/armnetwork/watchers_client.go @@ -48,7 +48,7 @@ func NewWatchersClient(subscriptionID string, credential azcore.TokenCredential, // endpoint including another VM or an arbitrary remote server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the network watcher resource group. // - networkWatcherName - The name of the network watcher resource. // - parameters - Parameters that determine how the connectivity check will be performed. @@ -73,7 +73,7 @@ func (client *WatchersClient) BeginCheckConnectivity(ctx context.Context, resour // endpoint including another VM or an arbitrary remote server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *WatchersClient) checkConnectivity(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters ConnectivityParameters, options *WatchersClientBeginCheckConnectivityOptions) (*http.Response, error) { var err error const operationName = "WatchersClient.BeginCheckConnectivity" @@ -115,7 +115,7 @@ func (client *WatchersClient) checkConnectivityCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -127,7 +127,7 @@ func (client *WatchersClient) checkConnectivityCreateRequest(ctx context.Context // CreateOrUpdate - Creates or updates a network watcher in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkWatcherName - The name of the network watcher. // - parameters - Parameters that define the network watcher resource. @@ -174,7 +174,7 @@ func (client *WatchersClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -195,7 +195,7 @@ func (client *WatchersClient) createOrUpdateHandleResponse(resp *http.Response) // BeginDelete - Deletes the specified network watcher resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkWatcherName - The name of the network watcher. // - options - WatchersClientBeginDeleteOptions contains the optional parameters for the WatchersClient.BeginDelete method. @@ -217,7 +217,7 @@ func (client *WatchersClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Deletes the specified network watcher resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *WatchersClient) deleteOperation(ctx context.Context, resourceGroupName string, networkWatcherName string, options *WatchersClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "WatchersClient.BeginDelete" @@ -259,7 +259,7 @@ func (client *WatchersClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -268,7 +268,7 @@ func (client *WatchersClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Gets the specified network watcher by resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkWatcherName - The name of the network watcher. // - options - WatchersClientGetOptions contains the optional parameters for the WatchersClient.Get method. @@ -314,7 +314,7 @@ func (client *WatchersClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -333,7 +333,7 @@ func (client *WatchersClient) getHandleResponse(resp *http.Response) (WatchersCl // the relative latency score for internet service providers from a specified location to Azure regions. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the network watcher resource group. // - networkWatcherName - The name of the network watcher resource. // - parameters - Parameters that determine Azure reachability report configuration. @@ -358,7 +358,7 @@ func (client *WatchersClient) BeginGetAzureReachabilityReport(ctx context.Contex // relative latency score for internet service providers from a specified location to Azure regions. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *WatchersClient) getAzureReachabilityReport(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters AzureReachabilityReportParameters, options *WatchersClientBeginGetAzureReachabilityReportOptions) (*http.Response, error) { var err error const operationName = "WatchersClient.BeginGetAzureReachabilityReport" @@ -400,7 +400,7 @@ func (client *WatchersClient) getAzureReachabilityReportCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -412,7 +412,7 @@ func (client *WatchersClient) getAzureReachabilityReportCreateRequest(ctx contex // BeginGetFlowLogStatus - Queries status of flow log and traffic analytics (optional) on a specified resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the network watcher resource group. // - networkWatcherName - The name of the network watcher resource. // - parameters - Parameters that define a resource to query flow log and traffic analytics (optional) status. @@ -436,7 +436,7 @@ func (client *WatchersClient) BeginGetFlowLogStatus(ctx context.Context, resourc // GetFlowLogStatus - Queries status of flow log and traffic analytics (optional) on a specified resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *WatchersClient) getFlowLogStatus(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters FlowLogStatusParameters, options *WatchersClientBeginGetFlowLogStatusOptions) (*http.Response, error) { var err error const operationName = "WatchersClient.BeginGetFlowLogStatus" @@ -478,7 +478,7 @@ func (client *WatchersClient) getFlowLogStatusCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -494,7 +494,7 @@ func (client *WatchersClient) getFlowLogStatusCreateRequest(ctx context.Context, // the specified flow and the evaluation results. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkWatcherName - The name of the network watcher. // - parameters - Parameters to get network configuration diagnostic. @@ -522,7 +522,7 @@ func (client *WatchersClient) BeginGetNetworkConfigurationDiagnostic(ctx context // the specified flow and the evaluation results. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *WatchersClient) getNetworkConfigurationDiagnostic(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters ConfigurationDiagnosticParameters, options *WatchersClientBeginGetNetworkConfigurationDiagnosticOptions) (*http.Response, error) { var err error const operationName = "WatchersClient.BeginGetNetworkConfigurationDiagnostic" @@ -564,7 +564,7 @@ func (client *WatchersClient) getNetworkConfigurationDiagnosticCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -576,7 +576,7 @@ func (client *WatchersClient) getNetworkConfigurationDiagnosticCreateRequest(ctx // BeginGetNextHop - Gets the next hop from the specified VM. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkWatcherName - The name of the network watcher. // - parameters - Parameters that define the source and destination endpoint. @@ -600,7 +600,7 @@ func (client *WatchersClient) BeginGetNextHop(ctx context.Context, resourceGroup // GetNextHop - Gets the next hop from the specified VM. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *WatchersClient) getNextHop(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters NextHopParameters, options *WatchersClientBeginGetNextHopOptions) (*http.Response, error) { var err error const operationName = "WatchersClient.BeginGetNextHop" @@ -642,7 +642,7 @@ func (client *WatchersClient) getNextHopCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -654,7 +654,7 @@ func (client *WatchersClient) getNextHopCreateRequest(ctx context.Context, resou // GetTopology - Gets the current network topology by resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkWatcherName - The name of the network watcher. // - parameters - Parameters that define the representation of topology. @@ -701,7 +701,7 @@ func (client *WatchersClient) getTopologyCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -722,7 +722,7 @@ func (client *WatchersClient) getTopologyHandleResponse(resp *http.Response) (Wa // BeginGetTroubleshooting - Initiate troubleshooting on a specified resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkWatcherName - The name of the network watcher resource. // - parameters - Parameters that define the resource to troubleshoot. @@ -746,7 +746,7 @@ func (client *WatchersClient) BeginGetTroubleshooting(ctx context.Context, resou // GetTroubleshooting - Initiate troubleshooting on a specified resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *WatchersClient) getTroubleshooting(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters TroubleshootingParameters, options *WatchersClientBeginGetTroubleshootingOptions) (*http.Response, error) { var err error const operationName = "WatchersClient.BeginGetTroubleshooting" @@ -788,7 +788,7 @@ func (client *WatchersClient) getTroubleshootingCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -800,7 +800,7 @@ func (client *WatchersClient) getTroubleshootingCreateRequest(ctx context.Contex // BeginGetTroubleshootingResult - Get the last completed troubleshooting result on a specified resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkWatcherName - The name of the network watcher resource. // - parameters - Parameters that define the resource to query the troubleshooting result. @@ -824,7 +824,7 @@ func (client *WatchersClient) BeginGetTroubleshootingResult(ctx context.Context, // GetTroubleshootingResult - Get the last completed troubleshooting result on a specified resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *WatchersClient) getTroubleshootingResult(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters QueryTroubleshootingParameters, options *WatchersClientBeginGetTroubleshootingResultOptions) (*http.Response, error) { var err error const operationName = "WatchersClient.BeginGetTroubleshootingResult" @@ -866,7 +866,7 @@ func (client *WatchersClient) getTroubleshootingResultCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -878,7 +878,7 @@ func (client *WatchersClient) getTroubleshootingResultCreateRequest(ctx context. // BeginGetVMSecurityRules - Gets the configured and effective security group rules on the specified VM. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkWatcherName - The name of the network watcher. // - parameters - Parameters that define the VM to check security groups for. @@ -902,7 +902,7 @@ func (client *WatchersClient) BeginGetVMSecurityRules(ctx context.Context, resou // GetVMSecurityRules - Gets the configured and effective security group rules on the specified VM. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *WatchersClient) getVMSecurityRules(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters SecurityGroupViewParameters, options *WatchersClientBeginGetVMSecurityRulesOptions) (*http.Response, error) { var err error const operationName = "WatchersClient.BeginGetVMSecurityRules" @@ -944,7 +944,7 @@ func (client *WatchersClient) getVMSecurityRulesCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -955,7 +955,7 @@ func (client *WatchersClient) getVMSecurityRulesCreateRequest(ctx context.Contex // NewListPager - Gets all network watchers by resource group. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - options - WatchersClientListOptions contains the optional parameters for the WatchersClient.NewListPager method. func (client *WatchersClient) NewListPager(resourceGroupName string, options *WatchersClientListOptions) *runtime.Pager[WatchersClientListResponse] { @@ -998,7 +998,7 @@ func (client *WatchersClient) listCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1015,7 +1015,7 @@ func (client *WatchersClient) listHandleResponse(resp *http.Response) (WatchersC // NewListAllPager - Gets all network watchers by subscription. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - options - WatchersClientListAllOptions contains the optional parameters for the WatchersClient.NewListAllPager method. func (client *WatchersClient) NewListAllPager(options *WatchersClientListAllOptions) *runtime.Pager[WatchersClientListAllResponse] { return runtime.NewPager(runtime.PagingHandler[WatchersClientListAllResponse]{ @@ -1053,7 +1053,7 @@ func (client *WatchersClient) listAllCreateRequest(ctx context.Context, options return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1072,7 +1072,7 @@ func (client *WatchersClient) listAllHandleResponse(resp *http.Response) (Watche // available internet service providers for a specified Azure region. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the network watcher resource group. // - networkWatcherName - The name of the network watcher resource. // - parameters - Parameters that scope the list of available providers. @@ -1097,7 +1097,7 @@ func (client *WatchersClient) BeginListAvailableProviders(ctx context.Context, r // internet service providers for a specified Azure region. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *WatchersClient) listAvailableProviders(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters AvailableProvidersListParameters, options *WatchersClientBeginListAvailableProvidersOptions) (*http.Response, error) { var err error const operationName = "WatchersClient.BeginListAvailableProviders" @@ -1139,7 +1139,7 @@ func (client *WatchersClient) listAvailableProvidersCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -1151,7 +1151,7 @@ func (client *WatchersClient) listAvailableProvidersCreateRequest(ctx context.Co // BeginSetFlowLogConfiguration - Configures flow log and traffic analytics (optional) on a specified resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the network watcher resource group. // - networkWatcherName - The name of the network watcher resource. // - parameters - Parameters that define the configuration of flow log. @@ -1175,7 +1175,7 @@ func (client *WatchersClient) BeginSetFlowLogConfiguration(ctx context.Context, // SetFlowLogConfiguration - Configures flow log and traffic analytics (optional) on a specified resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *WatchersClient) setFlowLogConfiguration(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters FlowLogInformation, options *WatchersClientBeginSetFlowLogConfigurationOptions) (*http.Response, error) { var err error const operationName = "WatchersClient.BeginSetFlowLogConfiguration" @@ -1217,7 +1217,7 @@ func (client *WatchersClient) setFlowLogConfigurationCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -1229,7 +1229,7 @@ func (client *WatchersClient) setFlowLogConfigurationCreateRequest(ctx context.C // UpdateTags - Updates a network watcher tags. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkWatcherName - The name of the network watcher. // - parameters - Parameters supplied to update network watcher tags. @@ -1276,7 +1276,7 @@ func (client *WatchersClient) updateTagsCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -1297,7 +1297,7 @@ func (client *WatchersClient) updateTagsHandleResponse(resp *http.Response) (Wat // BeginVerifyIPFlow - Verify IP flow from the specified VM to a location given the currently configured NSG rules. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - networkWatcherName - The name of the network watcher. // - parameters - Parameters that define the IP flow to be verified. @@ -1321,7 +1321,7 @@ func (client *WatchersClient) BeginVerifyIPFlow(ctx context.Context, resourceGro // VerifyIPFlow - Verify IP flow from the specified VM to a location given the currently configured NSG rules. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *WatchersClient) verifyIPFlow(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters VerificationIPFlowParameters, options *WatchersClientBeginVerifyIPFlowOptions) (*http.Response, error) { var err error const operationName = "WatchersClient.BeginVerifyIPFlow" @@ -1363,7 +1363,7 @@ func (client *WatchersClient) verifyIPFlowCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/watchers_client_example_test.go b/sdk/resourcemanager/network/armnetwork/watchers_client_example_test.go deleted file mode 100644 index 37580daedc87..000000000000 --- a/sdk/resourcemanager/network/armnetwork/watchers_client_example_test.go +++ /dev/null @@ -1,909 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkWatcherCreate.json -func ExampleWatchersClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWatchersClient().CreateOrUpdate(ctx, "rg1", "nw1", armnetwork.Watcher{ - Location: to.Ptr("eastus"), - Properties: &armnetwork.WatcherPropertiesFormat{}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Watcher = armnetwork.Watcher{ - // Name: to.Ptr("nw1"), - // Type: to.Ptr("Microsoft.Network/networkWatchers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // }, - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.WatcherPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkWatcherGet.json -func ExampleWatchersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWatchersClient().Get(ctx, "rg1", "nw1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Watcher = armnetwork.Watcher{ - // Name: to.Ptr("nw1"), - // Type: to.Ptr("Microsoft.Network/networkWatchers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // }, - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.WatcherPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkWatcherDelete.json -func ExampleWatchersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewWatchersClient().BeginDelete(ctx, "rg1", "nw1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkWatcherUpdateTags.json -func ExampleWatchersClient_UpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWatchersClient().UpdateTags(ctx, "rg1", "nw1", armnetwork.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Watcher = armnetwork.Watcher{ - // Name: to.Ptr("nw1"), - // Type: to.Ptr("Microsoft.Network/networkWatchers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.WatcherPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkWatcherList.json -func ExampleWatchersClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewWatchersClient().NewListPager("rg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.WatcherListResult = armnetwork.WatcherListResult{ - // Value: []*armnetwork.Watcher{ - // { - // Name: to.Ptr("nw1"), - // Type: to.Ptr("Microsoft.Network/networkWatchers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // }, - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.WatcherPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }, - // { - // Name: to.Ptr("nw2"), - // Type: to.Ptr("Microsoft.Network/networkWatchers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw2"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // }, - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.WatcherPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkWatcherListAll.json -func ExampleWatchersClient_NewListAllPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewWatchersClient().NewListAllPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.WatcherListResult = armnetwork.WatcherListResult{ - // Value: []*armnetwork.Watcher{ - // { - // Name: to.Ptr("nw1"), - // Type: to.Ptr("Microsoft.Network/networkWatchers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // }, - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.WatcherPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }, - // { - // Name: to.Ptr("nw2"), - // Type: to.Ptr("Microsoft.Network/networkWatchers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw2"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // }, - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.WatcherPropertiesFormat{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkWatcherTopologyGet.json -func ExampleWatchersClient_GetTopology() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWatchersClient().GetTopology(ctx, "rg1", "nw1", armnetwork.TopologyParameters{ - TargetResourceGroupName: to.Ptr("rg2"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Topology = armnetwork.Topology{ - // CreatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-02T19:31:55.9461781Z"); return t}()), - // ID: to.Ptr("ce592f46-8164-4bf2-ad36-b8e4acf6fb68"), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-27T00:00:13.2005337Z"); return t}()), - // Resources: []*armnetwork.TopologyResource{ - // { - // Name: to.Ptr("MultiTierApp0"), - // Associations: []*armnetwork.TopologyAssociation{ - // { - // Name: to.Ptr("appNic0"), - // AssociationType: to.Ptr(armnetwork.AssociationTypeContains), - // ResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/networkInterfaces/appNic0"), - // }, - // { - // Name: to.Ptr("appNic10"), - // AssociationType: to.Ptr(armnetwork.AssociationTypeContains), - // ResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/networkInterfaces/appNic10"), - // }}, - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/MultiTierApp0"), - // Location: to.Ptr("westus"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkWatcherIpFlowVerify.json -func ExampleWatchersClient_BeginVerifyIPFlow() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewWatchersClient().BeginVerifyIPFlow(ctx, "rg1", "nw1", armnetwork.VerificationIPFlowParameters{ - Direction: to.Ptr(armnetwork.DirectionOutbound), - LocalIPAddress: to.Ptr("10.2.0.4"), - LocalPort: to.Ptr("80"), - RemoteIPAddress: to.Ptr("121.10.1.1"), - RemotePort: to.Ptr("80"), - TargetResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1"), - Protocol: to.Ptr(armnetwork.IPFlowProtocolTCP), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VerificationIPFlowResult = armnetwork.VerificationIPFlowResult{ - // Access: to.Ptr(armnetwork.AccessAllow), - // RuleName: to.Ptr("Rule1"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkWatcherNextHopGet.json -func ExampleWatchersClient_BeginGetNextHop() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewWatchersClient().BeginGetNextHop(ctx, "rg1", "nw1", armnetwork.NextHopParameters{ - DestinationIPAddress: to.Ptr("10.0.0.10"), - SourceIPAddress: to.Ptr("10.0.0.5"), - TargetNicResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/nic1"), - TargetResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.NextHopResult = armnetwork.NextHopResult{ - // NextHopIPAddress: to.Ptr("10.0.0.1"), - // NextHopType: to.Ptr(armnetwork.NextHopTypeVnetLocal), - // RouteTableID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/routeTables/rt1"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkWatcherSecurityGroupViewGet.json -func ExampleWatchersClient_BeginGetVMSecurityRules() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewWatchersClient().BeginGetVMSecurityRules(ctx, "rg1", "nw1", armnetwork.SecurityGroupViewParameters{ - TargetResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SecurityGroupViewResult = armnetwork.SecurityGroupViewResult{ - // NetworkInterfaces: []*armnetwork.SecurityGroupNetworkInterface{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/networkInterfaces/nic1"), - // SecurityRuleAssociations: &armnetwork.SecurityRuleAssociations{ - // DefaultSecurityRules: []*armnetwork.SecurityRule{ - // { - // ID: to.Ptr("/subscriptions//resourceGroups//providers/Microsoft.Network/networkSecurityGroups//defaultSecurityRules/"), - // Name: to.Ptr("AllowVnetInBound"), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow inbound traffic from all VMs in VNET"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("VirtualNetwork"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](65000), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("VirtualNetwork"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - // }, - // }}, - // EffectiveSecurityRules: []*armnetwork.EffectiveNetworkSecurityRule{ - // { - // Name: to.Ptr("DefaultOutboundDenyAll"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessDeny), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationPortRange: to.Ptr("0-65535"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionOutbound), - // Priority: to.Ptr[int32](65500), - // SourceAddressPrefix: to.Ptr("*"), - // SourcePortRange: to.Ptr("0-65535"), - // Protocol: to.Ptr(armnetwork.EffectiveSecurityRuleProtocolAll), - // }}, - // SubnetAssociation: &armnetwork.SubnetAssociation{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // SecurityRules: []*armnetwork.SecurityRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/networkSecurityGroups/AppNSG/securityRules/fe_rule"), - // Name: to.Ptr("fe_rule"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.SecurityRulePropertiesFormat{ - // Description: to.Ptr("Allow Frontend"), - // Access: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationPortRange: to.Ptr("*"), - // Direction: to.Ptr(armnetwork.SecurityRuleDirectionInbound), - // Priority: to.Ptr[int32](100), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceAddressPrefix: to.Ptr("10.1.0.0/24"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armnetwork.SecurityRuleProtocolTCP), - // }, - // }}, - // }, - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkWatcherTroubleshootGet.json -func ExampleWatchersClient_BeginGetTroubleshooting() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewWatchersClient().BeginGetTroubleshooting(ctx, "rg1", "nw1", armnetwork.TroubleshootingParameters{ - Properties: &armnetwork.TroubleshootingProperties{ - StorageID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/st1"), - StoragePath: to.Ptr("https://st1.blob.core.windows.net/cn1"), - }, - TargetResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.TroubleshootingResult = armnetwork.TroubleshootingResult{ - // Code: to.Ptr("UnHealthy"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-01-12T00:20:09.914Z"); return t}()), - // Results: []*armnetwork.TroubleshootingDetails{ - // { - // Detail: to.Ptr("During this time S2S VPN tunnels to on premises sites or other Azure virtual networks will be disconnected"), - // ID: to.Ptr("000000"), - // ReasonType: to.Ptr("VipUnResponsive"), - // RecommendedActions: []*armnetwork.TroubleshootingRecommendedActions{ - // { - // ActionText: to.Ptr("Verify if there is a network security group (NSG) applied to the GatewaySubnet"), - // ActionURI: to.Ptr("https://docs.microsoft.com/en-us/azure/virtual-network/virtual-networks-create-nsg-arm-pportal"), - // ActionURIText: to.Ptr("Verify"), - // }, - // { - // ActionText: to.Ptr("If your VPN gateway isn't up and running by the expected resolution time, contact support"), - // ActionURI: to.Ptr("http://azure.microsoft.com/support"), - // ActionURIText: to.Ptr("contact support"), - // }}, - // Summary: to.Ptr("We are sorry, your VPN gateway is unreachable from the Internet"), - // }}, - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-01-12T00:19:47.0442834Z"); return t}()), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkWatcherTroubleshootResultQuery.json -func ExampleWatchersClient_BeginGetTroubleshootingResult() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewWatchersClient().BeginGetTroubleshootingResult(ctx, "rg1", "nw1", armnetwork.QueryTroubleshootingParameters{ - TargetResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.TroubleshootingResult = armnetwork.TroubleshootingResult{ - // Code: to.Ptr("UnHealthy"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-01-12T00:20:09.914Z"); return t}()), - // Results: []*armnetwork.TroubleshootingDetails{ - // { - // Detail: to.Ptr("During this time S2S VPN tunnels to on premises sites or other Azure virtual networks will be disconnected"), - // ID: to.Ptr("000000"), - // ReasonType: to.Ptr("VipUnResponsive"), - // RecommendedActions: []*armnetwork.TroubleshootingRecommendedActions{ - // { - // ActionText: to.Ptr("Verify if there is a network security group (NSG) applied to the GatewaySubnet"), - // ActionURI: to.Ptr("https://docs.microsoft.com/en-us/azure/virtual-network/virtual-networks-create-nsg-arm-pportal"), - // ActionURIText: to.Ptr("Verify"), - // }, - // { - // ActionText: to.Ptr("If your VPN gateway isn't up and running by the expected resolution time, contact support"), - // ActionURI: to.Ptr("http://azure.microsoft.com/support"), - // ActionURIText: to.Ptr("contact support"), - // }}, - // Summary: to.Ptr("We are sorry, your VPN gateway is unreachable from the Internet"), - // }}, - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-01-12T00:19:47.0442834Z"); return t}()), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkWatcherFlowLogConfigure.json -func ExampleWatchersClient_BeginSetFlowLogConfiguration() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewWatchersClient().BeginSetFlowLogConfiguration(ctx, "rg1", "nw1", armnetwork.FlowLogInformation{ - Properties: &armnetwork.FlowLogProperties{ - Enabled: to.Ptr(true), - StorageID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/st1"), - }, - TargetResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.FlowLogInformation = armnetwork.FlowLogInformation{ - // Properties: &armnetwork.FlowLogProperties{ - // Enabled: to.Ptr(true), - // StorageID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/st1"), - // }, - // TargetResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkWatcherFlowLogStatusQuery.json -func ExampleWatchersClient_BeginGetFlowLogStatus() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewWatchersClient().BeginGetFlowLogStatus(ctx, "rg1", "nw1", armnetwork.FlowLogStatusParameters{ - TargetResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.FlowLogInformation = armnetwork.FlowLogInformation{ - // Properties: &armnetwork.FlowLogProperties{ - // Enabled: to.Ptr(true), - // StorageID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/st1"), - // }, - // TargetResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkWatcherConnectivityCheck.json -func ExampleWatchersClient_BeginCheckConnectivity() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewWatchersClient().BeginCheckConnectivity(ctx, "rg1", "nw1", armnetwork.ConnectivityParameters{ - Destination: &armnetwork.ConnectivityDestination{ - Address: to.Ptr("192.168.100.4"), - Port: to.Ptr[int32](3389), - }, - PreferredIPVersion: to.Ptr(armnetwork.IPVersionIPv4), - Source: &armnetwork.ConnectivitySource{ - ResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ConnectivityInformation = armnetwork.ConnectivityInformation{ - // AvgLatencyInMs: to.Ptr[int32](1), - // ConnectionStatus: to.Ptr(armnetwork.ConnectionStatusConnected), - // Hops: []*armnetwork.ConnectivityHop{ - // { - // Type: to.Ptr("Source"), - // Address: to.Ptr("10.1.1.4"), - // ID: to.Ptr("7dbbe7aa-60ba-4650-831e-63d775d38e9e"), - // Issues: []*armnetwork.ConnectivityIssue{ - // }, - // NextHopIDs: []*string{ - // to.Ptr("75c8d819-b208-4584-a311-1aa45ce753f9")}, - // ResourceID: to.Ptr("subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/networkInterfaces/nic0/ipConfigurations/ipconfig1"), - // }, - // { - // Type: to.Ptr("VirtualNetwork"), - // Address: to.Ptr("192.168.100.4"), - // ID: to.Ptr("75c8d819-b208-4584-a311-1aa45ce753f9"), - // Issues: []*armnetwork.ConnectivityIssue{ - // }, - // NextHopIDs: []*string{ - // }, - // ResourceID: to.Ptr("subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/networkInterfaces/nic1/ipConfigurations/ipconfig1"), - // }}, - // MaxLatencyInMs: to.Ptr[int32](4), - // MinLatencyInMs: to.Ptr[int32](1), - // ProbesFailed: to.Ptr[int32](0), - // ProbesSent: to.Ptr[int32](100), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkWatcherAzureReachabilityReportGet.json -func ExampleWatchersClient_BeginGetAzureReachabilityReport() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewWatchersClient().BeginGetAzureReachabilityReport(ctx, "rg1", "nw1", armnetwork.AzureReachabilityReportParameters{ - AzureLocations: []*string{ - to.Ptr("West US")}, - EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-10T00:00:00Z"); return t }()), - ProviderLocation: &armnetwork.AzureReachabilityReportLocation{ - Country: to.Ptr("United States"), - State: to.Ptr("washington"), - }, - Providers: []*string{ - to.Ptr("Frontier Communications of America, Inc. - ASN 5650")}, - StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-07T00:00:00Z"); return t }()), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AzureReachabilityReport = armnetwork.AzureReachabilityReport{ - // AggregationLevel: to.Ptr("State"), - // ProviderLocation: &armnetwork.AzureReachabilityReportLocation{ - // Country: to.Ptr("United States"), - // State: to.Ptr("washington"), - // }, - // ReachabilityReport: []*armnetwork.AzureReachabilityReportItem{ - // { - // AzureLocation: to.Ptr("West US"), - // Latencies: []*armnetwork.AzureReachabilityReportLatencyInfo{ - // { - // Score: to.Ptr[int32](94), - // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-07T00:00:00Z"); return t}()), - // }, - // { - // Score: to.Ptr[int32](94), - // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-08T00:00:00Z"); return t}()), - // }, - // { - // Score: to.Ptr[int32](94), - // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-09T00:00:00Z"); return t}()), - // }}, - // Provider: to.Ptr("Frontier Communications of America, Inc. - ASN 5650"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkWatcherAvailableProvidersListGet.json -func ExampleWatchersClient_BeginListAvailableProviders() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewWatchersClient().BeginListAvailableProviders(ctx, "rg1", "nw1", armnetwork.AvailableProvidersListParameters{ - AzureLocations: []*string{ - to.Ptr("West US")}, - City: to.Ptr("seattle"), - Country: to.Ptr("United States"), - State: to.Ptr("washington"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AvailableProvidersList = armnetwork.AvailableProvidersList{ - // Countries: []*armnetwork.AvailableProvidersListCountry{ - // { - // CountryName: to.Ptr("United States"), - // States: []*armnetwork.AvailableProvidersListState{ - // { - // Cities: []*armnetwork.AvailableProvidersListCity{ - // { - // CityName: to.Ptr("seattle"), - // Providers: []*string{ - // to.Ptr("Comcast Cable Communications, Inc. - ASN 7922"), - // to.Ptr("Comcast Cable Communications, LLC - ASN 7922"), - // to.Ptr("Level 3 Communications, Inc. (GBLX) - ASN 3549"), - // to.Ptr("Qwest Communications Company, LLC - ASN 209")}, - // }}, - // StateName: to.Ptr("washington"), - // }}, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/NetworkWatcherNetworkConfigurationDiagnostic.json -func ExampleWatchersClient_BeginGetNetworkConfigurationDiagnostic() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewWatchersClient().BeginGetNetworkConfigurationDiagnostic(ctx, "rg1", "nw1", armnetwork.ConfigurationDiagnosticParameters{ - Profiles: []*armnetwork.ConfigurationDiagnosticProfile{ - { - Destination: to.Ptr("12.11.12.14"), - DestinationPort: to.Ptr("12100"), - Direction: to.Ptr(armnetwork.DirectionInbound), - Source: to.Ptr("10.1.0.4"), - Protocol: to.Ptr("TCP"), - }}, - TargetResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ConfigurationDiagnosticResponse = armnetwork.ConfigurationDiagnosticResponse{ - // Results: []*armnetwork.ConfigurationDiagnosticResult{ - // { - // NetworkSecurityGroupResult: &armnetwork.SecurityGroupResult{ - // EvaluatedNetworkSecurityGroups: []*armnetwork.EvaluatedNetworkSecurityGroup{ - // { - // AppliedTo: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/vnet/subnets/AppSubnet"), - // MatchedRule: &armnetwork.MatchedRule{ - // Action: to.Ptr("Allow"), - // RuleName: to.Ptr("UserRule_fe_rule"), - // }, - // NetworkSecurityGroupID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/networkSecurityGroups/nsg1"), - // RulesEvaluationResult: []*armnetwork.SecurityRulesEvaluationResult{ - // { - // Name: to.Ptr("UserRule_Cleanuptool-Allow-100"), - // DestinationMatched: to.Ptr(true), - // DestinationPortMatched: to.Ptr(false), - // ProtocolMatched: to.Ptr(true), - // SourceMatched: to.Ptr(false), - // SourcePortMatched: to.Ptr(true), - // }, - // { - // Name: to.Ptr("UserRule_Cleanuptool-Allow-101"), - // DestinationMatched: to.Ptr(true), - // DestinationPortMatched: to.Ptr(false), - // ProtocolMatched: to.Ptr(true), - // SourceMatched: to.Ptr(true), - // SourcePortMatched: to.Ptr(true), - // }, - // { - // Name: to.Ptr("UserRule_Cleanuptool-Allow-102"), - // DestinationMatched: to.Ptr(true), - // DestinationPortMatched: to.Ptr(false), - // ProtocolMatched: to.Ptr(true), - // SourceMatched: to.Ptr(false), - // SourcePortMatched: to.Ptr(true), - // }, - // { - // Name: to.Ptr("UserRule_Cleanuptool-Deny-103"), - // DestinationMatched: to.Ptr(true), - // DestinationPortMatched: to.Ptr(false), - // ProtocolMatched: to.Ptr(true), - // SourceMatched: to.Ptr(true), - // SourcePortMatched: to.Ptr(true), - // }, - // { - // Name: to.Ptr("UserRule_fe_rule"), - // DestinationMatched: to.Ptr(true), - // DestinationPortMatched: to.Ptr(true), - // ProtocolMatched: to.Ptr(true), - // SourceMatched: to.Ptr(true), - // SourcePortMatched: to.Ptr(true), - // }}, - // }, - // { - // AppliedTo: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/vnet/networkInterfaces/nic"), - // MatchedRule: &armnetwork.MatchedRule{ - // Action: to.Ptr("Allow"), - // RuleName: to.Ptr("UserRule_fe_rule"), - // }, - // NetworkSecurityGroupID: to.Ptr("/subscriptions/61cc8a98-a8be-4bfe-a04e-0b461f93fe35/resourceGroups/NwRgCentralUSEUAP_copy/providers/Microsoft.Network/networkSecurityGroups/AppNSG"), - // RulesEvaluationResult: []*armnetwork.SecurityRulesEvaluationResult{ - // { - // Name: to.Ptr("UserRule_fe_rule"), - // DestinationMatched: to.Ptr(true), - // DestinationPortMatched: to.Ptr(true), - // ProtocolMatched: to.Ptr(true), - // SourceMatched: to.Ptr(true), - // SourcePortMatched: to.Ptr(true), - // }}, - // }}, - // SecurityRuleAccessResult: to.Ptr(armnetwork.SecurityRuleAccessAllow), - // }, - // Profile: &armnetwork.ConfigurationDiagnosticProfile{ - // Destination: to.Ptr("12.11.12.14"), - // DestinationPort: to.Ptr("12100"), - // Direction: to.Ptr(armnetwork.DirectionInbound), - // Source: to.Ptr("10.1.0.4"), - // Protocol: to.Ptr("TCP"), - // }, - // }}, - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/webapplicationfirewallpolicies_client.go b/sdk/resourcemanager/network/armnetwork/webapplicationfirewallpolicies_client.go index 7f2005d6788b..9a3a23fc4764 100644 --- a/sdk/resourcemanager/network/armnetwork/webapplicationfirewallpolicies_client.go +++ b/sdk/resourcemanager/network/armnetwork/webapplicationfirewallpolicies_client.go @@ -47,7 +47,7 @@ func NewWebApplicationFirewallPoliciesClient(subscriptionID string, credential a // CreateOrUpdate - Creates or update policy with specified rule set name within a resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - policyName - The name of the policy. // - parameters - Policy to be created. @@ -95,7 +95,7 @@ func (client *WebApplicationFirewallPoliciesClient) createOrUpdateCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -116,7 +116,7 @@ func (client *WebApplicationFirewallPoliciesClient) createOrUpdateHandleResponse // BeginDelete - Deletes Policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - policyName - The name of the policy. // - options - WebApplicationFirewallPoliciesClientBeginDeleteOptions contains the optional parameters for the WebApplicationFirewallPoliciesClient.BeginDelete @@ -139,7 +139,7 @@ func (client *WebApplicationFirewallPoliciesClient) BeginDelete(ctx context.Cont // Delete - Deletes Policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 func (client *WebApplicationFirewallPoliciesClient) deleteOperation(ctx context.Context, resourceGroupName string, policyName string, options *WebApplicationFirewallPoliciesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "WebApplicationFirewallPoliciesClient.BeginDelete" @@ -181,7 +181,7 @@ func (client *WebApplicationFirewallPoliciesClient) deleteCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -190,7 +190,7 @@ func (client *WebApplicationFirewallPoliciesClient) deleteCreateRequest(ctx cont // Get - Retrieve protection policy with specified name within a resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - policyName - The name of the policy. // - options - WebApplicationFirewallPoliciesClientGetOptions contains the optional parameters for the WebApplicationFirewallPoliciesClient.Get @@ -237,7 +237,7 @@ func (client *WebApplicationFirewallPoliciesClient) getCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -254,7 +254,7 @@ func (client *WebApplicationFirewallPoliciesClient) getHandleResponse(resp *http // NewListPager - Lists all of the protection policies within a resource group. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. // - options - WebApplicationFirewallPoliciesClientListOptions contains the optional parameters for the WebApplicationFirewallPoliciesClient.NewListPager // method. @@ -304,7 +304,7 @@ func (client *WebApplicationFirewallPoliciesClient) listCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -321,7 +321,7 @@ func (client *WebApplicationFirewallPoliciesClient) listHandleResponse(resp *htt // NewListAllPager - Gets all the WAF policies in a subscription. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - options - WebApplicationFirewallPoliciesClientListAllOptions contains the optional parameters for the WebApplicationFirewallPoliciesClient.NewListAllPager // method. func (client *WebApplicationFirewallPoliciesClient) NewListAllPager(options *WebApplicationFirewallPoliciesClientListAllOptions) *runtime.Pager[WebApplicationFirewallPoliciesClientListAllResponse] { @@ -366,7 +366,7 @@ func (client *WebApplicationFirewallPoliciesClient) listAllCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/webapplicationfirewallpolicies_client_example_test.go b/sdk/resourcemanager/network/armnetwork/webapplicationfirewallpolicies_client_example_test.go deleted file mode 100644 index 6d1a7c31daba..000000000000 --- a/sdk/resourcemanager/network/armnetwork/webapplicationfirewallpolicies_client_example_test.go +++ /dev/null @@ -1,945 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/WafListPolicies.json -func ExampleWebApplicationFirewallPoliciesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewWebApplicationFirewallPoliciesClient().NewListPager("rg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.WebApplicationFirewallPolicyListResult = armnetwork.WebApplicationFirewallPolicyListResult{ - // Value: []*armnetwork.WebApplicationFirewallPolicy{ - // { - // Name: to.Ptr("Policy1"), - // Type: to.Ptr("Microsoft.Network/applicationgatewaywebapplicationfirewallpolicies"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/Policy1"), - // Location: to.Ptr("WestUs"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armnetwork.WebApplicationFirewallPolicyPropertiesFormat{ - // CustomRules: []*armnetwork.WebApplicationFirewallCustomRule{ - // { - // Name: to.Ptr("Rule1"), - // Action: to.Ptr(armnetwork.WebApplicationFirewallActionBlock), - // MatchConditions: []*armnetwork.MatchCondition{ - // { - // MatchValues: []*string{ - // to.Ptr("192.168.1.0/24"), - // to.Ptr("10.0.0.0/24")}, - // MatchVariables: []*armnetwork.MatchVariable{ - // { - // VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariableRemoteAddr), - // }}, - // NegationConditon: to.Ptr(false), - // Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorIPMatch), - // Transforms: []*armnetwork.WebApplicationFirewallTransform{ - // }, - // }}, - // Priority: to.Ptr[int32](1), - // RuleType: to.Ptr(armnetwork.WebApplicationFirewallRuleTypeMatchRule), - // State: to.Ptr(armnetwork.WebApplicationFirewallStateEnabled), - // }, - // { - // Name: to.Ptr("Rule2"), - // Action: to.Ptr(armnetwork.WebApplicationFirewallActionBlock), - // MatchConditions: []*armnetwork.MatchCondition{ - // { - // MatchValues: []*string{ - // to.Ptr("192.168.1.0/24")}, - // MatchVariables: []*armnetwork.MatchVariable{ - // { - // VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariableRemoteAddr), - // }}, - // NegationConditon: to.Ptr(false), - // Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorIPMatch), - // }, - // { - // MatchValues: []*string{ - // to.Ptr("Windows")}, - // MatchVariables: []*armnetwork.MatchVariable{ - // { - // Selector: to.Ptr("UserAgent"), - // VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariable("RequestHeader")), - // }}, - // NegationConditon: to.Ptr(false), - // Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorContains), - // }}, - // Priority: to.Ptr[int32](2), - // RuleType: to.Ptr(armnetwork.WebApplicationFirewallRuleTypeMatchRule), - // State: to.Ptr(armnetwork.WebApplicationFirewallStateEnabled), - // }, - // { - // Name: to.Ptr("RateLimitRule3"), - // Action: to.Ptr(armnetwork.WebApplicationFirewallActionBlock), - // GroupByUserSession: []*armnetwork.GroupByUserSession{ - // { - // GroupByVariables: []*armnetwork.GroupByVariable{ - // { - // VariableName: to.Ptr(armnetwork.ApplicationGatewayFirewallUserSessionVariableClientAddr), - // }}, - // }}, - // MatchConditions: []*armnetwork.MatchCondition{ - // { - // MatchValues: []*string{ - // to.Ptr("192.168.1.0/24"), - // to.Ptr("10.0.0.0/24")}, - // MatchVariables: []*armnetwork.MatchVariable{ - // { - // VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariableRemoteAddr), - // }}, - // NegationConditon: to.Ptr(true), - // Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorIPMatch), - // }}, - // Priority: to.Ptr[int32](3), - // RateLimitDuration: to.Ptr(armnetwork.ApplicationGatewayFirewallRateLimitDurationOneMin), - // RateLimitThreshold: to.Ptr[int32](10), - // RuleType: to.Ptr(armnetwork.WebApplicationFirewallRuleTypeRateLimitRule), - // }}, - // ManagedRules: &armnetwork.ManagedRulesDefinition{ - // ManagedRuleSets: []*armnetwork.ManagedRuleSet{ - // { - // RuleSetType: to.Ptr("OWASP"), - // RuleSetVersion: to.Ptr("3.2"), - // }}, - // }, - // PolicySettings: &armnetwork.PolicySettings{ - // CustomBlockResponseBody: to.Ptr("SGVsbG8="), - // CustomBlockResponseStatusCode: to.Ptr[int32](405), - // FileUploadEnforcement: to.Ptr(true), - // FileUploadLimitInMb: to.Ptr[int32](4000), - // LogScrubbing: &armnetwork.PolicySettingsLogScrubbing{ - // ScrubbingRules: []*armnetwork.WebApplicationFirewallScrubbingRules{ - // { - // MatchVariable: to.Ptr(armnetwork.ScrubbingRuleEntryMatchVariableRequestArgNames), - // Selector: to.Ptr("test"), - // SelectorMatchOperator: to.Ptr(armnetwork.ScrubbingRuleEntryMatchOperatorEquals), - // State: to.Ptr(armnetwork.ScrubbingRuleEntryStateEnabled), - // }, - // { - // MatchVariable: to.Ptr(armnetwork.ScrubbingRuleEntryMatchVariableRequestIPAddress), - // SelectorMatchOperator: to.Ptr(armnetwork.ScrubbingRuleEntryMatchOperatorEqualsAny), - // State: to.Ptr(armnetwork.ScrubbingRuleEntryStateEnabled), - // }}, - // State: to.Ptr(armnetwork.WebApplicationFirewallScrubbingStateEnabled), - // }, - // MaxRequestBodySizeInKb: to.Ptr[int32](2000), - // Mode: to.Ptr(armnetwork.WebApplicationFirewallModeDetection), - // RequestBodyCheck: to.Ptr(true), - // RequestBodyEnforcement: to.Ptr(true), - // RequestBodyInspectLimitInKB: to.Ptr[int32](2000), - // State: to.Ptr(armnetwork.WebApplicationFirewallEnabledStateEnabled), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceState: to.Ptr(armnetwork.WebApplicationFirewallPolicyResourceStateEnabled), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/WafListAllPolicies.json -func ExampleWebApplicationFirewallPoliciesClient_NewListAllPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewWebApplicationFirewallPoliciesClient().NewListAllPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.WebApplicationFirewallPolicyListResult = armnetwork.WebApplicationFirewallPolicyListResult{ - // Value: []*armnetwork.WebApplicationFirewallPolicy{ - // { - // Name: to.Ptr("Policy1"), - // Type: to.Ptr("Microsoft.Network/applicationgatewaywebapplicationfirewallpolicies"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/Policy1"), - // Location: to.Ptr("WestUs"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armnetwork.WebApplicationFirewallPolicyPropertiesFormat{ - // CustomRules: []*armnetwork.WebApplicationFirewallCustomRule{ - // { - // Name: to.Ptr("Rule1"), - // Action: to.Ptr(armnetwork.WebApplicationFirewallActionBlock), - // MatchConditions: []*armnetwork.MatchCondition{ - // { - // MatchValues: []*string{ - // to.Ptr("192.168.1.0/24"), - // to.Ptr("10.0.0.0/24")}, - // MatchVariables: []*armnetwork.MatchVariable{ - // { - // VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariableRemoteAddr), - // }}, - // NegationConditon: to.Ptr(false), - // Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorIPMatch), - // Transforms: []*armnetwork.WebApplicationFirewallTransform{ - // }, - // }}, - // Priority: to.Ptr[int32](1), - // RuleType: to.Ptr(armnetwork.WebApplicationFirewallRuleTypeMatchRule), - // State: to.Ptr(armnetwork.WebApplicationFirewallStateEnabled), - // }, - // { - // Name: to.Ptr("Rule2"), - // Action: to.Ptr(armnetwork.WebApplicationFirewallActionBlock), - // MatchConditions: []*armnetwork.MatchCondition{ - // { - // MatchValues: []*string{ - // to.Ptr("192.168.1.0/24")}, - // MatchVariables: []*armnetwork.MatchVariable{ - // { - // VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariableRemoteAddr), - // }}, - // NegationConditon: to.Ptr(false), - // Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorIPMatch), - // }, - // { - // MatchValues: []*string{ - // to.Ptr("Windows")}, - // MatchVariables: []*armnetwork.MatchVariable{ - // { - // Selector: to.Ptr("UserAgent"), - // VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariable("RequestHeader")), - // }}, - // NegationConditon: to.Ptr(false), - // Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorContains), - // }}, - // Priority: to.Ptr[int32](2), - // RuleType: to.Ptr(armnetwork.WebApplicationFirewallRuleTypeMatchRule), - // State: to.Ptr(armnetwork.WebApplicationFirewallStateEnabled), - // }, - // { - // Name: to.Ptr("RateLimitRule3"), - // Action: to.Ptr(armnetwork.WebApplicationFirewallActionBlock), - // GroupByUserSession: []*armnetwork.GroupByUserSession{ - // { - // GroupByVariables: []*armnetwork.GroupByVariable{ - // { - // VariableName: to.Ptr(armnetwork.ApplicationGatewayFirewallUserSessionVariableClientAddr), - // }}, - // }}, - // MatchConditions: []*armnetwork.MatchCondition{ - // { - // MatchValues: []*string{ - // to.Ptr("192.168.1.0/24"), - // to.Ptr("10.0.0.0/24")}, - // MatchVariables: []*armnetwork.MatchVariable{ - // { - // VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariableRemoteAddr), - // }}, - // NegationConditon: to.Ptr(true), - // Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorIPMatch), - // }}, - // Priority: to.Ptr[int32](3), - // RateLimitDuration: to.Ptr(armnetwork.ApplicationGatewayFirewallRateLimitDurationOneMin), - // RateLimitThreshold: to.Ptr[int32](10), - // RuleType: to.Ptr(armnetwork.WebApplicationFirewallRuleTypeRateLimitRule), - // }}, - // ManagedRules: &armnetwork.ManagedRulesDefinition{ - // ManagedRuleSets: []*armnetwork.ManagedRuleSet{ - // { - // RuleSetType: to.Ptr("OWASP"), - // RuleSetVersion: to.Ptr("3.2"), - // }}, - // }, - // PolicySettings: &armnetwork.PolicySettings{ - // CustomBlockResponseBody: to.Ptr("SGVsbG8="), - // CustomBlockResponseStatusCode: to.Ptr[int32](405), - // FileUploadEnforcement: to.Ptr(true), - // FileUploadLimitInMb: to.Ptr[int32](4000), - // LogScrubbing: &armnetwork.PolicySettingsLogScrubbing{ - // ScrubbingRules: []*armnetwork.WebApplicationFirewallScrubbingRules{ - // { - // MatchVariable: to.Ptr(armnetwork.ScrubbingRuleEntryMatchVariableRequestArgNames), - // Selector: to.Ptr("test"), - // SelectorMatchOperator: to.Ptr(armnetwork.ScrubbingRuleEntryMatchOperatorEquals), - // State: to.Ptr(armnetwork.ScrubbingRuleEntryStateEnabled), - // }, - // { - // MatchVariable: to.Ptr(armnetwork.ScrubbingRuleEntryMatchVariableRequestIPAddress), - // Selector: to.Ptr("*"), - // SelectorMatchOperator: to.Ptr(armnetwork.ScrubbingRuleEntryMatchOperatorEqualsAny), - // State: to.Ptr(armnetwork.ScrubbingRuleEntryStateEnabled), - // }}, - // State: to.Ptr(armnetwork.WebApplicationFirewallScrubbingStateEnabled), - // }, - // MaxRequestBodySizeInKb: to.Ptr[int32](2000), - // Mode: to.Ptr(armnetwork.WebApplicationFirewallModePrevention), - // RequestBodyCheck: to.Ptr(true), - // RequestBodyEnforcement: to.Ptr(true), - // RequestBodyInspectLimitInKB: to.Ptr[int32](2000), - // State: to.Ptr(armnetwork.WebApplicationFirewallEnabledStateEnabled), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceState: to.Ptr(armnetwork.WebApplicationFirewallPolicyResourceStateEnabled), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/WafPolicyGet.json -func ExampleWebApplicationFirewallPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWebApplicationFirewallPoliciesClient().Get(ctx, "rg1", "Policy1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.WebApplicationFirewallPolicy = armnetwork.WebApplicationFirewallPolicy{ - // Name: to.Ptr("Policy1"), - // Type: to.Ptr("Microsoft.Network/applicationgatewaywebapplicationfirewallpolicies"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/Policy1"), - // Location: to.Ptr("WestUs"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armnetwork.WebApplicationFirewallPolicyPropertiesFormat{ - // CustomRules: []*armnetwork.WebApplicationFirewallCustomRule{ - // { - // Name: to.Ptr("Rule1"), - // Action: to.Ptr(armnetwork.WebApplicationFirewallActionBlock), - // MatchConditions: []*armnetwork.MatchCondition{ - // { - // MatchValues: []*string{ - // to.Ptr("192.168.1.0/24"), - // to.Ptr("10.0.0.0/24")}, - // MatchVariables: []*armnetwork.MatchVariable{ - // { - // VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariableRemoteAddr), - // }}, - // NegationConditon: to.Ptr(false), - // Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorIPMatch), - // Transforms: []*armnetwork.WebApplicationFirewallTransform{ - // }, - // }}, - // Priority: to.Ptr[int32](1), - // RuleType: to.Ptr(armnetwork.WebApplicationFirewallRuleTypeMatchRule), - // State: to.Ptr(armnetwork.WebApplicationFirewallStateEnabled), - // }, - // { - // Name: to.Ptr("Rule2"), - // Action: to.Ptr(armnetwork.WebApplicationFirewallActionBlock), - // MatchConditions: []*armnetwork.MatchCondition{ - // { - // MatchValues: []*string{ - // to.Ptr("192.168.1.0/24")}, - // MatchVariables: []*armnetwork.MatchVariable{ - // { - // VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariableRemoteAddr), - // }}, - // NegationConditon: to.Ptr(false), - // Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorIPMatch), - // }, - // { - // MatchValues: []*string{ - // to.Ptr("Windows")}, - // MatchVariables: []*armnetwork.MatchVariable{ - // { - // Selector: to.Ptr("UserAgent"), - // VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariable("RequestHeader")), - // }}, - // NegationConditon: to.Ptr(false), - // Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorContains), - // }}, - // Priority: to.Ptr[int32](2), - // RuleType: to.Ptr(armnetwork.WebApplicationFirewallRuleTypeMatchRule), - // State: to.Ptr(armnetwork.WebApplicationFirewallStateEnabled), - // }, - // { - // Name: to.Ptr("RateLimitRule3"), - // Action: to.Ptr(armnetwork.WebApplicationFirewallActionBlock), - // GroupByUserSession: []*armnetwork.GroupByUserSession{ - // { - // GroupByVariables: []*armnetwork.GroupByVariable{ - // { - // VariableName: to.Ptr(armnetwork.ApplicationGatewayFirewallUserSessionVariableClientAddr), - // }}, - // }}, - // MatchConditions: []*armnetwork.MatchCondition{ - // { - // MatchValues: []*string{ - // to.Ptr("192.168.1.0/24"), - // to.Ptr("10.0.0.0/24")}, - // MatchVariables: []*armnetwork.MatchVariable{ - // { - // VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariableRemoteAddr), - // }}, - // NegationConditon: to.Ptr(true), - // Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorIPMatch), - // }}, - // Priority: to.Ptr[int32](3), - // RateLimitDuration: to.Ptr(armnetwork.ApplicationGatewayFirewallRateLimitDurationOneMin), - // RateLimitThreshold: to.Ptr[int32](10), - // RuleType: to.Ptr(armnetwork.WebApplicationFirewallRuleTypeRateLimitRule), - // }}, - // ManagedRules: &armnetwork.ManagedRulesDefinition{ - // Exclusions: []*armnetwork.OwaspCrsExclusionEntry{ - // { - // MatchVariable: to.Ptr(armnetwork.OwaspCrsExclusionEntryMatchVariableRequestHeaderNames), - // Selector: to.Ptr("testHeader1"), - // SelectorMatchOperator: to.Ptr(armnetwork.OwaspCrsExclusionEntrySelectorMatchOperatorEquals), - // }, - // { - // MatchVariable: to.Ptr(armnetwork.OwaspCrsExclusionEntryMatchVariableRequestHeaderNames), - // Selector: to.Ptr("testHeader2"), - // SelectorMatchOperator: to.Ptr(armnetwork.OwaspCrsExclusionEntrySelectorMatchOperatorStartsWith), - // }, - // { - // MatchVariable: to.Ptr(armnetwork.OwaspCrsExclusionEntryMatchVariableRequestArgValues), - // Selector: to.Ptr("hello"), - // SelectorMatchOperator: to.Ptr(armnetwork.OwaspCrsExclusionEntrySelectorMatchOperatorStartsWith), - // }, - // { - // ExclusionManagedRuleSets: []*armnetwork.ExclusionManagedRuleSet{ - // { - // RuleGroups: []*armnetwork.ExclusionManagedRuleGroup{ - // { - // RuleGroupName: to.Ptr("REQUEST-930-APPLICATION-ATTACK-LFI"), - // Rules: []*armnetwork.ExclusionManagedRule{ - // { - // RuleID: to.Ptr("930120"), - // }}, - // }, - // { - // RuleGroupName: to.Ptr("REQUEST-932-APPLICATION-ATTACK-RCE"), - // }}, - // RuleSetType: to.Ptr("OWASP"), - // RuleSetVersion: to.Ptr("3.2"), - // }}, - // MatchVariable: to.Ptr(armnetwork.OwaspCrsExclusionEntryMatchVariableRequestArgNames), - // Selector: to.Ptr("hello"), - // SelectorMatchOperator: to.Ptr(armnetwork.OwaspCrsExclusionEntrySelectorMatchOperatorStartsWith), - // }, - // { - // ExclusionManagedRuleSets: []*armnetwork.ExclusionManagedRuleSet{ - // { - // RuleGroups: []*armnetwork.ExclusionManagedRuleGroup{ - // }, - // RuleSetType: to.Ptr("OWASP"), - // RuleSetVersion: to.Ptr("3.1"), - // }}, - // MatchVariable: to.Ptr(armnetwork.OwaspCrsExclusionEntryMatchVariableRequestArgNames), - // Selector: to.Ptr("hello"), - // SelectorMatchOperator: to.Ptr(armnetwork.OwaspCrsExclusionEntrySelectorMatchOperatorEndsWith), - // }}, - // ManagedRuleSets: []*armnetwork.ManagedRuleSet{ - // { - // RuleGroupOverrides: []*armnetwork.ManagedRuleGroupOverride{ - // { - // RuleGroupName: to.Ptr("REQUEST-942-APPLICATION-ATTACK-SQLI"), - // Rules: []*armnetwork.ManagedRuleOverride{ - // { - // Action: to.Ptr(armnetwork.ActionTypeAnomalyScoring), - // RuleID: to.Ptr("942130"), - // State: to.Ptr(armnetwork.ManagedRuleEnabledStateDisabled), - // }, - // { - // Action: to.Ptr(armnetwork.ActionTypeAnomalyScoring), - // RuleID: to.Ptr("942110"), - // State: to.Ptr(armnetwork.ManagedRuleEnabledStateDisabled), - // }, - // { - // Action: to.Ptr(armnetwork.ActionTypeLog), - // RuleID: to.Ptr("942140"), - // State: to.Ptr(armnetwork.ManagedRuleEnabledStateEnabled), - // }}, - // }, - // { - // RuleGroupName: to.Ptr("REQUEST-920-PROTOCOL-ENFORCEMENT"), - // Rules: []*armnetwork.ManagedRuleOverride{ - // { - // Action: to.Ptr(armnetwork.ActionTypeAnomalyScoring), - // RuleID: to.Ptr("920100"), - // State: to.Ptr(armnetwork.ManagedRuleEnabledStateDisabled), - // }, - // { - // Action: to.Ptr(armnetwork.ActionTypeAnomalyScoring), - // RuleID: to.Ptr("920120"), - // State: to.Ptr(armnetwork.ManagedRuleEnabledStateDisabled), - // }, - // { - // Action: to.Ptr(armnetwork.ActionTypeBlock), - // RuleID: to.Ptr("920130"), - // State: to.Ptr(armnetwork.ManagedRuleEnabledStateEnabled), - // }}, - // }}, - // RuleSetType: to.Ptr("OWASP"), - // RuleSetVersion: to.Ptr("3.2"), - // }}, - // }, - // PolicySettings: &armnetwork.PolicySettings{ - // CustomBlockResponseBody: to.Ptr("SGVsbG8="), - // CustomBlockResponseStatusCode: to.Ptr[int32](405), - // FileUploadEnforcement: to.Ptr(true), - // FileUploadLimitInMb: to.Ptr[int32](4000), - // LogScrubbing: &armnetwork.PolicySettingsLogScrubbing{ - // ScrubbingRules: []*armnetwork.WebApplicationFirewallScrubbingRules{ - // { - // MatchVariable: to.Ptr(armnetwork.ScrubbingRuleEntryMatchVariableRequestArgNames), - // Selector: to.Ptr("test"), - // SelectorMatchOperator: to.Ptr(armnetwork.ScrubbingRuleEntryMatchOperatorEquals), - // State: to.Ptr(armnetwork.ScrubbingRuleEntryStateEnabled), - // }, - // { - // MatchVariable: to.Ptr(armnetwork.ScrubbingRuleEntryMatchVariableRequestIPAddress), - // SelectorMatchOperator: to.Ptr(armnetwork.ScrubbingRuleEntryMatchOperatorEqualsAny), - // State: to.Ptr(armnetwork.ScrubbingRuleEntryStateEnabled), - // }}, - // State: to.Ptr(armnetwork.WebApplicationFirewallScrubbingStateEnabled), - // }, - // MaxRequestBodySizeInKb: to.Ptr[int32](2000), - // Mode: to.Ptr(armnetwork.WebApplicationFirewallModePrevention), - // RequestBodyCheck: to.Ptr(true), - // RequestBodyEnforcement: to.Ptr(true), - // RequestBodyInspectLimitInKB: to.Ptr[int32](2000), - // State: to.Ptr(armnetwork.WebApplicationFirewallEnabledStateEnabled), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceState: to.Ptr(armnetwork.WebApplicationFirewallPolicyResourceStateEnabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/WafPolicyCreateOrUpdate.json -func ExampleWebApplicationFirewallPoliciesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWebApplicationFirewallPoliciesClient().CreateOrUpdate(ctx, "rg1", "Policy1", armnetwork.WebApplicationFirewallPolicy{ - Location: to.Ptr("WestUs"), - Properties: &armnetwork.WebApplicationFirewallPolicyPropertiesFormat{ - CustomRules: []*armnetwork.WebApplicationFirewallCustomRule{ - { - Name: to.Ptr("Rule1"), - Action: to.Ptr(armnetwork.WebApplicationFirewallActionBlock), - MatchConditions: []*armnetwork.MatchCondition{ - { - MatchValues: []*string{ - to.Ptr("192.168.1.0/24"), - to.Ptr("10.0.0.0/24")}, - MatchVariables: []*armnetwork.MatchVariable{ - { - VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariableRemoteAddr), - }}, - Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorIPMatch), - }}, - Priority: to.Ptr[int32](1), - RuleType: to.Ptr(armnetwork.WebApplicationFirewallRuleTypeMatchRule), - }, - { - Name: to.Ptr("Rule2"), - Action: to.Ptr(armnetwork.WebApplicationFirewallActionBlock), - MatchConditions: []*armnetwork.MatchCondition{ - { - MatchValues: []*string{ - to.Ptr("192.168.1.0/24")}, - MatchVariables: []*armnetwork.MatchVariable{ - { - VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariableRemoteAddr), - }}, - Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorIPMatch), - }, - { - MatchValues: []*string{ - to.Ptr("Windows")}, - MatchVariables: []*armnetwork.MatchVariable{ - { - Selector: to.Ptr("UserAgent"), - VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariableRequestHeaders), - }}, - Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorContains), - }}, - Priority: to.Ptr[int32](2), - RuleType: to.Ptr(armnetwork.WebApplicationFirewallRuleTypeMatchRule), - }, - { - Name: to.Ptr("RateLimitRule3"), - Action: to.Ptr(armnetwork.WebApplicationFirewallActionBlock), - GroupByUserSession: []*armnetwork.GroupByUserSession{ - { - GroupByVariables: []*armnetwork.GroupByVariable{ - { - VariableName: to.Ptr(armnetwork.ApplicationGatewayFirewallUserSessionVariableClientAddr), - }}, - }}, - MatchConditions: []*armnetwork.MatchCondition{ - { - MatchValues: []*string{ - to.Ptr("192.168.1.0/24"), - to.Ptr("10.0.0.0/24")}, - MatchVariables: []*armnetwork.MatchVariable{ - { - VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariableRemoteAddr), - }}, - NegationConditon: to.Ptr(true), - Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorIPMatch), - }}, - Priority: to.Ptr[int32](3), - RateLimitDuration: to.Ptr(armnetwork.ApplicationGatewayFirewallRateLimitDurationOneMin), - RateLimitThreshold: to.Ptr[int32](10), - RuleType: to.Ptr(armnetwork.WebApplicationFirewallRuleTypeRateLimitRule), - }}, - ManagedRules: &armnetwork.ManagedRulesDefinition{ - Exclusions: []*armnetwork.OwaspCrsExclusionEntry{ - { - ExclusionManagedRuleSets: []*armnetwork.ExclusionManagedRuleSet{ - { - RuleGroups: []*armnetwork.ExclusionManagedRuleGroup{ - { - RuleGroupName: to.Ptr("REQUEST-930-APPLICATION-ATTACK-LFI"), - Rules: []*armnetwork.ExclusionManagedRule{ - { - RuleID: to.Ptr("930120"), - }}, - }, - { - RuleGroupName: to.Ptr("REQUEST-932-APPLICATION-ATTACK-RCE"), - }}, - RuleSetType: to.Ptr("OWASP"), - RuleSetVersion: to.Ptr("3.2"), - }}, - MatchVariable: to.Ptr(armnetwork.OwaspCrsExclusionEntryMatchVariableRequestArgNames), - Selector: to.Ptr("hello"), - SelectorMatchOperator: to.Ptr(armnetwork.OwaspCrsExclusionEntrySelectorMatchOperatorStartsWith), - }, - { - ExclusionManagedRuleSets: []*armnetwork.ExclusionManagedRuleSet{ - { - RuleGroups: []*armnetwork.ExclusionManagedRuleGroup{}, - RuleSetType: to.Ptr("OWASP"), - RuleSetVersion: to.Ptr("3.1"), - }}, - MatchVariable: to.Ptr(armnetwork.OwaspCrsExclusionEntryMatchVariableRequestArgNames), - Selector: to.Ptr("hello"), - SelectorMatchOperator: to.Ptr(armnetwork.OwaspCrsExclusionEntrySelectorMatchOperatorEndsWith), - }, - { - MatchVariable: to.Ptr(armnetwork.OwaspCrsExclusionEntryMatchVariableRequestArgNames), - Selector: to.Ptr("test"), - SelectorMatchOperator: to.Ptr(armnetwork.OwaspCrsExclusionEntrySelectorMatchOperatorStartsWith), - }, - { - MatchVariable: to.Ptr(armnetwork.OwaspCrsExclusionEntryMatchVariableRequestArgValues), - Selector: to.Ptr("test"), - SelectorMatchOperator: to.Ptr(armnetwork.OwaspCrsExclusionEntrySelectorMatchOperatorStartsWith), - }}, - ManagedRuleSets: []*armnetwork.ManagedRuleSet{ - { - RuleGroupOverrides: []*armnetwork.ManagedRuleGroupOverride{ - { - RuleGroupName: to.Ptr("REQUEST-931-APPLICATION-ATTACK-RFI"), - Rules: []*armnetwork.ManagedRuleOverride{ - { - Action: to.Ptr(armnetwork.ActionTypeLog), - RuleID: to.Ptr("931120"), - State: to.Ptr(armnetwork.ManagedRuleEnabledStateEnabled), - }, - { - Action: to.Ptr(armnetwork.ActionTypeAnomalyScoring), - RuleID: to.Ptr("931130"), - State: to.Ptr(armnetwork.ManagedRuleEnabledStateDisabled), - }}, - }}, - RuleSetType: to.Ptr("OWASP"), - RuleSetVersion: to.Ptr("3.2"), - }}, - }, - PolicySettings: &armnetwork.PolicySettings{ - LogScrubbing: &armnetwork.PolicySettingsLogScrubbing{ - ScrubbingRules: []*armnetwork.WebApplicationFirewallScrubbingRules{ - { - MatchVariable: to.Ptr(armnetwork.ScrubbingRuleEntryMatchVariableRequestArgNames), - Selector: to.Ptr("test"), - SelectorMatchOperator: to.Ptr(armnetwork.ScrubbingRuleEntryMatchOperatorEquals), - State: to.Ptr(armnetwork.ScrubbingRuleEntryStateEnabled), - }, - { - MatchVariable: to.Ptr(armnetwork.ScrubbingRuleEntryMatchVariableRequestIPAddress), - SelectorMatchOperator: to.Ptr(armnetwork.ScrubbingRuleEntryMatchOperatorEqualsAny), - State: to.Ptr(armnetwork.ScrubbingRuleEntryStateEnabled), - }}, - State: to.Ptr(armnetwork.WebApplicationFirewallScrubbingStateEnabled), - }, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.WebApplicationFirewallPolicy = armnetwork.WebApplicationFirewallPolicy{ - // Name: to.Ptr("Policy1"), - // Type: to.Ptr("Microsoft.Network/applicationgatewaywebapplicationfirewallpolicies"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/Policy1"), - // Location: to.Ptr("WestUs"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armnetwork.WebApplicationFirewallPolicyPropertiesFormat{ - // CustomRules: []*armnetwork.WebApplicationFirewallCustomRule{ - // { - // Name: to.Ptr("Rule1"), - // Action: to.Ptr(armnetwork.WebApplicationFirewallActionBlock), - // MatchConditions: []*armnetwork.MatchCondition{ - // { - // MatchValues: []*string{ - // to.Ptr("192.168.1.0/24"), - // to.Ptr("10.0.0.0/24")}, - // MatchVariables: []*armnetwork.MatchVariable{ - // { - // VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariableRemoteAddr), - // }}, - // NegationConditon: to.Ptr(false), - // Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorIPMatch), - // Transforms: []*armnetwork.WebApplicationFirewallTransform{ - // }, - // }}, - // Priority: to.Ptr[int32](1), - // RuleType: to.Ptr(armnetwork.WebApplicationFirewallRuleTypeMatchRule), - // State: to.Ptr(armnetwork.WebApplicationFirewallStateEnabled), - // }, - // { - // Name: to.Ptr("Rule2"), - // Action: to.Ptr(armnetwork.WebApplicationFirewallActionBlock), - // MatchConditions: []*armnetwork.MatchCondition{ - // { - // MatchValues: []*string{ - // to.Ptr("192.168.1.0/24")}, - // MatchVariables: []*armnetwork.MatchVariable{ - // { - // VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariableRemoteAddr), - // }}, - // NegationConditon: to.Ptr(false), - // Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorIPMatch), - // }, - // { - // MatchValues: []*string{ - // to.Ptr("Windows")}, - // MatchVariables: []*armnetwork.MatchVariable{ - // { - // Selector: to.Ptr("UserAgent"), - // VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariable("RequestHeader")), - // }}, - // NegationConditon: to.Ptr(false), - // Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorContains), - // }}, - // Priority: to.Ptr[int32](2), - // RuleType: to.Ptr(armnetwork.WebApplicationFirewallRuleTypeMatchRule), - // State: to.Ptr(armnetwork.WebApplicationFirewallStateEnabled), - // }, - // { - // Name: to.Ptr("RateLimitRule3"), - // Action: to.Ptr(armnetwork.WebApplicationFirewallActionBlock), - // GroupByUserSession: []*armnetwork.GroupByUserSession{ - // { - // GroupByVariables: []*armnetwork.GroupByVariable{ - // { - // VariableName: to.Ptr(armnetwork.ApplicationGatewayFirewallUserSessionVariableClientAddr), - // }}, - // }}, - // MatchConditions: []*armnetwork.MatchCondition{ - // { - // MatchValues: []*string{ - // to.Ptr("192.168.1.0/24"), - // to.Ptr("10.0.0.0/24")}, - // MatchVariables: []*armnetwork.MatchVariable{ - // { - // VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariableRemoteAddr), - // }}, - // NegationConditon: to.Ptr(true), - // Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorIPMatch), - // }}, - // Priority: to.Ptr[int32](3), - // RateLimitDuration: to.Ptr(armnetwork.ApplicationGatewayFirewallRateLimitDurationOneMin), - // RateLimitThreshold: to.Ptr[int32](10), - // RuleType: to.Ptr(armnetwork.WebApplicationFirewallRuleTypeRateLimitRule), - // }}, - // ManagedRules: &armnetwork.ManagedRulesDefinition{ - // Exclusions: []*armnetwork.OwaspCrsExclusionEntry{ - // { - // ExclusionManagedRuleSets: []*armnetwork.ExclusionManagedRuleSet{ - // { - // RuleGroups: []*armnetwork.ExclusionManagedRuleGroup{ - // { - // RuleGroupName: to.Ptr("REQUEST-930-APPLICATION-ATTACK-LFI"), - // Rules: []*armnetwork.ExclusionManagedRule{ - // { - // RuleID: to.Ptr("930120"), - // }}, - // }, - // { - // RuleGroupName: to.Ptr("REQUEST-932-APPLICATION-ATTACK-RCE"), - // }}, - // RuleSetType: to.Ptr("OWASP"), - // RuleSetVersion: to.Ptr("3.2"), - // }}, - // MatchVariable: to.Ptr(armnetwork.OwaspCrsExclusionEntryMatchVariableRequestArgNames), - // Selector: to.Ptr("hello"), - // SelectorMatchOperator: to.Ptr(armnetwork.OwaspCrsExclusionEntrySelectorMatchOperatorStartsWith), - // }, - // { - // ExclusionManagedRuleSets: []*armnetwork.ExclusionManagedRuleSet{ - // { - // RuleGroups: []*armnetwork.ExclusionManagedRuleGroup{ - // }, - // RuleSetType: to.Ptr("OWASP"), - // RuleSetVersion: to.Ptr("3.1"), - // }}, - // MatchVariable: to.Ptr(armnetwork.OwaspCrsExclusionEntryMatchVariableRequestArgNames), - // Selector: to.Ptr("hello"), - // SelectorMatchOperator: to.Ptr(armnetwork.OwaspCrsExclusionEntrySelectorMatchOperatorEndsWith), - // }, - // { - // MatchVariable: to.Ptr(armnetwork.OwaspCrsExclusionEntryMatchVariableRequestArgNames), - // Selector: to.Ptr("test"), - // SelectorMatchOperator: to.Ptr(armnetwork.OwaspCrsExclusionEntrySelectorMatchOperatorStartsWith), - // }, - // { - // MatchVariable: to.Ptr(armnetwork.OwaspCrsExclusionEntryMatchVariableRequestArgValues), - // Selector: to.Ptr("test"), - // SelectorMatchOperator: to.Ptr(armnetwork.OwaspCrsExclusionEntrySelectorMatchOperatorStartsWith), - // }}, - // ManagedRuleSets: []*armnetwork.ManagedRuleSet{ - // { - // RuleGroupOverrides: []*armnetwork.ManagedRuleGroupOverride{ - // { - // RuleGroupName: to.Ptr("REQUEST-931-APPLICATION-ATTACK-RFI"), - // Rules: []*armnetwork.ManagedRuleOverride{ - // { - // Action: to.Ptr(armnetwork.ActionTypeLog), - // RuleID: to.Ptr("931120"), - // State: to.Ptr(armnetwork.ManagedRuleEnabledStateEnabled), - // }, - // { - // Action: to.Ptr(armnetwork.ActionTypeAnomalyScoring), - // RuleID: to.Ptr("931130"), - // State: to.Ptr(armnetwork.ManagedRuleEnabledStateDisabled), - // }}, - // }}, - // RuleSetType: to.Ptr("OWASP"), - // RuleSetVersion: to.Ptr("3.2"), - // }}, - // }, - // PolicySettings: &armnetwork.PolicySettings{ - // CustomBlockResponseBody: to.Ptr("SGVsbG8="), - // CustomBlockResponseStatusCode: to.Ptr[int32](405), - // FileUploadEnforcement: to.Ptr(true), - // FileUploadLimitInMb: to.Ptr[int32](4000), - // LogScrubbing: &armnetwork.PolicySettingsLogScrubbing{ - // ScrubbingRules: []*armnetwork.WebApplicationFirewallScrubbingRules{ - // { - // MatchVariable: to.Ptr(armnetwork.ScrubbingRuleEntryMatchVariableRequestArgNames), - // Selector: to.Ptr("test"), - // SelectorMatchOperator: to.Ptr(armnetwork.ScrubbingRuleEntryMatchOperatorEquals), - // State: to.Ptr(armnetwork.ScrubbingRuleEntryStateEnabled), - // }, - // { - // MatchVariable: to.Ptr(armnetwork.ScrubbingRuleEntryMatchVariableRequestIPAddress), - // SelectorMatchOperator: to.Ptr(armnetwork.ScrubbingRuleEntryMatchOperatorEqualsAny), - // State: to.Ptr(armnetwork.ScrubbingRuleEntryStateEnabled), - // }}, - // State: to.Ptr(armnetwork.WebApplicationFirewallScrubbingStateEnabled), - // }, - // MaxRequestBodySizeInKb: to.Ptr[int32](2000), - // Mode: to.Ptr(armnetwork.WebApplicationFirewallModeDetection), - // RequestBodyCheck: to.Ptr(true), - // RequestBodyEnforcement: to.Ptr(true), - // RequestBodyInspectLimitInKB: to.Ptr[int32](2000), - // State: to.Ptr(armnetwork.WebApplicationFirewallEnabledStateEnabled), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceState: to.Ptr(armnetwork.WebApplicationFirewallPolicyResourceStateEnabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/WafPolicyDelete.json -func ExampleWebApplicationFirewallPoliciesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewWebApplicationFirewallPoliciesClient().BeginDelete(ctx, "rg1", "Policy1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/network/armnetwork/webcategories_client.go b/sdk/resourcemanager/network/armnetwork/webcategories_client.go index aa32b0c691f7..9cc137f7e66c 100644 --- a/sdk/resourcemanager/network/armnetwork/webcategories_client.go +++ b/sdk/resourcemanager/network/armnetwork/webcategories_client.go @@ -47,7 +47,7 @@ func NewWebCategoriesClient(subscriptionID string, credential azcore.TokenCreden // Get - Gets the specified Azure Web Category. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - name - The name of the azureWebCategory. // - options - WebCategoriesClientGetOptions contains the optional parameters for the WebCategoriesClient.Get method. func (client *WebCategoriesClient) Get(ctx context.Context, name string, options *WebCategoriesClientGetOptions) (WebCategoriesClientGetResponse, error) { @@ -88,7 +88,7 @@ func (client *WebCategoriesClient) getCreateRequest(ctx context.Context, name st return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } @@ -108,7 +108,7 @@ func (client *WebCategoriesClient) getHandleResponse(resp *http.Response) (WebCa // NewListBySubscriptionPager - Gets all the Azure Web Categories in a subscription. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-05-01 // - options - WebCategoriesClientListBySubscriptionOptions contains the optional parameters for the WebCategoriesClient.NewListBySubscriptionPager // method. func (client *WebCategoriesClient) NewListBySubscriptionPager(options *WebCategoriesClientListBySubscriptionOptions) *runtime.Pager[WebCategoriesClientListBySubscriptionResponse] { @@ -153,7 +153,7 @@ func (client *WebCategoriesClient) listBySubscriptionCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/webcategories_client_example_test.go b/sdk/resourcemanager/network/armnetwork/webcategories_client_example_test.go deleted file mode 100644 index 2074c6ef6910..000000000000 --- a/sdk/resourcemanager/network/armnetwork/webcategories_client_example_test.go +++ /dev/null @@ -1,84 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetwork_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/AzureWebCategoryGet.json -func ExampleWebCategoriesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWebCategoriesClient().Get(ctx, "Arts", &armnetwork.WebCategoriesClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AzureWebCategory = armnetwork.AzureWebCategory{ - // Name: to.Ptr("Arts"), - // Type: to.Ptr("Microsoft.Network/azureWebCategories"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // ID: to.Ptr("/subscriptions/4de8428a-4a92-4cea-90ff-b47128b8cab8/providers/Microsoft.Network/azureWebCategories/Arts"), - // Properties: &armnetwork.AzureWebCategoryPropertiesFormat{ - // Group: to.Ptr("General"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9975d3476c05bcc6bd9535ad3dfb564e6a168fa5/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/examples/AzureWebCategoriesListBySubscription.json -func ExampleWebCategoriesClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewWebCategoriesClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AzureWebCategoryListResult = armnetwork.AzureWebCategoryListResult{ - // Value: []*armnetwork.AzureWebCategory{ - // { - // Name: to.Ptr("Arts"), - // Type: to.Ptr("Microsoft.Network/azureWebCategories"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // ID: to.Ptr("/subscriptions/4de8428a-4a92-4cea-90ff-b47128b8cab8/providers/Microsoft.Network/azureWebCategories/Arts"), - // Properties: &armnetwork.AzureWebCategoryPropertiesFormat{ - // Group: to.Ptr("General"), - // }, - // }}, - // } - } -}