From c6848d35637eecc18e1c5f41e7f38fbce9cd7959 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 30 Dec 2024 21:02:40 +0000 Subject: [PATCH] CodeGen from PR 31787 in Azure/azure-rest-api-specs Merge f6692525b021117706c09936cb4c4fde73fabd3c into 51342b5799a03047e71f9da81b95940a12bbc2e9 --- .../network/armnetwork/CHANGELOG.md | 16 + .../network/armnetwork/README.md | 2 +- .../armnetwork/adminrulecollections_client.go | 18 +- ...dminrulecollections_client_example_test.go | 184 - .../network/armnetwork/adminrules_client.go | 18 +- .../adminrules_client_example_test.go | 389 --- ...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 - ...iongatewaywafdynamicmanifests_live_test.go | 2 +- ...atewaywafdynamicmanifestsdefault_client.go | 4 +- ...micmanifestsdefault_client_example_test.go | 84 - .../applicationsecuritygroup_live_test.go | 2 +- .../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 - .../availabledelegations_live_test.go | 2 +- .../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 - .../availableservicealiases_live_test.go | 2 +- .../azurefirewallfqdntag_live_test.go | 2 +- .../azurefirewallfqdntags_client.go | 4 +- ...urefirewallfqdntags_client_example_test.go | 60 - .../armnetwork/azurefirewalls_client.go | 42 +- .../azurefirewalls_client_example_test.go | 2987 ---------------- .../armnetwork/azurewebcategory_live_test.go | 2 +- .../armnetwork/bastionhost_live_test.go | 2 +- .../network/armnetwork/bastionhosts_client.go | 30 +- .../bastionhosts_client_example_test.go | 980 ------ .../bgpservicecommunities_client.go | 4 +- ...pservicecommunities_client_example_test.go | 84 - .../checkdnsavailability_live_test.go | 2 +- .../configurationpolicygroups_client.go | 20 +- ...urationpolicygroups_client_example_test.go | 226 -- .../armnetwork/connectionmonitors_client.go | 42 +- .../connectionmonitors_client_example_test.go | 721 ---- .../connectivityconfigurations_client.go | 18 +- ...ivityconfigurations_client_example_test.go | 228 -- .../network/armnetwork/constants.go | 35 +- .../armnetwork/customipprefix_live_test.go | 2 +- .../armnetwork/customipprefixes_client.go | 28 +- .../customipprefixes_client_example_test.go | 627 ---- .../armnetwork/ddoscustompolicies_client.go | 20 +- .../ddoscustompolicies_client_example_test.go | 145 - .../ddosprotectionplan_live_test.go | 2 +- .../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 | 602 ---- .../armnetwork/endpointservice_live_test.go | 2 +- .../expressroutecircuit_live_test.go | 2 +- ...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 | 644 ---- .../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 - .../fake/adminrulecollections_server.go | 2 +- .../armnetwork/fake/adminrules_server.go | 2 +- ...atewayprivateendpointconnections_server.go | 2 +- ...ationgatewayprivatelinkresources_server.go | 2 +- .../fake/applicationgateways_server.go | 2 +- ...cationgatewaywafdynamicmanifests_server.go | 2 +- ...atewaywafdynamicmanifestsdefault_server.go | 2 +- .../fake/applicationsecuritygroups_server.go | 2 +- .../fake/availabledelegations_server.go | 2 +- .../fake/availableendpointservices_server.go | 2 +- .../availableprivateendpointtypes_server.go | 2 +- ...vailableresourcegroupdelegations_server.go | 2 +- .../fake/availableservicealiases_server.go | 2 +- .../fake/azurefirewallfqdntags_server.go | 2 +- .../armnetwork/fake/azurefirewalls_server.go | 2 +- .../armnetwork/fake/bastionhosts_server.go | 2 +- .../fake/bgpservicecommunities_server.go | 2 +- .../fake/configurationpolicygroups_server.go | 2 +- .../fake/connectionmonitors_server.go | 2 +- .../fake/connectivityconfigurations_server.go | 2 +- .../fake/customipprefixes_server.go | 2 +- .../fake/ddoscustompolicies_server.go | 2 +- .../fake/ddosprotectionplans_server.go | 2 +- .../fake/defaultsecurityrules_server.go | 2 +- .../fake/dscpconfiguration_server.go | 2 +- ...xpressroutecircuitauthorizations_server.go | 2 +- .../expressroutecircuitconnections_server.go | 2 +- .../expressroutecircuitpeerings_server.go | 2 +- .../fake/expressroutecircuits_server.go | 2 +- .../fake/expressrouteconnections_server.go | 2 +- ...ressroutecrossconnectionpeerings_server.go | 2 +- .../expressroutecrossconnections_server.go | 2 +- .../fake/expressroutegateways_server.go | 2 +- .../fake/expressroutelinks_server.go | 2 +- .../expressrouteportauthorizations_server.go | 2 +- .../fake/expressrouteports_server.go | 2 +- .../fake/expressrouteportslocations_server.go | 2 +- ...xpressrouteproviderportslocation_server.go | 2 +- .../expressrouteserviceproviders_server.go | 2 +- .../fake/firewallpolicies_server.go | 2 +- .../fake/firewallpolicydeployments_server.go | 2 +- .../fake/firewallpolicydrafts_server.go | 2 +- .../firewallpolicyidpssignatures_server.go | 2 +- ...policyidpssignaturesfiltervalues_server.go | 2 +- ...allpolicyidpssignaturesoverrides_server.go | 2 +- ...lpolicyrulecollectiongroupdrafts_server.go | 2 +- ...rewallpolicyrulecollectiongroups_server.go | 2 +- .../armnetwork/fake/flowlogs_server.go | 2 +- .../network/armnetwork/fake/groups_server.go | 2 +- .../armnetwork/fake/hubroutetables_server.go | 2 +- .../hubvirtualnetworkconnections_server.go | 2 +- .../armnetwork/fake/inboundnatrules_server.go | 2 +- .../fake/inboundsecurityrule_server.go | 2 +- .../fake/interfaceipconfigurations_server.go | 2 +- .../fake/interfaceloadbalancers_server.go | 2 +- .../armnetwork/fake/interfaces_server.go | 2 +- .../fake/interfacetapconfigurations_server.go | 2 +- .../armnetwork/fake/ipallocations_server.go | 2 +- .../armnetwork/fake/ipampools_server.go | 2 +- .../armnetwork/fake/ipgroups_server.go | 2 +- .../loadbalancerbackendaddresspools_server.go | 2 +- ...balancerfrontendipconfigurations_server.go | 2 +- .../loadbalancerloadbalancingrules_server.go | 2 +- .../loadbalancernetworkinterfaces_server.go | 2 +- .../fake/loadbalanceroutboundrules_server.go | 2 +- .../fake/loadbalancerprobes_server.go | 2 +- .../armnetwork/fake/loadbalancers_server.go | 2 +- .../fake/localnetworkgateways_server.go | 2 +- .../armnetwork/fake/management_server.go | 2 +- ...ntgroupnetworkmanagerconnections_server.go | 2 +- .../armnetwork/fake/managercommits_server.go | 2 +- .../fake/managerdeploymentstatus_server.go | 2 +- .../managerroutingconfigurations_server.go | 2 +- .../armnetwork/fake/managers_server.go | 2 +- .../armnetwork/fake/natgateways_server.go | 2 +- .../armnetwork/fake/natrules_server.go | 2 +- .../armnetwork/fake/operations_server.go | 2 +- .../armnetwork/fake/p2svpngateways_server.go | 2 +- .../armnetwork/fake/packetcaptures_server.go | 2 +- ...erexpressroutecircuitconnections_server.go | 2 +- .../armnetwork/fake/polymorphic_helpers.go | 2 +- .../fake/privatednszonegroups_server.go | 2 +- .../fake/privateendpoints_server.go | 2 +- .../fake/privatelinkservices_server.go | 2 +- .../armnetwork/fake/profiles_server.go | 2 +- .../fake/publicipaddresses_server.go | 2 +- .../fake/publicipprefixes_server.go | 2 +- .../reachabilityanalysisintents_server.go | 2 +- .../fake/reachabilityanalysisruns_server.go | 2 +- .../fake/resourcenavigationlinks_server.go | 2 +- .../fake/routefilterrules_server.go | 2 +- .../armnetwork/fake/routefilters_server.go | 2 +- .../armnetwork/fake/routemaps_server.go | 2 +- .../network/armnetwork/fake/routes_server.go | 2 +- .../armnetwork/fake/routetables_server.go | 2 +- .../armnetwork/fake/routingintent_server.go | 2 +- .../fake/routingrulecollections_server.go | 2 +- .../armnetwork/fake/routingrules_server.go | 2 +- .../fake/scopeconnections_server.go | 2 +- .../securityadminconfigurations_server.go | 2 +- .../armnetwork/fake/securitygroups_server.go | 2 +- .../fake/securitypartnerproviders_server.go | 2 +- .../armnetwork/fake/securityrules_server.go | 2 +- .../fake/securityuserconfigurations_server.go | 2 +- .../securityuserrulecollections_server.go | 2 +- .../fake/securityuserrules_server.go | 2 +- .../fake/serviceassociationlinks_server.go | 2 +- .../fake/serviceendpointpolicies_server.go | 2 +- ...serviceendpointpolicydefinitions_server.go | 2 +- .../fake/servicetaginformation_server.go | 2 +- .../armnetwork/fake/servicetags_server.go | 2 +- .../armnetwork/fake/staticcidrs_server.go | 2 +- .../armnetwork/fake/staticmembers_server.go | 2 +- .../network/armnetwork/fake/subnets_server.go | 2 +- ...riptionnetworkmanagerconnections_server.go | 2 +- .../network/armnetwork/fake/usages_server.go | 2 +- .../fake/verifierworkspaces_server.go | 2 +- .../network/armnetwork/fake/vipswap_server.go | 2 +- .../virtualapplianceconnections_server.go | 2 +- .../fake/virtualappliances_server.go | 126 +- .../fake/virtualappliancesites_server.go | 2 +- .../fake/virtualapplianceskus_server.go | 2 +- .../fake/virtualhubbgpconnection_server.go | 2 +- .../fake/virtualhubbgpconnections_server.go | 2 +- .../fake/virtualhubipconfiguration_server.go | 2 +- .../fake/virtualhubroutetablev2s_server.go | 2 +- .../armnetwork/fake/virtualhubs_server.go | 2 +- ...virtualnetworkgatewayconnections_server.go | 2 +- .../virtualnetworkgatewaynatrules_server.go | 2 +- .../fake/virtualnetworkgateways_server.go | 2 +- .../fake/virtualnetworkpeerings_server.go | 2 +- .../armnetwork/fake/virtualnetworks_server.go | 2 +- .../fake/virtualnetworktaps_server.go | 2 +- .../fake/virtualrouterpeerings_server.go | 2 +- .../armnetwork/fake/virtualrouters_server.go | 2 +- .../armnetwork/fake/virtualwans_server.go | 2 +- .../armnetwork/fake/vpnconnections_server.go | 2 +- .../armnetwork/fake/vpngateways_server.go | 2 +- .../fake/vpnlinkconnections_server.go | 2 +- .../fake/vpnserverconfigurations_server.go | 2 +- ...urationsassociatedwithvirtualwan_server.go | 2 +- .../fake/vpnsitelinkconnections_server.go | 2 +- .../armnetwork/fake/vpnsitelinks_server.go | 2 +- .../armnetwork/fake/vpnsites_server.go | 2 +- .../fake/vpnsitesconfiguration_server.go | 2 +- .../armnetwork/fake/watchers_server.go | 2 +- .../webapplicationfirewallpolicies_server.go | 2 +- .../armnetwork/fake/webcategories_server.go | 2 +- .../armnetwork/firewallpolicies_client.go | 28 +- .../firewallpolicies_client_example_test.go | 601 ---- .../armnetwork/firewallpolicy_live_test.go | 2 +- .../firewallpolicydeployments_client.go | 6 +- ...llpolicydeployments_client_example_test.go | 39 - .../armnetwork/firewallpolicydrafts_client.go | 12 +- ...irewallpolicydrafts_client_example_test.go | 311 -- .../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 - ...lpolicyrulecollectiongroupdrafts_client.go | 12 +- ...llectiongroupdrafts_client_example_test.go | 160 - ...rewallpolicyrulecollectiongroups_client.go | 20 +- ...ulecollectiongroups_client_example_test.go | 866 ----- .../network/armnetwork/flowlogs_client.go | 24 +- .../flowlogs_client_example_test.go | 341 -- sdk/resourcemanager/network/armnetwork/go.mod | 4 +- .../network/armnetwork/groups_client.go | 18 +- .../armnetwork/groups_client_example_test.go | 172 - .../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 | 10 +- ...inboundsecurityrule_client_example_test.go | 118 - .../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 | 1403 -------- .../interfacetapconfigurations_client.go | 20 +- ...cetapconfigurations_client_example_test.go | 154 - .../armnetwork/ipallocations_client.go | 28 +- .../ipallocations_client_example_test.go | 276 -- .../network/armnetwork/ipampools_client.go | 32 +- .../ipampools_client_example_test.go | 351 -- .../network/armnetwork/ipgroups_client.go | 28 +- .../ipgroups_client_example_test.go | 320 -- .../network/armnetwork/ipgroups_live_test.go | 2 +- .../armnetwork/loadbalancer_live_test.go | 2 +- .../loadbalancerbackendaddresspools_client.go | 20 +- ...backendaddresspools_client_example_test.go | 312 -- ...balancerfrontendipconfigurations_client.go | 8 +- ...endipconfigurations_client_example_test.go | 112 - .../loadbalancerloadbalancingrules_client.go | 14 +- ...rloadbalancingrules_client_example_test.go | 152 - .../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 | 44 +- .../loadbalancers_client_example_test.go | 3017 ----------------- .../armnetwork/localnetworkgateways_client.go | 24 +- ...ocalnetworkgateways_client_example_test.go | 230 -- .../network/armnetwork/management_client.go | 66 +- .../management_client_example_test.go | 654 ---- ...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 - .../managerroutingconfigurations_client.go | 18 +- ...utingconfigurations_client_example_test.go | 168 - .../network/armnetwork/managers_client.go | 26 +- .../managers_client_example_test.go | 316 -- .../network/armnetwork/models.go | 40 +- .../network/armnetwork/models_serde.go | 105 + .../armnetwork/natgateway_live_test.go | 2 +- .../network/armnetwork/natgateways_client.go | 28 +- .../natgateways_client_example_test.go | 359 -- .../network/armnetwork/natrules_client.go | 20 +- .../natrules_client_example_test.go | 172 - .../armnetwork/networkinterface_live_test.go | 2 +- .../armnetwork/networkmanager_live_test.go | 2 +- .../networkmanagerconnection_live_test.go | 2 +- ...agerconnectivityconfiguration_live_test.go | 2 +- .../networkmanagergroup_live_test.go | 2 +- ...gersecurityadminconfiguration_live_test.go | 2 +- .../armnetwork/networkprofile_live_test.go | 2 +- .../networksecuritygroup_live_test.go | 2 +- .../armnetwork/networkwatcher_live_test.go | 2 +- .../network/armnetwork/operation_live_test.go | 2 +- .../network/armnetwork/operations_client.go | 4 +- .../operations_client_example_test.go | 166 - .../network/armnetwork/options.go | 20 + .../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 | 941 ----- .../armnetwork/privatelinkservices_client.go | 62 +- ...privatelinkservices_client_example_test.go | 798 ----- .../network/armnetwork/profiles_client.go | 26 +- .../profiles_client_example_test.go | 684 ---- .../armnetwork/publicipaddress_live_test.go | 2 +- .../armnetwork/publicipaddresses_client.go | 46 +- .../publicipaddresses_client_example_test.go | 863 ----- .../armnetwork/publicipprefix_live_test.go | 2 +- .../armnetwork/publicipprefixes_client.go | 28 +- .../publicipprefixes_client_example_test.go | 399 --- .../reachabilityanalysisintents_client.go | 16 +- ...lityanalysisintents_client_example_test.go | 220 -- .../reachabilityanalysisruns_client.go | 18 +- ...abilityanalysisruns_client_example_test.go | 222 -- .../resourcenavigationlinks_client.go | 4 +- ...urcenavigationlinks_client_example_test.go | 52 - .../network/armnetwork/responses.go | 11 + .../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 - .../armnetwork/routetable_live_test.go | 2 +- .../network/armnetwork/routetables_client.go | 28 +- .../routetables_client_example_test.go | 333 -- .../armnetwork/routingintent_client.go | 20 +- .../routingintent_client_example_test.go | 194 -- .../routingrulecollections_client.go | 18 +- ...tingrulecollections_client_example_test.go | 187 - .../network/armnetwork/routingrules_client.go | 18 +- .../routingrules_client_example_test.go | 199 -- .../armnetwork/scopeconnections_client.go | 16 +- .../scopeconnections_client_example_test.go | 169 - .../securityadminconfigurations_client.go | 18 +- ...adminconfigurations_client_example_test.go | 219 -- .../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 - .../securityuserconfigurations_client.go | 18 +- ...yuserconfigurations_client_example_test.go | 168 - .../securityuserrulecollections_client.go | 18 +- ...userrulecollections_client_example_test.go | 184 - .../armnetwork/securityuserrules_client.go | 18 +- .../securityuserrules_client_example_test.go | 232 -- .../serviceassociationlinks_client.go | 4 +- ...iceassociationlinks_client_example_test.go | 54 - .../armnetwork/servicecommunity_live_test.go | 2 +- .../serviceendpointpolicies_client.go | 28 +- ...iceendpointpolicies_client_example_test.go | 397 --- .../serviceendpointpolicy_live_test.go | 2 +- ...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/servicetags_live_test.go | 2 +- .../network/armnetwork/staticcidrs_client.go | 18 +- .../staticcidrs_client_example_test.go | 174 - .../armnetwork/staticmembers_client.go | 16 +- .../staticmembers_client_example_test.go | 162 - .../network/armnetwork/subnets_client.go | 32 +- .../armnetwork/subnets_client_example_test.go | 452 --- ...riptionnetworkmanagerconnections_client.go | 16 +- ...kmanagerconnections_client_example_test.go | 164 - .../network/armnetwork/usage_live_test.go | 2 +- .../network/armnetwork/usages_client.go | 4 +- .../armnetwork/usages_client_example_test.go | 644 ---- .../armnetwork/verifierworkspaces_client.go | 22 +- .../verifierworkspaces_client_example_test.go | 213 -- .../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 | 202 +- .../virtualappliances_client_example_test.go | 916 ----- .../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 | 706 ---- .../armnetwork/virtualnetwork_live_test.go | 2 +- .../virtualnetworkgateway_live_test.go | 2 +- ...virtualnetworkgatewayconnections_client.go | 66 +- ...kgatewayconnections_client_example_test.go | 689 ---- .../virtualnetworkgatewaynatrules_client.go | 20 +- ...workgatewaynatrules_client_example_test.go | 169 - .../virtualnetworkgateways_client.go | 146 +- ...tualnetworkgateways_client_example_test.go | 1703 ---------- .../virtualnetworkpeerings_client.go | 20 +- ...tualnetworkpeerings_client_example_test.go | 950 ------ .../armnetwork/virtualnetworks_client.go | 42 +- .../virtualnetworks_client_example_test.go | 1209 ------- .../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 -- .../armnetwork/virtualwan_live_test.go | 2 +- .../network/armnetwork/virtualwans_client.go | 28 +- .../virtualwans_client_example_test.go | 374 -- .../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 | 34 +- .../vpnlinkconnections_client_example_test.go | 221 -- .../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 | 72 - .../network/armnetwork/vpnsitelinks_client.go | 8 +- .../vpnsitelinks_client_example_test.go | 117 - .../network/armnetwork/vpnsites_client.go | 28 +- .../vpnsites_client_example_test.go | 464 --- .../vpnsitesconfiguration_client.go | 6 +- ...nsitesconfiguration_client_example_test.go | 44 - .../network/armnetwork/watchers_client.go | 96 +- .../watchers_client_example_test.go | 933 ----- .../webapplicationfirewall_live_test.go | 2 +- .../webapplicationfirewallpolicies_client.go | 22 +- ...ionfirewallpolicies_client_example_test.go | 1383 -------- .../armnetwork/webcategories_client.go | 8 +- .../webcategories_client_example_test.go | 84 - 488 files changed, 2333 insertions(+), 56663 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/firewallpolicydeployments_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/firewallpolicydrafts_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/firewallpolicyrulecollectiongroupdrafts_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/ipampools_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/managerroutingconfigurations_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/reachabilityanalysisintents_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/reachabilityanalysisruns_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/routingrulecollections_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/routingrules_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/securityuserconfigurations_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/securityuserrulecollections_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/securityuserrules_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/staticcidrs_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/verifierworkspaces_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 0de615e48240..3193cb0806f2 100644 --- a/sdk/resourcemanager/network/armnetwork/CHANGELOG.md +++ b/sdk/resourcemanager/network/armnetwork/CHANGELOG.md @@ -1,5 +1,21 @@ # Release History +## 7.0.0 (2024-12-30) +### Breaking Changes + +- Type of `LoadBalancerHealthPerRulePerBackendAddress.NetworkInterfaceIPConfigurationID` has been changed from `*InterfaceIPConfiguration` to `*string` + +### Features Added + +- New enum type `AdvertisedPublicPrefixPropertiesValidationState` with values `AdvertisedPublicPrefixPropertiesValidationStateAsnValidationFailed`, `AdvertisedPublicPrefixPropertiesValidationStateCertificateMissingInRoutingRegistry`, `AdvertisedPublicPrefixPropertiesValidationStateConfigured`, `AdvertisedPublicPrefixPropertiesValidationStateConfiguring`, `AdvertisedPublicPrefixPropertiesValidationStateInvalidSignatureEncoding`, `AdvertisedPublicPrefixPropertiesValidationStateManualValidationNeeded`, `AdvertisedPublicPrefixPropertiesValidationStateNotConfigured`, `AdvertisedPublicPrefixPropertiesValidationStateSignatureVerificationFailed`, `AdvertisedPublicPrefixPropertiesValidationStateValidationFailed`, `AdvertisedPublicPrefixPropertiesValidationStateValidationNeeded` +- New function `*VirtualAppliancesClient.BeginGetBootDiagnosticLogs(context.Context, string, string, *VirtualAppliancesClientBeginGetBootDiagnosticLogsOptions) (*runtime.Poller[VirtualAppliancesClientGetBootDiagnosticLogsResponse], error)` +- New function `*VirtualAppliancesClient.BeginReimage(context.Context, string, string, *VirtualAppliancesClientBeginReimageOptions) (*runtime.Poller[VirtualAppliancesClientReimageResponse], error)` +- New struct `AdvertisedPublicPrefixProperties` +- New struct `VirtualApplianceBootDiagnosticParameters` +- New struct `VirtualApplianceInstanceID` +- New field `AdvertisedPublicPrefixInfo` in struct `ExpressRouteCircuitPeeringConfig` + + ## 6.2.0 (2024-12-09) ### Features Added diff --git a/sdk/resourcemanager/network/armnetwork/README.md b/sdk/resourcemanager/network/armnetwork/README.md index c4348574780b..cbd79dcf92c1 100644 --- a/sdk/resourcemanager/network/armnetwork/README.md +++ b/sdk/resourcemanager/network/armnetwork/README.md @@ -18,7 +18,7 @@ This project uses [Go modules](https://github.com/golang/go/wiki/Modules) for ve Install the Azure Network module: ```sh -go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6 +go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7 ``` ## Authorization diff --git a/sdk/resourcemanager/network/armnetwork/adminrulecollections_client.go b/sdk/resourcemanager/network/armnetwork/adminrulecollections_client.go index 9a4c50e8871c..d0326e9bc3ce 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 2024-05-01 +// Generated from API version 2024-07-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", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Security Configuration. @@ -155,7 +155,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -205,7 +205,7 @@ func (client *AdminRuleCollectionsClient) deleteCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } @@ -217,7 +217,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Security Configuration. @@ -274,7 +274,7 @@ func (client *AdminRuleCollectionsClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -291,7 +291,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Security Configuration. @@ -350,7 +350,7 @@ func (client *AdminRuleCollectionsClient) listCreateRequest(ctx context.Context, if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil 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 0d64c1947916..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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:27.000Z"); 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:27.000Z"); 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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:27.000Z"); 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:27.000Z"); 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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:27.000Z"); 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:27.000Z"); 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 e6787b35aef1..dfbbd17bbe14 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 2024-05-01 +// Generated from API version 2024-07-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", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Security Configuration. @@ -160,7 +160,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -214,7 +214,7 @@ func (client *AdminRulesClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } @@ -226,7 +226,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Security Configuration. @@ -287,7 +287,7 @@ func (client *AdminRulesClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -304,7 +304,7 @@ func (client *AdminRulesClient) getHandleResponse(resp *http.Response) (AdminRul // NewListPager - List all network manager security configuration admin rules. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Security Configuration. @@ -367,7 +367,7 @@ func (client *AdminRulesClient) listCreateRequest(ctx context.Context, resourceG if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil 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 27e5eadfd7cc..000000000000 --- a/sdk/resourcemanager/network/armnetwork/adminrules_client_example_test.go +++ /dev/null @@ -1,389 +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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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:27.000Z"); 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:27.000Z"); 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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:27.000Z"); 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:27.000Z"); 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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:27.000Z"); 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:27.000Z"); 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/NetworkManagerAdminRulePut_NetworkGroupSource.json -func ExampleAdminRulesClient_CreateOrUpdate_createAAdminRuleWithNetworkGroupAsSourceOrDestination() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain 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("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/ng1"), - AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeNetworkGroup), - }}, - 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:27.000Z"); 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:27.000Z"); 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 using a network group as a source and destination."), - // 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), - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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:27.000Z"); 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:27.000Z"); 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 08621ae7cea9..ca9e25d8bf8f 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 2024-05-01 +// Generated from API version 2024-07-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. @@ -74,7 +74,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -120,7 +120,7 @@ func (client *ApplicationGatewayPrivateEndpointConnectionsClient) deleteCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -129,7 +129,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -181,7 +181,7 @@ func (client *ApplicationGatewayPrivateEndpointConnectionsClient) getCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -198,7 +198,7 @@ func (client *ApplicationGatewayPrivateEndpointConnectionsClient) getHandleRespo // NewListPager - Lists all private endpoint connections on an application gateway. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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 @@ -246,7 +246,7 @@ func (client *ApplicationGatewayPrivateEndpointConnectionsClient) listCreateRequ return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -264,7 +264,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -292,7 +292,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -338,7 +338,7 @@ func (client *ApplicationGatewayPrivateEndpointConnectionsClient) updateCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 66a74192fc6d..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 bffc0442fa3a..54ad3bb3093f 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 2024-05-01 +// Generated from API version 2024-07-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 @@ -94,7 +94,7 @@ func (client *ApplicationGatewayPrivateLinkResourcesClient) listCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 8b78ca10d521..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 0ccdcae68368..e63b1f0d8852 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 2024-05-01 +// Generated from API version 2024-07-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 @@ -73,7 +73,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *ApplicationGatewaysClient) backendHealth(ctx context.Context, resourceGroupName string, applicationGatewayName string, options *ApplicationGatewaysClientBeginBackendHealthOptions) (*http.Response, error) { var err error const operationName = "ApplicationGatewaysClient.BeginBackendHealth" @@ -118,7 +118,7 @@ func (client *ApplicationGatewaysClient) backendHealthCreateRequest(ctx context. if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -128,7 +128,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - applicationGatewayName - The name of the application gateway. // - probeRequest - Request body for on-demand test probe operation. @@ -156,7 +156,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -201,7 +201,7 @@ func (client *ApplicationGatewaysClient) backendHealthOnDemandCreateRequest(ctx if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, probeRequest); err != nil { @@ -213,7 +213,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -240,7 +240,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -282,7 +282,7 @@ func (client *ApplicationGatewaysClient) createOrUpdateCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -294,7 +294,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -320,7 +320,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *ApplicationGatewaysClient) deleteOperation(ctx context.Context, resourceGroupName string, applicationGatewayName string, options *ApplicationGatewaysClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ApplicationGatewaysClient.BeginDelete" @@ -362,7 +362,7 @@ func (client *ApplicationGatewaysClient) deleteCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -371,7 +371,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -417,7 +417,7 @@ func (client *ApplicationGatewaysClient) getCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -435,7 +435,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 2024-05-01 +// Generated from API version 2024-07-01 // - predefinedPolicyName - Name of Ssl predefined policy. // - options - ApplicationGatewaysClientGetSSLPredefinedPolicyOptions contains the optional parameters for the ApplicationGatewaysClient.GetSSLPredefinedPolicy // method. @@ -477,7 +477,7 @@ func (client *ApplicationGatewaysClient) getSSLPredefinedPolicyCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -494,7 +494,7 @@ func (client *ApplicationGatewaysClient) getSSLPredefinedPolicyHandleResponse(re // NewListPager - Lists all application gateways in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - ApplicationGatewaysClientListOptions contains the optional parameters for the ApplicationGatewaysClient.NewListPager // method. @@ -537,7 +537,7 @@ func (client *ApplicationGatewaysClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -554,7 +554,7 @@ func (client *ApplicationGatewaysClient) listHandleResponse(resp *http.Response) // NewListAllPager - Gets all the application gateways in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - options - ApplicationGatewaysClientListAllOptions contains the optional parameters for the ApplicationGatewaysClient.NewListAllPager // method. func (client *ApplicationGatewaysClient) NewListAllPager(options *ApplicationGatewaysClientListAllOptions) *runtime.Pager[ApplicationGatewaysClientListAllResponse] { @@ -592,7 +592,7 @@ func (client *ApplicationGatewaysClient) listAllCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -610,7 +610,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 2024-05-01 +// Generated from API version 2024-07-01 // - options - ApplicationGatewaysClientListAvailableRequestHeadersOptions contains the optional parameters for the ApplicationGatewaysClient.ListAvailableRequestHeaders // method. func (client *ApplicationGatewaysClient) ListAvailableRequestHeaders(ctx context.Context, options *ApplicationGatewaysClientListAvailableRequestHeadersOptions) (ApplicationGatewaysClientListAvailableRequestHeadersResponse, error) { @@ -647,7 +647,7 @@ func (client *ApplicationGatewaysClient) listAvailableRequestHeadersCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -665,7 +665,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 2024-05-01 +// Generated from API version 2024-07-01 // - options - ApplicationGatewaysClientListAvailableResponseHeadersOptions contains the optional parameters for the ApplicationGatewaysClient.ListAvailableResponseHeaders // method. func (client *ApplicationGatewaysClient) ListAvailableResponseHeaders(ctx context.Context, options *ApplicationGatewaysClientListAvailableResponseHeadersOptions) (ApplicationGatewaysClientListAvailableResponseHeadersResponse, error) { @@ -702,7 +702,7 @@ func (client *ApplicationGatewaysClient) listAvailableResponseHeadersCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -720,7 +720,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 2024-05-01 +// Generated from API version 2024-07-01 // - options - ApplicationGatewaysClientListAvailableSSLOptionsOptions contains the optional parameters for the ApplicationGatewaysClient.ListAvailableSSLOptions // method. func (client *ApplicationGatewaysClient) ListAvailableSSLOptions(ctx context.Context, options *ApplicationGatewaysClientListAvailableSSLOptionsOptions) (ApplicationGatewaysClientListAvailableSSLOptionsResponse, error) { @@ -757,7 +757,7 @@ func (client *ApplicationGatewaysClient) listAvailableSSLOptionsCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -774,7 +774,7 @@ func (client *ApplicationGatewaysClient) listAvailableSSLOptionsHandleResponse(r // NewListAvailableSSLPredefinedPoliciesPager - Lists all SSL predefined policies for configuring Ssl policy. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - options - ApplicationGatewaysClientListAvailableSSLPredefinedPoliciesOptions contains the optional parameters for the ApplicationGatewaysClient.NewListAvailableSSLPredefinedPoliciesPager // method. func (client *ApplicationGatewaysClient) NewListAvailableSSLPredefinedPoliciesPager(options *ApplicationGatewaysClientListAvailableSSLPredefinedPoliciesOptions) *runtime.Pager[ApplicationGatewaysClientListAvailableSSLPredefinedPoliciesResponse] { @@ -812,7 +812,7 @@ func (client *ApplicationGatewaysClient) listAvailableSSLPredefinedPoliciesCreat return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -830,7 +830,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 2024-05-01 +// Generated from API version 2024-07-01 // - options - ApplicationGatewaysClientListAvailableServerVariablesOptions contains the optional parameters for the ApplicationGatewaysClient.ListAvailableServerVariables // method. func (client *ApplicationGatewaysClient) ListAvailableServerVariables(ctx context.Context, options *ApplicationGatewaysClientListAvailableServerVariablesOptions) (ApplicationGatewaysClientListAvailableServerVariablesResponse, error) { @@ -867,7 +867,7 @@ func (client *ApplicationGatewaysClient) listAvailableServerVariablesCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -885,7 +885,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 2024-05-01 +// Generated from API version 2024-07-01 // - options - ApplicationGatewaysClientListAvailableWafRuleSetsOptions contains the optional parameters for the ApplicationGatewaysClient.ListAvailableWafRuleSets // method. func (client *ApplicationGatewaysClient) ListAvailableWafRuleSets(ctx context.Context, options *ApplicationGatewaysClientListAvailableWafRuleSetsOptions) (ApplicationGatewaysClientListAvailableWafRuleSetsResponse, error) { @@ -922,7 +922,7 @@ func (client *ApplicationGatewaysClient) listAvailableWafRuleSetsCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -940,7 +940,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -966,7 +966,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *ApplicationGatewaysClient) start(ctx context.Context, resourceGroupName string, applicationGatewayName string, options *ApplicationGatewaysClientBeginStartOptions) (*http.Response, error) { var err error const operationName = "ApplicationGatewaysClient.BeginStart" @@ -1008,7 +1008,7 @@ func (client *ApplicationGatewaysClient) startCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1017,7 +1017,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -1043,7 +1043,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *ApplicationGatewaysClient) stop(ctx context.Context, resourceGroupName string, applicationGatewayName string, options *ApplicationGatewaysClientBeginStopOptions) (*http.Response, error) { var err error const operationName = "ApplicationGatewaysClient.BeginStop" @@ -1085,7 +1085,7 @@ func (client *ApplicationGatewaysClient) stopCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1094,7 +1094,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - applicationGatewayName - The name of the application gateway. // - parameters - Parameters supplied to update application gateway tags. @@ -1142,7 +1142,7 @@ func (client *ApplicationGatewaysClient) updateTagsCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 7ca4f02377d0..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 45d3570b7765..38dc8d1a6b4e 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 2024-05-01 +// Generated from API version 2024-07-01 // - location - The region where the nrp are located at. // - options - ApplicationGatewayWafDynamicManifestsClientGetOptions contains the optional parameters for the ApplicationGatewayWafDynamicManifestsClient.NewGetPager // method. @@ -89,7 +89,7 @@ func (client *ApplicationGatewayWafDynamicManifestsClient) getCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 81c80063cf70..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/applicationgatewaywafdynamicmanifests_live_test.go b/sdk/resourcemanager/network/armnetwork/applicationgatewaywafdynamicmanifests_live_test.go index 1bf432ecacea..fc3f8b799f16 100644 --- a/sdk/resourcemanager/network/armnetwork/applicationgatewaywafdynamicmanifests_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/applicationgatewaywafdynamicmanifests_live_test.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/applicationgatewaywafdynamicmanifestsdefault_client.go b/sdk/resourcemanager/network/armnetwork/applicationgatewaywafdynamicmanifestsdefault_client.go index b5acb3421f1b..dedd051585d5 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 2024-05-01 +// Generated from API version 2024-07-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", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 c477d8e01c27..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/applicationsecuritygroup_live_test.go b/sdk/resourcemanager/network/armnetwork/applicationsecuritygroup_live_test.go index e85f405113e6..a1ec8d525dcb 100644 --- a/sdk/resourcemanager/network/armnetwork/applicationsecuritygroup_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/applicationsecuritygroup_live_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/applicationsecuritygroups_client.go b/sdk/resourcemanager/network/armnetwork/applicationsecuritygroups_client.go index d11fe3c1e3b3..94cf0df7b586 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 2024-05-01 +// Generated from API version 2024-07-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. @@ -74,7 +74,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -116,7 +116,7 @@ func (client *ApplicationSecurityGroupsClient) createOrUpdateCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -128,7 +128,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -154,7 +154,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *ApplicationSecurityGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, applicationSecurityGroupName string, options *ApplicationSecurityGroupsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ApplicationSecurityGroupsClient.BeginDelete" @@ -196,7 +196,7 @@ func (client *ApplicationSecurityGroupsClient) deleteCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -205,7 +205,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -252,7 +252,7 @@ func (client *ApplicationSecurityGroupsClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -269,7 +269,7 @@ func (client *ApplicationSecurityGroupsClient) getHandleResponse(resp *http.Resp // NewListPager - Gets all the application security groups in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - ApplicationSecurityGroupsClientListOptions contains the optional parameters for the ApplicationSecurityGroupsClient.NewListPager // method. @@ -312,7 +312,7 @@ func (client *ApplicationSecurityGroupsClient) listCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -329,7 +329,7 @@ func (client *ApplicationSecurityGroupsClient) listHandleResponse(resp *http.Res // NewListAllPager - Gets all application security groups in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - options - ApplicationSecurityGroupsClientListAllOptions contains the optional parameters for the ApplicationSecurityGroupsClient.NewListAllPager // method. func (client *ApplicationSecurityGroupsClient) NewListAllPager(options *ApplicationSecurityGroupsClientListAllOptions) *runtime.Pager[ApplicationSecurityGroupsClientListAllResponse] { @@ -367,7 +367,7 @@ func (client *ApplicationSecurityGroupsClient) listAllCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -385,7 +385,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -433,7 +433,7 @@ func (client *ApplicationSecurityGroupsClient) updateTagsCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 d799432e2ea7..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 05ed14d22535..420d23734898 100644 --- a/sdk/resourcemanager/network/armnetwork/autorest.md +++ b/sdk/resourcemanager/network/armnetwork/autorest.md @@ -5,9 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/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-version: 6.2.0 -tag: package-2024-05 +module-version: 7.0.0 ``` diff --git a/sdk/resourcemanager/network/armnetwork/availabledelegations_client.go b/sdk/resourcemanager/network/armnetwork/availabledelegations_client.go index ba70192e252c..9d2566c685a7 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 2024-05-01 +// Generated from API version 2024-07-01 // - location - The location of the subnet. // - options - AvailableDelegationsClientListOptions contains the optional parameters for the AvailableDelegationsClient.NewListPager // method. @@ -89,7 +89,7 @@ func (client *AvailableDelegationsClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 4db270f699e1..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/availabledelegations_live_test.go b/sdk/resourcemanager/network/armnetwork/availabledelegations_live_test.go index 1fab20deb4cd..c96b59155c67 100644 --- a/sdk/resourcemanager/network/armnetwork/availabledelegations_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/availabledelegations_live_test.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/availableendpointservices_client.go b/sdk/resourcemanager/network/armnetwork/availableendpointservices_client.go index c133087e0b4e..6c19ebcbb444 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 2024-05-01 +// Generated from API version 2024-07-01 // - location - The location to check available endpoint services. // - options - AvailableEndpointServicesClientListOptions contains the optional parameters for the AvailableEndpointServicesClient.NewListPager // method. @@ -89,7 +89,7 @@ func (client *AvailableEndpointServicesClient) listCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 b0618df006ae..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 1a9771dad0e2..0dbe7705df38 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 2024-05-01 +// Generated from API version 2024-07-01 // - location - The location of the domain name. // - options - AvailablePrivateEndpointTypesClientListOptions contains the optional parameters for the AvailablePrivateEndpointTypesClient.NewListPager // method. @@ -90,7 +90,7 @@ func (client *AvailablePrivateEndpointTypesClient) listCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -108,7 +108,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -156,7 +156,7 @@ func (client *AvailablePrivateEndpointTypesClient) listByResourceGroupCreateRequ return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 23250fc22e9e..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 63c742f340c8..7c44edfbf264 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 2024-05-01 +// Generated from API version 2024-07-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 @@ -94,7 +94,7 @@ func (client *AvailableResourceGroupDelegationsClient) listCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 dcac73642165..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 25fed378647b..4f6eaca2f9f0 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 2024-05-01 +// Generated from API version 2024-07-01 // - location - The location. // - options - AvailableServiceAliasesClientListOptions contains the optional parameters for the AvailableServiceAliasesClient.NewListPager // method. @@ -89,7 +89,7 @@ func (client *AvailableServiceAliasesClient) listCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -106,7 +106,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - location - The location. // - options - AvailableServiceAliasesClientListByResourceGroupOptions contains the optional parameters for the AvailableServiceAliasesClient.NewListByResourceGroupPager @@ -154,7 +154,7 @@ func (client *AvailableServiceAliasesClient) listByResourceGroupCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 a3767ecfa297..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/availableservicealiases_live_test.go b/sdk/resourcemanager/network/armnetwork/availableservicealiases_live_test.go index 60ef18967d63..a710397ef0ba 100644 --- a/sdk/resourcemanager/network/armnetwork/availableservicealiases_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/availableservicealiases_live_test.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/azurefirewallfqdntag_live_test.go b/sdk/resourcemanager/network/armnetwork/azurefirewallfqdntag_live_test.go index 1f3f6d7cbcdf..62b6879c5c1a 100644 --- a/sdk/resourcemanager/network/armnetwork/azurefirewallfqdntag_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/azurefirewallfqdntag_live_test.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/azurefirewallfqdntags_client.go b/sdk/resourcemanager/network/armnetwork/azurefirewallfqdntags_client.go index 386bfe8f0f6c..b343b89dd60a 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 2024-05-01 +// Generated from API version 2024-07-01 // - options - AzureFirewallFqdnTagsClientListAllOptions contains the optional parameters for the AzureFirewallFqdnTagsClient.NewListAllPager // method. func (client *AzureFirewallFqdnTagsClient) NewListAllPager(options *AzureFirewallFqdnTagsClientListAllOptions) *runtime.Pager[AzureFirewallFqdnTagsClientListAllResponse] { @@ -84,7 +84,7 @@ func (client *AzureFirewallFqdnTagsClient) listAllCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 bd4d59fb8368..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 798b5c858119..0407307aa7fa 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 2024-05-01 +// Generated from API version 2024-07-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. @@ -74,7 +74,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -116,7 +116,7 @@ func (client *AzureFirewallsClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -128,7 +128,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -154,7 +154,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *AzureFirewallsClient) deleteOperation(ctx context.Context, resourceGroupName string, azureFirewallName string, options *AzureFirewallsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "AzureFirewallsClient.BeginDelete" @@ -196,7 +196,7 @@ func (client *AzureFirewallsClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -205,7 +205,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -251,7 +251,7 @@ func (client *AzureFirewallsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -268,7 +268,7 @@ func (client *AzureFirewallsClient) getHandleResponse(resp *http.Response) (Azur // NewListPager - Lists all Azure Firewalls in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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] { @@ -310,7 +310,7 @@ func (client *AzureFirewallsClient) listCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -327,7 +327,7 @@ func (client *AzureFirewallsClient) listHandleResponse(resp *http.Response) (Azu // NewListAllPager - Gets all the Azure Firewalls in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - options - AzureFirewallsClientListAllOptions contains the optional parameters for the AzureFirewallsClient.NewListAllPager // method. func (client *AzureFirewallsClient) NewListAllPager(options *AzureFirewallsClientListAllOptions) *runtime.Pager[AzureFirewallsClientListAllResponse] { @@ -365,7 +365,7 @@ func (client *AzureFirewallsClient) listAllCreateRequest(ctx context.Context, op return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -383,7 +383,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -409,7 +409,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *AzureFirewallsClient) listLearnedPrefixes(ctx context.Context, resourceGroupName string, azureFirewallName string, options *AzureFirewallsClientBeginListLearnedPrefixesOptions) (*http.Response, error) { var err error const operationName = "AzureFirewallsClient.BeginListLearnedPrefixes" @@ -451,7 +451,7 @@ func (client *AzureFirewallsClient) listLearnedPrefixesCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -460,7 +460,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -487,7 +487,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -529,7 +529,7 @@ func (client *AzureFirewallsClient) packetCaptureCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -541,7 +541,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - azureFirewallName - The name of the Azure Firewall. // - parameters - Parameters supplied to update azure firewall tags. @@ -568,7 +568,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -610,7 +610,7 @@ func (client *AzureFirewallsClient) updateTagsCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 0435e0b3a680..000000000000 --- a/sdk/resourcemanager/network/armnetwork/azurefirewalls_client_example_test.go +++ /dev/null @@ -1,2987 +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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/applicationRuleCollections/apprulecoll"), - // 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")}, - // }}, - // }, - // }}, - // AutoscaleConfiguration: &armnetwork.AzureFirewallAutoscaleConfiguration{ - // MaxCapacity: to.Ptr[int32](15), - // MinCapacity: to.Ptr[int32](10), - // }, - // IPConfigurations: []*armnetwork.AzureFirewallIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/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{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/natRuleCollections/natrulecoll"), - // 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{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/networkRuleCollections/netrulecoll"), - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/applicationRuleCollections/apprulecoll"), - // 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/azurefirewall/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{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/natRuleCollections/natrulecoll"), - // 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{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/networkRuleCollections/netrulecoll"), - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/applicationRuleCollections/apprulecoll"), - // 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/azurefirewall/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{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/natRuleCollections/natrulecoll"), - // 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{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/networkRuleCollections/netrulecoll"), - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/applicationRuleCollections/apprulecoll"), - // 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/azurefirewall/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{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/natRuleCollections/natrulecoll"), - // 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{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/networkRuleCollections/netrulecoll"), - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/applicationRuleCollections/apprulecoll"), - // 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/azurefirewall/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/azurefirewall/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{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/natRuleCollections/natrulecoll"), - // 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{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/networkRuleCollections/netrulecoll"), - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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{ - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/applicationRuleCollections/apprulecoll"), - 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{ - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/natRuleCollections/natrulecoll"), - 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{ - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/networkRuleCollections/netrulecoll"), - 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{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/applicationRuleCollections/apprulecoll"), - // 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/azurefirewall/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{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/natRuleCollections/natrulecoll"), - // 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{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/networkRuleCollections/netrulecoll"), - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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{ - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/applicationRuleCollections/apprulecoll"), - 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{ - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/natRuleCollections/natrulecoll"), - 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{ - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/networkRuleCollections/netrulecoll"), - 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{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/applicationRuleCollections/apprulecoll"), - // 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/azurefirewall/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{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/natRuleCollections/natrulecoll"), - // 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{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/networkRuleCollections/netrulecoll"), - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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{ - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/applicationRuleCollections/apprulecoll"), - 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{ - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/natRuleCollections/natrulecoll"), - 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{ - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/networkRuleCollections/netrulecoll"), - 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{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/applicationRuleCollections/apprulecoll"), - // 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/azurefirewall/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{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/natRuleCollections/natrulecoll"), - // 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{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/networkRuleCollections/netrulecoll"), - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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{ - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/applicationRuleCollections/apprulecoll"), - 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{ - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/natRuleCollections/natrulecoll"), - 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{ - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/networkRuleCollections/netrulecoll"), - 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{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/applicationRuleCollections/apprulecoll"), - // 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/azurefirewall/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{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/natRuleCollections/natrulecoll"), - // 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{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/networkRuleCollections/netrulecoll"), - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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{ - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/applicationRuleCollections/apprulecoll"), - 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{ - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/natRuleCollections/natrulecoll"), - 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{ - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/networkRuleCollections/netrulecoll"), - 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{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/applicationRuleCollections/apprulecoll"), - // 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/azurefirewall/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{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/natRuleCollections/natrulecoll"), - // 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{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/networkRuleCollections/netrulecoll"), - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/applicationRuleCollections/apprulecoll"), - // 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/azurefirewall/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/azurefirewall/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{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/natRuleCollections/natrulecoll"), - // 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{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/networkRuleCollections/netrulecoll"), - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/applicationRuleCollections/apprulecoll"), - // 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/azurefirewall/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/azurefirewall/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{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/natRuleCollections/natrulecoll"), - // 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{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/networkRuleCollections/netrulecoll"), - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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{ - 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/azurewebcategory_live_test.go b/sdk/resourcemanager/network/armnetwork/azurewebcategory_live_test.go index ad4d12530531..0ad772907e28 100644 --- a/sdk/resourcemanager/network/armnetwork/azurewebcategory_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/azurewebcategory_live_test.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/bastionhost_live_test.go b/sdk/resourcemanager/network/armnetwork/bastionhost_live_test.go index dd772b930191..9f692ddb2d54 100644 --- a/sdk/resourcemanager/network/armnetwork/bastionhost_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/bastionhost_live_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/bastionhosts_client.go b/sdk/resourcemanager/network/armnetwork/bastionhosts_client.go index 39d56ad14332..7f4e5b5c0a08 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 2024-05-01 +// Generated from API version 2024-07-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. @@ -74,7 +74,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -116,7 +116,7 @@ func (client *BastionHostsClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -128,7 +128,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -154,7 +154,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *BastionHostsClient) deleteOperation(ctx context.Context, resourceGroupName string, bastionHostName string, options *BastionHostsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "BastionHostsClient.BeginDelete" @@ -196,7 +196,7 @@ func (client *BastionHostsClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -205,7 +205,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -251,7 +251,7 @@ func (client *BastionHostsClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -268,7 +268,7 @@ func (client *BastionHostsClient) getHandleResponse(resp *http.Response) (Bastio // NewListPager - Lists all Bastion Hosts in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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]{ @@ -305,7 +305,7 @@ func (client *BastionHostsClient) listCreateRequest(ctx context.Context, options return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -322,7 +322,7 @@ func (client *BastionHostsClient) listHandleResponse(resp *http.Response) (Basti // NewListByResourceGroupPager - Lists all Bastion Hosts in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - BastionHostsClientListByResourceGroupOptions contains the optional parameters for the BastionHostsClient.NewListByResourceGroupPager // method. @@ -365,7 +365,7 @@ func (client *BastionHostsClient) listByResourceGroupCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -383,7 +383,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - bastionHostName - The name of the Bastion Host. // - parameters - Parameters supplied to update BastionHost tags. @@ -410,7 +410,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -452,7 +452,7 @@ func (client *BastionHostsClient) updateTagsCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 ce29ccde438b..000000000000 --- a/sdk/resourcemanager/network/armnetwork/bastionhosts_client_example_test.go +++ /dev/null @@ -1,980 +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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/BastionHostDelete.json -func ExampleBastionHostsClient_BeginDelete_deleteBastionHost() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/BastionHostDeveloperDelete.json -func ExampleBastionHostsClient_BeginDelete_deleteDeveloperBastionHost() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", 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, "rg2", "bastionhostdeveloper", 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/BastionHostGet.json -func ExampleBastionHostsClient_Get_getBastionHost() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain 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), - // EnablePrivateOnlyBastion: to.Ptr(false), - // EnableSessionRecording: 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), - // }, - // Zones: []*string{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/BastionHostGetWithPrivateOnly.json -func ExampleBastionHostsClient_Get_getBastionHostWithPrivateOnly() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain 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("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{ - // "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), - // EnablePrivateOnlyBastion: to.Ptr(true), - // EnableSessionRecording: 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), - // 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.BastionHostSKUNamePremium), - // }, - // Zones: []*string{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/BastionHostGetWithZones.json -func ExampleBastionHostsClient_Get_getBastionHostWithZones() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain 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("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{ - // "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), - // EnablePrivateOnlyBastion: to.Ptr(false), - // EnableSessionRecording: 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), - // }, - // Zones: []*string{ - // to.Ptr("1"), - // to.Ptr("2")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/BastionHostDeveloperGet.json -func ExampleBastionHostsClient_Get_getDeveloperBastionHost() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain 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", "bastionhostdeveloper'", 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("bastionhostdeveloper'"), - // Type: to.Ptr("Microsoft.Network/bastionHosts"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/bastionHosts/bastionhostdeveloper'"), - // Location: to.Ptr("West US"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.BastionHostPropertiesFormat{ - // DNSName: to.Ptr("omnibrain.uswest.bastionglobal.azure.com"), - // IPConfigurations: []*armnetwork.BastionHostIPConfiguration{ - // }, - // NetworkACLs: &armnetwork.BastionHostPropertiesFormatNetworkACLs{ - // IPRules: []*armnetwork.IPRule{ - // { - // AddressPrefix: to.Ptr("1.1.1.1/16"), - // }}, - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualNetwork: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/vnet2"), - // }, - // }, - // SKU: &armnetwork.SKU{ - // Name: to.Ptr(armnetwork.BastionHostSKUNameDeveloper), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/BastionHostPut.json -func ExampleBastionHostsClient_BeginCreateOrUpdate_createBastionHost() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", 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), - // EnablePrivateOnlyBastion: to.Ptr(false), - // EnableSessionRecording: 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/BastionHostPutWithPrivateOnly.json -func ExampleBastionHostsClient_BeginCreateOrUpdate_createBastionHostWithPrivateOnly() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", 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{ - EnablePrivateOnlyBastion: to.Ptr(true), - IPConfigurations: []*armnetwork.BastionHostIPConfiguration{ - { - Name: to.Ptr("bastionHostIpConfiguration"), - Properties: &armnetwork.BastionHostIPConfigurationPropertiesFormat{ - 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("bastionhosttenant"), - // 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), - // EnablePrivateOnlyBastion: to.Ptr(true), - // EnableSessionRecording: 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), - // 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.BastionHostSKUNamePremium), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/BastionHostPutWithZones.json -func ExampleBastionHostsClient_BeginCreateOrUpdate_createBastionHostWithZones() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", 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), - // EnablePrivateOnlyBastion: to.Ptr(false), - // EnableSessionRecording: 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/BastionHostDeveloperPut.json -func ExampleBastionHostsClient_BeginCreateOrUpdate_createDeveloperBastionHost() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", 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, "rg2", "bastionhostdeveloper", armnetwork.BastionHost{ - Properties: &armnetwork.BastionHostPropertiesFormat{ - IPConfigurations: []*armnetwork.BastionHostIPConfiguration{}, - NetworkACLs: &armnetwork.BastionHostPropertiesFormatNetworkACLs{ - IPRules: []*armnetwork.IPRule{ - { - AddressPrefix: to.Ptr("1.1.1.1/16"), - }}, - }, - VirtualNetwork: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/vnet2"), - }, - }, - }, 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("bastionhostdeveloper"), - // Type: to.Ptr("Microsoft.Network/bastionHosts"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/bastionHosts/bastionhostdeveloper'"), - // Location: to.Ptr("West US"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.BastionHostPropertiesFormat{ - // DNSName: to.Ptr("omnibrain.uswest.bastionglobal.azure.com"), - // IPConfigurations: []*armnetwork.BastionHostIPConfiguration{ - // }, - // NetworkACLs: &armnetwork.BastionHostPropertiesFormatNetworkACLs{ - // IPRules: []*armnetwork.IPRule{ - // { - // AddressPrefix: to.Ptr("1.1.1.1/16"), - // }}, - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualNetwork: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/vnet2"), - // }, - // }, - // SKU: &armnetwork.SKU{ - // Name: to.Ptr(armnetwork.BastionHostSKUNameDeveloper), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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), - // EnablePrivateOnlyBastion: to.Ptr(false), - // EnableSessionRecording: 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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("bastionhosttenant"), - // 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), - // EnablePrivateOnlyBastion: to.Ptr(false), - // EnableSessionRecording: 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/vnet/subnets/AzureBastionSubnet"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ScaleUnits: to.Ptr[int32](2), - // }, - // SKU: &armnetwork.SKU{ - // Name: to.Ptr(armnetwork.BastionHostSKUNameStandard), - // }, - // Zones: []*string{ - // }, - // }, - // { - // Name: to.Ptr("bastionhostdeveloper"), - // Type: to.Ptr("Microsoft.Network/bastionHosts"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/bastionHosts/bastionhostdeveloper"), - // Location: to.Ptr("West US"), - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetwork.BastionHostPropertiesFormat{ - // DNSName: to.Ptr("omnibrain.uswest.bastionglobal.azure.com"), - // IPConfigurations: []*armnetwork.BastionHostIPConfiguration{ - // }, - // NetworkACLs: &armnetwork.BastionHostPropertiesFormatNetworkACLs{ - // IPRules: []*armnetwork.IPRule{ - // { - // AddressPrefix: to.Ptr("1.1.1.1/16"), - // }}, - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualNetwork: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/vnet2"), - // }, - // }, - // SKU: &armnetwork.SKU{ - // Name: to.Ptr(armnetwork.BastionHostSKUNameDeveloper), - // }, - // }, - // { - // Name: to.Ptr("bastionhost3"), - // Type: to.Ptr("Microsoft.Network/bastionHosts"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhost3"), - // 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), - // EnablePrivateOnlyBastion: to.Ptr(false), - // EnableSessionRecording: to.Ptr(true), - // EnableShareableLink: to.Ptr(false), - // EnableTunneling: to.Ptr(false), - // IPConfigurations: []*armnetwork.BastionHostIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhost3/bastionHostIpConfigurations/IpConf"), - // 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/pipName3"), - // }, - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet3/subnets/AzureBastionSubnet"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ScaleUnits: to.Ptr[int32](2), - // }, - // SKU: &armnetwork.SKU{ - // Name: to.Ptr(armnetwork.BastionHostSKUNamePremium), - // }, - // Zones: []*string{ - // }, - // }, - // { - // Name: to.Ptr("bastionhost4"), - // Type: to.Ptr("Microsoft.Network/bastionHosts"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhost4"), - // 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), - // EnablePrivateOnlyBastion: to.Ptr(true), - // EnableSessionRecording: 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/bastionhost4/bastionHostIpConfigurations/IpConf"), - // 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), - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet4/subnets/AzureBastionSubnet"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ScaleUnits: to.Ptr[int32](2), - // }, - // SKU: &armnetwork.SKU{ - // Name: to.Ptr(armnetwork.BastionHostSKUNamePremium), - // }, - // Zones: []*string{ - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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("bastionhosttenant"), - // 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), - // EnablePrivateOnlyBastion: to.Ptr(false), - // EnableSessionRecording: 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/vnet/subnets/AzureBastionSubnet"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ScaleUnits: to.Ptr[int32](2), - // }, - // SKU: &armnetwork.SKU{ - // Name: to.Ptr(armnetwork.BastionHostSKUNameStandard), - // }, - // Zones: []*string{ - // }, - // }, - // { - // Name: to.Ptr("bastionhost2"), - // Type: to.Ptr("Microsoft.Network/bastionHosts"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhost2"), - // 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), - // EnablePrivateOnlyBastion: to.Ptr(false), - // EnableSessionRecording: to.Ptr(true), - // EnableShareableLink: to.Ptr(false), - // EnableTunneling: to.Ptr(false), - // IPConfigurations: []*armnetwork.BastionHostIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhost2/bastionHostIpConfigurations/IpConf"), - // 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/pipName2"), - // }, - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureBastionSubnet"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ScaleUnits: to.Ptr[int32](2), - // }, - // SKU: &armnetwork.SKU{ - // Name: to.Ptr(armnetwork.BastionHostSKUNamePremium), - // }, - // Zones: []*string{ - // }, - // }, - // { - // Name: to.Ptr("bastionhost3"), - // Type: to.Ptr("Microsoft.Network/bastionHosts"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhost3"), - // 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), - // EnablePrivateOnlyBastion: to.Ptr(true), - // EnableSessionRecording: 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/bastionhost3/bastionHostIpConfigurations/IpConf"), - // 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), - // Subnet: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet3/subnets/AzureBastionSubnet"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ScaleUnits: to.Ptr[int32](2), - // }, - // SKU: &armnetwork.SKU{ - // Name: to.Ptr(armnetwork.BastionHostSKUNamePremium), - // }, - // Zones: []*string{ - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/bgpservicecommunities_client.go b/sdk/resourcemanager/network/armnetwork/bgpservicecommunities_client.go index e018e227facb..a0722bfdc181 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 2024-05-01 +// Generated from API version 2024-07-01 // - options - BgpServiceCommunitiesClientListOptions contains the optional parameters for the BgpServiceCommunitiesClient.NewListPager // method. func (client *BgpServiceCommunitiesClient) NewListPager(options *BgpServiceCommunitiesClientListOptions) *runtime.Pager[BgpServiceCommunitiesClientListResponse] { @@ -84,7 +84,7 @@ func (client *BgpServiceCommunitiesClient) listCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 c9937c70e0d3..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/checkdnsavailability_live_test.go b/sdk/resourcemanager/network/armnetwork/checkdnsavailability_live_test.go index 51398cc719bf..381c4b09be5b 100644 --- a/sdk/resourcemanager/network/armnetwork/checkdnsavailability_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/checkdnsavailability_live_test.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/configurationpolicygroups_client.go b/sdk/resourcemanager/network/armnetwork/configurationpolicygroups_client.go index 1c615a8956e7..daacb1a80d49 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the ConfigurationPolicyGroup. // - vpnServerConfigurationName - The name of the VpnServerConfiguration. // - configurationPolicyGroupName - The name of the ConfigurationPolicyGroup. @@ -75,7 +75,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -121,7 +121,7 @@ func (client *ConfigurationPolicyGroupsClient) createOrUpdateCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, vpnServerConfigurationPolicyGroupParameters); err != nil { @@ -133,7 +133,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the ConfigurationPolicyGroup. // - vpnServerConfigurationName - The name of the VpnServerConfiguration. // - configurationPolicyGroupName - The name of the ConfigurationPolicyGroup. @@ -160,7 +160,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -206,7 +206,7 @@ func (client *ConfigurationPolicyGroupsClient) deleteCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -215,7 +215,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VpnServerConfiguration. // - vpnServerConfigurationName - The name of the VpnServerConfiguration. // - configurationPolicyGroupName - The name of the ConfigurationPolicyGroup being retrieved. @@ -267,7 +267,7 @@ func (client *ConfigurationPolicyGroupsClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -284,7 +284,7 @@ func (client *ConfigurationPolicyGroupsClient) getHandleResponse(resp *http.Resp // NewListByVPNServerConfigurationPager - Lists all the configurationPolicyGroups in a resource group for a vpnServerConfiguration. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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 @@ -332,7 +332,7 @@ func (client *ConfigurationPolicyGroupsClient) listByVPNServerConfigurationCreat return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 32c342728c45..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 1e94426f50b4..81b7692fba20 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 2024-05-01 +// Generated from API version 2024-07-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. @@ -75,7 +75,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -121,7 +121,7 @@ func (client *ConnectionMonitorsClient) createOrUpdateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") if options != nil && options.Migrate != nil { reqQP.Set("migrate", *options.Migrate) } @@ -136,7 +136,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -163,7 +163,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -209,7 +209,7 @@ func (client *ConnectionMonitorsClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -218,7 +218,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -269,7 +269,7 @@ func (client *ConnectionMonitorsClient) getCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -286,7 +286,7 @@ func (client *ConnectionMonitorsClient) getHandleResponse(resp *http.Response) ( // NewListPager - Lists all connection monitors for the specified Network Watcher. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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 @@ -335,7 +335,7 @@ func (client *ConnectionMonitorsClient) listCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -353,7 +353,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -380,7 +380,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -426,7 +426,7 @@ func (client *ConnectionMonitorsClient) queryCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -435,7 +435,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -462,7 +462,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -508,7 +508,7 @@ func (client *ConnectionMonitorsClient) startCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -517,7 +517,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -544,7 +544,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -590,7 +590,7 @@ func (client *ConnectionMonitorsClient) stopCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -599,7 +599,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkWatcherName - The name of the network watcher. // - connectionMonitorName - The name of the connection monitor. @@ -652,7 +652,7 @@ func (client *ConnectionMonitorsClient) updateTagsCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 7629f2c5bcb9..000000000000 --- a/sdk/resourcemanager/network/armnetwork/connectionmonitors_client_example_test.go +++ /dev/null @@ -1,721 +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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/NetworkWatcherConnectionMonitorCreateWithArcNetwork.json -func ExampleConnectionMonitorsClient_BeginCreateOrUpdate_createConnectionMonitorWithArcNetwork() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", 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"), - Type: to.Ptr(armnetwork.EndpointTypeAzureVM), - ResourceID: to.Ptr("/subscriptions/9cece3e3-0f7d-47ca-af0e-9772773f90b7/resourceGroups/testRG/providers/Microsoft.Compute/virtualMachines/TESTVM"), - }, - { - Name: to.Ptr("bing"), - Type: to.Ptr(armnetwork.EndpointTypeExternalAddress), - Address: to.Ptr("bing.com"), - }, - { - Name: to.Ptr("google"), - Type: to.Ptr(armnetwork.EndpointTypeExternalAddress), - Address: to.Ptr("google.com"), - }, - { - Name: to.Ptr("ArcBasedNetwork"), - Type: to.Ptr(armnetwork.EndpointTypeAzureArcNetwork), - LocationDetails: &armnetwork.ConnectionMonitorEndpointLocationDetails{ - Region: to.Ptr("eastus"), - }, - Scope: &armnetwork.ConnectionMonitorEndpointScope{ - Include: []*armnetwork.ConnectionMonitorEndpointScopeItem{ - { - Address: to.Ptr("172.21.128.0/20"), - }}, - }, - SubscriptionID: to.Ptr("9cece3e3-0f7d-47ca-af0e-9772773f90b7"), - }}, - 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("ArcBasedNetwork")}, - 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/9cece3e3-0f7d-47ca-af0e-9772773f90b7/resourceGroups/testRG/providers/Microsoft.Compute/virtualMachines/TESTVM"), - // }, - // { - // Name: to.Ptr("ArcBasedNetwork"), - // Type: to.Ptr(armnetwork.EndpointTypeAzureArcNetwork), - // LocationDetails: &armnetwork.ConnectionMonitorEndpointLocationDetails{ - // Region: to.Ptr("eastus"), - // }, - // Scope: &armnetwork.ConnectionMonitorEndpointScope{ - // Include: []*armnetwork.ConnectionMonitorEndpointScopeItem{ - // { - // Address: to.Ptr("172.21.128.0/20"), - // }}, - // }, - // SubscriptionID: to.Ptr("9cece3e3-0f7d-47ca-af0e-9772773f90b7"), - // }, - // { - // 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("ArcBasedNetwork")}, - // TestConfigurations: []*string{ - // to.Ptr("testConfig1")}, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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.679Z"); 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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.526Z"); 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.338Z"); return t}()), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 fe590913732a..177dd7e1d983 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 2024-05-01 +// Generated from API version 2024-07-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", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager connectivity configuration. @@ -151,7 +151,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -197,7 +197,7 @@ func (client *ConnectivityConfigurationsClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } @@ -210,7 +210,7 @@ func (client *ConnectivityConfigurationsClient) deleteCreateRequest(ctx context. // Configuration name // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager connectivity configuration. @@ -262,7 +262,7 @@ func (client *ConnectivityConfigurationsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -279,7 +279,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -333,7 +333,7 @@ func (client *ConnectivityConfigurationsClient) listCreateRequest(ctx context.Co if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil 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 bcca2c7ed289..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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:27.000Z"); 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:27.000Z"); 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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:27.000Z"); 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:27.000Z"); 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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:27.000Z"); 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:27.000Z"); 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 eb9395b8adbe..3a6dd642c133 100644 --- a/sdk/resourcemanager/network/armnetwork/constants.go +++ b/sdk/resourcemanager/network/armnetwork/constants.go @@ -10,7 +10,7 @@ package armnetwork const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork" - moduleVersion = "v6.2.0" + moduleVersion = "v7.0.0" ) // Access - Access to be allowed or denied. @@ -119,6 +119,39 @@ func PossibleAdminStateValues() []AdminState { } } +// AdvertisedPublicPrefixPropertiesValidationState - Advertised Public Prefix State that denotes if the prefix is validated +// or not. +type AdvertisedPublicPrefixPropertiesValidationState string + +const ( + AdvertisedPublicPrefixPropertiesValidationStateAsnValidationFailed AdvertisedPublicPrefixPropertiesValidationState = "AsnValidationFailed" + AdvertisedPublicPrefixPropertiesValidationStateCertificateMissingInRoutingRegistry AdvertisedPublicPrefixPropertiesValidationState = "CertificateMissingInRoutingRegistry" + AdvertisedPublicPrefixPropertiesValidationStateConfigured AdvertisedPublicPrefixPropertiesValidationState = "Configured" + AdvertisedPublicPrefixPropertiesValidationStateConfiguring AdvertisedPublicPrefixPropertiesValidationState = "Configuring" + AdvertisedPublicPrefixPropertiesValidationStateInvalidSignatureEncoding AdvertisedPublicPrefixPropertiesValidationState = "InvalidSignatureEncoding" + AdvertisedPublicPrefixPropertiesValidationStateManualValidationNeeded AdvertisedPublicPrefixPropertiesValidationState = "ManualValidationNeeded" + AdvertisedPublicPrefixPropertiesValidationStateNotConfigured AdvertisedPublicPrefixPropertiesValidationState = "NotConfigured" + AdvertisedPublicPrefixPropertiesValidationStateSignatureVerificationFailed AdvertisedPublicPrefixPropertiesValidationState = "SignatureVerificationFailed" + AdvertisedPublicPrefixPropertiesValidationStateValidationFailed AdvertisedPublicPrefixPropertiesValidationState = "ValidationFailed" + AdvertisedPublicPrefixPropertiesValidationStateValidationNeeded AdvertisedPublicPrefixPropertiesValidationState = "ValidationNeeded" +) + +// PossibleAdvertisedPublicPrefixPropertiesValidationStateValues returns the possible values for the AdvertisedPublicPrefixPropertiesValidationState const type. +func PossibleAdvertisedPublicPrefixPropertiesValidationStateValues() []AdvertisedPublicPrefixPropertiesValidationState { + return []AdvertisedPublicPrefixPropertiesValidationState{ + AdvertisedPublicPrefixPropertiesValidationStateAsnValidationFailed, + AdvertisedPublicPrefixPropertiesValidationStateCertificateMissingInRoutingRegistry, + AdvertisedPublicPrefixPropertiesValidationStateConfigured, + AdvertisedPublicPrefixPropertiesValidationStateConfiguring, + AdvertisedPublicPrefixPropertiesValidationStateInvalidSignatureEncoding, + AdvertisedPublicPrefixPropertiesValidationStateManualValidationNeeded, + AdvertisedPublicPrefixPropertiesValidationStateNotConfigured, + AdvertisedPublicPrefixPropertiesValidationStateSignatureVerificationFailed, + AdvertisedPublicPrefixPropertiesValidationStateValidationFailed, + AdvertisedPublicPrefixPropertiesValidationStateValidationNeeded, + } +} + // ApplicationGatewayBackendHealthServerHealth - Health of backend server. type ApplicationGatewayBackendHealthServerHealth string diff --git a/sdk/resourcemanager/network/armnetwork/customipprefix_live_test.go b/sdk/resourcemanager/network/armnetwork/customipprefix_live_test.go index 34e77892e764..5db581a56be3 100644 --- a/sdk/resourcemanager/network/armnetwork/customipprefix_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/customipprefix_live_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/customipprefixes_client.go b/sdk/resourcemanager/network/armnetwork/customipprefixes_client.go index 4340573a8f3d..33f904371fb4 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 2024-05-01 +// Generated from API version 2024-07-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. @@ -74,7 +74,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -116,7 +116,7 @@ func (client *CustomIPPrefixesClient) createOrUpdateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -128,7 +128,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - customIPPrefixName - The name of the CustomIpPrefix. // - options - CustomIPPrefixesClientBeginDeleteOptions contains the optional parameters for the CustomIPPrefixesClient.BeginDelete @@ -154,7 +154,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *CustomIPPrefixesClient) deleteOperation(ctx context.Context, resourceGroupName string, customIPPrefixName string, options *CustomIPPrefixesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "CustomIPPrefixesClient.BeginDelete" @@ -196,7 +196,7 @@ func (client *CustomIPPrefixesClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -205,7 +205,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -254,7 +254,7 @@ func (client *CustomIPPrefixesClient) getCreateRequest(ctx context.Context, reso if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -271,7 +271,7 @@ func (client *CustomIPPrefixesClient) getHandleResponse(resp *http.Response) (Cu // NewListPager - Gets all custom IP prefixes in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - CustomIPPrefixesClientListOptions contains the optional parameters for the CustomIPPrefixesClient.NewListPager // method. @@ -314,7 +314,7 @@ func (client *CustomIPPrefixesClient) listCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -331,7 +331,7 @@ func (client *CustomIPPrefixesClient) listHandleResponse(resp *http.Response) (C // NewListAllPager - Gets all the custom IP prefixes in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - options - CustomIPPrefixesClientListAllOptions contains the optional parameters for the CustomIPPrefixesClient.NewListAllPager // method. func (client *CustomIPPrefixesClient) NewListAllPager(options *CustomIPPrefixesClientListAllOptions) *runtime.Pager[CustomIPPrefixesClientListAllResponse] { @@ -369,7 +369,7 @@ func (client *CustomIPPrefixesClient) listAllCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -387,7 +387,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -435,7 +435,7 @@ func (client *CustomIPPrefixesClient) updateTagsCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 71bca36a2fde..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 ff5c08f89f41..b1c9a62d45e7 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 2024-05-01 +// Generated from API version 2024-07-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. @@ -74,7 +74,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -116,7 +116,7 @@ func (client *DdosCustomPoliciesClient) createOrUpdateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -128,7 +128,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -154,7 +154,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *DdosCustomPoliciesClient) deleteOperation(ctx context.Context, resourceGroupName string, ddosCustomPolicyName string, options *DdosCustomPoliciesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "DdosCustomPoliciesClient.BeginDelete" @@ -196,7 +196,7 @@ func (client *DdosCustomPoliciesClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -205,7 +205,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -251,7 +251,7 @@ func (client *DdosCustomPoliciesClient) getCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -269,7 +269,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -317,7 +317,7 @@ func (client *DdosCustomPoliciesClient) updateTagsCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 6092143b6589..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ddosprotectionplan_live_test.go b/sdk/resourcemanager/network/armnetwork/ddosprotectionplan_live_test.go index d979108a056f..3ebbef0b8f48 100644 --- a/sdk/resourcemanager/network/armnetwork/ddosprotectionplan_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/ddosprotectionplan_live_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/ddosprotectionplans_client.go b/sdk/resourcemanager/network/armnetwork/ddosprotectionplans_client.go index 744620b5164b..da2636354e35 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 2024-05-01 +// Generated from API version 2024-07-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. @@ -74,7 +74,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -116,7 +116,7 @@ func (client *DdosProtectionPlansClient) createOrUpdateCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -128,7 +128,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -154,7 +154,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *DdosProtectionPlansClient) deleteOperation(ctx context.Context, resourceGroupName string, ddosProtectionPlanName string, options *DdosProtectionPlansClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "DdosProtectionPlansClient.BeginDelete" @@ -196,7 +196,7 @@ func (client *DdosProtectionPlansClient) deleteCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -205,7 +205,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -251,7 +251,7 @@ func (client *DdosProtectionPlansClient) getCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -268,7 +268,7 @@ func (client *DdosProtectionPlansClient) getHandleResponse(resp *http.Response) // NewListPager - Gets all DDoS protection plans in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - options - DdosProtectionPlansClientListOptions contains the optional parameters for the DdosProtectionPlansClient.NewListPager // method. func (client *DdosProtectionPlansClient) NewListPager(options *DdosProtectionPlansClientListOptions) *runtime.Pager[DdosProtectionPlansClientListResponse] { @@ -306,7 +306,7 @@ func (client *DdosProtectionPlansClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -323,7 +323,7 @@ func (client *DdosProtectionPlansClient) listHandleResponse(resp *http.Response) // NewListByResourceGroupPager - Gets all the DDoS protection plans in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - DdosProtectionPlansClientListByResourceGroupOptions contains the optional parameters for the DdosProtectionPlansClient.NewListByResourceGroupPager // method. @@ -366,7 +366,7 @@ func (client *DdosProtectionPlansClient) listByResourceGroupCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -384,7 +384,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -432,7 +432,7 @@ func (client *DdosProtectionPlansClient) updateTagsCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 fa75e5a29142..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 3678338bc2ba..6031ab1227e1 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 2024-05-01 +// Generated from API version 2024-07-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", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 2024-05-01 +// Generated from API version 2024-07-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 @@ -164,7 +164,7 @@ func (client *DefaultSecurityRulesClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 cbb0034c68e4..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 b42795445065..be3ede54c8fd 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 2024-05-01 +// Generated from API version 2024-07-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. @@ -74,7 +74,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -116,7 +116,7 @@ func (client *DscpConfigurationClient) createOrUpdateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -128,7 +128,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - dscpConfigurationName - The name of the resource. // - options - DscpConfigurationClientBeginDeleteOptions contains the optional parameters for the DscpConfigurationClient.BeginDelete @@ -154,7 +154,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *DscpConfigurationClient) deleteOperation(ctx context.Context, resourceGroupName string, dscpConfigurationName string, options *DscpConfigurationClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "DscpConfigurationClient.BeginDelete" @@ -196,7 +196,7 @@ func (client *DscpConfigurationClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -205,7 +205,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -251,7 +251,7 @@ func (client *DscpConfigurationClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -268,7 +268,7 @@ func (client *DscpConfigurationClient) getHandleResponse(resp *http.Response) (D // NewListPager - Gets a DSCP Configuration. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - DscpConfigurationClientListOptions contains the optional parameters for the DscpConfigurationClient.NewListPager // method. @@ -311,7 +311,7 @@ func (client *DscpConfigurationClient) listCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -328,7 +328,7 @@ func (client *DscpConfigurationClient) listHandleResponse(resp *http.Response) ( // NewListAllPager - Gets all dscp configurations in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - options - DscpConfigurationClientListAllOptions contains the optional parameters for the DscpConfigurationClient.NewListAllPager // method. func (client *DscpConfigurationClient) NewListAllPager(options *DscpConfigurationClientListAllOptions) *runtime.Pager[DscpConfigurationClientListAllResponse] { @@ -366,7 +366,7 @@ func (client *DscpConfigurationClient) listAllCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 2545c32df00f..000000000000 --- a/sdk/resourcemanager/network/armnetwork/dscpconfiguration_client_example_test.go +++ /dev/null @@ -1,602 +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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic2"), - // }}, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic2"), - // }}, - // 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{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic3"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic4"), - // }}, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic2"), - // }}, - // 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{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/networkInterfaces/test-nic3"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/networkInterfaces/test-nic4"), - // }}, - // 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/endpointservice_live_test.go b/sdk/resourcemanager/network/armnetwork/endpointservice_live_test.go index 805d54f9303c..c43e48adaa26 100644 --- a/sdk/resourcemanager/network/armnetwork/endpointservice_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/endpointservice_live_test.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/expressroutecircuit_live_test.go b/sdk/resourcemanager/network/armnetwork/expressroutecircuit_live_test.go index 60155afd15e3..7e106efa078b 100644 --- a/sdk/resourcemanager/network/armnetwork/expressroutecircuit_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/expressroutecircuit_live_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/expressroutecircuitauthorizations_client.go b/sdk/resourcemanager/network/armnetwork/expressroutecircuitauthorizations_client.go index 25ffbfd54392..894ecbf18647 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - circuitName - The name of the express route circuit. // - authorizationName - The name of the authorization. @@ -75,7 +75,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -121,7 +121,7 @@ func (client *ExpressRouteCircuitAuthorizationsClient) createOrUpdateCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, authorizationParameters); err != nil { @@ -133,7 +133,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - circuitName - The name of the express route circuit. // - authorizationName - The name of the authorization. @@ -160,7 +160,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -206,7 +206,7 @@ func (client *ExpressRouteCircuitAuthorizationsClient) deleteCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -215,7 +215,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - circuitName - The name of the express route circuit. // - authorizationName - The name of the authorization. @@ -267,7 +267,7 @@ func (client *ExpressRouteCircuitAuthorizationsClient) getCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -284,7 +284,7 @@ func (client *ExpressRouteCircuitAuthorizationsClient) getHandleResponse(resp *h // NewListPager - Gets all authorizations in an express route circuit. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - circuitName - The name of the circuit. // - options - ExpressRouteCircuitAuthorizationsClientListOptions contains the optional parameters for the ExpressRouteCircuitAuthorizationsClient.NewListPager @@ -332,7 +332,7 @@ func (client *ExpressRouteCircuitAuthorizationsClient) listCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 7bb37a02b30c..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 96aea0946f92..eecf68968c6a 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - circuitName - The name of the express route circuit. // - peeringName - The name of the peering. @@ -77,7 +77,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -127,7 +127,7 @@ func (client *ExpressRouteCircuitConnectionsClient) createOrUpdateCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, expressRouteCircuitConnectionParameters); err != nil { @@ -139,7 +139,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - circuitName - The name of the express route circuit. // - peeringName - The name of the peering. @@ -167,7 +167,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -217,7 +217,7 @@ func (client *ExpressRouteCircuitConnectionsClient) deleteCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -226,7 +226,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - circuitName - The name of the express route circuit. // - peeringName - The name of the peering. @@ -283,7 +283,7 @@ func (client *ExpressRouteCircuitConnectionsClient) getCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -300,7 +300,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - circuitName - The name of the circuit. // - peeringName - The name of the peering. @@ -353,7 +353,7 @@ func (client *ExpressRouteCircuitConnectionsClient) listCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 3f0263d80b87..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 0e734f307719..942caf0eeb49 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - circuitName - The name of the express route circuit. // - peeringName - The name of the peering. @@ -75,7 +75,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -121,7 +121,7 @@ func (client *ExpressRouteCircuitPeeringsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, peeringParameters); err != nil { @@ -133,7 +133,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - circuitName - The name of the express route circuit. // - peeringName - The name of the peering. @@ -160,7 +160,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -206,7 +206,7 @@ func (client *ExpressRouteCircuitPeeringsClient) deleteCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -215,7 +215,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - circuitName - The name of the express route circuit. // - peeringName - The name of the peering. @@ -267,7 +267,7 @@ func (client *ExpressRouteCircuitPeeringsClient) getCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -284,7 +284,7 @@ func (client *ExpressRouteCircuitPeeringsClient) getHandleResponse(resp *http.Re // NewListPager - Gets all peerings in a specified express route circuit. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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 @@ -332,7 +332,7 @@ func (client *ExpressRouteCircuitPeeringsClient) listCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 be8096c9ec2f..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 51b386a2a3b7..d05c18229749 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 2024-05-01 +// Generated from API version 2024-07-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. @@ -74,7 +74,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -116,7 +116,7 @@ func (client *ExpressRouteCircuitsClient) createOrUpdateCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -128,7 +128,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -154,7 +154,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *ExpressRouteCircuitsClient) deleteOperation(ctx context.Context, resourceGroupName string, circuitName string, options *ExpressRouteCircuitsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ExpressRouteCircuitsClient.BeginDelete" @@ -196,7 +196,7 @@ func (client *ExpressRouteCircuitsClient) deleteCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -205,7 +205,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -252,7 +252,7 @@ func (client *ExpressRouteCircuitsClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -270,7 +270,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - circuitName - The name of the express route circuit. // - peeringName - The name of the peering. @@ -322,7 +322,7 @@ func (client *ExpressRouteCircuitsClient) getPeeringStatsCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -340,7 +340,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -387,7 +387,7 @@ func (client *ExpressRouteCircuitsClient) getStatsCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -404,7 +404,7 @@ func (client *ExpressRouteCircuitsClient) getStatsHandleResponse(resp *http.Resp // NewListPager - Gets all the express route circuits in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - ExpressRouteCircuitsClientListOptions contains the optional parameters for the ExpressRouteCircuitsClient.NewListPager // method. @@ -447,7 +447,7 @@ func (client *ExpressRouteCircuitsClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -464,7 +464,7 @@ func (client *ExpressRouteCircuitsClient) listHandleResponse(resp *http.Response // NewListAllPager - Gets all the express route circuits in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - options - ExpressRouteCircuitsClientListAllOptions contains the optional parameters for the ExpressRouteCircuitsClient.NewListAllPager // method. func (client *ExpressRouteCircuitsClient) NewListAllPager(options *ExpressRouteCircuitsClientListAllOptions) *runtime.Pager[ExpressRouteCircuitsClientListAllResponse] { @@ -502,7 +502,7 @@ func (client *ExpressRouteCircuitsClient) listAllCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -520,7 +520,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - circuitName - The name of the express route circuit. // - peeringName - The name of the peering. @@ -548,7 +548,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -598,7 +598,7 @@ func (client *ExpressRouteCircuitsClient) listArpTableCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -608,7 +608,7 @@ func (client *ExpressRouteCircuitsClient) listArpTableCreateRequest(ctx context. // group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - circuitName - The name of the express route circuit. // - peeringName - The name of the peering. @@ -636,7 +636,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -686,7 +686,7 @@ func (client *ExpressRouteCircuitsClient) listRoutesTableCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -696,7 +696,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - circuitName - The name of the express route circuit. // - peeringName - The name of the peering. @@ -725,7 +725,7 @@ func (client *ExpressRouteCircuitsClient) BeginListRoutesTableSummary(ctx contex // a resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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" @@ -775,7 +775,7 @@ func (client *ExpressRouteCircuitsClient) listRoutesTableSummaryCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -784,7 +784,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - circuitName - The name of the circuit. // - parameters - Parameters supplied to update express route circuit tags. @@ -832,7 +832,7 @@ func (client *ExpressRouteCircuitsClient) updateTagsCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 0451bc88f3ab..000000000000 --- a/sdk/resourcemanager/network/armnetwork/expressroutecircuits_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/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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), - EnableDirectPortRateLimit: to.Ptr(false), - 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"), - // EnableDirectPortRateLimit: to.Ptr(false), - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 da0b52483ef6..306a465c8aea 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - expressRouteGatewayName - The name of the ExpressRoute gateway. // - connectionName - The name of the connection subresource. @@ -75,7 +75,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -121,7 +121,7 @@ func (client *ExpressRouteConnectionsClient) createOrUpdateCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, putExpressRouteConnectionParameters); err != nil { @@ -133,7 +133,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - expressRouteGatewayName - The name of the ExpressRoute gateway. // - connectionName - The name of the connection subresource. @@ -160,7 +160,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -206,7 +206,7 @@ func (client *ExpressRouteConnectionsClient) deleteCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -215,7 +215,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - expressRouteGatewayName - The name of the ExpressRoute gateway. // - connectionName - The name of the ExpressRoute connection. @@ -267,7 +267,7 @@ func (client *ExpressRouteConnectionsClient) getCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -285,7 +285,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -332,7 +332,7 @@ func (client *ExpressRouteConnectionsClient) listCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 1bcdc8a689a5..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 0ee7169ee32f..1e8613a6b4f9 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - crossConnectionName - The name of the ExpressRouteCrossConnection. // - peeringName - The name of the peering. @@ -75,7 +75,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -121,7 +121,7 @@ func (client *ExpressRouteCrossConnectionPeeringsClient) createOrUpdateCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, peeringParameters); err != nil { @@ -133,7 +133,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - crossConnectionName - The name of the ExpressRouteCrossConnection. // - peeringName - The name of the peering. @@ -160,7 +160,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -206,7 +206,7 @@ func (client *ExpressRouteCrossConnectionPeeringsClient) deleteCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -215,7 +215,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - crossConnectionName - The name of the ExpressRouteCrossConnection. // - peeringName - The name of the peering. @@ -267,7 +267,7 @@ func (client *ExpressRouteCrossConnectionPeeringsClient) getCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -284,7 +284,7 @@ func (client *ExpressRouteCrossConnectionPeeringsClient) getHandleResponse(resp // NewListPager - Gets all peerings in a specified ExpressRouteCrossConnection. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - crossConnectionName - The name of the ExpressRouteCrossConnection. // - options - ExpressRouteCrossConnectionPeeringsClientListOptions contains the optional parameters for the ExpressRouteCrossConnectionPeeringsClient.NewListPager @@ -332,7 +332,7 @@ func (client *ExpressRouteCrossConnectionPeeringsClient) listCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 0a1126ca8c28..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 b831b4ab8736..95d3ed540111 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - crossConnectionName - The name of the ExpressRouteCrossConnection. // - parameters - Parameters supplied to the update express route crossConnection operation. @@ -74,7 +74,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -116,7 +116,7 @@ func (client *ExpressRouteCrossConnectionsClient) createOrUpdateCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -128,7 +128,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -175,7 +175,7 @@ func (client *ExpressRouteCrossConnectionsClient) getCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -192,7 +192,7 @@ func (client *ExpressRouteCrossConnectionsClient) getHandleResponse(resp *http.R // NewListPager - Retrieves all the ExpressRouteCrossConnections in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - options - ExpressRouteCrossConnectionsClientListOptions contains the optional parameters for the ExpressRouteCrossConnectionsClient.NewListPager // method. func (client *ExpressRouteCrossConnectionsClient) NewListPager(options *ExpressRouteCrossConnectionsClientListOptions) *runtime.Pager[ExpressRouteCrossConnectionsClientListResponse] { @@ -233,7 +233,7 @@ func (client *ExpressRouteCrossConnectionsClient) listCreateRequest(ctx context. if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -252,7 +252,7 @@ func (client *ExpressRouteCrossConnectionsClient) listHandleResponse(resp *http. // group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - crossConnectionName - The name of the ExpressRouteCrossConnection. // - peeringName - The name of the peering. @@ -281,7 +281,7 @@ func (client *ExpressRouteCrossConnectionsClient) BeginListArpTable(ctx context. // group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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" @@ -331,7 +331,7 @@ func (client *ExpressRouteCrossConnectionsClient) listArpTableCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -339,7 +339,7 @@ func (client *ExpressRouteCrossConnectionsClient) listArpTableCreateRequest(ctx // NewListByResourceGroupPager - Retrieves all the ExpressRouteCrossConnections in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - ExpressRouteCrossConnectionsClientListByResourceGroupOptions contains the optional parameters for the ExpressRouteCrossConnectionsClient.NewListByResourceGroupPager // method. @@ -382,7 +382,7 @@ func (client *ExpressRouteCrossConnectionsClient) listByResourceGroupCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -401,7 +401,7 @@ func (client *ExpressRouteCrossConnectionsClient) listByResourceGroupHandleRespo // a resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - crossConnectionName - The name of the ExpressRouteCrossConnection. // - peeringName - The name of the peering. @@ -430,7 +430,7 @@ func (client *ExpressRouteCrossConnectionsClient) BeginListRoutesTable(ctx conte // group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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" @@ -480,7 +480,7 @@ func (client *ExpressRouteCrossConnectionsClient) listRoutesTableCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -490,7 +490,7 @@ func (client *ExpressRouteCrossConnectionsClient) listRoutesTableCreateRequest(c // group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - crossConnectionName - The name of the ExpressRouteCrossConnection. // - peeringName - The name of the peering. @@ -519,7 +519,7 @@ func (client *ExpressRouteCrossConnectionsClient) BeginListRoutesTableSummary(ct // group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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" @@ -569,7 +569,7 @@ func (client *ExpressRouteCrossConnectionsClient) listRoutesTableSummaryCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -578,7 +578,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -626,7 +626,7 @@ func (client *ExpressRouteCrossConnectionsClient) updateTagsCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 48a853ae2dbe..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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(&armnetwork.ExpressRouteCrossConnectionsClientListOptions{Filter: 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 952e5af33372..2d420f27a286 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - expressRouteGatewayName - The name of the ExpressRoute gateway. // - putExpressRouteGatewayParameters - Parameters required in an ExpressRoute gateway PUT operation. @@ -74,7 +74,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -116,7 +116,7 @@ func (client *ExpressRouteGatewaysClient) createOrUpdateCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, putExpressRouteGatewayParameters); err != nil { @@ -129,7 +129,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -156,7 +156,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *ExpressRouteGatewaysClient) deleteOperation(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, options *ExpressRouteGatewaysClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ExpressRouteGatewaysClient.BeginDelete" @@ -198,7 +198,7 @@ func (client *ExpressRouteGatewaysClient) deleteCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -207,7 +207,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -254,7 +254,7 @@ func (client *ExpressRouteGatewaysClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -272,7 +272,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - ExpressRouteGatewaysClientListByResourceGroupOptions contains the optional parameters for the ExpressRouteGatewaysClient.ListByResourceGroup // method. @@ -314,7 +314,7 @@ func (client *ExpressRouteGatewaysClient) listByResourceGroupCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -332,7 +332,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 2024-05-01 +// Generated from API version 2024-07-01 // - options - ExpressRouteGatewaysClientListBySubscriptionOptions contains the optional parameters for the ExpressRouteGatewaysClient.ListBySubscription // method. func (client *ExpressRouteGatewaysClient) ListBySubscription(ctx context.Context, options *ExpressRouteGatewaysClientListBySubscriptionOptions) (ExpressRouteGatewaysClientListBySubscriptionResponse, error) { @@ -369,7 +369,7 @@ func (client *ExpressRouteGatewaysClient) listBySubscriptionCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -387,7 +387,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -414,7 +414,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -456,7 +456,7 @@ func (client *ExpressRouteGatewaysClient) updateTagsCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 2eabe9870449..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 71c1f29e02d1..246b57a14684 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 2024-05-01 +// Generated from API version 2024-07-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", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 2024-05-01 +// Generated from API version 2024-07-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 @@ -163,7 +163,7 @@ func (client *ExpressRouteLinksClient) listCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 a75976edd283..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 b75717deafc3..ed8daec4cd7b 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - expressRoutePortName - The name of the express route port. // - authorizationName - The name of the authorization. @@ -75,7 +75,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -121,7 +121,7 @@ func (client *ExpressRoutePortAuthorizationsClient) createOrUpdateCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, authorizationParameters); err != nil { @@ -133,7 +133,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - expressRoutePortName - The name of the express route port. // - authorizationName - The name of the authorization. @@ -160,7 +160,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -206,7 +206,7 @@ func (client *ExpressRoutePortAuthorizationsClient) deleteCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -215,7 +215,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - expressRoutePortName - The name of the express route port. // - authorizationName - The name of the authorization. @@ -267,7 +267,7 @@ func (client *ExpressRoutePortAuthorizationsClient) getCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -284,7 +284,7 @@ func (client *ExpressRoutePortAuthorizationsClient) getHandleResponse(resp *http // NewListPager - Gets all authorizations in an express route port. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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 @@ -332,7 +332,7 @@ func (client *ExpressRoutePortAuthorizationsClient) listCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 fc4211e64b87..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 6f39f0083bf6..0cb6ff5c8bf4 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - expressRoutePortName - The name of the ExpressRoutePort resource. // - parameters - Parameters supplied to the create ExpressRoutePort operation. @@ -74,7 +74,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -116,7 +116,7 @@ func (client *ExpressRoutePortsClient) createOrUpdateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -128,7 +128,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -154,7 +154,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *ExpressRoutePortsClient) deleteOperation(ctx context.Context, resourceGroupName string, expressRoutePortName string, options *ExpressRoutePortsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ExpressRoutePortsClient.BeginDelete" @@ -196,7 +196,7 @@ func (client *ExpressRoutePortsClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -205,7 +205,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - expressRoutePortName - The name of ExpressRoutePort. // - request - Request parameters supplied to generate a letter of authorization. @@ -253,7 +253,7 @@ func (client *ExpressRoutePortsClient) generateLOACreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, request); err != nil { @@ -274,7 +274,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - expressRoutePortName - The name of ExpressRoutePort. // - options - ExpressRoutePortsClientGetOptions contains the optional parameters for the ExpressRoutePortsClient.Get method. @@ -320,7 +320,7 @@ func (client *ExpressRoutePortsClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -337,7 +337,7 @@ func (client *ExpressRoutePortsClient) getHandleResponse(resp *http.Response) (E // NewListPager - List all the ExpressRoutePort resources in the specified subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - options - ExpressRoutePortsClientListOptions contains the optional parameters for the ExpressRoutePortsClient.NewListPager // method. func (client *ExpressRoutePortsClient) NewListPager(options *ExpressRoutePortsClientListOptions) *runtime.Pager[ExpressRoutePortsClientListResponse] { @@ -375,7 +375,7 @@ func (client *ExpressRoutePortsClient) listCreateRequest(ctx context.Context, op return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -392,7 +392,7 @@ func (client *ExpressRoutePortsClient) listHandleResponse(resp *http.Response) ( // NewListByResourceGroupPager - List all the ExpressRoutePort resources in the specified resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - ExpressRoutePortsClientListByResourceGroupOptions contains the optional parameters for the ExpressRoutePortsClient.NewListByResourceGroupPager // method. @@ -435,7 +435,7 @@ func (client *ExpressRoutePortsClient) listByResourceGroupCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -453,7 +453,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - expressRoutePortName - The name of the ExpressRoutePort resource. // - parameters - Parameters supplied to update ExpressRoutePort resource tags. @@ -501,7 +501,7 @@ func (client *ExpressRoutePortsClient) updateTagsCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 bc0ecc5f5190..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 917531a0eae2..5ad76118e511 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 2024-05-01 +// Generated from API version 2024-07-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", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 2024-05-01 +// Generated from API version 2024-07-01 // - options - ExpressRoutePortsLocationsClientListOptions contains the optional parameters for the ExpressRoutePortsLocationsClient.NewListPager // method. func (client *ExpressRoutePortsLocationsClient) NewListPager(options *ExpressRoutePortsLocationsClientListOptions) *runtime.Pager[ExpressRoutePortsLocationsClientListResponse] { @@ -146,7 +146,7 @@ func (client *ExpressRoutePortsLocationsClient) listCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 73a01f5b91f9..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 7967c35da1d6..4d4e9234e47f 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 2024-05-01 +// Generated from API version 2024-07-01 // - options - ExpressRouteProviderPortsLocationClientListOptions contains the optional parameters for the ExpressRouteProviderPortsLocationClient.List // method. func (client *ExpressRouteProviderPortsLocationClient) List(ctx context.Context, options *ExpressRouteProviderPortsLocationClientListOptions) (ExpressRouteProviderPortsLocationClientListResponse, error) { @@ -87,7 +87,7 @@ func (client *ExpressRouteProviderPortsLocationClient) listCreateRequest(ctx con if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil 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 7df7dfb91d28..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 903af3f31b3f..b1fd70b869ff 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 2024-05-01 +// Generated from API version 2024-07-01 // - options - ExpressRouteServiceProvidersClientListOptions contains the optional parameters for the ExpressRouteServiceProvidersClient.NewListPager // method. func (client *ExpressRouteServiceProvidersClient) NewListPager(options *ExpressRouteServiceProvidersClientListOptions) *runtime.Pager[ExpressRouteServiceProvidersClientListResponse] { @@ -84,7 +84,7 @@ func (client *ExpressRouteServiceProvidersClient) listCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 31092ed3365e..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/adminrulecollections_server.go b/sdk/resourcemanager/network/armnetwork/fake/adminrulecollections_server.go index c958a9eb29cc..70b5b3ef0940 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/adminrulecollections_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/adminrulecollections_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/adminrules_server.go b/sdk/resourcemanager/network/armnetwork/fake/adminrules_server.go index 6132879793aa..6603598b0021 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/adminrules_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/adminrules_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/applicationgatewayprivateendpointconnections_server.go b/sdk/resourcemanager/network/armnetwork/fake/applicationgatewayprivateendpointconnections_server.go index 6f6b3959bca9..60f32003c22d 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/applicationgatewayprivateendpointconnections_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/applicationgatewayprivateendpointconnections_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/applicationgatewayprivatelinkresources_server.go b/sdk/resourcemanager/network/armnetwork/fake/applicationgatewayprivatelinkresources_server.go index 7848befdbce3..59bc584d2d45 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/applicationgatewayprivatelinkresources_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/applicationgatewayprivatelinkresources_server.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/applicationgateways_server.go b/sdk/resourcemanager/network/armnetwork/fake/applicationgateways_server.go index 801c4ef52703..18a3629a473c 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/applicationgateways_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/applicationgateways_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/applicationgatewaywafdynamicmanifests_server.go b/sdk/resourcemanager/network/armnetwork/fake/applicationgatewaywafdynamicmanifests_server.go index 2de6e8ab2caa..73b08f5ec971 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/applicationgatewaywafdynamicmanifests_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/applicationgatewaywafdynamicmanifests_server.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/applicationgatewaywafdynamicmanifestsdefault_server.go b/sdk/resourcemanager/network/armnetwork/fake/applicationgatewaywafdynamicmanifestsdefault_server.go index 31c9c1750d42..6774b2a6fc00 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/applicationgatewaywafdynamicmanifestsdefault_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/applicationgatewaywafdynamicmanifestsdefault_server.go @@ -15,7 +15,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/applicationsecuritygroups_server.go b/sdk/resourcemanager/network/armnetwork/fake/applicationsecuritygroups_server.go index 1affea079f0a..b5db2dd3711d 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/applicationsecuritygroups_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/applicationsecuritygroups_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/availabledelegations_server.go b/sdk/resourcemanager/network/armnetwork/fake/availabledelegations_server.go index 13ca251dd9a0..09c4bc65c91c 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/availabledelegations_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/availabledelegations_server.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/availableendpointservices_server.go b/sdk/resourcemanager/network/armnetwork/fake/availableendpointservices_server.go index 531ec7088fac..c3f95b3a9ebe 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/availableendpointservices_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/availableendpointservices_server.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/availableprivateendpointtypes_server.go b/sdk/resourcemanager/network/armnetwork/fake/availableprivateendpointtypes_server.go index da67169bbfa4..81b98275aa6f 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/availableprivateendpointtypes_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/availableprivateendpointtypes_server.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/availableresourcegroupdelegations_server.go b/sdk/resourcemanager/network/armnetwork/fake/availableresourcegroupdelegations_server.go index 2682423b72ed..58811f5c2349 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/availableresourcegroupdelegations_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/availableresourcegroupdelegations_server.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/availableservicealiases_server.go b/sdk/resourcemanager/network/armnetwork/fake/availableservicealiases_server.go index 37db0d55666b..ca3555286ae2 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/availableservicealiases_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/availableservicealiases_server.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/azurefirewallfqdntags_server.go b/sdk/resourcemanager/network/armnetwork/fake/azurefirewallfqdntags_server.go index a9963941ed00..5eaf88f07680 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/azurefirewallfqdntags_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/azurefirewallfqdntags_server.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "regexp" ) diff --git a/sdk/resourcemanager/network/armnetwork/fake/azurefirewalls_server.go b/sdk/resourcemanager/network/armnetwork/fake/azurefirewalls_server.go index 79706c2c2127..78b3e3e12529 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/azurefirewalls_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/azurefirewalls_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/bastionhosts_server.go b/sdk/resourcemanager/network/armnetwork/fake/bastionhosts_server.go index 38c804a14572..a902b035281e 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/bastionhosts_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/bastionhosts_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/bgpservicecommunities_server.go b/sdk/resourcemanager/network/armnetwork/fake/bgpservicecommunities_server.go index 69959c571646..f25f40348178 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/bgpservicecommunities_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/bgpservicecommunities_server.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "regexp" ) diff --git a/sdk/resourcemanager/network/armnetwork/fake/configurationpolicygroups_server.go b/sdk/resourcemanager/network/armnetwork/fake/configurationpolicygroups_server.go index fb63c90db098..34b0de1880d7 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/configurationpolicygroups_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/configurationpolicygroups_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/connectionmonitors_server.go b/sdk/resourcemanager/network/armnetwork/fake/connectionmonitors_server.go index 59c56f2e2c88..464b1ed661a1 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/connectionmonitors_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/connectionmonitors_server.go @@ -15,7 +15,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/connectivityconfigurations_server.go b/sdk/resourcemanager/network/armnetwork/fake/connectivityconfigurations_server.go index 1d535e2624bb..945df023d7f4 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/connectivityconfigurations_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/connectivityconfigurations_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/customipprefixes_server.go b/sdk/resourcemanager/network/armnetwork/fake/customipprefixes_server.go index 09fee8114eb9..9df528b7de10 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/customipprefixes_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/customipprefixes_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/ddoscustompolicies_server.go b/sdk/resourcemanager/network/armnetwork/fake/ddoscustompolicies_server.go index 9cf7492b8767..46a7e5d7dcf1 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/ddoscustompolicies_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/ddoscustompolicies_server.go @@ -15,7 +15,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/ddosprotectionplans_server.go b/sdk/resourcemanager/network/armnetwork/fake/ddosprotectionplans_server.go index ab016c4c4c86..96b2926d61cf 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/ddosprotectionplans_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/ddosprotectionplans_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/defaultsecurityrules_server.go b/sdk/resourcemanager/network/armnetwork/fake/defaultsecurityrules_server.go index 98630d27bd4e..59be2dfe44dc 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/defaultsecurityrules_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/defaultsecurityrules_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/dscpconfiguration_server.go b/sdk/resourcemanager/network/armnetwork/fake/dscpconfiguration_server.go index 9351f97323ca..e642afa2d152 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/dscpconfiguration_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/dscpconfiguration_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/expressroutecircuitauthorizations_server.go b/sdk/resourcemanager/network/armnetwork/fake/expressroutecircuitauthorizations_server.go index 842dddaf68df..ee261d658273 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/expressroutecircuitauthorizations_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/expressroutecircuitauthorizations_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/expressroutecircuitconnections_server.go b/sdk/resourcemanager/network/armnetwork/fake/expressroutecircuitconnections_server.go index 6cb6a801b00d..eb81e054d9e3 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/expressroutecircuitconnections_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/expressroutecircuitconnections_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/expressroutecircuitpeerings_server.go b/sdk/resourcemanager/network/armnetwork/fake/expressroutecircuitpeerings_server.go index 0bfcb07d5aba..5b552dfe061f 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/expressroutecircuitpeerings_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/expressroutecircuitpeerings_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/expressroutecircuits_server.go b/sdk/resourcemanager/network/armnetwork/fake/expressroutecircuits_server.go index 6aa0d91e85ad..5c149448796a 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/expressroutecircuits_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/expressroutecircuits_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/expressrouteconnections_server.go b/sdk/resourcemanager/network/armnetwork/fake/expressrouteconnections_server.go index 634de74077c7..1d16a0e57e4c 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/expressrouteconnections_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/expressrouteconnections_server.go @@ -15,7 +15,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/expressroutecrossconnectionpeerings_server.go b/sdk/resourcemanager/network/armnetwork/fake/expressroutecrossconnectionpeerings_server.go index 7c8e458f0903..71e71247f9bf 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/expressroutecrossconnectionpeerings_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/expressroutecrossconnectionpeerings_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/expressroutecrossconnections_server.go b/sdk/resourcemanager/network/armnetwork/fake/expressroutecrossconnections_server.go index 27d87890c326..dbc0ba7d50d2 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/expressroutecrossconnections_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/expressroutecrossconnections_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/expressroutegateways_server.go b/sdk/resourcemanager/network/armnetwork/fake/expressroutegateways_server.go index ff1d8b35635e..9bba2ae7b084 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/expressroutegateways_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/expressroutegateways_server.go @@ -15,7 +15,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/expressroutelinks_server.go b/sdk/resourcemanager/network/armnetwork/fake/expressroutelinks_server.go index 319fc4052783..31a4ad1c2e37 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/expressroutelinks_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/expressroutelinks_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/expressrouteportauthorizations_server.go b/sdk/resourcemanager/network/armnetwork/fake/expressrouteportauthorizations_server.go index 7e41c8265d3f..a8e6d3ef0ed4 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/expressrouteportauthorizations_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/expressrouteportauthorizations_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/expressrouteports_server.go b/sdk/resourcemanager/network/armnetwork/fake/expressrouteports_server.go index 48de481fc565..dee8b8bacc02 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/expressrouteports_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/expressrouteports_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/expressrouteportslocations_server.go b/sdk/resourcemanager/network/armnetwork/fake/expressrouteportslocations_server.go index fbda48d5d293..918dcd0e7bd6 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/expressrouteportslocations_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/expressrouteportslocations_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/expressrouteproviderportslocation_server.go b/sdk/resourcemanager/network/armnetwork/fake/expressrouteproviderportslocation_server.go index 5c7fca6dbb9d..8600f99914b0 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/expressrouteproviderportslocation_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/expressrouteproviderportslocation_server.go @@ -15,7 +15,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/expressrouteserviceproviders_server.go b/sdk/resourcemanager/network/armnetwork/fake/expressrouteserviceproviders_server.go index cbe8b098e38d..4b9c4dc37de8 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/expressrouteserviceproviders_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/expressrouteserviceproviders_server.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "regexp" ) diff --git a/sdk/resourcemanager/network/armnetwork/fake/firewallpolicies_server.go b/sdk/resourcemanager/network/armnetwork/fake/firewallpolicies_server.go index 726ae1c9aaa5..d15280cf6469 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/firewallpolicies_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/firewallpolicies_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/firewallpolicydeployments_server.go b/sdk/resourcemanager/network/armnetwork/fake/firewallpolicydeployments_server.go index abd47170b278..b3869499f832 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/firewallpolicydeployments_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/firewallpolicydeployments_server.go @@ -15,7 +15,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/firewallpolicydrafts_server.go b/sdk/resourcemanager/network/armnetwork/fake/firewallpolicydrafts_server.go index b016caed9334..a2d323127e49 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/firewallpolicydrafts_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/firewallpolicydrafts_server.go @@ -15,7 +15,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/firewallpolicyidpssignatures_server.go b/sdk/resourcemanager/network/armnetwork/fake/firewallpolicyidpssignatures_server.go index bd0ae1fdab01..c4cc3fb0052d 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/firewallpolicyidpssignatures_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/firewallpolicyidpssignatures_server.go @@ -15,7 +15,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/firewallpolicyidpssignaturesfiltervalues_server.go b/sdk/resourcemanager/network/armnetwork/fake/firewallpolicyidpssignaturesfiltervalues_server.go index 8e7f877da764..04f964d36a98 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/firewallpolicyidpssignaturesfiltervalues_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/firewallpolicyidpssignaturesfiltervalues_server.go @@ -15,7 +15,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/firewallpolicyidpssignaturesoverrides_server.go b/sdk/resourcemanager/network/armnetwork/fake/firewallpolicyidpssignaturesoverrides_server.go index 65182b3c494b..c99fc6a14ef7 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/firewallpolicyidpssignaturesoverrides_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/firewallpolicyidpssignaturesoverrides_server.go @@ -15,7 +15,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/firewallpolicyrulecollectiongroupdrafts_server.go b/sdk/resourcemanager/network/armnetwork/fake/firewallpolicyrulecollectiongroupdrafts_server.go index 8a5a7ecf8d0e..b8741422fcf4 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/firewallpolicyrulecollectiongroupdrafts_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/firewallpolicyrulecollectiongroupdrafts_server.go @@ -15,7 +15,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/firewallpolicyrulecollectiongroups_server.go b/sdk/resourcemanager/network/armnetwork/fake/firewallpolicyrulecollectiongroups_server.go index 8ba471999491..ee53e4d7b2ed 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/firewallpolicyrulecollectiongroups_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/firewallpolicyrulecollectiongroups_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/flowlogs_server.go b/sdk/resourcemanager/network/armnetwork/fake/flowlogs_server.go index 462cafd68d39..4d3cf0e0ad05 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/flowlogs_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/flowlogs_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/groups_server.go b/sdk/resourcemanager/network/armnetwork/fake/groups_server.go index 8d59d40f9644..aab00656a18a 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/groups_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/groups_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/hubroutetables_server.go b/sdk/resourcemanager/network/armnetwork/fake/hubroutetables_server.go index 24709c26eb14..f7089dbd6def 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/hubroutetables_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/hubroutetables_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/hubvirtualnetworkconnections_server.go b/sdk/resourcemanager/network/armnetwork/fake/hubvirtualnetworkconnections_server.go index 6c888d0a46e2..66453cecfabe 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/hubvirtualnetworkconnections_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/hubvirtualnetworkconnections_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/inboundnatrules_server.go b/sdk/resourcemanager/network/armnetwork/fake/inboundnatrules_server.go index aec9371088c8..d348b373fcff 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/inboundnatrules_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/inboundnatrules_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/inboundsecurityrule_server.go b/sdk/resourcemanager/network/armnetwork/fake/inboundsecurityrule_server.go index 16b0787fcf12..b94c2702b3a0 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/inboundsecurityrule_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/inboundsecurityrule_server.go @@ -15,7 +15,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/interfaceipconfigurations_server.go b/sdk/resourcemanager/network/armnetwork/fake/interfaceipconfigurations_server.go index f5740cfa146b..c55788bc55dd 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/interfaceipconfigurations_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/interfaceipconfigurations_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/interfaceloadbalancers_server.go b/sdk/resourcemanager/network/armnetwork/fake/interfaceloadbalancers_server.go index 23f3dbd7b31a..48dbf55084f5 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/interfaceloadbalancers_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/interfaceloadbalancers_server.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/interfaces_server.go b/sdk/resourcemanager/network/armnetwork/fake/interfaces_server.go index 64bb42c52f09..946767d8e025 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/interfaces_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/interfaces_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/interfacetapconfigurations_server.go b/sdk/resourcemanager/network/armnetwork/fake/interfacetapconfigurations_server.go index 92ea98817f58..3ea0183f14e2 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/interfacetapconfigurations_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/interfacetapconfigurations_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/ipallocations_server.go b/sdk/resourcemanager/network/armnetwork/fake/ipallocations_server.go index ebccd5a14792..21fc6d9d75fe 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/ipallocations_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/ipallocations_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/ipampools_server.go b/sdk/resourcemanager/network/armnetwork/fake/ipampools_server.go index f854fd983951..34b8020b0d5c 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/ipampools_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/ipampools_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "reflect" diff --git a/sdk/resourcemanager/network/armnetwork/fake/ipgroups_server.go b/sdk/resourcemanager/network/armnetwork/fake/ipgroups_server.go index f6727e4b0d9e..086b85e9f6b1 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/ipgroups_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/ipgroups_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/loadbalancerbackendaddresspools_server.go b/sdk/resourcemanager/network/armnetwork/fake/loadbalancerbackendaddresspools_server.go index 6d97365487a3..8ba6abbdc675 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/loadbalancerbackendaddresspools_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/loadbalancerbackendaddresspools_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/loadbalancerfrontendipconfigurations_server.go b/sdk/resourcemanager/network/armnetwork/fake/loadbalancerfrontendipconfigurations_server.go index 1bbe07878818..1e711ba2c079 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/loadbalancerfrontendipconfigurations_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/loadbalancerfrontendipconfigurations_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/loadbalancerloadbalancingrules_server.go b/sdk/resourcemanager/network/armnetwork/fake/loadbalancerloadbalancingrules_server.go index e1e3f3f437ca..c6ea5f918603 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/loadbalancerloadbalancingrules_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/loadbalancerloadbalancingrules_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/loadbalancernetworkinterfaces_server.go b/sdk/resourcemanager/network/armnetwork/fake/loadbalancernetworkinterfaces_server.go index 097da96d2e7d..2f2d0598cf2b 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/loadbalancernetworkinterfaces_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/loadbalancernetworkinterfaces_server.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/loadbalanceroutboundrules_server.go b/sdk/resourcemanager/network/armnetwork/fake/loadbalanceroutboundrules_server.go index b6737fdf35f2..f46a12491060 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/loadbalanceroutboundrules_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/loadbalanceroutboundrules_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/loadbalancerprobes_server.go b/sdk/resourcemanager/network/armnetwork/fake/loadbalancerprobes_server.go index 6b72163b6ee3..560bf3750f5f 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/loadbalancerprobes_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/loadbalancerprobes_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/loadbalancers_server.go b/sdk/resourcemanager/network/armnetwork/fake/loadbalancers_server.go index 4deff2485204..d886907b1a5c 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/loadbalancers_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/loadbalancers_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "reflect" diff --git a/sdk/resourcemanager/network/armnetwork/fake/localnetworkgateways_server.go b/sdk/resourcemanager/network/armnetwork/fake/localnetworkgateways_server.go index 4879592d7a71..584d5659b850 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/localnetworkgateways_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/localnetworkgateways_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/management_server.go b/sdk/resourcemanager/network/armnetwork/fake/management_server.go index e0ea954dc2ce..bba0c06237e9 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/management_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/management_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/managementgroupnetworkmanagerconnections_server.go b/sdk/resourcemanager/network/armnetwork/fake/managementgroupnetworkmanagerconnections_server.go index 10d94f184557..ea6d804a5591 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/managementgroupnetworkmanagerconnections_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/managementgroupnetworkmanagerconnections_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/managercommits_server.go b/sdk/resourcemanager/network/armnetwork/fake/managercommits_server.go index 5c3d14a2e2a5..4a91715f6231 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/managercommits_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/managercommits_server.go @@ -15,7 +15,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/managerdeploymentstatus_server.go b/sdk/resourcemanager/network/armnetwork/fake/managerdeploymentstatus_server.go index 71bfaf39db56..bf1d5bf3fccc 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/managerdeploymentstatus_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/managerdeploymentstatus_server.go @@ -15,7 +15,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/managerroutingconfigurations_server.go b/sdk/resourcemanager/network/armnetwork/fake/managerroutingconfigurations_server.go index 69fce16b8d36..20d770f17f26 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/managerroutingconfigurations_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/managerroutingconfigurations_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/managers_server.go b/sdk/resourcemanager/network/armnetwork/fake/managers_server.go index 6fad97626e61..123dd7b4c6cd 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/managers_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/managers_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/natgateways_server.go b/sdk/resourcemanager/network/armnetwork/fake/natgateways_server.go index 55d8fe78c800..93c7d430602b 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/natgateways_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/natgateways_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/natrules_server.go b/sdk/resourcemanager/network/armnetwork/fake/natrules_server.go index 81e17c0ee7af..cca08b8c4a02 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/natrules_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/natrules_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/operations_server.go b/sdk/resourcemanager/network/armnetwork/fake/operations_server.go index 1ebaa1bfeae3..96294fa8557a 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/operations_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/operations_server.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" ) diff --git a/sdk/resourcemanager/network/armnetwork/fake/p2svpngateways_server.go b/sdk/resourcemanager/network/armnetwork/fake/p2svpngateways_server.go index cbb998b78192..5f7a6fdf599b 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/p2svpngateways_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/p2svpngateways_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/packetcaptures_server.go b/sdk/resourcemanager/network/armnetwork/fake/packetcaptures_server.go index ebd0917c7951..d519dc166b52 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/packetcaptures_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/packetcaptures_server.go @@ -15,7 +15,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/peerexpressroutecircuitconnections_server.go b/sdk/resourcemanager/network/armnetwork/fake/peerexpressroutecircuitconnections_server.go index 9b2a6e3d1645..e4b0e30600c8 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/peerexpressroutecircuitconnections_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/peerexpressroutecircuitconnections_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/polymorphic_helpers.go b/sdk/resourcemanager/network/armnetwork/fake/polymorphic_helpers.go index c0f35be01144..e8bdfa3ebac5 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/polymorphic_helpers.go +++ b/sdk/resourcemanager/network/armnetwork/fake/polymorphic_helpers.go @@ -10,7 +10,7 @@ package fake import ( "encoding/json" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" ) func unmarshalBaseAdminRuleClassification(rawMsg json.RawMessage) (armnetwork.BaseAdminRuleClassification, error) { diff --git a/sdk/resourcemanager/network/armnetwork/fake/privatednszonegroups_server.go b/sdk/resourcemanager/network/armnetwork/fake/privatednszonegroups_server.go index 834bcaf79745..5b7ed79abedd 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/privatednszonegroups_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/privatednszonegroups_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/privateendpoints_server.go b/sdk/resourcemanager/network/armnetwork/fake/privateendpoints_server.go index 7346ec6d5fc3..154410f57f20 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/privateendpoints_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/privateendpoints_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/privatelinkservices_server.go b/sdk/resourcemanager/network/armnetwork/fake/privatelinkservices_server.go index adf2eaa6b929..8a25b88c8d2c 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/privatelinkservices_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/privatelinkservices_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/profiles_server.go b/sdk/resourcemanager/network/armnetwork/fake/profiles_server.go index 155ddbf49451..fc5b190dd4a4 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/profiles_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/profiles_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/publicipaddresses_server.go b/sdk/resourcemanager/network/armnetwork/fake/publicipaddresses_server.go index f125b0b66098..99ca223799ca 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/publicipaddresses_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/publicipaddresses_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/publicipprefixes_server.go b/sdk/resourcemanager/network/armnetwork/fake/publicipprefixes_server.go index 855a90c6a970..36de75800f0c 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/publicipprefixes_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/publicipprefixes_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/reachabilityanalysisintents_server.go b/sdk/resourcemanager/network/armnetwork/fake/reachabilityanalysisintents_server.go index 5b2de118b013..72c236632984 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/reachabilityanalysisintents_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/reachabilityanalysisintents_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/reachabilityanalysisruns_server.go b/sdk/resourcemanager/network/armnetwork/fake/reachabilityanalysisruns_server.go index b3bfbac76693..43235be4c04a 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/reachabilityanalysisruns_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/reachabilityanalysisruns_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/resourcenavigationlinks_server.go b/sdk/resourcemanager/network/armnetwork/fake/resourcenavigationlinks_server.go index c731ef5187d3..ec936e4d3789 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/resourcenavigationlinks_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/resourcenavigationlinks_server.go @@ -15,7 +15,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/routefilterrules_server.go b/sdk/resourcemanager/network/armnetwork/fake/routefilterrules_server.go index 03b82a4ff0ba..493f9a830a79 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/routefilterrules_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/routefilterrules_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/routefilters_server.go b/sdk/resourcemanager/network/armnetwork/fake/routefilters_server.go index d0e6f94d91c1..1296b60f7929 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/routefilters_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/routefilters_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/routemaps_server.go b/sdk/resourcemanager/network/armnetwork/fake/routemaps_server.go index d45bab46b98b..6858353bdecd 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/routemaps_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/routemaps_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/routes_server.go b/sdk/resourcemanager/network/armnetwork/fake/routes_server.go index cda31ce573cb..97f3e75af7e1 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/routes_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/routes_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/routetables_server.go b/sdk/resourcemanager/network/armnetwork/fake/routetables_server.go index 38bfc6d01adf..3a9f3775342b 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/routetables_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/routetables_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/routingintent_server.go b/sdk/resourcemanager/network/armnetwork/fake/routingintent_server.go index a64d6681a210..6ba861dd2387 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/routingintent_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/routingintent_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/routingrulecollections_server.go b/sdk/resourcemanager/network/armnetwork/fake/routingrulecollections_server.go index 5222db6cad3a..ae65e5a9bb23 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/routingrulecollections_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/routingrulecollections_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/routingrules_server.go b/sdk/resourcemanager/network/armnetwork/fake/routingrules_server.go index 9a46348662f4..c8b135a11323 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/routingrules_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/routingrules_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/scopeconnections_server.go b/sdk/resourcemanager/network/armnetwork/fake/scopeconnections_server.go index 152199dd715f..44be919ba8d5 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/scopeconnections_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/scopeconnections_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/securityadminconfigurations_server.go b/sdk/resourcemanager/network/armnetwork/fake/securityadminconfigurations_server.go index a1b88a59778b..5b4137a75af6 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/securityadminconfigurations_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/securityadminconfigurations_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/securitygroups_server.go b/sdk/resourcemanager/network/armnetwork/fake/securitygroups_server.go index aa05338961d9..d9c017fe4056 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/securitygroups_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/securitygroups_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/securitypartnerproviders_server.go b/sdk/resourcemanager/network/armnetwork/fake/securitypartnerproviders_server.go index 853e8e4d6032..4b24c6d309cd 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/securitypartnerproviders_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/securitypartnerproviders_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/securityrules_server.go b/sdk/resourcemanager/network/armnetwork/fake/securityrules_server.go index 0bb4bd926b0b..7cafe155cf91 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/securityrules_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/securityrules_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/securityuserconfigurations_server.go b/sdk/resourcemanager/network/armnetwork/fake/securityuserconfigurations_server.go index 76d437c0c08a..840c93865ea6 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/securityuserconfigurations_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/securityuserconfigurations_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/securityuserrulecollections_server.go b/sdk/resourcemanager/network/armnetwork/fake/securityuserrulecollections_server.go index b0d0f5e38a06..51185875eceb 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/securityuserrulecollections_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/securityuserrulecollections_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/securityuserrules_server.go b/sdk/resourcemanager/network/armnetwork/fake/securityuserrules_server.go index 83fcaaa548c9..6d0407441b0d 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/securityuserrules_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/securityuserrules_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/serviceassociationlinks_server.go b/sdk/resourcemanager/network/armnetwork/fake/serviceassociationlinks_server.go index de590dcc90bc..15817d1abae5 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/serviceassociationlinks_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/serviceassociationlinks_server.go @@ -15,7 +15,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/serviceendpointpolicies_server.go b/sdk/resourcemanager/network/armnetwork/fake/serviceendpointpolicies_server.go index cce990df11ad..0f7b8c65d173 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/serviceendpointpolicies_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/serviceendpointpolicies_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/serviceendpointpolicydefinitions_server.go b/sdk/resourcemanager/network/armnetwork/fake/serviceendpointpolicydefinitions_server.go index b98583aff419..aeb37393bd6a 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/serviceendpointpolicydefinitions_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/serviceendpointpolicydefinitions_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/servicetaginformation_server.go b/sdk/resourcemanager/network/armnetwork/fake/servicetaginformation_server.go index 580b965d4b46..35d766f42061 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/servicetaginformation_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/servicetaginformation_server.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/servicetags_server.go b/sdk/resourcemanager/network/armnetwork/fake/servicetags_server.go index 59a84e80d161..608cbaacd3bc 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/servicetags_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/servicetags_server.go @@ -15,7 +15,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/staticcidrs_server.go b/sdk/resourcemanager/network/armnetwork/fake/staticcidrs_server.go index f2517ca99509..fc36ad2a641c 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/staticcidrs_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/staticcidrs_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "reflect" diff --git a/sdk/resourcemanager/network/armnetwork/fake/staticmembers_server.go b/sdk/resourcemanager/network/armnetwork/fake/staticmembers_server.go index ccb1202c0b6f..d3c74c14f72f 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/staticmembers_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/staticmembers_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/subnets_server.go b/sdk/resourcemanager/network/armnetwork/fake/subnets_server.go index 0fb03971fd97..2c1877dbcd7b 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/subnets_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/subnets_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/subscriptionnetworkmanagerconnections_server.go b/sdk/resourcemanager/network/armnetwork/fake/subscriptionnetworkmanagerconnections_server.go index 6e26f42fbc2b..efd5f44da41a 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/subscriptionnetworkmanagerconnections_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/subscriptionnetworkmanagerconnections_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/usages_server.go b/sdk/resourcemanager/network/armnetwork/fake/usages_server.go index 63546fc825d1..902b38c45a2b 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/usages_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/usages_server.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/verifierworkspaces_server.go b/sdk/resourcemanager/network/armnetwork/fake/verifierworkspaces_server.go index d5fead734dd6..773f281139ba 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/verifierworkspaces_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/verifierworkspaces_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "reflect" diff --git a/sdk/resourcemanager/network/armnetwork/fake/vipswap_server.go b/sdk/resourcemanager/network/armnetwork/fake/vipswap_server.go index 8f9342430659..d0938665a318 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/vipswap_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/vipswap_server.go @@ -15,7 +15,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/virtualapplianceconnections_server.go b/sdk/resourcemanager/network/armnetwork/fake/virtualapplianceconnections_server.go index 6ec94ff2b2b6..fa5214647023 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/virtualapplianceconnections_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/virtualapplianceconnections_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/virtualappliances_server.go b/sdk/resourcemanager/network/armnetwork/fake/virtualappliances_server.go index d271ab68538e..d2c516a07655 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/virtualappliances_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/virtualappliances_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "reflect" @@ -37,6 +37,10 @@ type VirtualAppliancesServer struct { // HTTP status codes to indicate success: http.StatusOK Get func(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, options *armnetwork.VirtualAppliancesClientGetOptions) (resp azfake.Responder[armnetwork.VirtualAppliancesClientGetResponse], errResp azfake.ErrorResponder) + // BeginGetBootDiagnosticLogs is the fake for method VirtualAppliancesClient.BeginGetBootDiagnosticLogs + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginGetBootDiagnosticLogs func(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, options *armnetwork.VirtualAppliancesClientBeginGetBootDiagnosticLogsOptions) (resp azfake.PollerResponder[armnetwork.VirtualAppliancesClientGetBootDiagnosticLogsResponse], errResp azfake.ErrorResponder) + // NewListPager is the fake for method VirtualAppliancesClient.NewListPager // HTTP status codes to indicate success: http.StatusOK NewListPager func(options *armnetwork.VirtualAppliancesClientListOptions) (resp azfake.PagerResponder[armnetwork.VirtualAppliancesClientListResponse]) @@ -45,6 +49,10 @@ type VirtualAppliancesServer struct { // HTTP status codes to indicate success: http.StatusOK NewListByResourceGroupPager func(resourceGroupName string, options *armnetwork.VirtualAppliancesClientListByResourceGroupOptions) (resp azfake.PagerResponder[armnetwork.VirtualAppliancesClientListByResourceGroupResponse]) + // BeginReimage is the fake for method VirtualAppliancesClient.BeginReimage + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginReimage func(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, options *armnetwork.VirtualAppliancesClientBeginReimageOptions) (resp azfake.PollerResponder[armnetwork.VirtualAppliancesClientReimageResponse], errResp azfake.ErrorResponder) + // BeginRestart is the fake for method VirtualAppliancesClient.BeginRestart // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted BeginRestart func(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, options *armnetwork.VirtualAppliancesClientBeginRestartOptions) (resp azfake.PollerResponder[armnetwork.VirtualAppliancesClientRestartResponse], errResp azfake.ErrorResponder) @@ -62,8 +70,10 @@ func NewVirtualAppliancesServerTransport(srv *VirtualAppliancesServer) *VirtualA srv: srv, beginCreateOrUpdate: newTracker[azfake.PollerResponder[armnetwork.VirtualAppliancesClientCreateOrUpdateResponse]](), beginDelete: newTracker[azfake.PollerResponder[armnetwork.VirtualAppliancesClientDeleteResponse]](), + beginGetBootDiagnosticLogs: newTracker[azfake.PollerResponder[armnetwork.VirtualAppliancesClientGetBootDiagnosticLogsResponse]](), newListPager: newTracker[azfake.PagerResponder[armnetwork.VirtualAppliancesClientListResponse]](), newListByResourceGroupPager: newTracker[azfake.PagerResponder[armnetwork.VirtualAppliancesClientListByResourceGroupResponse]](), + beginReimage: newTracker[azfake.PollerResponder[armnetwork.VirtualAppliancesClientReimageResponse]](), beginRestart: newTracker[azfake.PollerResponder[armnetwork.VirtualAppliancesClientRestartResponse]](), } } @@ -74,8 +84,10 @@ type VirtualAppliancesServerTransport struct { srv *VirtualAppliancesServer beginCreateOrUpdate *tracker[azfake.PollerResponder[armnetwork.VirtualAppliancesClientCreateOrUpdateResponse]] beginDelete *tracker[azfake.PollerResponder[armnetwork.VirtualAppliancesClientDeleteResponse]] + beginGetBootDiagnosticLogs *tracker[azfake.PollerResponder[armnetwork.VirtualAppliancesClientGetBootDiagnosticLogsResponse]] newListPager *tracker[azfake.PagerResponder[armnetwork.VirtualAppliancesClientListResponse]] newListByResourceGroupPager *tracker[azfake.PagerResponder[armnetwork.VirtualAppliancesClientListByResourceGroupResponse]] + beginReimage *tracker[azfake.PollerResponder[armnetwork.VirtualAppliancesClientReimageResponse]] beginRestart *tracker[azfake.PollerResponder[armnetwork.VirtualAppliancesClientRestartResponse]] } @@ -97,10 +109,14 @@ func (v *VirtualAppliancesServerTransport) Do(req *http.Request) (*http.Response resp, err = v.dispatchBeginDelete(req) case "VirtualAppliancesClient.Get": resp, err = v.dispatchGet(req) + case "VirtualAppliancesClient.BeginGetBootDiagnosticLogs": + resp, err = v.dispatchBeginGetBootDiagnosticLogs(req) case "VirtualAppliancesClient.NewListPager": resp, err = v.dispatchNewListPager(req) case "VirtualAppliancesClient.NewListByResourceGroupPager": resp, err = v.dispatchNewListByResourceGroupPager(req) + case "VirtualAppliancesClient.BeginReimage": + resp, err = v.dispatchBeginReimage(req) case "VirtualAppliancesClient.BeginRestart": resp, err = v.dispatchBeginRestart(req) case "VirtualAppliancesClient.UpdateTags": @@ -253,6 +269,60 @@ func (v *VirtualAppliancesServerTransport) dispatchGet(req *http.Request) (*http return resp, nil } +func (v *VirtualAppliancesServerTransport) dispatchBeginGetBootDiagnosticLogs(req *http.Request) (*http.Response, error) { + if v.srv.BeginGetBootDiagnosticLogs == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginGetBootDiagnosticLogs not implemented")} + } + beginGetBootDiagnosticLogs := v.beginGetBootDiagnosticLogs.get(req) + if beginGetBootDiagnosticLogs == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/networkVirtualAppliances/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/getBootDiagnosticLogs` + 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.VirtualApplianceBootDiagnosticParameters](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + networkVirtualApplianceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("networkVirtualApplianceName")]) + if err != nil { + return nil, err + } + var options *armnetwork.VirtualAppliancesClientBeginGetBootDiagnosticLogsOptions + if !reflect.ValueOf(body).IsZero() { + options = &armnetwork.VirtualAppliancesClientBeginGetBootDiagnosticLogsOptions{ + InstanceID: &body, + } + } + respr, errRespr := v.srv.BeginGetBootDiagnosticLogs(req.Context(), resourceGroupNameParam, networkVirtualApplianceNameParam, options) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginGetBootDiagnosticLogs = &respr + v.beginGetBootDiagnosticLogs.add(req, beginGetBootDiagnosticLogs) + } + + resp, err := server.PollerResponderNext(beginGetBootDiagnosticLogs, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + v.beginGetBootDiagnosticLogs.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginGetBootDiagnosticLogs) { + v.beginGetBootDiagnosticLogs.remove(req) + } + + return resp, nil +} + func (v *VirtualAppliancesServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { if v.srv.NewListPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} @@ -323,6 +393,60 @@ func (v *VirtualAppliancesServerTransport) dispatchNewListByResourceGroupPager(r return resp, nil } +func (v *VirtualAppliancesServerTransport) dispatchBeginReimage(req *http.Request) (*http.Response, error) { + if v.srv.BeginReimage == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginReimage not implemented")} + } + beginReimage := v.beginReimage.get(req) + if beginReimage == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/networkVirtualAppliances/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/reimage` + 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.VirtualApplianceInstanceIDs](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + networkVirtualApplianceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("networkVirtualApplianceName")]) + if err != nil { + return nil, err + } + var options *armnetwork.VirtualAppliancesClientBeginReimageOptions + if !reflect.ValueOf(body).IsZero() { + options = &armnetwork.VirtualAppliancesClientBeginReimageOptions{ + NetworkVirtualApplianceInstanceIDs: &body, + } + } + respr, errRespr := v.srv.BeginReimage(req.Context(), resourceGroupNameParam, networkVirtualApplianceNameParam, options) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginReimage = &respr + v.beginReimage.add(req, beginReimage) + } + + resp, err := server.PollerResponderNext(beginReimage, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + v.beginReimage.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginReimage) { + v.beginReimage.remove(req) + } + + return resp, nil +} + func (v *VirtualAppliancesServerTransport) dispatchBeginRestart(req *http.Request) (*http.Response, error) { if v.srv.BeginRestart == nil { return nil, &nonRetriableError{errors.New("fake for method BeginRestart not implemented")} diff --git a/sdk/resourcemanager/network/armnetwork/fake/virtualappliancesites_server.go b/sdk/resourcemanager/network/armnetwork/fake/virtualappliancesites_server.go index cb8c405a6fd9..d749ac0ee341 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/virtualappliancesites_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/virtualappliancesites_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/virtualapplianceskus_server.go b/sdk/resourcemanager/network/armnetwork/fake/virtualapplianceskus_server.go index 15ec7ac21e56..1a73721b168c 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/virtualapplianceskus_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/virtualapplianceskus_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/virtualhubbgpconnection_server.go b/sdk/resourcemanager/network/armnetwork/fake/virtualhubbgpconnection_server.go index 09abcfc39728..6a7f8400a40d 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/virtualhubbgpconnection_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/virtualhubbgpconnection_server.go @@ -15,7 +15,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/virtualhubbgpconnections_server.go b/sdk/resourcemanager/network/armnetwork/fake/virtualhubbgpconnections_server.go index b1593dfc8e26..b65dea2ca260 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/virtualhubbgpconnections_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/virtualhubbgpconnections_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/virtualhubipconfiguration_server.go b/sdk/resourcemanager/network/armnetwork/fake/virtualhubipconfiguration_server.go index 9299fa6fb144..4051182a6fdc 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/virtualhubipconfiguration_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/virtualhubipconfiguration_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/virtualhubroutetablev2s_server.go b/sdk/resourcemanager/network/armnetwork/fake/virtualhubroutetablev2s_server.go index c9ee6cb3a576..599aa7003945 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/virtualhubroutetablev2s_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/virtualhubroutetablev2s_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/virtualhubs_server.go b/sdk/resourcemanager/network/armnetwork/fake/virtualhubs_server.go index b923f21a36f9..c60a3adee731 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/virtualhubs_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/virtualhubs_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "reflect" diff --git a/sdk/resourcemanager/network/armnetwork/fake/virtualnetworkgatewayconnections_server.go b/sdk/resourcemanager/network/armnetwork/fake/virtualnetworkgatewayconnections_server.go index d249ae64d822..27315bb86c91 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/virtualnetworkgatewayconnections_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/virtualnetworkgatewayconnections_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "reflect" diff --git a/sdk/resourcemanager/network/armnetwork/fake/virtualnetworkgatewaynatrules_server.go b/sdk/resourcemanager/network/armnetwork/fake/virtualnetworkgatewaynatrules_server.go index f6893c02b48e..ad85a1f4f676 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/virtualnetworkgatewaynatrules_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/virtualnetworkgatewaynatrules_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/virtualnetworkgateways_server.go b/sdk/resourcemanager/network/armnetwork/fake/virtualnetworkgateways_server.go index 11fbf9fb255b..bc6c5e841eee 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/virtualnetworkgateways_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/virtualnetworkgateways_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "reflect" diff --git a/sdk/resourcemanager/network/armnetwork/fake/virtualnetworkpeerings_server.go b/sdk/resourcemanager/network/armnetwork/fake/virtualnetworkpeerings_server.go index 4839332861d3..7ddaf9f44317 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/virtualnetworkpeerings_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/virtualnetworkpeerings_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/virtualnetworks_server.go b/sdk/resourcemanager/network/armnetwork/fake/virtualnetworks_server.go index 6b61b3baed96..4c231ad9f7df 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/virtualnetworks_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/virtualnetworks_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/virtualnetworktaps_server.go b/sdk/resourcemanager/network/armnetwork/fake/virtualnetworktaps_server.go index f3ac25fdc99a..897a91b9b804 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/virtualnetworktaps_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/virtualnetworktaps_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/virtualrouterpeerings_server.go b/sdk/resourcemanager/network/armnetwork/fake/virtualrouterpeerings_server.go index c831280fc908..5a0c9462b669 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/virtualrouterpeerings_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/virtualrouterpeerings_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/virtualrouters_server.go b/sdk/resourcemanager/network/armnetwork/fake/virtualrouters_server.go index 373c3a33c2f6..8bab3a9ec097 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/virtualrouters_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/virtualrouters_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/virtualwans_server.go b/sdk/resourcemanager/network/armnetwork/fake/virtualwans_server.go index 6a5e5426e3c3..d6053b6f1c6a 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/virtualwans_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/virtualwans_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/vpnconnections_server.go b/sdk/resourcemanager/network/armnetwork/fake/vpnconnections_server.go index 0f8a330483c9..ad0b053d5d7f 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/vpnconnections_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/vpnconnections_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "reflect" diff --git a/sdk/resourcemanager/network/armnetwork/fake/vpngateways_server.go b/sdk/resourcemanager/network/armnetwork/fake/vpngateways_server.go index cd72034e622f..88a856f6fe31 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/vpngateways_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/vpngateways_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "reflect" diff --git a/sdk/resourcemanager/network/armnetwork/fake/vpnlinkconnections_server.go b/sdk/resourcemanager/network/armnetwork/fake/vpnlinkconnections_server.go index 414cf1618a7f..6727290c15bf 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/vpnlinkconnections_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/vpnlinkconnections_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/vpnserverconfigurations_server.go b/sdk/resourcemanager/network/armnetwork/fake/vpnserverconfigurations_server.go index fcdb23b40778..73507af220fa 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/vpnserverconfigurations_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/vpnserverconfigurations_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/vpnserverconfigurationsassociatedwithvirtualwan_server.go b/sdk/resourcemanager/network/armnetwork/fake/vpnserverconfigurationsassociatedwithvirtualwan_server.go index 16691263aba6..696111af1ab9 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/vpnserverconfigurationsassociatedwithvirtualwan_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/vpnserverconfigurationsassociatedwithvirtualwan_server.go @@ -15,7 +15,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/vpnsitelinkconnections_server.go b/sdk/resourcemanager/network/armnetwork/fake/vpnsitelinkconnections_server.go index 1b3675c91d1b..b78d1411d88c 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/vpnsitelinkconnections_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/vpnsitelinkconnections_server.go @@ -15,7 +15,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/vpnsitelinks_server.go b/sdk/resourcemanager/network/armnetwork/fake/vpnsitelinks_server.go index 9aa7d6c05509..afb8b5f441d8 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/vpnsitelinks_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/vpnsitelinks_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/vpnsites_server.go b/sdk/resourcemanager/network/armnetwork/fake/vpnsites_server.go index 0c207fa83084..4b02ebc407a5 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/vpnsites_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/vpnsites_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/vpnsitesconfiguration_server.go b/sdk/resourcemanager/network/armnetwork/fake/vpnsitesconfiguration_server.go index 8459d19b216a..b0fc6847bf9f 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/vpnsitesconfiguration_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/vpnsitesconfiguration_server.go @@ -15,7 +15,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/watchers_server.go b/sdk/resourcemanager/network/armnetwork/fake/watchers_server.go index 56f578a77953..4d8647d47722 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/watchers_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/watchers_server.go @@ -15,7 +15,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/webapplicationfirewallpolicies_server.go b/sdk/resourcemanager/network/armnetwork/fake/webapplicationfirewallpolicies_server.go index a0e4344194dc..ae7bb6e482de 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/webapplicationfirewallpolicies_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/webapplicationfirewallpolicies_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/fake/webcategories_server.go b/sdk/resourcemanager/network/armnetwork/fake/webcategories_server.go index 469be222aa40..5c0956fca226 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/webcategories_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/webcategories_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/network/armnetwork/firewallpolicies_client.go b/sdk/resourcemanager/network/armnetwork/firewallpolicies_client.go index f36b3f47cfbc..3e6ad11c3e8b 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 2024-05-01 +// Generated from API version 2024-07-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. @@ -74,7 +74,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -116,7 +116,7 @@ func (client *FirewallPoliciesClient) createOrUpdateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -128,7 +128,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -154,7 +154,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *FirewallPoliciesClient) deleteOperation(ctx context.Context, resourceGroupName string, firewallPolicyName string, options *FirewallPoliciesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "FirewallPoliciesClient.BeginDelete" @@ -196,7 +196,7 @@ func (client *FirewallPoliciesClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -205,7 +205,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -254,7 +254,7 @@ func (client *FirewallPoliciesClient) getCreateRequest(ctx context.Context, reso if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -271,7 +271,7 @@ func (client *FirewallPoliciesClient) getHandleResponse(resp *http.Response) (Fi // NewListPager - Lists all Firewall Policies in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - FirewallPoliciesClientListOptions contains the optional parameters for the FirewallPoliciesClient.NewListPager // method. @@ -314,7 +314,7 @@ func (client *FirewallPoliciesClient) listCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -331,7 +331,7 @@ func (client *FirewallPoliciesClient) listHandleResponse(resp *http.Response) (F // NewListAllPager - Gets all the Firewall Policies in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - options - FirewallPoliciesClientListAllOptions contains the optional parameters for the FirewallPoliciesClient.NewListAllPager // method. func (client *FirewallPoliciesClient) NewListAllPager(options *FirewallPoliciesClientListAllOptions) *runtime.Pager[FirewallPoliciesClientListAllResponse] { @@ -369,7 +369,7 @@ func (client *FirewallPoliciesClient) listAllCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -387,7 +387,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - firewallPolicyName - The name of the Firewall Policy. // - parameters - Parameters supplied to update Azure Firewall Policy tags. @@ -435,7 +435,7 @@ func (client *FirewallPoliciesClient) updateTagsCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 025eaefd2fbb..000000000000 --- a/sdk/resourcemanager/network/armnetwork/firewallpolicies_client_example_test.go +++ /dev/null @@ -1,601 +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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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"), - // }}, - // Size: to.Ptr("0.5MB"), - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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), - Profile: to.Ptr(armnetwork.FirewallPolicyIntrusionDetectionProfileType("Balanced")), - }, - 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), - // Profile: to.Ptr(armnetwork.FirewallPolicyIntrusionDetectionProfileType("Balanced")), - // }, - // 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"), - // }}, - // Size: to.Ptr("0.5MB"), - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/firewallpolicy_live_test.go b/sdk/resourcemanager/network/armnetwork/firewallpolicy_live_test.go index 81ae4ff38422..4fef9fb3def1 100644 --- a/sdk/resourcemanager/network/armnetwork/firewallpolicy_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/firewallpolicy_live_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/firewallpolicydeployments_client.go b/sdk/resourcemanager/network/armnetwork/firewallpolicydeployments_client.go index 8d83c781a7a6..c71606a03ef7 100644 --- a/sdk/resourcemanager/network/armnetwork/firewallpolicydeployments_client.go +++ b/sdk/resourcemanager/network/armnetwork/firewallpolicydeployments_client.go @@ -47,7 +47,7 @@ func NewFirewallPolicyDeploymentsClient(subscriptionID string, credential azcore // BeginDeploy - Deploys the firewall policy draft and child rule collection group drafts. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - firewallPolicyName - The name of the Firewall Policy. // - options - FirewallPolicyDeploymentsClientBeginDeployOptions contains the optional parameters for the FirewallPolicyDeploymentsClient.BeginDeploy @@ -73,7 +73,7 @@ func (client *FirewallPolicyDeploymentsClient) BeginDeploy(ctx context.Context, // Deploy - Deploys the firewall policy draft and child rule collection group drafts. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 func (client *FirewallPolicyDeploymentsClient) deploy(ctx context.Context, resourceGroupName string, firewallPolicyName string, options *FirewallPolicyDeploymentsClientBeginDeployOptions) (*http.Response, error) { var err error const operationName = "FirewallPolicyDeploymentsClient.BeginDeploy" @@ -115,7 +115,7 @@ func (client *FirewallPolicyDeploymentsClient) deployCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/firewallpolicydeployments_client_example_test.go b/sdk/resourcemanager/network/armnetwork/firewallpolicydeployments_client_example_test.go deleted file mode 100644 index c3f9aff501a8..000000000000 --- a/sdk/resourcemanager/network/armnetwork/firewallpolicydeployments_client_example_test.go +++ /dev/null @@ -1,39 +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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/FirewallPolicyDraftDeploy.json -func ExampleFirewallPolicyDeploymentsClient_BeginDeploy() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFirewallPolicyDeploymentsClient().BeginDeploy(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) - } -} diff --git a/sdk/resourcemanager/network/armnetwork/firewallpolicydrafts_client.go b/sdk/resourcemanager/network/armnetwork/firewallpolicydrafts_client.go index 30bd0cf26f6d..df1a2c6a2fea 100644 --- a/sdk/resourcemanager/network/armnetwork/firewallpolicydrafts_client.go +++ b/sdk/resourcemanager/network/armnetwork/firewallpolicydrafts_client.go @@ -47,7 +47,7 @@ func NewFirewallPolicyDraftsClient(subscriptionID string, credential azcore.Toke // CreateOrUpdate - Create or update a draft Firewall Policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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 Draft operation. @@ -95,7 +95,7 @@ func (client *FirewallPolicyDraftsClient) createOrUpdateCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 *FirewallPolicyDraftsClient) createOrUpdateHandleResponse(resp *htt // Delete - Delete a draft policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - firewallPolicyName - The name of the Firewall Policy. // - options - FirewallPolicyDraftsClientDeleteOptions contains the optional parameters for the FirewallPolicyDraftsClient.Delete @@ -162,7 +162,7 @@ func (client *FirewallPolicyDraftsClient) deleteCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -171,7 +171,7 @@ func (client *FirewallPolicyDraftsClient) deleteCreateRequest(ctx context.Contex // Get - Get a draft Firewall Policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - firewallPolicyName - The name of the Firewall Policy. // - options - FirewallPolicyDraftsClientGetOptions contains the optional parameters for the FirewallPolicyDraftsClient.Get @@ -218,7 +218,7 @@ func (client *FirewallPolicyDraftsClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/firewallpolicydrafts_client_example_test.go b/sdk/resourcemanager/network/armnetwork/firewallpolicydrafts_client_example_test.go deleted file mode 100644 index efd5a47c62c0..000000000000 --- a/sdk/resourcemanager/network/armnetwork/firewallpolicydrafts_client_example_test.go +++ /dev/null @@ -1,311 +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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/FirewallPolicyDraftPut.json -func ExampleFirewallPolicyDraftsClient_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.NewFirewallPolicyDraftsClient().CreateOrUpdate(ctx, "rg1", "firewallPolicy", armnetwork.FirewallPolicyDraft{ - Properties: &armnetwork.FirewallPolicyDraftProperties{ - DNSSettings: &armnetwork.DNSSettings{ - EnableProxy: to.Ptr(true), - RequireProxyForNetworkRules: to.Ptr(false), - Servers: []*string{ - to.Ptr("30.3.4.5")}, - }, - ExplicitProxy: &armnetwork.ExplicitProxySettings{ - EnableExplicitProxy: to.Ptr(true), - EnablePacFile: to.Ptr(true), - HTTPPort: to.Ptr[int32](8087), - HTTPSPort: to.Ptr[int32](8087), - PacFile: to.Ptr("https://tinawstorage.file.core.windows.net/?sv=2020-02-10&ss=bfqt&srt=sco&sp=rwdlacuptfx&se=2021-06-04T07:01:12Z&st=2021-06-03T23:01:12Z&sip=68.65.171.11&spr=https&sig=Plsa0RRVpGbY0IETZZOT6znOHcSro71LLTTbzquYPgs%3D"), - PacFilePort: to.Ptr[int32](8087), - }, - 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), - Profile: to.Ptr(armnetwork.FirewallPolicyIntrusionDetectionProfileType("Balanced")), - }, - 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")}, - }, - }, - }, 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.FirewallPolicyDraft = armnetwork.FirewallPolicyDraft{ - // Name: to.Ptr("firewallPolicy"), - // Type: to.Ptr("Microsoft.Network/firewallPolicies"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy"), - // Properties: &armnetwork.FirewallPolicyDraftProperties{ - // DNSSettings: &armnetwork.DNSSettings{ - // EnableProxy: to.Ptr(true), - // RequireProxyForNetworkRules: to.Ptr(false), - // Servers: []*string{ - // to.Ptr("30.3.4.5")}, - // }, - // ExplicitProxy: &armnetwork.ExplicitProxySettings{ - // EnableExplicitProxy: to.Ptr(true), - // EnablePacFile: to.Ptr(true), - // HTTPPort: to.Ptr[int32](8087), - // HTTPSPort: to.Ptr[int32](8087), - // PacFile: to.Ptr("https://tinawstorage.file.core.windows.net/?sv=2020-02-10&ss=bfqt&srt=sco&sp=rwdlacuptfx&se=2021-06-04T07:01:12Z&st=2021-06-03T23:01:12Z&sip=68.65.171.11&spr=https&sig=Plsa0RRVpGbY0IETZZOT6znOHcSro71LLTTbzquYPgs%3D"), - // PacFilePort: to.Ptr[int32](8087), - // }, - // 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), - // Profile: to.Ptr(armnetwork.FirewallPolicyIntrusionDetectionProfileType("Balanced")), - // }, - // 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")}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/FirewallPolicyDraftDelete.json -func ExampleFirewallPolicyDraftsClient_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.NewFirewallPolicyDraftsClient().Delete(ctx, "rg1", "firewallPolicy", 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/FirewallPolicyDraftGet.json -func ExampleFirewallPolicyDraftsClient_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.NewFirewallPolicyDraftsClient().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.FirewallPolicyDraft = armnetwork.FirewallPolicyDraft{ - // Name: to.Ptr("firewallPolicy"), - // Type: to.Ptr("Microsoft.Network/firewallPolicies"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy"), - // Properties: &armnetwork.FirewallPolicyDraftProperties{ - // DNSSettings: &armnetwork.DNSSettings{ - // EnableProxy: to.Ptr(true), - // RequireProxyForNetworkRules: to.Ptr(false), - // Servers: []*string{ - // to.Ptr("30.3.4.5")}, - // }, - // ExplicitProxy: &armnetwork.ExplicitProxySettings{ - // EnableExplicitProxy: to.Ptr(true), - // EnablePacFile: to.Ptr(true), - // HTTPPort: to.Ptr[int32](8087), - // HTTPSPort: to.Ptr[int32](8087), - // PacFile: to.Ptr("https://tinawstorage.file.core.windows.net/?sv=2020-02-10&ss=bfqt&srt=sco&sp=rwdlacuptfx&se=2021-06-04T07:01:12Z&st=2021-06-03T23:01:12Z&sip=68.65.171.11&spr=https&sig=Plsa0RRVpGbY0IETZZOT6znOHcSro71LLTTbzquYPgs%3D"), - // PacFilePort: to.Ptr[int32](8087), - // }, - // 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), - // }, - // 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")}, - // }, - // }, - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignatures_client.go b/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignatures_client.go index f9209a0d946c..dfd5d99a095e 100644 --- a/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignatures_client.go +++ b/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignatures_client.go @@ -48,7 +48,7 @@ func NewFirewallPolicyIdpsSignaturesClient(subscriptionID string, credential azc // 1000. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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 @@ -95,7 +95,7 @@ func (client *FirewallPolicyIdpsSignaturesClient) listCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 63344d3ea2a1..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 e199e4a0eabc..2cb9d7b500c4 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 2024-05-01 +// Generated from API version 2024-07-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", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 55084e40d157..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 1daa0d656561..a3ab39dd3e3a 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 2024-05-01 +// Generated from API version 2024-07-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", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 2024-05-01 +// Generated from API version 2024-07-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", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 2024-05-01 +// Generated from API version 2024-07-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", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 2024-05-01 +// Generated from API version 2024-07-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", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 846ec05cc370..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/firewallpolicyrulecollectiongroupdrafts_client.go b/sdk/resourcemanager/network/armnetwork/firewallpolicyrulecollectiongroupdrafts_client.go index 742cf9a22c5f..8a8729373998 100644 --- a/sdk/resourcemanager/network/armnetwork/firewallpolicyrulecollectiongroupdrafts_client.go +++ b/sdk/resourcemanager/network/armnetwork/firewallpolicyrulecollectiongroupdrafts_client.go @@ -47,7 +47,7 @@ func NewFirewallPolicyRuleCollectionGroupDraftsClient(subscriptionID string, cre // CreateOrUpdate - Create or Update Rule Collection Group Draft. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - firewallPolicyName - The name of the Firewall Policy. // - ruleCollectionGroupName - The name of the FirewallPolicyRuleCollectionGroup. @@ -100,7 +100,7 @@ func (client *FirewallPolicyRuleCollectionGroupDraftsClient) createOrUpdateCreat return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 *FirewallPolicyRuleCollectionGroupDraftsClient) createOrUpdateHandl // Delete - Delete Rule Collection Group Draft. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - firewallPolicyName - The name of the Firewall Policy. // - ruleCollectionGroupName - The name of the FirewallPolicyRuleCollectionGroup. @@ -172,7 +172,7 @@ func (client *FirewallPolicyRuleCollectionGroupDraftsClient) deleteCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -181,7 +181,7 @@ func (client *FirewallPolicyRuleCollectionGroupDraftsClient) deleteCreateRequest // Get - Get Rule Collection Group Draft. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - firewallPolicyName - The name of the Firewall Policy. // - ruleCollectionGroupName - The name of the FirewallPolicyRuleCollectionGroup. @@ -233,7 +233,7 @@ func (client *FirewallPolicyRuleCollectionGroupDraftsClient) getCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/firewallpolicyrulecollectiongroupdrafts_client_example_test.go b/sdk/resourcemanager/network/armnetwork/firewallpolicyrulecollectiongroupdrafts_client_example_test.go deleted file mode 100644 index 35329417f1ce..000000000000 --- a/sdk/resourcemanager/network/armnetwork/firewallpolicyrulecollectiongroupdrafts_client_example_test.go +++ /dev/null @@ -1,160 +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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/FirewallPolicyRuleCollectionGroupDraftDelete.json -func ExampleFirewallPolicyRuleCollectionGroupDraftsClient_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.NewFirewallPolicyRuleCollectionGroupDraftsClient().Delete(ctx, "rg1", "firewallPolicy", "ruleCollectionGroup1", 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/FirewallPolicyRuleCollectionGroupDraftPut.json -func ExampleFirewallPolicyRuleCollectionGroupDraftsClient_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.NewFirewallPolicyRuleCollectionGroupDraftsClient().CreateOrUpdate(ctx, "rg1", "firewallPolicy", "ruleCollectionGroup1", armnetwork.FirewallPolicyRuleCollectionGroupDraft{ - Properties: &armnetwork.FirewallPolicyRuleCollectionGroupDraftProperties{ - 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.FirewallPolicyRuleCollectionGroupDraft = armnetwork.FirewallPolicyRuleCollectionGroupDraft{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1"), - // Name: to.Ptr("ruleCollectionGroup1"), - // Properties: &armnetwork.FirewallPolicyRuleCollectionGroupDraftProperties{ - // 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")}, - // }}, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/FirewallPolicyRuleCollectionGroupDraftGet.json -func ExampleFirewallPolicyRuleCollectionGroupDraftsClient_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.NewFirewallPolicyRuleCollectionGroupDraftsClient().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.FirewallPolicyRuleCollectionGroupDraft = armnetwork.FirewallPolicyRuleCollectionGroupDraft{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/ruleCollectionGroups/ruleCollectionGroup1"), - // Name: to.Ptr("ruleCollectionGroup1"), - // Properties: &armnetwork.FirewallPolicyRuleCollectionGroupDraftProperties{ - // Priority: to.Ptr[int32](110), - // 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")}, - // }}, - // }}, - // }, - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/firewallpolicyrulecollectiongroups_client.go b/sdk/resourcemanager/network/armnetwork/firewallpolicyrulecollectiongroups_client.go index 67655c097e00..f45c6322132e 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - firewallPolicyName - The name of the Firewall Policy. // - ruleCollectionGroupName - The name of the FirewallPolicyRuleCollectionGroup. @@ -75,7 +75,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -121,7 +121,7 @@ func (client *FirewallPolicyRuleCollectionGroupsClient) createOrUpdateCreateRequ return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -133,7 +133,7 @@ func (client *FirewallPolicyRuleCollectionGroupsClient) createOrUpdateCreateRequ // BeginDelete - Deletes the specified FirewallPolicyRuleCollectionGroup. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - firewallPolicyName - The name of the Firewall Policy. // - ruleCollectionGroupName - The name of the FirewallPolicyRuleCollectionGroup. @@ -160,7 +160,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -206,7 +206,7 @@ func (client *FirewallPolicyRuleCollectionGroupsClient) deleteCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -215,7 +215,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - firewallPolicyName - The name of the Firewall Policy. // - ruleCollectionGroupName - The name of the FirewallPolicyRuleCollectionGroup. @@ -267,7 +267,7 @@ func (client *FirewallPolicyRuleCollectionGroupsClient) getCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -284,7 +284,7 @@ func (client *FirewallPolicyRuleCollectionGroupsClient) getHandleResponse(resp * // NewListPager - Lists all FirewallPolicyRuleCollectionGroups in a FirewallPolicy resource. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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 @@ -332,7 +332,7 @@ func (client *FirewallPolicyRuleCollectionGroupsClient) listCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 64d179a3b156..000000000000 --- a/sdk/resourcemanager/network/armnetwork/firewallpolicyrulecollectiongroups_client_example_test.go +++ /dev/null @@ -1,866 +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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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")}, - // }}, - // }}, - // Size: to.Ptr("1.2MB"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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")}, - // }}, - // }}, - // Size: to.Ptr("1.2MB"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 trusted tenants header"), - 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.FirewallPolicyFilterRuleCollectionActionTypeAllow), - // }, - // Rules: []armnetwork.FirewallPolicyRuleClassification{ - // &armnetwork.ApplicationRule{ - // Name: to.Ptr("rule1"), - // Description: to.Ptr("Insert trusted tenants header"), - // 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")}, - // }}, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 18d8d6a1c3b6..9794418a7963 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkWatcherName - The name of the network watcher. // - flowLogName - The name of the flow log. @@ -75,7 +75,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -121,7 +121,7 @@ func (client *FlowLogsClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -133,7 +133,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkWatcherName - The name of the network watcher. // - flowLogName - The name of the flow log resource. @@ -159,7 +159,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -205,7 +205,7 @@ func (client *FlowLogsClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -214,7 +214,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkWatcherName - The name of the network watcher. // - flowLogName - The name of the flow log resource. @@ -265,7 +265,7 @@ func (client *FlowLogsClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -282,7 +282,7 @@ func (client *FlowLogsClient) getHandleResponse(resp *http.Response) (FlowLogsCl // NewListPager - Lists all flow log resources for the specified Network Watcher. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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. @@ -329,7 +329,7 @@ func (client *FlowLogsClient) listCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -347,7 +347,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkWatcherName - The name of the network watcher. // - flowLogName - The name of the flow log. @@ -399,7 +399,7 @@ func (client *FlowLogsClient) updateTagsCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 6ede81c2cf53..000000000000 --- a/sdk/resourcemanager/network/armnetwork/flowlogs_client_example_test.go +++ /dev/null @@ -1,341 +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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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"), - Identity: &armnetwork.ManagedServiceIdentity{ - Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), - UserAssignedIdentities: map[string]*armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": {}, - }, - }, - Properties: &armnetwork.FlowLogPropertiesFormat{ - Format: &armnetwork.FlowLogFormatParameters{ - Type: to.Ptr(armnetwork.FlowLogFormatTypeJSON), - Version: to.Ptr[int32](1), - }, - Enabled: to.Ptr(true), - EnabledFilteringCriteria: to.Ptr("srcIP=158.255.7.8 || dstPort=56891"), - 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\""), - // Identity: &armnetwork.ManagedServiceIdentity{ - // Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - // "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": &armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - // ClientID: to.Ptr("c16d15e1-f60a-40e4-8a05-df3d3f655c14"), - // PrincipalID: to.Ptr("e3858881-e40c-43bd-9cde-88da39c05023"), - // }, - // }, - // }, - // Properties: &armnetwork.FlowLogPropertiesFormat{ - // Format: &armnetwork.FlowLogFormatParameters{ - // Type: to.Ptr(armnetwork.FlowLogFormatTypeJSON), - // Version: to.Ptr[int32](1), - // }, - // Enabled: to.Ptr(true), - // EnabledFilteringCriteria: to.Ptr("srcIP=158.255.7.8 || dstPort=56891"), - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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\""), - // Identity: &armnetwork.ManagedServiceIdentity{ - // Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - // "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": &armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - // ClientID: to.Ptr("c16d15e1-f60a-40e4-8a05-df3d3f655c14"), - // PrincipalID: to.Ptr("e3858881-e40c-43bd-9cde-88da39c05023"), - // }, - // }, - // }, - // Properties: &armnetwork.FlowLogPropertiesFormat{ - // Format: &armnetwork.FlowLogFormatParameters{ - // Type: to.Ptr(armnetwork.FlowLogFormatTypeJSON), - // Version: to.Ptr[int32](1), - // }, - // Enabled: to.Ptr(true), - // EnabledFilteringCriteria: to.Ptr("srcIP=158.255.7.8 || dstPort=56891"), - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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\""), - // Identity: &armnetwork.ManagedServiceIdentity{ - // Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - // "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": &armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - // ClientID: to.Ptr("c16d15e1-f60a-40e4-8a05-df3d3f655c14"), - // PrincipalID: to.Ptr("e3858881-e40c-43bd-9cde-88da39c05023"), - // }, - // }, - // }, - // Properties: &armnetwork.FlowLogPropertiesFormat{ - // Format: &armnetwork.FlowLogFormatParameters{ - // Type: to.Ptr(armnetwork.FlowLogFormatTypeJSON), - // Version: to.Ptr[int32](2), - // }, - // Enabled: to.Ptr(true), - // EnabledFilteringCriteria: to.Ptr("srcIP=158.255.7.8 || dstPort=56891"), - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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\""), - // Identity: &armnetwork.ManagedServiceIdentity{ - // Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - // "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": &armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - // ClientID: to.Ptr("c16d15e1-f60a-40e4-8a05-df3d3f655c14"), - // PrincipalID: to.Ptr("e3858881-e40c-43bd-9cde-88da39c05023"), - // }, - // }, - // }, - // Properties: &armnetwork.FlowLogPropertiesFormat{ - // Format: &armnetwork.FlowLogFormatParameters{ - // Type: to.Ptr(armnetwork.FlowLogFormatTypeJSON), - // Version: to.Ptr[int32](2), - // }, - // Enabled: to.Ptr(true), - // EnabledFilteringCriteria: to.Ptr("srcIP=158.255.7.8 || dstPort=56891"), - // 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\""), - // Identity: &armnetwork.ManagedServiceIdentity{ - // Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - // "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": &armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - // ClientID: to.Ptr("c16d15e1-f60a-40e4-8a05-df3d3f655c14"), - // PrincipalID: to.Ptr("e3858881-e40c-43bd-9cde-88da39c05023"), - // }, - // }, - // }, - // Properties: &armnetwork.FlowLogPropertiesFormat{ - // Format: &armnetwork.FlowLogFormatParameters{ - // Type: to.Ptr(armnetwork.FlowLogFormatTypeJSON), - // Version: to.Ptr[int32](2), - // }, - // Enabled: to.Ptr(true), - // EnabledFilteringCriteria: to.Ptr("srcIP=158.255.7.8 || dstPort=56891"), - // 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/go.mod b/sdk/resourcemanager/network/armnetwork/go.mod index 177fd26c71b0..38cd44bc8551 100644 --- a/sdk/resourcemanager/network/armnetwork/go.mod +++ b/sdk/resourcemanager/network/armnetwork/go.mod @@ -1,16 +1,16 @@ -module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6 +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7 go 1.18 require ( github.com/Azure/azure-sdk-for-go/sdk/azcore v1.16.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.0 github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3 v3.1.0 github.com/stretchr/testify v1.10.0 ) require ( + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v1.3.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect diff --git a/sdk/resourcemanager/network/armnetwork/groups_client.go b/sdk/resourcemanager/network/armnetwork/groups_client.go index beaac1f2519e..8af1aeb2ffe5 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 2024-05-01 +// Generated from API version 2024-07-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", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.IfMatch != nil { @@ -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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - networkGroupName - The name of the network group. @@ -153,7 +153,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -199,7 +199,7 @@ func (client *GroupsClient) deleteCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } @@ -211,7 +211,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - networkGroupName - The name of the network group. @@ -262,7 +262,7 @@ func (client *GroupsClient) getCreateRequest(ctx context.Context, resourceGroupN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -279,7 +279,7 @@ func (client *GroupsClient) getHandleResponse(resp *http.Response) (GroupsClient // NewListPager - Lists the specified network group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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. @@ -332,7 +332,7 @@ func (client *GroupsClient) listCreateRequest(ctx context.Context, resourceGroup if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil 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 ed111b3fb5ae..000000000000 --- a/sdk/resourcemanager/network/armnetwork/groups_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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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"), - // MemberType: to.Ptr(armnetwork.GroupMemberTypeVirtualNetwork), - // 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:27.000Z"); 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:27.000Z"); 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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"), - MemberType: to.Ptr(armnetwork.GroupMemberTypeVirtualNetwork), - }, - }, &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"), - // MemberType: to.Ptr(armnetwork.GroupMemberTypeVirtualNetwork), - // 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:27.000Z"); 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:27.000Z"); 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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"), - // MemberType: to.Ptr(armnetwork.GroupMemberTypeVirtualNetwork), - // 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:27.000Z"); 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:27.000Z"); 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 8fb1ea571a78..22d4d5893fac 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VirtualHub. // - virtualHubName - The name of the VirtualHub. // - routeTableName - The name of the RouteTable. @@ -75,7 +75,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -121,7 +121,7 @@ func (client *HubRouteTablesClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, routeTableParameters); err != nil { @@ -133,7 +133,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the RouteTable. // - virtualHubName - The name of the VirtualHub. // - routeTableName - The name of the RouteTable. @@ -160,7 +160,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -206,7 +206,7 @@ func (client *HubRouteTablesClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -215,7 +215,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VirtualHub. // - virtualHubName - The name of the VirtualHub. // - routeTableName - The name of the RouteTable. @@ -266,7 +266,7 @@ func (client *HubRouteTablesClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -283,7 +283,7 @@ func (client *HubRouteTablesClient) getHandleResponse(resp *http.Response) (HubR // NewListPager - Retrieves the details of all RouteTables. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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. @@ -330,7 +330,7 @@ func (client *HubRouteTablesClient) listCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 1da52bcb2b6e..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 7159fff7c2e2..af162d216bc4 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the HubVirtualNetworkConnection. // - virtualHubName - The name of the VirtualHub. // - connectionName - The name of the HubVirtualNetworkConnection. @@ -75,7 +75,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -121,7 +121,7 @@ func (client *HubVirtualNetworkConnectionsClient) createOrUpdateCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, hubVirtualNetworkConnectionParameters); err != nil { @@ -133,7 +133,7 @@ func (client *HubVirtualNetworkConnectionsClient) createOrUpdateCreateRequest(ct // BeginDelete - Deletes a HubVirtualNetworkConnection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VirtualHub. // - virtualHubName - The name of the VirtualHub. // - connectionName - The name of the HubVirtualNetworkConnection. @@ -160,7 +160,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -206,7 +206,7 @@ func (client *HubVirtualNetworkConnectionsClient) deleteCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -215,7 +215,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VirtualHub. // - virtualHubName - The name of the VirtualHub. // - connectionName - The name of the vpn connection. @@ -267,7 +267,7 @@ func (client *HubVirtualNetworkConnectionsClient) getCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -284,7 +284,7 @@ func (client *HubVirtualNetworkConnectionsClient) getHandleResponse(resp *http.R // NewListPager - Retrieves the details of all HubVirtualNetworkConnections. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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 @@ -332,7 +332,7 @@ func (client *HubVirtualNetworkConnectionsClient) listCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 648c629ab8f6..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 0766cd160325..12540e5d3ed1 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - loadBalancerName - The name of the load balancer. // - inboundNatRuleName - The name of the inbound NAT rule. @@ -75,7 +75,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -121,7 +121,7 @@ func (client *InboundNatRulesClient) createOrUpdateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, inboundNatRuleParameters); err != nil { @@ -133,7 +133,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - loadBalancerName - The name of the load balancer. // - inboundNatRuleName - The name of the inbound NAT rule. @@ -160,7 +160,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -206,7 +206,7 @@ func (client *InboundNatRulesClient) deleteCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -215,7 +215,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - loadBalancerName - The name of the load balancer. // - inboundNatRuleName - The name of the inbound NAT rule. @@ -269,7 +269,7 @@ func (client *InboundNatRulesClient) getCreateRequest(ctx context.Context, resou if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -286,7 +286,7 @@ func (client *InboundNatRulesClient) getHandleResponse(resp *http.Response) (Inb // NewListPager - Gets all the inbound NAT rules in a load balancer. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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 @@ -334,7 +334,7 @@ func (client *InboundNatRulesClient) listCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 747bfecb963b..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 5471a9f4a039..2232e86b1473 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkVirtualApplianceName - The name of the Network Virtual Appliance. // - ruleCollectionName - The name of security rule collection. @@ -75,7 +75,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -121,7 +121,7 @@ func (client *InboundSecurityRuleClient) createOrUpdateCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -133,7 +133,7 @@ func (client *InboundSecurityRuleClient) createOrUpdateCreateRequest(ctx context // Get - Retrieves the available specified Network Virtual Appliance Inbound Security Rules Collection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkVirtualApplianceName - The name of the Network Virtual Appliance. // - ruleCollectionName - The name of security rule collection. @@ -184,7 +184,7 @@ func (client *InboundSecurityRuleClient) getCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, 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 a87dfc43364c..000000000000 --- a/sdk/resourcemanager/network/armnetwork/inboundsecurityrule_client_example_test.go +++ /dev/null @@ -1,118 +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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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{ - RuleType: to.Ptr(armnetwork.InboundSecurityRuleTypePermanent), - Rules: []*armnetwork.InboundSecurityRules{ - { - Name: to.Ptr("inboundRule1"), - AppliesOn: []*string{ - to.Ptr("slbip1")}, - DestinationPortRange: to.Ptr[int32](22), - DestinationPortRanges: []*string{ - to.Ptr("80-100")}, - 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), - // RuleType: to.Ptr(armnetwork.InboundSecurityRuleTypePermanent), - // Rules: []*armnetwork.InboundSecurityRules{ - // { - // Name: to.Ptr("inboundRule1"), - // AppliesOn: []*string{ - // to.Ptr("slbip1")}, - // DestinationPortRange: to.Ptr[int32](22), - // DestinationPortRanges: []*string{ - // to.Ptr("80-100")}, - // SourceAddressPrefix: to.Ptr("50.20.121.5/32"), - // Protocol: to.Ptr(armnetwork.InboundSecurityRulesProtocolTCP), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/InboundSecurityRuleGet.json -func ExampleInboundSecurityRuleClient_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.NewInboundSecurityRuleClient().Get(ctx, "rg1", "nva", "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.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), - // RuleType: to.Ptr(armnetwork.InboundSecurityRuleTypePermanent), - // Rules: []*armnetwork.InboundSecurityRules{ - // { - // Name: to.Ptr("inboundRule1"), - // AppliesOn: []*string{ - // to.Ptr("slbip1")}, - // DestinationPortRange: to.Ptr[int32](22), - // DestinationPortRanges: []*string{ - // to.Ptr("80-100")}, - // 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 50c4d89ec2ec..31e45089ceee 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 2024-05-01 +// Generated from API version 2024-07-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", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 2024-05-01 +// Generated from API version 2024-07-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 @@ -164,7 +164,7 @@ func (client *InterfaceIPConfigurationsClient) listCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 1a5f09eeb997..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 699183c3fc82..3d12f2677805 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 2024-05-01 +// Generated from API version 2024-07-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 @@ -94,7 +94,7 @@ func (client *InterfaceLoadBalancersClient) listCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 7108e217b658..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 9d511dabede7..a65dc6f1fb4a 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 2024-05-01 +// Generated from API version 2024-07-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. @@ -74,7 +74,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -116,7 +116,7 @@ func (client *InterfacesClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -128,7 +128,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -153,7 +153,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *InterfacesClient) deleteOperation(ctx context.Context, resourceGroupName string, networkInterfaceName string, options *InterfacesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "InterfacesClient.BeginDelete" @@ -195,7 +195,7 @@ func (client *InterfacesClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -204,7 +204,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -253,7 +253,7 @@ func (client *InterfacesClient) getCreateRequest(ctx context.Context, resourceGr if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -271,7 +271,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - cloudServiceName - The name of the cloud service. // - roleInstanceName - The name of role instance. @@ -331,7 +331,7 @@ func (client *InterfacesClient) getCloudServiceNetworkInterfaceCreateRequest(ctx if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -349,7 +349,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -375,7 +375,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *InterfacesClient) getEffectiveRouteTable(ctx context.Context, resourceGroupName string, networkInterfaceName string, options *InterfacesClientBeginGetEffectiveRouteTableOptions) (*http.Response, error) { var err error const operationName = "InterfacesClient.BeginGetEffectiveRouteTable" @@ -417,7 +417,7 @@ func (client *InterfacesClient) getEffectiveRouteTableCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -587,7 +587,7 @@ func (client *InterfacesClient) getVirtualMachineScaleSetNetworkInterfaceHandleR // NewListPager - Gets all network interfaces in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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] { @@ -629,7 +629,7 @@ func (client *InterfacesClient) listCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -646,7 +646,7 @@ func (client *InterfacesClient) listHandleResponse(resp *http.Response) (Interfa // NewListAllPager - Gets all network interfaces in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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]{ @@ -683,7 +683,7 @@ func (client *InterfacesClient) listAllCreateRequest(ctx context.Context, option return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -700,7 +700,7 @@ func (client *InterfacesClient) listAllHandleResponse(resp *http.Response) (Inte // NewListCloudServiceNetworkInterfacesPager - Gets all network interfaces in a cloud service. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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 @@ -748,7 +748,7 @@ func (client *InterfacesClient) listCloudServiceNetworkInterfacesCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -766,7 +766,7 @@ func (client *InterfacesClient) listCloudServiceNetworkInterfacesHandleResponse( // NewListCloudServiceRoleInstanceNetworkInterfacesPager - Gets information about all network interfaces in a role instance // in a cloud service. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - cloudServiceName - The name of the cloud service. // - roleInstanceName - The name of role instance. @@ -819,7 +819,7 @@ func (client *InterfacesClient) listCloudServiceRoleInstanceNetworkInterfacesCre return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -837,7 +837,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -863,7 +863,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *InterfacesClient) listEffectiveNetworkSecurityGroups(ctx context.Context, resourceGroupName string, networkInterfaceName string, options *InterfacesClientBeginListEffectiveNetworkSecurityGroupsOptions) (*http.Response, error) { var err error const operationName = "InterfacesClient.BeginListEffectiveNetworkSecurityGroups" @@ -905,7 +905,7 @@ func (client *InterfacesClient) listEffectiveNetworkSecurityGroupsCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1129,7 +1129,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkInterfaceName - The name of the network interface. // - parameters - Parameters supplied to update network interface tags. @@ -1176,7 +1176,7 @@ func (client *InterfacesClient) updateTagsCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 56f9cacd479e..000000000000 --- a/sdk/resourcemanager/network/armnetwork/interfaces_client_example_test.go +++ /dev/null @@ -1,1403 +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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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"), - // }, - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic/ipConfigurations/ipconfig2"), - // Name: to.Ptr("ipconfig2"), - // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ - // Primary: to.Ptr(false), - // PrivateIPAddress: to.Ptr("172.20.2.16/28"), - // PrivateIPAddressPrefixLength: to.Ptr[int32](28), - // 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/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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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"), - }, - }, - }, - { - Name: to.Ptr("ipconfig2"), - Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ - PrivateIPAddressPrefixLength: to.Ptr[int32](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.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"), - // }, - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic/ipConfigurations/ipconfig2"), - // Name: to.Ptr("ipconfig2"), - // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ - // Primary: to.Ptr(false), - // PrivateIPAddress: to.Ptr("172.20.2.16/28"), - // PrivateIPAddressPrefixLength: to.Ptr[int32](28), - // 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/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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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"), - // }, - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic/ipConfigurations/ipconfig2"), - // Name: to.Ptr("ipconfig2"), - // Properties: &armnetwork.InterfaceIPConfigurationPropertiesFormat{ - // Primary: to.Ptr(false), - // PrivateIPAddress: to.Ptr("172.20.2.16/28"), - // PrivateIPAddressPrefixLength: to.Ptr[int32](28), - // 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/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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 7b2f499f1dfd..86d80f899dca 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkInterfaceName - The name of the network interface. // - tapConfigurationName - The name of the tap configuration. @@ -75,7 +75,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -121,7 +121,7 @@ func (client *InterfaceTapConfigurationsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, tapConfigurationParameters); err != nil { @@ -133,7 +133,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkInterfaceName - The name of the network interface. // - tapConfigurationName - The name of the tap configuration. @@ -160,7 +160,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -206,7 +206,7 @@ func (client *InterfaceTapConfigurationsClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -215,7 +215,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkInterfaceName - The name of the network interface. // - tapConfigurationName - The name of the tap configuration. @@ -267,7 +267,7 @@ func (client *InterfaceTapConfigurationsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -284,7 +284,7 @@ func (client *InterfaceTapConfigurationsClient) getHandleResponse(resp *http.Res // NewListPager - Get all Tap configurations in a network interface. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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 @@ -332,7 +332,7 @@ func (client *InterfaceTapConfigurationsClient) listCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 276de65d8eaa..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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, "testrg", "mynic", "tapconfiguration1", 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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("testrg", "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 6cd53bcbacba..711898c2a844 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 2024-05-01 +// Generated from API version 2024-07-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. @@ -74,7 +74,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -116,7 +116,7 @@ func (client *IPAllocationsClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -128,7 +128,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - ipAllocationName - The name of the IpAllocation. // - options - IPAllocationsClientBeginDeleteOptions contains the optional parameters for the IPAllocationsClient.BeginDelete @@ -154,7 +154,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *IPAllocationsClient) deleteOperation(ctx context.Context, resourceGroupName string, ipAllocationName string, options *IPAllocationsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "IPAllocationsClient.BeginDelete" @@ -196,7 +196,7 @@ func (client *IPAllocationsClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -205,7 +205,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -254,7 +254,7 @@ func (client *IPAllocationsClient) getCreateRequest(ctx context.Context, resourc if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -271,7 +271,7 @@ func (client *IPAllocationsClient) getHandleResponse(resp *http.Response) (IPAll // NewListPager - Gets all IpAllocations in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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]{ @@ -308,7 +308,7 @@ func (client *IPAllocationsClient) listCreateRequest(ctx context.Context, option return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -325,7 +325,7 @@ func (client *IPAllocationsClient) listHandleResponse(resp *http.Response) (IPAl // NewListByResourceGroupPager - Gets all IpAllocations in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - IPAllocationsClientListByResourceGroupOptions contains the optional parameters for the IPAllocationsClient.NewListByResourceGroupPager // method. @@ -368,7 +368,7 @@ func (client *IPAllocationsClient) listByResourceGroupCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -386,7 +386,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - ipAllocationName - The name of the IpAllocation. // - parameters - Parameters supplied to update IpAllocation tags. @@ -434,7 +434,7 @@ func (client *IPAllocationsClient) updateTagsCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 e5ce0e0c5049..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ipampools_client.go b/sdk/resourcemanager/network/armnetwork/ipampools_client.go index 000dd7cb97b3..24eb0ea5970c 100644 --- a/sdk/resourcemanager/network/armnetwork/ipampools_client.go +++ b/sdk/resourcemanager/network/armnetwork/ipampools_client.go @@ -48,7 +48,7 @@ func NewIpamPoolsClient(subscriptionID string, credential azcore.TokenCredential // BeginCreate - Creates/Updates the Pool resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - poolName - IP Address Manager Pool resource name. @@ -75,7 +75,7 @@ func (client *IpamPoolsClient) BeginCreate(ctx context.Context, resourceGroupNam // Create - Creates/Updates the Pool resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 func (client *IpamPoolsClient) create(ctx context.Context, resourceGroupName string, networkManagerName string, poolName string, body IpamPool, options *IpamPoolsClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "IpamPoolsClient.BeginCreate" @@ -121,7 +121,7 @@ func (client *IpamPoolsClient) createCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -133,7 +133,7 @@ func (client *IpamPoolsClient) createCreateRequest(ctx context.Context, resource // BeginDelete - Delete the Pool resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - poolName - Pool resource name. @@ -159,7 +159,7 @@ func (client *IpamPoolsClient) BeginDelete(ctx context.Context, resourceGroupNam // Delete - Delete the Pool resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 func (client *IpamPoolsClient) deleteOperation(ctx context.Context, resourceGroupName string, networkManagerName string, poolName string, options *IpamPoolsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "IpamPoolsClient.BeginDelete" @@ -205,7 +205,7 @@ func (client *IpamPoolsClient) deleteCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -214,7 +214,7 @@ func (client *IpamPoolsClient) deleteCreateRequest(ctx context.Context, resource // Get - Gets the specific Pool resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - poolName - Pool resource name. @@ -265,7 +265,7 @@ func (client *IpamPoolsClient) getCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -283,7 +283,7 @@ func (client *IpamPoolsClient) getHandleResponse(resp *http.Response) (IpamPools // GetPoolUsage - Get the Pool Usage. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - poolName - Pool resource name. @@ -334,7 +334,7 @@ func (client *IpamPoolsClient) getPoolUsageCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -351,7 +351,7 @@ func (client *IpamPoolsClient) getPoolUsageHandleResponse(resp *http.Response) ( // NewListPager - Gets list of Pool resources at Network Manager level. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - options - IpamPoolsClientListOptions contains the optional parameters for the IpamPoolsClient.NewListPager method. @@ -398,7 +398,7 @@ func (client *IpamPoolsClient) listCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") if options != nil && options.Skip != nil { reqQP.Set("skip", strconv.FormatInt(int64(*options.Skip), 10)) } @@ -430,7 +430,7 @@ func (client *IpamPoolsClient) listHandleResponse(resp *http.Response) (IpamPool // NewListAssociatedResourcesPager - List Associated Resource in the Pool. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - poolName - Pool resource name. @@ -483,7 +483,7 @@ func (client *IpamPoolsClient) listAssociatedResourcesCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -501,7 +501,7 @@ func (client *IpamPoolsClient) listAssociatedResourcesHandleResponse(resp *http. // Update - Updates the specific Pool resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - poolName - IP Address Manager Pool resource name. @@ -552,7 +552,7 @@ func (client *IpamPoolsClient) updateCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Body != nil { diff --git a/sdk/resourcemanager/network/armnetwork/ipampools_client_example_test.go b/sdk/resourcemanager/network/armnetwork/ipampools_client_example_test.go deleted file mode 100644 index 79c495c783d6..000000000000 --- a/sdk/resourcemanager/network/armnetwork/ipampools_client_example_test.go +++ /dev/null @@ -1,351 +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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/IpamPools_List.json -func ExampleIpamPoolsClient_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.NewIpamPoolsClient().NewListPager("rg1", "TestNetworkManager", &armnetwork.IpamPoolsClientListOptions{SkipToken: nil, - Skip: nil, - Top: nil, - SortKey: nil, - SortValue: 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.IpamPoolList = armnetwork.IpamPoolList{ - // Value: []*armnetwork.IpamPool{ - // { - // Name: to.Ptr("TestPool"), - // Type: to.Ptr("Microsoft.Network/networkManagers/ipamPools"), - // ID: to.Ptr("/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/TestNetworkManager/ipamPools/TestPool"), - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); 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:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // }, - // Properties: &armnetwork.IpamPoolProperties{ - // Description: to.Ptr("Test description."), - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/24")}, - // IPAddressType: []*armnetwork.IPType{ - // to.Ptr(armnetwork.IPTypeIPv4)}, - // ParentPoolName: to.Ptr(""), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/IpamPools_Create.json -func ExampleIpamPoolsClient_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.NewIpamPoolsClient().BeginCreate(ctx, "rg1", "TestNetworkManager", "TestPool", armnetwork.IpamPool{ - Location: to.Ptr("eastus"), - Properties: &armnetwork.IpamPoolProperties{ - Description: to.Ptr("Test description."), - AddressPrefixes: []*string{ - to.Ptr("10.0.0.0/24")}, - ParentPoolName: to.Ptr(""), - }, - }, 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.IpamPool = armnetwork.IpamPool{ - // Name: to.Ptr("TestPool"), - // Type: to.Ptr("Microsoft.Network/networkManagers/ipamPools"), - // ID: to.Ptr("/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/TestNetworkManager/ipamPools/TestPool"), - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); 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:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // }, - // Properties: &armnetwork.IpamPoolProperties{ - // Description: to.Ptr("Test description."), - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/24")}, - // IPAddressType: []*armnetwork.IPType{ - // to.Ptr(armnetwork.IPTypeIPv4)}, - // ParentPoolName: to.Ptr(""), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/IpamPools_Update.json -func ExampleIpamPoolsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain 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.NewIpamPoolsClient().Update(ctx, "rg1", "TestNetworkManager", "TestPool", &armnetwork.IpamPoolsClientUpdateOptions{Body: 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.IpamPool = armnetwork.IpamPool{ - // Name: to.Ptr("TestPool"), - // Type: to.Ptr("Microsoft.Network/networkManagers/ipamPools"), - // ID: to.Ptr("/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/TestNetworkManager/ipamPools/TestPool"), - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); 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:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // }, - // Properties: &armnetwork.IpamPoolProperties{ - // Description: to.Ptr("Test description."), - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/24")}, - // IPAddressType: []*armnetwork.IPType{ - // to.Ptr(armnetwork.IPTypeIPv4)}, - // ParentPoolName: to.Ptr("test-ipam-pool"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/IpamPools_Get.json -func ExampleIpamPoolsClient_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.NewIpamPoolsClient().Get(ctx, "rg1", "TestNetworkManager", "TestPool", 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.IpamPool = armnetwork.IpamPool{ - // Name: to.Ptr("TestPool"), - // Type: to.Ptr("Microsoft.Network/networkManagers/ipamPools"), - // ID: to.Ptr("/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/TestNetworkManager/ipamPools/TestPool"), - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); 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:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // }, - // Properties: &armnetwork.IpamPoolProperties{ - // Description: to.Ptr("Test description."), - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/24")}, - // IPAddressType: []*armnetwork.IPType{ - // to.Ptr(armnetwork.IPTypeIPv4)}, - // ParentPoolName: to.Ptr(""), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/IpamPools_Delete.json -func ExampleIpamPoolsClient_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.NewIpamPoolsClient().BeginDelete(ctx, "rg1", "TestNetworkManager", "TestPool", 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/IpamPools_GetPoolUsage.json -func ExampleIpamPoolsClient_GetPoolUsage() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain 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.NewIpamPoolsClient().GetPoolUsage(ctx, "rg1", "TestNetworkManager", "TestPool", 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.PoolUsage = armnetwork.PoolUsage{ - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/8"), - // to.Ptr("192.0.0.0/8")}, - // AllocatedAddressPrefixes: []*string{ - // to.Ptr("10.0.2.0/26"), - // to.Ptr("10.0.3.0/26")}, - // AvailableAddressPrefixes: []*string{ - // to.Ptr("10.0.1.0/24"), - // to.Ptr("10.0.2.64/26"), - // to.Ptr("10.0.2.128/25"), - // to.Ptr("10.0.3.64/26"), - // to.Ptr("10.0.3.128/25"), - // to.Ptr("10.0.4.0/22"), - // to.Ptr("10.0.8.0/21"), - // to.Ptr("10.0.16.0/20"), - // to.Ptr("10.0.32.0/19"), - // to.Ptr("10.0.64.0/18"), - // to.Ptr("10.0.128.0/17"), - // to.Ptr("10.1.0.0/16"), - // to.Ptr("10.2.0.0/15"), - // to.Ptr("10.4.0.0/14"), - // to.Ptr("10.8.0.0/13"), - // to.Ptr("10.16.0.0/12"), - // to.Ptr("10.32.0.0/11"), - // to.Ptr("10.64.0.0/10"), - // to.Ptr("10.128.0.0/9"), - // to.Ptr("192.0.0.0/8")}, - // ChildPools: []*armnetwork.ResourceBasics{ - // { - // AddressPrefixes: []*string{ - // to.Ptr("10.0.2.0/26")}, - // ResourceID: to.Ptr("/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/TestNetworkManager/ipamPools/TestPool1"), - // }, - // { - // AddressPrefixes: []*string{ - // to.Ptr("10.0.3.0/26")}, - // ResourceID: to.Ptr("/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/TestNetworkManager/ipamPools/TestPool2"), - // }}, - // NumberOfAllocatedIPAddresses: to.Ptr("128"), - // NumberOfAvailableIPAddresses: to.Ptr("33554048"), - // NumberOfReservedIPAddresses: to.Ptr("256"), - // ReservedAddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/24")}, - // TotalNumberOfIPAddresses: to.Ptr("33554432"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/IpamPools_ListAssociatedResources.json -func ExampleIpamPoolsClient_NewListAssociatedResourcesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain 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.NewIpamPoolsClient().NewListAssociatedResourcesPager("rg1", "TestNetworkManager", "TestPool", 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.PoolAssociationList = armnetwork.PoolAssociationList{ - // Value: []*armnetwork.PoolAssociation{ - // { - // Description: to.Ptr(""), - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/24")}, - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-09-09T20:00:00.000Z"); return t}()), - // NumberOfReservedIPAddresses: to.Ptr("0"), - // PoolID: to.Ptr("/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/TestNetworkManager/ipamPools/TestPool"), - // ReservedPrefixes: []*string{ - // }, - // ResourceID: to.Ptr("/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/testVnet"), - // TotalNumberOfIPAddresses: to.Ptr("256"), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/ipgroups_client.go b/sdk/resourcemanager/network/armnetwork/ipgroups_client.go index 4bbb8e0be173..0b8201048673 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - ipGroupsName - The name of the ipGroups. // - parameters - Parameters supplied to the create or update IpGroups operation. @@ -74,7 +74,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -116,7 +116,7 @@ func (client *IPGroupsClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -128,7 +128,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -153,7 +153,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *IPGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, ipGroupsName string, options *IPGroupsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "IPGroupsClient.BeginDelete" @@ -195,7 +195,7 @@ func (client *IPGroupsClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -204,7 +204,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -253,7 +253,7 @@ func (client *IPGroupsClient) getCreateRequest(ctx context.Context, resourceGrou if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -270,7 +270,7 @@ func (client *IPGroupsClient) getHandleResponse(resp *http.Response) (IPGroupsCl // NewListPager - Gets all IpGroups in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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]{ @@ -307,7 +307,7 @@ func (client *IPGroupsClient) listCreateRequest(ctx context.Context, options *IP return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -324,7 +324,7 @@ func (client *IPGroupsClient) listHandleResponse(resp *http.Response) (IPGroupsC // NewListByResourceGroupPager - Gets all IpGroups in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - IPGroupsClientListByResourceGroupOptions contains the optional parameters for the IPGroupsClient.NewListByResourceGroupPager // method. @@ -367,7 +367,7 @@ func (client *IPGroupsClient) listByResourceGroupCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -385,7 +385,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - ipGroupsName - The name of the ipGroups. // - parameters - Parameters supplied to the update ipGroups operation. @@ -432,7 +432,7 @@ func (client *IPGroupsClient) updateGroupsCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 68c555b9373c..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ipgroups_live_test.go b/sdk/resourcemanager/network/armnetwork/ipgroups_live_test.go index c6feaf7b192f..17a452bf9a7c 100644 --- a/sdk/resourcemanager/network/armnetwork/ipgroups_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/ipgroups_live_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/loadbalancer_live_test.go b/sdk/resourcemanager/network/armnetwork/loadbalancer_live_test.go index 5b60718fe29a..ece0f1fde28b 100644 --- a/sdk/resourcemanager/network/armnetwork/loadbalancer_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/loadbalancer_live_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/loadbalancerbackendaddresspools_client.go b/sdk/resourcemanager/network/armnetwork/loadbalancerbackendaddresspools_client.go index 23379642890b..ea84f976eb5e 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - loadBalancerName - The name of the load balancer. // - backendAddressPoolName - The name of the backend address pool. @@ -75,7 +75,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -121,7 +121,7 @@ func (client *LoadBalancerBackendAddressPoolsClient) createOrUpdateCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -133,7 +133,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - loadBalancerName - The name of the load balancer. // - backendAddressPoolName - The name of the backend address pool. @@ -160,7 +160,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -206,7 +206,7 @@ func (client *LoadBalancerBackendAddressPoolsClient) deleteCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -215,7 +215,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - loadBalancerName - The name of the load balancer. // - backendAddressPoolName - The name of the backend address pool. @@ -267,7 +267,7 @@ func (client *LoadBalancerBackendAddressPoolsClient) getCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -284,7 +284,7 @@ func (client *LoadBalancerBackendAddressPoolsClient) getHandleResponse(resp *htt // NewListPager - Gets all the load balancer backed address pools. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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 @@ -332,7 +332,7 @@ func (client *LoadBalancerBackendAddressPoolsClient) listCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 61ef9ff970da..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 c5a4b6f88191..ba683ce1351c 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 2024-05-01 +// Generated from API version 2024-07-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", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 2024-05-01 +// Generated from API version 2024-07-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 @@ -164,7 +164,7 @@ func (client *LoadBalancerFrontendIPConfigurationsClient) listCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 70ec3338da9f..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 b8ad74fe6fda..270f5a44de0e 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 2024-05-01 +// Generated from API version 2024-07-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", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -117,7 +117,7 @@ func (client *LoadBalancerLoadBalancingRulesClient) getHandleResponse(resp *http // BeginHealth - Get health details of a load balancing rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - groupName - The name of the resource group. // - loadBalancerName - The name of the load balancer. // - loadBalancingRuleName - The name of the load balancing rule. @@ -144,7 +144,7 @@ func (client *LoadBalancerLoadBalancingRulesClient) BeginHealth(ctx context.Cont // Health - Get health details of a load balancing rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 func (client *LoadBalancerLoadBalancingRulesClient) health(ctx context.Context, groupName string, loadBalancerName string, loadBalancingRuleName string, options *LoadBalancerLoadBalancingRulesClientBeginHealthOptions) (*http.Response, error) { var err error const operationName = "LoadBalancerLoadBalancingRulesClient.BeginHealth" @@ -190,7 +190,7 @@ func (client *LoadBalancerLoadBalancingRulesClient) healthCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -198,7 +198,7 @@ func (client *LoadBalancerLoadBalancingRulesClient) healthCreateRequest(ctx cont // NewListPager - Gets all the load balancing rules in a load balancer. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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 @@ -246,7 +246,7 @@ func (client *LoadBalancerLoadBalancingRulesClient) listCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 406d34d81a18..000000000000 --- a/sdk/resourcemanager/network/armnetwork/loadbalancerloadbalancingrules_client_example_test.go +++ /dev/null @@ -1,152 +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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/LoadBalancerHealth.json -func ExampleLoadBalancerLoadBalancingRulesClient_BeginHealth() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetwork.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLoadBalancerLoadBalancingRulesClient().BeginHealth(ctx, "rg1", "lb1", "rulelb", 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.LoadBalancerHealthPerRule = armnetwork.LoadBalancerHealthPerRule{ - // Down: to.Ptr[int32](0), - // LoadBalancerBackendAddresses: []*armnetwork.LoadBalancerHealthPerRulePerBackendAddress{ - // { - // IPAddress: to.Ptr("10.1.0.4"), - // NetworkInterfaceIPConfigurationID: &armnetwork.InterfaceIPConfiguration{ - // }, - // Reason: to.Ptr("Up_Probe_Success"), - // State: to.Ptr("Up"), - // }}, - // Up: to.Ptr[int32](1), - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/loadbalancernetworkinterfaces_client.go b/sdk/resourcemanager/network/armnetwork/loadbalancernetworkinterfaces_client.go index 27426ef64db9..c4b691c7471f 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 2024-05-01 +// Generated from API version 2024-07-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 @@ -94,7 +94,7 @@ func (client *LoadBalancerNetworkInterfacesClient) listCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 3c0c9fd82a0d..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 d8d9724ed3ba..cca8edf3a0dc 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 2024-05-01 +// Generated from API version 2024-07-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", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 2024-05-01 +// Generated from API version 2024-07-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 @@ -164,7 +164,7 @@ func (client *LoadBalancerOutboundRulesClient) listCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 8784fb9899b0..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 5e52e1b3cc36..80f8e426deb3 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 2024-05-01 +// Generated from API version 2024-07-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", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 2024-05-01 +// Generated from API version 2024-07-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 @@ -163,7 +163,7 @@ func (client *LoadBalancerProbesClient) listCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 846ab52d3d3e..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 0b71a6fea855..d90842b73934 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 2024-05-01 +// Generated from API version 2024-07-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. @@ -74,7 +74,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -116,7 +116,7 @@ func (client *LoadBalancersClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -128,7 +128,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -154,7 +154,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *LoadBalancersClient) deleteOperation(ctx context.Context, resourceGroupName string, loadBalancerName string, options *LoadBalancersClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "LoadBalancersClient.BeginDelete" @@ -196,7 +196,7 @@ func (client *LoadBalancersClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -205,7 +205,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -254,7 +254,7 @@ func (client *LoadBalancersClient) getCreateRequest(ctx context.Context, resourc if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -271,7 +271,7 @@ func (client *LoadBalancersClient) getHandleResponse(resp *http.Response) (LoadB // NewListPager - Gets all the load balancers in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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] { @@ -313,7 +313,7 @@ func (client *LoadBalancersClient) listCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -330,7 +330,7 @@ func (client *LoadBalancersClient) listHandleResponse(resp *http.Response) (Load // NewListAllPager - Gets all the load balancers in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - options - LoadBalancersClientListAllOptions contains the optional parameters for the LoadBalancersClient.NewListAllPager // method. func (client *LoadBalancersClient) NewListAllPager(options *LoadBalancersClientListAllOptions) *runtime.Pager[LoadBalancersClientListAllResponse] { @@ -368,7 +368,7 @@ func (client *LoadBalancersClient) listAllCreateRequest(ctx context.Context, opt return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -386,7 +386,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -414,7 +414,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -460,7 +460,7 @@ func (client *LoadBalancersClient) listInboundNatRulePortMappingsCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -472,7 +472,7 @@ func (client *LoadBalancersClient) listInboundNatRulePortMappingsCreateRequest(c // MigrateToIPBased - Migrate load balancer to IP Based // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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 @@ -519,7 +519,7 @@ func (client *LoadBalancersClient) migrateToIPBasedCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Parameters != nil { @@ -543,7 +543,7 @@ func (client *LoadBalancersClient) migrateToIPBasedHandleResponse(resp *http.Res // BeginSwapPublicIPAddresses - Swaps VIPs between two load balancers. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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 @@ -569,7 +569,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *LoadBalancersClient) swapPublicIPAddresses(ctx context.Context, location string, parameters LoadBalancerVipSwapRequest, options *LoadBalancersClientBeginSwapPublicIPAddressesOptions) (*http.Response, error) { var err error const operationName = "LoadBalancersClient.BeginSwapPublicIPAddresses" @@ -607,7 +607,7 @@ func (client *LoadBalancersClient) swapPublicIPAddressesCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -619,7 +619,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - loadBalancerName - The name of the load balancer. // - parameters - Parameters supplied to update load balancer tags. @@ -667,7 +667,7 @@ func (client *LoadBalancersClient) updateTagsCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 2b84cfb866bf..000000000000 --- a/sdk/resourcemanager/network/armnetwork/loadbalancers_client_example_test.go +++ /dev/null @@ -1,3017 +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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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.LoadBalancerSKUNameGateway), - }, - }, 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.LoadBalancerSKUNameGateway), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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.LoadBalancerSKUNameGateway), - }, - }, 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.LoadBalancerSKUNameGateway), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/LoadBalancerCreateWithSyncModePropertyOnPool.json -func ExampleLoadBalancersClient_BeginCreateOrUpdate_createLoadBalancerWithSyncModePropertyOnPool() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", 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{ - SyncMode: to.Ptr(armnetwork.SyncModeAutomatic), - VirtualNetwork: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb"), - }, - }, - }}, - 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), - // SyncMode: to.Ptr(armnetwork.SyncModeAutomatic), - // VirtualNetwork: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb"), - // }, - // }, - // }}, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/MigrateLoadBalancerToIPBased.json -func ExampleLoadBalancersClient_MigrateToIPBased() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain 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().MigrateToIPBased(ctx, "rg1", "lb1", &armnetwork.LoadBalancersClientMigrateToIPBasedOptions{Parameters: &armnetwork.MigrateLoadBalancerToIPBasedRequest{ - Pools: []*string{ - to.Ptr("pool1"), - to.Ptr("pool2")}, - }, - }) - 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.MigratedPools = armnetwork.MigratedPools{ - // MigratedPools: []*string{ - // to.Ptr("pool1"), - // to.Ptr("pool2")}, - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/localnetworkgateways_client.go b/sdk/resourcemanager/network/armnetwork/localnetworkgateways_client.go index 4bcfa4274433..786f14146278 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 2024-05-01 +// Generated from API version 2024-07-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. @@ -74,7 +74,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -116,7 +116,7 @@ func (client *LocalNetworkGatewaysClient) createOrUpdateCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -128,7 +128,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -154,7 +154,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *LocalNetworkGatewaysClient) deleteOperation(ctx context.Context, resourceGroupName string, localNetworkGatewayName string, options *LocalNetworkGatewaysClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "LocalNetworkGatewaysClient.BeginDelete" @@ -196,7 +196,7 @@ func (client *LocalNetworkGatewaysClient) deleteCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -205,7 +205,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -252,7 +252,7 @@ func (client *LocalNetworkGatewaysClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -269,7 +269,7 @@ func (client *LocalNetworkGatewaysClient) getHandleResponse(resp *http.Response) // NewListPager - Gets all the local network gateways in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - LocalNetworkGatewaysClientListOptions contains the optional parameters for the LocalNetworkGatewaysClient.NewListPager // method. @@ -312,7 +312,7 @@ func (client *LocalNetworkGatewaysClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -330,7 +330,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -378,7 +378,7 @@ func (client *LocalNetworkGatewaysClient) updateTagsCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 0b84b0642d94..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 e2532f6fc9cf..13be3a7d82b2 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 2024-05-01 +// Generated from API version 2024-07-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 @@ -91,7 +91,7 @@ func (client *ManagementClient) checkDNSNameAvailabilityCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") reqQP.Set("domainNameLabel", domainNameLabel) req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} @@ -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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - bastionHostName - The name of the Bastion Host. // - bslRequest - Post request for Create/Delete/Get Bastion Shareable Link endpoints. @@ -137,7 +137,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -179,7 +179,7 @@ func (client *ManagementClient) deleteBastionShareableLinkCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, bslRequest); err != nil { @@ -191,7 +191,7 @@ func (client *ManagementClient) deleteBastionShareableLinkCreateRequest(ctx cont // BeginDeleteBastionShareableLinkByToken - Deletes the Bastion Shareable Links for all the tokens specified in the request. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - bastionHostName - The name of the Bastion Host. // - bslTokenRequest - Post request for Delete Bastion Shareable Link By Token endpoint. @@ -218,7 +218,7 @@ func (client *ManagementClient) BeginDeleteBastionShareableLinkByToken(ctx conte // DeleteBastionShareableLinkByToken - Deletes the Bastion Shareable Links for all the tokens specified in the request. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 func (client *ManagementClient) deleteBastionShareableLinkByToken(ctx context.Context, resourceGroupName string, bastionHostName string, bslTokenRequest BastionShareableLinkTokenListRequest, options *ManagementClientBeginDeleteBastionShareableLinkByTokenOptions) (*http.Response, error) { var err error const operationName = "ManagementClient.BeginDeleteBastionShareableLinkByToken" @@ -260,7 +260,7 @@ func (client *ManagementClient) deleteBastionShareableLinkByTokenCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, bslTokenRequest); err != nil { @@ -271,7 +271,7 @@ func (client *ManagementClient) deleteBastionShareableLinkByTokenCreateRequest(c // NewDisconnectActiveSessionsPager - Returns the list of currently active sessions on the Bastion. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - bastionHostName - The name of the Bastion Host. // - sessionIDs - The list of sessionids to disconnect. @@ -320,7 +320,7 @@ func (client *ManagementClient) disconnectActiveSessionsCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, sessionIDs); err != nil { @@ -341,7 +341,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 2024-05-01 +// Generated from API version 2024-07-01 // - providerport - The name of the provider port. // - options - ManagementClientExpressRouteProviderPortOptions contains the optional parameters for the ManagementClient.ExpressRouteProviderPort // method. @@ -383,7 +383,7 @@ func (client *ManagementClient) expressRouteProviderPortCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -402,7 +402,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -430,7 +430,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -472,7 +472,7 @@ func (client *ManagementClient) generatevirtualwanvpnserverconfigurationvpnprofi return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, vpnClientParams); err != nil { @@ -483,7 +483,7 @@ func (client *ManagementClient) generatevirtualwanvpnserverconfigurationvpnprofi // BeginGetActiveSessions - Returns the list of currently active sessions on the Bastion. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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 @@ -526,7 +526,7 @@ func (client *ManagementClient) BeginGetActiveSessions(ctx context.Context, reso // GetActiveSessions - Returns the list of currently active sessions on the Bastion. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 func (client *ManagementClient) getActiveSessions(ctx context.Context, resourceGroupName string, bastionHostName string, options *ManagementClientBeginGetActiveSessionsOptions) (*http.Response, error) { var err error const operationName = "ManagementClient.BeginGetActiveSessions" @@ -568,7 +568,7 @@ func (client *ManagementClient) getActiveSessionsCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -585,7 +585,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - bastionHostName - The name of the Bastion Host. // - bslRequest - Post request for Create/Delete/Get Bastion Shareable Link endpoints. @@ -634,7 +634,7 @@ func (client *ManagementClient) getBastionShareableLinkCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, bslRequest); err != nil { @@ -655,7 +655,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - parameters - Active Configuration Parameter. @@ -706,7 +706,7 @@ func (client *ManagementClient) listActiveConnectivityConfigurationsCreateReques if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -727,7 +727,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - parameters - Active Configuration Parameter. @@ -778,7 +778,7 @@ func (client *ManagementClient) listActiveSecurityAdminRulesCreateRequest(ctx co if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 *ManagementClient) listActiveSecurityAdminRulesHandleResponse(resp // network. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkName - The name of the virtual network. // - parameters - Parameters supplied to list correct page. @@ -851,7 +851,7 @@ func (client *ManagementClient) listNetworkManagerEffectiveConnectivityConfigura if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -872,7 +872,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkName - The name of the virtual network. // - parameters - Parameters supplied to list correct page. @@ -923,7 +923,7 @@ func (client *ManagementClient) listNetworkManagerEffectiveSecurityAdminRulesCre if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -943,7 +943,7 @@ func (client *ManagementClient) listNetworkManagerEffectiveSecurityAdminRulesHan // BeginPutBastionShareableLink - Creates a Bastion Shareable Links for all the VMs specified in the request. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - bastionHostName - The name of the Bastion Host. // - bslRequest - Post request for Create/Delete/Get Bastion Shareable Link endpoints. @@ -987,7 +987,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -1029,7 +1029,7 @@ func (client *ManagementClient) putBastionShareableLinkCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, bslRequest); err != nil { @@ -1050,7 +1050,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -1097,7 +1097,7 @@ func (client *ManagementClient) supportedSecurityProvidersCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 255d311e3f80..000000000000 --- a/sdk/resourcemanager/network/armnetwork/management_client_example_test.go +++ /dev/null @@ -1,654 +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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/BastionShareableLinkDeleteByToken.json -func ExampleManagementClient_BeginDeleteBastionShareableLinkByToken() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", 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().BeginDeleteBastionShareableLinkByToken(ctx, "rg1", "bastionhosttenant", armnetwork.BastionShareableLinkTokenListRequest{ - Tokens: []*string{ - to.Ptr("abcd1234-efgh-hijk-5678-abcdefgh1234"), - to.Ptr("dcba4321-hgfe-kjih-8765-hgfedcba4321")}, - }, 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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-10T12:33:22.257Z"); return t}()), - // Region: to.Ptr("westus"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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-10T12:33:22.257Z"); 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 185997bf6e9e..0f913be162db 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 2024-05-01 +// Generated from API version 2024-07-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", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 2024-05-01 +// Generated from API version 2024-07-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", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 2024-05-01 +// Generated from API version 2024-07-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", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 2024-05-01 +// Generated from API version 2024-07-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. @@ -265,7 +265,7 @@ func (client *ManagementGroupNetworkManagerConnectionsClient) listCreateRequest( if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil 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 dc6c7a50f088..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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:27.000Z"); 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:27.000Z"); 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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:27.000Z"); 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:27.000Z"); 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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:27.000Z"); 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:27.000Z"); 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 6f9a0a8ad754..9e882309b13f 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 2024-05-01 +// Generated from API version 2024-07-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. @@ -74,7 +74,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -116,7 +116,7 @@ func (client *ManagerCommitsClient) postCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 be3330894b57..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 73935ee7e59e..47a500276af5 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 2024-05-01 +// Generated from API version 2024-07-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. @@ -99,7 +99,7 @@ func (client *ManagerDeploymentStatusClient) listCreateRequest(ctx context.Conte if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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/managerdeploymentstatus_client_example_test.go b/sdk/resourcemanager/network/armnetwork/managerdeploymentstatus_client_example_test.go deleted file mode 100644 index 4a38c058c70b..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/managerroutingconfigurations_client.go b/sdk/resourcemanager/network/armnetwork/managerroutingconfigurations_client.go index 81bfecf25e59..9bc037c6123a 100644 --- a/sdk/resourcemanager/network/armnetwork/managerroutingconfigurations_client.go +++ b/sdk/resourcemanager/network/armnetwork/managerroutingconfigurations_client.go @@ -48,7 +48,7 @@ func NewManagerRoutingConfigurationsClient(subscriptionID string, credential azc // CreateOrUpdate - Creates or updates a network manager routing configuration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Routing Configuration. @@ -101,7 +101,7 @@ func (client *ManagerRoutingConfigurationsClient) createOrUpdateCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, routingConfiguration); err != nil { @@ -122,7 +122,7 @@ func (client *ManagerRoutingConfigurationsClient) createOrUpdateHandleResponse(r // BeginDelete - Deletes a network manager routing configuration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Routing Configuration. @@ -149,7 +149,7 @@ func (client *ManagerRoutingConfigurationsClient) BeginDelete(ctx context.Contex // Delete - Deletes a network manager routing configuration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 func (client *ManagerRoutingConfigurationsClient) deleteOperation(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, options *ManagerRoutingConfigurationsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ManagerRoutingConfigurationsClient.BeginDelete" @@ -195,7 +195,7 @@ func (client *ManagerRoutingConfigurationsClient) deleteCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } @@ -207,7 +207,7 @@ func (client *ManagerRoutingConfigurationsClient) deleteCreateRequest(ctx contex // Get - Retrieves a network manager routing configuration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Routing Configuration. @@ -259,7 +259,7 @@ func (client *ManagerRoutingConfigurationsClient) getCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -276,7 +276,7 @@ func (client *ManagerRoutingConfigurationsClient) getHandleResponse(resp *http.R // NewListPager - Lists all the network manager routing configurations in a network manager, in a paginated format. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - options - ManagerRoutingConfigurationsClientListOptions contains the optional parameters for the ManagerRoutingConfigurationsClient.NewListPager @@ -330,7 +330,7 @@ func (client *ManagerRoutingConfigurationsClient) listCreateRequest(ctx context. if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/managerroutingconfigurations_client_example_test.go b/sdk/resourcemanager/network/armnetwork/managerroutingconfigurations_client_example_test.go deleted file mode 100644 index 0edcddfa0a62..000000000000 --- a/sdk/resourcemanager/network/armnetwork/managerroutingconfigurations_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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/NetworkManagerRoutingConfigurationList.json -func ExampleManagerRoutingConfigurationsClient_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.NewManagerRoutingConfigurationsClient().NewListPager("rg1", "testNetworkManager", &armnetwork.ManagerRoutingConfigurationsClientListOptions{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.ManagerRoutingConfigurationListResult = armnetwork.ManagerRoutingConfigurationListResult{ - // Value: []*armnetwork.ManagerRoutingConfiguration{ - // { - // Name: to.Ptr("myTestRoutingConfig"), - // Type: to.Ptr("Microsoft.Network/networkManagers/routingConfigurations"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/routingConfigurations/myTestRoutingConfig"), - // Properties: &armnetwork.ManagerRoutingConfigurationPropertiesFormat{ - // Description: to.Ptr("A sample policy"), - // 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:27.000Z"); 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:27.000Z"); 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/NetworkManagerRoutingConfigurationGet.json -func ExampleManagerRoutingConfigurationsClient_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.NewManagerRoutingConfigurationsClient().Get(ctx, "rg1", "testNetworkManager", "myTestRoutingConfig", 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.ManagerRoutingConfiguration = armnetwork.ManagerRoutingConfiguration{ - // Name: to.Ptr("myTestRoutingConfig"), - // Type: to.Ptr("Microsoft.Network/networkManagers/routingConfigurations"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/routingConfigurations/myTestRoutingConfig"), - // Properties: &armnetwork.ManagerRoutingConfigurationPropertiesFormat{ - // Description: to.Ptr("A sample policy"), - // 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:27.000Z"); 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:27.000Z"); 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/NetworkManagerRoutingConfigurationPut.json -func ExampleManagerRoutingConfigurationsClient_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.NewManagerRoutingConfigurationsClient().CreateOrUpdate(ctx, "rg1", "testNetworkManager", "myTestRoutingConfig", armnetwork.ManagerRoutingConfiguration{ - Properties: &armnetwork.ManagerRoutingConfigurationPropertiesFormat{ - Description: to.Ptr("A sample 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.ManagerRoutingConfiguration = armnetwork.ManagerRoutingConfiguration{ - // Name: to.Ptr("myTestRoutingConfig"), - // Type: to.Ptr("Microsoft.Network/networkManagers/routingConfigurations"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManager/testNetworkManager/routingConfigurations/myTestRoutingConfig"), - // Properties: &armnetwork.ManagerRoutingConfigurationPropertiesFormat{ - // Description: to.Ptr("A sample policy"), - // 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:27.000Z"); 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:27.000Z"); 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/NetworkManagerRoutingConfigurationDelete.json -func ExampleManagerRoutingConfigurationsClient_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.NewManagerRoutingConfigurationsClient().BeginDelete(ctx, "rg1", "testNetworkManager", "myTestRoutingConfig", &armnetwork.ManagerRoutingConfigurationsClientBeginDeleteOptions{Force: 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/managers_client.go b/sdk/resourcemanager/network/armnetwork/managers_client.go index 738791efab20..52f93959b137 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 2024-05-01 +// Generated from API version 2024-07-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", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 2024-05-01 +// Generated from API version 2024-07-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. @@ -141,7 +141,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *ManagersClient) deleteOperation(ctx context.Context, resourceGroupName string, networkManagerName string, options *ManagersClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ManagersClient.BeginDelete" @@ -183,7 +183,7 @@ func (client *ManagersClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } @@ -195,7 +195,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -241,7 +241,7 @@ func (client *ManagersClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -258,7 +258,7 @@ func (client *ManagersClient) getHandleResponse(resp *http.Response) (ManagersCl // NewListPager - List network managers in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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] { @@ -306,7 +306,7 @@ func (client *ManagersClient) listCreateRequest(ctx context.Context, resourceGro if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -323,7 +323,7 @@ func (client *ManagersClient) listHandleResponse(resp *http.Response) (ManagersC // NewListBySubscriptionPager - List all network managers in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - options - ManagersClientListBySubscriptionOptions contains the optional parameters for the ManagersClient.NewListBySubscriptionPager // method. func (client *ManagersClient) NewListBySubscriptionPager(options *ManagersClientListBySubscriptionOptions) *runtime.Pager[ManagersClientListBySubscriptionResponse] { @@ -367,7 +367,7 @@ func (client *ManagersClient) listBySubscriptionCreateRequest(ctx context.Contex if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -385,7 +385,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - parameters - Parameters supplied to specify which network manager is. @@ -432,7 +432,7 @@ func (client *ManagersClient) patchCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 eba3ec2e07ba..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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.ConfigurationTypeSecurityUser)}, - // 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:27.000Z"); 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:27.000Z"); 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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:27.000Z"); 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:27.000Z"); 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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:27.000Z"); 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:27.000Z"); 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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.ConfigurationTypeSecurityUser)}, - // 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:27.000Z"); 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:27.000Z"); 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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:27.000Z"); 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:27.000Z"); 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 82906f6aa2af..a99e5c285b23 100644 --- a/sdk/resourcemanager/network/armnetwork/models.go +++ b/sdk/resourcemanager/network/armnetwork/models.go @@ -347,6 +347,21 @@ type AdminRuleListResult struct { Value []BaseAdminRuleClassification } +// AdvertisedPublicPrefixProperties - Prefix properties required to perform validation using openssl signature. +type AdvertisedPublicPrefixProperties struct { + // Advertised Public Prefix. + Prefix *string + + // Signed string generated by encrypting validationId with a private key. + Signature *string + + // Validation string that contains circuit peering info. + ValidationID *string + + // READ-ONLY; Advertised Public Prefix State that denotes if the prefix is validated or not. + ValidationState *AdvertisedPublicPrefixPropertiesValidationState +} + // ApplicationGateway - Application gateway resource. type ApplicationGateway struct { // Resource ID. @@ -5097,6 +5112,9 @@ type ExpressRouteCircuitPeeringConfig struct { // The communities of bgp peering. Specified for microsoft peering. AdvertisedCommunities []*string + // List of Prefix information required to perform validation. + AdvertisedPublicPrefixInfo []*AdvertisedPublicPrefixProperties + // The reference to AdvertisedPublicPrefixes. AdvertisedPublicPrefixes []*string @@ -8349,8 +8367,8 @@ type LoadBalancerHealthPerRulePerBackendAddress struct { // The IP address belonging to the backend address. IPAddress *string - // The id of the network interface ip configuration belonging to the backend address - NetworkInterfaceIPConfigurationID *InterfaceIPConfiguration + // Resource ID of the Network Interface IP Configuration. + NetworkInterfaceIPConfigurationID *string // The explanation of the State Reason *string @@ -13604,6 +13622,19 @@ type VirtualApplianceAdditionalNicProperties struct { Name *string } +// VirtualApplianceBootDiagnosticParameters - Specifies input parameters required to retrieve the boot diagnostic logs for +// an NVA instance +type VirtualApplianceBootDiagnosticParameters struct { + // Specifies the sas-url to the storage blob into which console screen shot for the requested instance will be written + ConsoleScreenshotStorageSasURL *string + + // The network virtual appliance instance id for which boot diagnostic logs is being requested + InstanceID *int32 + + // Specifies the sas-url to the storage blob into which serial console logs for the requested instance will be written + SerialConsoleStorageSasURL *string +} + // VirtualApplianceConnection - NetworkVirtualApplianceConnection resource. type VirtualApplianceConnection struct { // Resource ID. @@ -13664,6 +13695,11 @@ type VirtualApplianceIPConfigurationProperties struct { Primary *bool } +type VirtualApplianceInstanceID struct { + // The network virtual appliance instance id for which boot diagnostic logs is being requested + InstanceID *int32 +} + // VirtualApplianceInstanceIDs - Specifies a list of virtual machine instance IDs from the Network Virtual Appliance VM instances. type VirtualApplianceInstanceIDs struct { // The network virtual appliance instance ids. Omitting the network virtual appliance instance ids will result in the operation diff --git a/sdk/resourcemanager/network/armnetwork/models_serde.go b/sdk/resourcemanager/network/armnetwork/models_serde.go index f9540543c654..94d6989697af 100644 --- a/sdk/resourcemanager/network/armnetwork/models_serde.go +++ b/sdk/resourcemanager/network/armnetwork/models_serde.go @@ -718,6 +718,45 @@ func (a *AdminRuleListResult) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type AdvertisedPublicPrefixProperties. +func (a AdvertisedPublicPrefixProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "prefix", a.Prefix) + populate(objectMap, "signature", a.Signature) + populate(objectMap, "validationId", a.ValidationID) + populate(objectMap, "validationState", a.ValidationState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AdvertisedPublicPrefixProperties. +func (a *AdvertisedPublicPrefixProperties) 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", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "prefix": + err = unpopulate(val, "Prefix", &a.Prefix) + delete(rawMsg, key) + case "signature": + err = unpopulate(val, "Signature", &a.Signature) + delete(rawMsg, key) + case "validationId": + err = unpopulate(val, "ValidationID", &a.ValidationID) + delete(rawMsg, key) + case "validationState": + err = unpopulate(val, "ValidationState", &a.ValidationState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ApplicationGateway. func (a ApplicationGateway) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -12473,6 +12512,7 @@ func (e *ExpressRouteCircuitPeering) UnmarshalJSON(data []byte) error { func (e ExpressRouteCircuitPeeringConfig) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "advertisedCommunities", e.AdvertisedCommunities) + populate(objectMap, "advertisedPublicPrefixInfo", e.AdvertisedPublicPrefixInfo) populate(objectMap, "advertisedPublicPrefixes", e.AdvertisedPublicPrefixes) populate(objectMap, "advertisedPublicPrefixesState", e.AdvertisedPublicPrefixesState) populate(objectMap, "customerASN", e.CustomerASN) @@ -12493,6 +12533,9 @@ func (e *ExpressRouteCircuitPeeringConfig) UnmarshalJSON(data []byte) error { case "advertisedCommunities": err = unpopulate(val, "AdvertisedCommunities", &e.AdvertisedCommunities) delete(rawMsg, key) + case "advertisedPublicPrefixInfo": + err = unpopulate(val, "AdvertisedPublicPrefixInfo", &e.AdvertisedPublicPrefixInfo) + delete(rawMsg, key) case "advertisedPublicPrefixes": err = unpopulate(val, "AdvertisedPublicPrefixes", &e.AdvertisedPublicPrefixes) delete(rawMsg, key) @@ -33917,6 +33960,41 @@ func (v *VirtualApplianceAdditionalNicProperties) UnmarshalJSON(data []byte) err return nil } +// MarshalJSON implements the json.Marshaller interface for type VirtualApplianceBootDiagnosticParameters. +func (v VirtualApplianceBootDiagnosticParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "consoleScreenshotStorageSasUrl", v.ConsoleScreenshotStorageSasURL) + populate(objectMap, "instanceId", v.InstanceID) + populate(objectMap, "serialConsoleStorageSasUrl", v.SerialConsoleStorageSasURL) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualApplianceBootDiagnosticParameters. +func (v *VirtualApplianceBootDiagnosticParameters) 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", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "consoleScreenshotStorageSasUrl": + err = unpopulate(val, "ConsoleScreenshotStorageSasURL", &v.ConsoleScreenshotStorageSasURL) + delete(rawMsg, key) + case "instanceId": + err = unpopulate(val, "InstanceID", &v.InstanceID) + delete(rawMsg, key) + case "serialConsoleStorageSasUrl": + err = unpopulate(val, "SerialConsoleStorageSasURL", &v.SerialConsoleStorageSasURL) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type VirtualApplianceConnection. func (v VirtualApplianceConnection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -34092,6 +34170,33 @@ func (v *VirtualApplianceIPConfigurationProperties) UnmarshalJSON(data []byte) e return nil } +// MarshalJSON implements the json.Marshaller interface for type VirtualApplianceInstanceID. +func (v VirtualApplianceInstanceID) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "instanceId", v.InstanceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualApplianceInstanceID. +func (v *VirtualApplianceInstanceID) 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", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "instanceId": + err = unpopulate(val, "InstanceID", &v.InstanceID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type VirtualApplianceInstanceIDs. func (v VirtualApplianceInstanceIDs) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) diff --git a/sdk/resourcemanager/network/armnetwork/natgateway_live_test.go b/sdk/resourcemanager/network/armnetwork/natgateway_live_test.go index f63b2fd57f0d..440975d93893 100644 --- a/sdk/resourcemanager/network/armnetwork/natgateway_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/natgateway_live_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/natgateways_client.go b/sdk/resourcemanager/network/armnetwork/natgateways_client.go index c30b1dfe5a6e..fa9a5f9f557d 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 2024-05-01 +// Generated from API version 2024-07-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. @@ -74,7 +74,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -116,7 +116,7 @@ func (client *NatGatewaysClient) createOrUpdateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -128,7 +128,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -153,7 +153,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *NatGatewaysClient) deleteOperation(ctx context.Context, resourceGroupName string, natGatewayName string, options *NatGatewaysClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "NatGatewaysClient.BeginDelete" @@ -195,7 +195,7 @@ func (client *NatGatewaysClient) deleteCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -204,7 +204,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -253,7 +253,7 @@ func (client *NatGatewaysClient) getCreateRequest(ctx context.Context, resourceG if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -270,7 +270,7 @@ func (client *NatGatewaysClient) getHandleResponse(resp *http.Response) (NatGate // NewListPager - Gets all nat gateways in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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] { @@ -312,7 +312,7 @@ func (client *NatGatewaysClient) listCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -329,7 +329,7 @@ func (client *NatGatewaysClient) listHandleResponse(resp *http.Response) (NatGat // NewListAllPager - Gets all the Nat Gateways in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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]{ @@ -366,7 +366,7 @@ func (client *NatGatewaysClient) listAllCreateRequest(ctx context.Context, optio return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -384,7 +384,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - natGatewayName - The name of the nat gateway. // - parameters - Parameters supplied to update nat gateway tags. @@ -431,7 +431,7 @@ func (client *NatGatewaysClient) updateTagsCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 926510d67669..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 f521f3520f73..d3df9138e157 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VpnGateway. // - gatewayName - The name of the gateway. // - natRuleName - The name of the nat rule. @@ -75,7 +75,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -121,7 +121,7 @@ func (client *NatRulesClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, natRuleParameters); err != nil { @@ -133,7 +133,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VpnGateway. // - gatewayName - The name of the gateway. // - natRuleName - The name of the nat rule. @@ -159,7 +159,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -205,7 +205,7 @@ func (client *NatRulesClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -214,7 +214,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VpnGateway. // - gatewayName - The name of the gateway. // - natRuleName - The name of the nat rule. @@ -265,7 +265,7 @@ func (client *NatRulesClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -282,7 +282,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -330,7 +330,7 @@ func (client *NatRulesClient) listByVPNGatewayCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 0e402752c247..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/networkinterface_live_test.go b/sdk/resourcemanager/network/armnetwork/networkinterface_live_test.go index 67d8aa6bc7c1..31f9ea1ddba9 100644 --- a/sdk/resourcemanager/network/armnetwork/networkinterface_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/networkinterface_live_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/networkmanager_live_test.go b/sdk/resourcemanager/network/armnetwork/networkmanager_live_test.go index 49ae4a788fdd..fe0451dd30ee 100644 --- a/sdk/resourcemanager/network/armnetwork/networkmanager_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/networkmanager_live_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/networkmanagerconnection_live_test.go b/sdk/resourcemanager/network/armnetwork/networkmanagerconnection_live_test.go index 3427d822c0ef..d1173f44f1b5 100644 --- a/sdk/resourcemanager/network/armnetwork/networkmanagerconnection_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/networkmanagerconnection_live_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/networkmanagerconnectivityconfiguration_live_test.go b/sdk/resourcemanager/network/armnetwork/networkmanagerconnectivityconfiguration_live_test.go index 7dab772fdd35..32c823bf9a62 100644 --- a/sdk/resourcemanager/network/armnetwork/networkmanagerconnectivityconfiguration_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/networkmanagerconnectivityconfiguration_live_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/networkmanagergroup_live_test.go b/sdk/resourcemanager/network/armnetwork/networkmanagergroup_live_test.go index 22110664e9ef..c5b2db9c9bc2 100644 --- a/sdk/resourcemanager/network/armnetwork/networkmanagergroup_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/networkmanagergroup_live_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/networkmanagersecurityadminconfiguration_live_test.go b/sdk/resourcemanager/network/armnetwork/networkmanagersecurityadminconfiguration_live_test.go index dac5c874884e..1b33f7ea9b5c 100644 --- a/sdk/resourcemanager/network/armnetwork/networkmanagersecurityadminconfiguration_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/networkmanagersecurityadminconfiguration_live_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/networkprofile_live_test.go b/sdk/resourcemanager/network/armnetwork/networkprofile_live_test.go index 781ffd39fea2..f09c9d8f0bec 100644 --- a/sdk/resourcemanager/network/armnetwork/networkprofile_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/networkprofile_live_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/networksecuritygroup_live_test.go b/sdk/resourcemanager/network/armnetwork/networksecuritygroup_live_test.go index 872e603dd062..b0e883f85da7 100644 --- a/sdk/resourcemanager/network/armnetwork/networksecuritygroup_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/networksecuritygroup_live_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/networkwatcher_live_test.go b/sdk/resourcemanager/network/armnetwork/networkwatcher_live_test.go index 367bcc90ae2e..5dc6b0541628 100644 --- a/sdk/resourcemanager/network/armnetwork/networkwatcher_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/networkwatcher_live_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/operation_live_test.go b/sdk/resourcemanager/network/armnetwork/operation_live_test.go index 3ba253a42bdb..827b5e8a8592 100644 --- a/sdk/resourcemanager/network/armnetwork/operation_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/operation_live_test.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/operations_client.go b/sdk/resourcemanager/network/armnetwork/operations_client.go index d331102c91c7..c479b2a7fc73 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 2024-05-01 +// Generated from API version 2024-07-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]{ @@ -72,7 +72,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 827a7cef8446..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 d2d0ed5cee28..9784500a9860 100644 --- a/sdk/resourcemanager/network/armnetwork/options.go +++ b/sdk/resourcemanager/network/armnetwork/options.go @@ -3613,6 +3613,26 @@ type VirtualAppliancesClientBeginDeleteOptions struct { ResumeToken string } +// VirtualAppliancesClientBeginGetBootDiagnosticLogsOptions contains the optional parameters for the VirtualAppliancesClient.BeginGetBootDiagnosticLogs +// method. +type VirtualAppliancesClientBeginGetBootDiagnosticLogsOptions struct { + // Specifies a virtual machine instance ID from the Network Virtual Appliance VM instances. + InstanceID *VirtualApplianceBootDiagnosticParameters + + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualAppliancesClientBeginReimageOptions contains the optional parameters for the VirtualAppliancesClient.BeginReimage +// method. +type VirtualAppliancesClientBeginReimageOptions struct { + // Specifies a list of virtual machine instance IDs from the Network Virtual Appliance VM instances. + NetworkVirtualApplianceInstanceIDs *VirtualApplianceInstanceIDs + + // Resumes the LRO from the provided token. + ResumeToken string +} + // VirtualAppliancesClientBeginRestartOptions contains the optional parameters for the VirtualAppliancesClient.BeginRestart // method. type VirtualAppliancesClientBeginRestartOptions struct { diff --git a/sdk/resourcemanager/network/armnetwork/p2svpngateways_client.go b/sdk/resourcemanager/network/armnetwork/p2svpngateways_client.go index c0d4c7f563e1..af08a03c0e82 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 2024-05-01 +// Generated from API version 2024-07-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. @@ -74,7 +74,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -116,7 +116,7 @@ func (client *P2SVPNGatewaysClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, p2SVPNGatewayParameters); err != nil { @@ -128,7 +128,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -154,7 +154,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *P2SVPNGatewaysClient) deleteOperation(ctx context.Context, resourceGroupName string, gatewayName string, options *P2SVPNGatewaysClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "P2SVPNGatewaysClient.BeginDelete" @@ -196,7 +196,7 @@ func (client *P2SVPNGatewaysClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -206,7 +206,7 @@ func (client *P2SVPNGatewaysClient) deleteCreateRequest(ctx context.Context, res // group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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. @@ -234,7 +234,7 @@ func (client *P2SVPNGatewaysClient) BeginDisconnectP2SVPNConnections(ctx context // group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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" @@ -276,7 +276,7 @@ func (client *P2SVPNGatewaysClient) disconnectP2SVPNConnectionsCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, request); err != nil { @@ -288,7 +288,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -315,7 +315,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -357,7 +357,7 @@ func (client *P2SVPNGatewaysClient) generateVPNProfileCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -369,7 +369,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -415,7 +415,7 @@ func (client *P2SVPNGatewaysClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -434,7 +434,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - gatewayName - The name of the P2SVpnGateway. // - options - P2SVPNGatewaysClientBeginGetP2SVPNConnectionHealthOptions contains the optional parameters for the P2SVPNGatewaysClient.BeginGetP2SVPNConnectionHealth @@ -461,7 +461,7 @@ func (client *P2SVPNGatewaysClient) BeginGetP2SVPNConnectionHealth(ctx context.C // resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 func (client *P2SVPNGatewaysClient) getP2SVPNConnectionHealth(ctx context.Context, resourceGroupName string, gatewayName string, options *P2SVPNGatewaysClientBeginGetP2SVPNConnectionHealthOptions) (*http.Response, error) { var err error const operationName = "P2SVPNGatewaysClient.BeginGetP2SVPNConnectionHealth" @@ -503,7 +503,7 @@ func (client *P2SVPNGatewaysClient) getP2SVPNConnectionHealthCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -513,7 +513,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -541,7 +541,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -583,7 +583,7 @@ func (client *P2SVPNGatewaysClient) getP2SVPNConnectionHealthDetailedCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, request); err != nil { @@ -594,7 +594,7 @@ func (client *P2SVPNGatewaysClient) getP2SVPNConnectionHealthDetailedCreateReque // NewListPager - Lists all the P2SVpnGateways in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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]{ @@ -631,7 +631,7 @@ func (client *P2SVPNGatewaysClient) listCreateRequest(ctx context.Context, optio return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -648,7 +648,7 @@ func (client *P2SVPNGatewaysClient) listHandleResponse(resp *http.Response) (P2S // NewListByResourceGroupPager - Lists all the P2SVpnGateways in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the P2SVpnGateway. // - options - P2SVPNGatewaysClientListByResourceGroupOptions contains the optional parameters for the P2SVPNGatewaysClient.NewListByResourceGroupPager // method. @@ -691,7 +691,7 @@ func (client *P2SVPNGatewaysClient) listByResourceGroupCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -709,7 +709,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -735,7 +735,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *P2SVPNGatewaysClient) reset(ctx context.Context, resourceGroupName string, gatewayName string, options *P2SVPNGatewaysClientBeginResetOptions) (*http.Response, error) { var err error const operationName = "P2SVPNGatewaysClient.BeginReset" @@ -777,7 +777,7 @@ func (client *P2SVPNGatewaysClient) resetCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -786,7 +786,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -813,7 +813,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -855,7 +855,7 @@ func (client *P2SVPNGatewaysClient) updateTagsCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 7e099526eaea..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 8a09e93337b0..e44fef183987 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkWatcherName - The name of the network watcher. // - packetCaptureName - The name of the packet capture session. @@ -75,7 +75,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -121,7 +121,7 @@ func (client *PacketCapturesClient) createCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -133,7 +133,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkWatcherName - The name of the network watcher. // - packetCaptureName - The name of the packet capture session. @@ -160,7 +160,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -206,7 +206,7 @@ func (client *PacketCapturesClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -215,7 +215,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkWatcherName - The name of the network watcher. // - packetCaptureName - The name of the packet capture session. @@ -266,7 +266,7 @@ func (client *PacketCapturesClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -284,7 +284,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -311,7 +311,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -357,7 +357,7 @@ func (client *PacketCapturesClient) getStatusCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -365,7 +365,7 @@ func (client *PacketCapturesClient) getStatusCreateRequest(ctx context.Context, // NewListPager - Lists all packet capture sessions within the specified resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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. @@ -413,7 +413,7 @@ func (client *PacketCapturesClient) listCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -431,7 +431,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkWatcherName - The name of the network watcher. // - packetCaptureName - The name of the packet capture session. @@ -458,7 +458,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -504,7 +504,7 @@ func (client *PacketCapturesClient) stopCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 3ee356eb0bf8..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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:24.000Z"); 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 d9877b7ee7af..9e841b8a57aa 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 2024-05-01 +// Generated from API version 2024-07-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", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - circuitName - The name of the circuit. // - peeringName - The name of the peering. @@ -174,7 +174,7 @@ func (client *PeerExpressRouteCircuitConnectionsClient) listCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 14763ad8ca70..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 ae477806a730..efa262cc64e3 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - privateEndpointName - The name of the private endpoint. // - privateDNSZoneGroupName - The name of the private dns zone group. @@ -75,7 +75,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -121,7 +121,7 @@ func (client *PrivateDNSZoneGroupsClient) createOrUpdateCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -133,7 +133,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - privateEndpointName - The name of the private endpoint. // - privateDNSZoneGroupName - The name of the private dns zone group. @@ -160,7 +160,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -206,7 +206,7 @@ func (client *PrivateDNSZoneGroupsClient) deleteCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -215,7 +215,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - privateEndpointName - The name of the private endpoint. // - privateDNSZoneGroupName - The name of the private dns zone group. @@ -267,7 +267,7 @@ func (client *PrivateDNSZoneGroupsClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -284,7 +284,7 @@ func (client *PrivateDNSZoneGroupsClient) getHandleResponse(resp *http.Response) // NewListPager - Gets all private dns zone groups in a private endpoint. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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 @@ -332,7 +332,7 @@ func (client *PrivateDNSZoneGroupsClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 46086e99d0bc..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 3484c42b97bc..2b68eb44d21d 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 2024-05-01 +// Generated from API version 2024-07-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. @@ -74,7 +74,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -116,7 +116,7 @@ func (client *PrivateEndpointsClient) createOrUpdateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -128,7 +128,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -154,7 +154,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *PrivateEndpointsClient) deleteOperation(ctx context.Context, resourceGroupName string, privateEndpointName string, options *PrivateEndpointsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "PrivateEndpointsClient.BeginDelete" @@ -196,7 +196,7 @@ func (client *PrivateEndpointsClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -205,7 +205,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -254,7 +254,7 @@ func (client *PrivateEndpointsClient) getCreateRequest(ctx context.Context, reso if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -271,7 +271,7 @@ func (client *PrivateEndpointsClient) getHandleResponse(resp *http.Response) (Pr // NewListPager - Gets all private endpoints in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - PrivateEndpointsClientListOptions contains the optional parameters for the PrivateEndpointsClient.NewListPager // method. @@ -314,7 +314,7 @@ func (client *PrivateEndpointsClient) listCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -331,7 +331,7 @@ func (client *PrivateEndpointsClient) listHandleResponse(resp *http.Response) (P // NewListBySubscriptionPager - Gets all private endpoints in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - options - PrivateEndpointsClientListBySubscriptionOptions contains the optional parameters for the PrivateEndpointsClient.NewListBySubscriptionPager // method. func (client *PrivateEndpointsClient) NewListBySubscriptionPager(options *PrivateEndpointsClientListBySubscriptionOptions) *runtime.Pager[PrivateEndpointsClientListBySubscriptionResponse] { @@ -369,7 +369,7 @@ func (client *PrivateEndpointsClient) listBySubscriptionCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 715b527688d4..000000000000 --- a/sdk/resourcemanager/network/armnetwork/privateendpoints_client_example_test.go +++ /dev/null @@ -1,941 +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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe/privateLinkServiceConnections/plsconnection1"), - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe/privateLinkServiceConnections/plsconnection1"), - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe/manualPrivateLinkServiceConnections/plsconnection1"), - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe/privateLinkServiceConnections/plsconnection1"), - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe/privateLinkServiceConnections/plsconnection1"), - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe/manualPrivateLinkServiceConnections/plsconnection1"), - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/pe1/privateLinkServiceConnections/plsconnection1"), - // 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{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/pe2/privateLinkServiceConnections/plsconnection2"), - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/pe1/privateLinkServiceConnections/plsconnection1"), - // 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{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg2/providers/Microsoft.Network/privateEndpoints/pe2/privateLinkServiceConnections/plsconnection2"), - // 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/rg2/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{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg3/providers/Microsoft.Network/privateEndpoints/testPe/privateLinkServiceConnections/plsconnection3"), - // 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 fcde434e96b3..2671b7972609 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 2024-05-01 +// Generated from API version 2024-07-01 // - location - The location of the domain name. // - parameters - The request body of CheckPrivateLinkService API call. // - options - PrivateLinkServicesClientBeginCheckPrivateLinkServiceVisibilityOptions contains the optional parameters for the @@ -73,7 +73,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *PrivateLinkServicesClient) checkPrivateLinkServiceVisibility(ctx context.Context, location string, parameters CheckPrivateLinkServiceVisibilityRequest, options *PrivateLinkServicesClientBeginCheckPrivateLinkServiceVisibilityOptions) (*http.Response, error) { var err error const operationName = "PrivateLinkServicesClient.BeginCheckPrivateLinkServiceVisibility" @@ -111,7 +111,7 @@ func (client *PrivateLinkServicesClient) checkPrivateLinkServiceVisibilityCreate return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 *PrivateLinkServicesClient) checkPrivateLinkServiceVisibilityCreate // in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - location - The location of the domain name. // - resourceGroupName - The name of the resource group. // - parameters - The request body of CheckPrivateLinkService API call. @@ -152,7 +152,7 @@ func (client *PrivateLinkServicesClient) BeginCheckPrivateLinkServiceVisibilityB // the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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" @@ -194,7 +194,7 @@ func (client *PrivateLinkServicesClient) checkPrivateLinkServiceVisibilityByReso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -206,7 +206,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -233,7 +233,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -275,7 +275,7 @@ func (client *PrivateLinkServicesClient) createOrUpdateCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -287,7 +287,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -313,7 +313,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *PrivateLinkServicesClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, options *PrivateLinkServicesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "PrivateLinkServicesClient.BeginDelete" @@ -355,7 +355,7 @@ func (client *PrivateLinkServicesClient) deleteCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -364,7 +364,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -391,7 +391,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -437,7 +437,7 @@ func (client *PrivateLinkServicesClient) deletePrivateEndpointConnectionCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -446,7 +446,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -495,7 +495,7 @@ func (client *PrivateLinkServicesClient) getCreateRequest(ctx context.Context, r if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -514,7 +514,7 @@ func (client *PrivateLinkServicesClient) getHandleResponse(resp *http.Response) // group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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. @@ -569,7 +569,7 @@ func (client *PrivateLinkServicesClient) getPrivateEndpointConnectionCreateReque if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -586,7 +586,7 @@ func (client *PrivateLinkServicesClient) getPrivateEndpointConnectionHandleRespo // NewListPager - Gets all private link services in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - PrivateLinkServicesClientListOptions contains the optional parameters for the PrivateLinkServicesClient.NewListPager // method. @@ -629,7 +629,7 @@ func (client *PrivateLinkServicesClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -647,7 +647,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 2024-05-01 +// Generated from API version 2024-07-01 // - location - The location of the domain name. // - options - PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesOptions contains the optional parameters for the // PrivateLinkServicesClient.NewListAutoApprovedPrivateLinkServicesPager method. @@ -690,7 +690,7 @@ func (client *PrivateLinkServicesClient) listAutoApprovedPrivateLinkServicesCrea return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -708,7 +708,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 2024-05-01 +// Generated from API version 2024-07-01 // - location - The location of the domain name. // - resourceGroupName - The name of the resource group. // - options - PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesByResourceGroupOptions contains the optional parameters @@ -756,7 +756,7 @@ func (client *PrivateLinkServicesClient) listAutoApprovedPrivateLinkServicesByRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -773,7 +773,7 @@ func (client *PrivateLinkServicesClient) listAutoApprovedPrivateLinkServicesByRe // NewListBySubscriptionPager - Gets all private link service in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - options - PrivateLinkServicesClientListBySubscriptionOptions contains the optional parameters for the PrivateLinkServicesClient.NewListBySubscriptionPager // method. func (client *PrivateLinkServicesClient) NewListBySubscriptionPager(options *PrivateLinkServicesClientListBySubscriptionOptions) *runtime.Pager[PrivateLinkServicesClientListBySubscriptionResponse] { @@ -811,7 +811,7 @@ func (client *PrivateLinkServicesClient) listBySubscriptionCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -828,7 +828,7 @@ func (client *PrivateLinkServicesClient) listBySubscriptionHandleResponse(resp * // NewListPrivateEndpointConnectionsPager - Gets all private end point connections for a specific private link service. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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 @@ -876,7 +876,7 @@ func (client *PrivateLinkServicesClient) listPrivateEndpointConnectionsCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -894,7 +894,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -947,7 +947,7 @@ func (client *PrivateLinkServicesClient) updatePrivateEndpointConnectionCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 3d689692f566..000000000000 --- a/sdk/resourcemanager/network/armnetwork/privatelinkservices_client_example_test.go +++ /dev/null @@ -1,798 +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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls/ipConfigurations/ipconfig1"), - // Name: to.Ptr("ipconfig1"), - // 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{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls/privateEndpointConnections/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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls/ipConfigurations/ipconfig1"), - // Name: to.Ptr("ipconfig1"), - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls1/ipConfigurations/ipconfig1"), - // Name: to.Ptr("ipconfig1"), - // 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{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls1/privateEndpointConnections/pec1"), - // 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{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls2/ipConfigurations/ipconfig2"), - // Name: to.Ptr("ipconfig2"), - // 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{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls2/privateEndpointConnections/pec2"), - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls1/ipConfigurations/ipconfig1"), - // Name: to.Ptr("ipconfig1"), - // 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{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls1/privateEndpointConnections/pec1"), - // 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{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg2/providers/Microsoft.Network/privateLinkServices/testPls2/ipConfigurations/ipconfig2"), - // Name: to.Ptr("ipconfig2"), - // 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{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg2/providers/Microsoft.Network/privateLinkServices/testPls2/privateEndpointConnections/pec2"), - // Name: to.Ptr("pec2"), - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls/privateEndpointConnections/testPlePeConnection"), - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls/privateEndpointConnections/testPlePeConnection"), - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls/privateEndpointConnections/testPlePeConnection1"), - // 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"), - // }, - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls/privateEndpointConnections/testPlePeConnection2"), - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 734324a37a60..6faa1a9871b1 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 2024-05-01 +// Generated from API version 2024-07-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", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 2024-05-01 +// Generated from API version 2024-07-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. @@ -140,7 +140,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *ProfilesClient) deleteOperation(ctx context.Context, resourceGroupName string, networkProfileName string, options *ProfilesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ProfilesClient.BeginDelete" @@ -182,7 +182,7 @@ func (client *ProfilesClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -191,7 +191,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -240,7 +240,7 @@ func (client *ProfilesClient) getCreateRequest(ctx context.Context, resourceGrou if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -257,7 +257,7 @@ func (client *ProfilesClient) getHandleResponse(resp *http.Response) (ProfilesCl // NewListPager - Gets all network profiles in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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] { @@ -299,7 +299,7 @@ func (client *ProfilesClient) listCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -316,7 +316,7 @@ func (client *ProfilesClient) listHandleResponse(resp *http.Response) (ProfilesC // NewListAllPager - Gets all the network profiles in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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]{ @@ -353,7 +353,7 @@ func (client *ProfilesClient) listAllCreateRequest(ctx context.Context, options return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -371,7 +371,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkProfileName - The name of the network profile. // - parameters - Parameters supplied to update network profile tags. @@ -418,7 +418,7 @@ func (client *ProfilesClient) updateTagsCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 b79ff4e58a6a..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/publicipaddress_live_test.go b/sdk/resourcemanager/network/armnetwork/publicipaddress_live_test.go index 68faf568be47..aec2db2edf55 100644 --- a/sdk/resourcemanager/network/armnetwork/publicipaddress_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/publicipaddress_live_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/publicipaddresses_client.go b/sdk/resourcemanager/network/armnetwork/publicipaddresses_client.go index e1ba5dbc7fb2..8423a575b7d2 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 2024-05-01 +// Generated from API version 2024-07-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. @@ -74,7 +74,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -116,7 +116,7 @@ func (client *PublicIPAddressesClient) createOrUpdateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -128,7 +128,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -154,7 +154,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *PublicIPAddressesClient) ddosProtectionStatus(ctx context.Context, resourceGroupName string, publicIPAddressName string, options *PublicIPAddressesClientBeginDdosProtectionStatusOptions) (*http.Response, error) { var err error const operationName = "PublicIPAddressesClient.BeginDdosProtectionStatus" @@ -196,7 +196,7 @@ func (client *PublicIPAddressesClient) ddosProtectionStatusCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -205,7 +205,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -231,7 +231,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *PublicIPAddressesClient) deleteOperation(ctx context.Context, resourceGroupName string, publicIPAddressName string, options *PublicIPAddressesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "PublicIPAddressesClient.BeginDelete" @@ -273,7 +273,7 @@ func (client *PublicIPAddressesClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -282,7 +282,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -331,7 +331,7 @@ func (client *PublicIPAddressesClient) getCreateRequest(ctx context.Context, res if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -349,7 +349,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - cloudServiceName - The name of the cloud service. // - roleInstanceName - The role instance name. @@ -419,7 +419,7 @@ func (client *PublicIPAddressesClient) getCloudServicePublicIPAddressCreateReque if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -524,7 +524,7 @@ func (client *PublicIPAddressesClient) getVirtualMachineScaleSetPublicIPAddressH // NewListPager - Gets all public IP addresses in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - PublicIPAddressesClientListOptions contains the optional parameters for the PublicIPAddressesClient.NewListPager // method. @@ -567,7 +567,7 @@ func (client *PublicIPAddressesClient) listCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -584,7 +584,7 @@ func (client *PublicIPAddressesClient) listHandleResponse(resp *http.Response) ( // NewListAllPager - Gets all the public IP addresses in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - options - PublicIPAddressesClientListAllOptions contains the optional parameters for the PublicIPAddressesClient.NewListAllPager // method. func (client *PublicIPAddressesClient) NewListAllPager(options *PublicIPAddressesClientListAllOptions) *runtime.Pager[PublicIPAddressesClientListAllResponse] { @@ -622,7 +622,7 @@ func (client *PublicIPAddressesClient) listAllCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -639,7 +639,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -687,7 +687,7 @@ func (client *PublicIPAddressesClient) listCloudServicePublicIPAddressesCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -705,7 +705,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - cloudServiceName - The name of the cloud service. // - roleInstanceName - The name of role instance. @@ -768,7 +768,7 @@ func (client *PublicIPAddressesClient) listCloudServiceRoleInstancePublicIPAddre return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -933,7 +933,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -981,7 +981,7 @@ func (client *PublicIPAddressesClient) updateTagsCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 303a6de2adc2..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/publicipprefix_live_test.go b/sdk/resourcemanager/network/armnetwork/publicipprefix_live_test.go index 7df729195a85..18c01d4c0336 100644 --- a/sdk/resourcemanager/network/armnetwork/publicipprefix_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/publicipprefix_live_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/publicipprefixes_client.go b/sdk/resourcemanager/network/armnetwork/publicipprefixes_client.go index 14115bb1df1f..cb64baeb6d56 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 2024-05-01 +// Generated from API version 2024-07-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. @@ -74,7 +74,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -116,7 +116,7 @@ func (client *PublicIPPrefixesClient) createOrUpdateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -128,7 +128,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - publicIPPrefixName - The name of the PublicIpPrefix. // - options - PublicIPPrefixesClientBeginDeleteOptions contains the optional parameters for the PublicIPPrefixesClient.BeginDelete @@ -154,7 +154,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *PublicIPPrefixesClient) deleteOperation(ctx context.Context, resourceGroupName string, publicIPPrefixName string, options *PublicIPPrefixesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "PublicIPPrefixesClient.BeginDelete" @@ -196,7 +196,7 @@ func (client *PublicIPPrefixesClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -205,7 +205,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -254,7 +254,7 @@ func (client *PublicIPPrefixesClient) getCreateRequest(ctx context.Context, reso if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -271,7 +271,7 @@ func (client *PublicIPPrefixesClient) getHandleResponse(resp *http.Response) (Pu // NewListPager - Gets all public IP prefixes in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - PublicIPPrefixesClientListOptions contains the optional parameters for the PublicIPPrefixesClient.NewListPager // method. @@ -314,7 +314,7 @@ func (client *PublicIPPrefixesClient) listCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -331,7 +331,7 @@ func (client *PublicIPPrefixesClient) listHandleResponse(resp *http.Response) (P // NewListAllPager - Gets all the public IP prefixes in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - options - PublicIPPrefixesClientListAllOptions contains the optional parameters for the PublicIPPrefixesClient.NewListAllPager // method. func (client *PublicIPPrefixesClient) NewListAllPager(options *PublicIPPrefixesClientListAllOptions) *runtime.Pager[PublicIPPrefixesClientListAllResponse] { @@ -369,7 +369,7 @@ func (client *PublicIPPrefixesClient) listAllCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -387,7 +387,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -435,7 +435,7 @@ func (client *PublicIPPrefixesClient) updateTagsCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 7710dcf2437b..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/reachabilityanalysisintents_client.go b/sdk/resourcemanager/network/armnetwork/reachabilityanalysisintents_client.go index 1bce960b699e..57ecccd57755 100644 --- a/sdk/resourcemanager/network/armnetwork/reachabilityanalysisintents_client.go +++ b/sdk/resourcemanager/network/armnetwork/reachabilityanalysisintents_client.go @@ -48,7 +48,7 @@ func NewReachabilityAnalysisIntentsClient(subscriptionID string, credential azco // Create - Creates Reachability Analysis Intent. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - workspaceName - Workspace name. @@ -106,7 +106,7 @@ func (client *ReachabilityAnalysisIntentsClient) createCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -127,7 +127,7 @@ func (client *ReachabilityAnalysisIntentsClient) createHandleResponse(resp *http // Delete - Deletes Reachability Analysis Intent. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - workspaceName - Workspace name. @@ -183,7 +183,7 @@ func (client *ReachabilityAnalysisIntentsClient) deleteCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -192,7 +192,7 @@ func (client *ReachabilityAnalysisIntentsClient) deleteCreateRequest(ctx context // Get - Get the Reachability Analysis Intent. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - workspaceName - Workspace name. @@ -249,7 +249,7 @@ func (client *ReachabilityAnalysisIntentsClient) getCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -266,7 +266,7 @@ func (client *ReachabilityAnalysisIntentsClient) getHandleResponse(resp *http.Re // NewListPager - Gets list of Reachability Analysis Intents . // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - workspaceName - Workspace name. @@ -319,7 +319,7 @@ func (client *ReachabilityAnalysisIntentsClient) listCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") if options != nil && options.Skip != nil { reqQP.Set("skip", strconv.FormatInt(int64(*options.Skip), 10)) } diff --git a/sdk/resourcemanager/network/armnetwork/reachabilityanalysisintents_client_example_test.go b/sdk/resourcemanager/network/armnetwork/reachabilityanalysisintents_client_example_test.go deleted file mode 100644 index 2da71ec0e014..000000000000 --- a/sdk/resourcemanager/network/armnetwork/reachabilityanalysisintents_client_example_test.go +++ /dev/null @@ -1,220 +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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/ReachabilityAnalysisIntentList.json -func ExampleReachabilityAnalysisIntentsClient_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.NewReachabilityAnalysisIntentsClient().NewListPager("rg1", "testNetworkManager", "testVerifierWorkspace1", &armnetwork.ReachabilityAnalysisIntentsClientListOptions{SkipToken: nil, - Skip: nil, - Top: nil, - SortKey: nil, - SortValue: 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.ReachabilityAnalysisIntentListResult = armnetwork.ReachabilityAnalysisIntentListResult{ - // Value: []*armnetwork.ReachabilityAnalysisIntent{ - // { - // Name: to.Ptr("testReachabilityAnalysisIntenant1"), - // Type: to.Ptr("Microsoft.Network/networkManagers/verifierWorkspaces/reachabilityAnalysisIntents"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/verifierWorkspaces/testVerifierWorkspace1/reachabilityAnalysisIntents/testReachabilityAnalysisIntenant1"), - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); 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:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // Properties: &armnetwork.ReachabilityAnalysisIntentProperties{ - // Description: to.Ptr("A sample reachability analysis intent"), - // DestinationResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/testVmDest"), - // IPTraffic: &armnetwork.IPTraffic{ - // DestinationIPs: []*string{ - // to.Ptr("10.4.0.1")}, - // DestinationPorts: []*string{ - // to.Ptr("0")}, - // Protocols: []*armnetwork.NetworkProtocol{ - // to.Ptr(armnetwork.NetworkProtocolAny)}, - // SourceIPs: []*string{ - // to.Ptr("10.4.0.0")}, - // SourcePorts: []*string{ - // to.Ptr("0")}, - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/testVmSrc"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/ReachabilityAnalysisIntentGet.json -func ExampleReachabilityAnalysisIntentsClient_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.NewReachabilityAnalysisIntentsClient().Get(ctx, "rg1", "testNetworkManager", "testWorkspace", "testAnalysisIntentName", 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.ReachabilityAnalysisIntent = armnetwork.ReachabilityAnalysisIntent{ - // Name: to.Ptr("testAnalysisIntentName"), - // Type: to.Ptr("Microsoft.Network/networkManagers/verifierWorkspaces/reachabilityAnalysisIntents"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/verifierWorkspaces/testWorkspace/reachabilityAnalysisIntents/testAnalysisIntentName"), - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); 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:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // Properties: &armnetwork.ReachabilityAnalysisIntentProperties{ - // Description: to.Ptr("A sample reachability analysis intent"), - // DestinationResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/testVmDest"), - // IPTraffic: &armnetwork.IPTraffic{ - // DestinationIPs: []*string{ - // to.Ptr("10.4.0.1")}, - // DestinationPorts: []*string{ - // to.Ptr("0")}, - // Protocols: []*armnetwork.NetworkProtocol{ - // to.Ptr(armnetwork.NetworkProtocolAny)}, - // SourceIPs: []*string{ - // to.Ptr("10.4.0.0")}, - // SourcePorts: []*string{ - // to.Ptr("0")}, - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/testVmSrc"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/ReachabilityAnalysisIntentPut.json -func ExampleReachabilityAnalysisIntentsClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain 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.NewReachabilityAnalysisIntentsClient().Create(ctx, "rg1", "testNetworkManager", "testWorkspace", "testAnalysisIntentName", armnetwork.ReachabilityAnalysisIntent{ - Properties: &armnetwork.ReachabilityAnalysisIntentProperties{ - Description: to.Ptr("A sample reachability analysis intent"), - DestinationResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/testVmDest"), - IPTraffic: &armnetwork.IPTraffic{ - DestinationIPs: []*string{ - to.Ptr("10.4.0.1")}, - DestinationPorts: []*string{ - to.Ptr("0")}, - Protocols: []*armnetwork.NetworkProtocol{ - to.Ptr(armnetwork.NetworkProtocolAny)}, - SourceIPs: []*string{ - to.Ptr("10.4.0.0")}, - SourcePorts: []*string{ - to.Ptr("0")}, - }, - SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/testVmSrc"), - }, - }, 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.ReachabilityAnalysisIntent = armnetwork.ReachabilityAnalysisIntent{ - // Name: to.Ptr("testAnalysisIntentName"), - // Type: to.Ptr("Microsoft.Network/networkManagers/verifierWorkspaces/reachabilityAnalysisIntents"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/verifierWorkspaces/testWorkspace/reachabilityAnalysisIntents/testAnalysisIntentName"), - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); 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:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // Properties: &armnetwork.ReachabilityAnalysisIntentProperties{ - // Description: to.Ptr("A sample reachability analysis intent"), - // DestinationResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/testVmDest"), - // IPTraffic: &armnetwork.IPTraffic{ - // DestinationIPs: []*string{ - // to.Ptr("10.4.0.1")}, - // DestinationPorts: []*string{ - // to.Ptr("0")}, - // Protocols: []*armnetwork.NetworkProtocol{ - // to.Ptr(armnetwork.NetworkProtocolAny)}, - // SourceIPs: []*string{ - // to.Ptr("10.4.0.0")}, - // SourcePorts: []*string{ - // to.Ptr("0")}, - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/testVmSrc"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/ReachabilityAnalysisIntentDelete.json -func ExampleReachabilityAnalysisIntentsClient_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.NewReachabilityAnalysisIntentsClient().Delete(ctx, "rg1", "testNetworkManager", "testWorkspace", "testAnalysisIntent", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/network/armnetwork/reachabilityanalysisruns_client.go b/sdk/resourcemanager/network/armnetwork/reachabilityanalysisruns_client.go index cb4cc839e2c4..16a9bb597e28 100644 --- a/sdk/resourcemanager/network/armnetwork/reachabilityanalysisruns_client.go +++ b/sdk/resourcemanager/network/armnetwork/reachabilityanalysisruns_client.go @@ -48,7 +48,7 @@ func NewReachabilityAnalysisRunsClient(subscriptionID string, credential azcore. // Create - Creates Reachability Analysis Runs. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - workspaceName - Workspace name. @@ -106,7 +106,7 @@ func (client *ReachabilityAnalysisRunsClient) createCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -127,7 +127,7 @@ func (client *ReachabilityAnalysisRunsClient) createHandleResponse(resp *http.Re // BeginDelete - Deletes Reachability Analysis Run. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - workspaceName - Workspace name. @@ -155,7 +155,7 @@ func (client *ReachabilityAnalysisRunsClient) BeginDelete(ctx context.Context, r // Delete - Deletes Reachability Analysis Run. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 func (client *ReachabilityAnalysisRunsClient) deleteOperation(ctx context.Context, resourceGroupName string, networkManagerName string, workspaceName string, reachabilityAnalysisRunName string, options *ReachabilityAnalysisRunsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ReachabilityAnalysisRunsClient.BeginDelete" @@ -205,7 +205,7 @@ func (client *ReachabilityAnalysisRunsClient) deleteCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -214,7 +214,7 @@ func (client *ReachabilityAnalysisRunsClient) deleteCreateRequest(ctx context.Co // Get - Gets Reachability Analysis Run. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - workspaceName - Workspace name. @@ -271,7 +271,7 @@ func (client *ReachabilityAnalysisRunsClient) getCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -288,7 +288,7 @@ func (client *ReachabilityAnalysisRunsClient) getHandleResponse(resp *http.Respo // NewListPager - Gets list of Reachability Analysis Runs. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - workspaceName - Workspace name. @@ -341,7 +341,7 @@ func (client *ReachabilityAnalysisRunsClient) listCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") if options != nil && options.Skip != nil { reqQP.Set("skip", strconv.FormatInt(int64(*options.Skip), 10)) } diff --git a/sdk/resourcemanager/network/armnetwork/reachabilityanalysisruns_client_example_test.go b/sdk/resourcemanager/network/armnetwork/reachabilityanalysisruns_client_example_test.go deleted file mode 100644 index 085e53625c29..000000000000 --- a/sdk/resourcemanager/network/armnetwork/reachabilityanalysisruns_client_example_test.go +++ /dev/null @@ -1,222 +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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/ReachabilityAnalysisRunList.json -func ExampleReachabilityAnalysisRunsClient_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.NewReachabilityAnalysisRunsClient().NewListPager("rg1", "testNetworkManager", "testVerifierWorkspace1", &armnetwork.ReachabilityAnalysisRunsClientListOptions{SkipToken: nil, - Skip: nil, - Top: nil, - SortKey: nil, - SortValue: 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.ReachabilityAnalysisRunListResult = armnetwork.ReachabilityAnalysisRunListResult{ - // Value: []*armnetwork.ReachabilityAnalysisRun{ - // { - // Name: to.Ptr("testReachabilityAnalysisRun1"), - // Type: to.Ptr("Microsoft.Network/networkManagers/verifierWorkspaces/reachabilityAnalysisRuns"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/verifierWorkspaces/testVerifierWorkspace1/reachabilityAnalysisRuns/testReachabilityAnalysisRun1"), - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); 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:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // Properties: &armnetwork.ReachabilityAnalysisRunProperties{ - // Description: to.Ptr("A sample reachability analysis intent"), - // IntentContent: &armnetwork.IntentContent{ - // DestinationResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/testVmDest"), - // IPTraffic: &armnetwork.IPTraffic{ - // DestinationIPs: []*string{ - // to.Ptr("10.4.0.1")}, - // DestinationPorts: []*string{ - // to.Ptr("0")}, - // Protocols: []*armnetwork.NetworkProtocol{ - // to.Ptr(armnetwork.NetworkProtocolAny)}, - // SourceIPs: []*string{ - // to.Ptr("10.4.0.0")}, - // SourcePorts: []*string{ - // to.Ptr("0")}, - // }, - // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/testVmSrc"), - // }, - // IntentID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/verifierWorkspaces/testVerifierWorkspace1/reachabilityAnalysisIntents/testReachabilityAnalysisIntenant1"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/ReachabilityAnalysisRunGet.json -func ExampleReachabilityAnalysisRunsClient_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.NewReachabilityAnalysisRunsClient().Get(ctx, "rg1", "testNetworkManager", "testWorkspace", "testAnalysisRunName", 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.ReachabilityAnalysisRun = armnetwork.ReachabilityAnalysisRun{ - // Name: to.Ptr("testAnalysisRunName"), - // Type: to.Ptr("Microsoft.Network/networkManagers/verifierWorkspaces/reachabilityAnalysisRuns"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/verifierWorkspaces/testWorkspace/reachabilityAnalysisRuns/testAnalysisRunName"), - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); 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:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // Properties: &armnetwork.ReachabilityAnalysisRunProperties{ - // Description: to.Ptr("A sample reachability analysis intent"), - // AnalysisResult: to.Ptr("{\"resultOutcome\":\"NoPacketsReached\",\"unreachedTrace\":\"[{\\\"name\\\":\\\"testVmSrc\\\",\\\"resourceId\\\":\\\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/testVmSrc\\\",\\\"resourceType\\\":\\\"Microsoft.Compute/virtualMachines\\\",\\\"packet\\\":{\\\"destinationAddress\\\":\\\"10.1.0.4\\\",\\\"destinationPort\\\":\\\"0\\\",\\\"sourceAddress\\\":\\\"10.5.0.4\\\",\\\"sourcePort\\\":\\\"0\\\",\\\"protocol\\\":\\\"TCP\\\"},\\\"explanation\\\":{\\\"description\\\":\\\"Packet has source IP address matching one of the network interface IPs.\\\",\\\"explanationCode\\\":\\\"MATCHED_NETWORK_INTERFACE_IP_SOURCE\\\",\\\"matchedNetworkInterfaceAddress\\\":{\\\"networkInterface\\\":\\\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testNetworkInterface\\\",\\\"ipAddress\\\":\\\"10.5.0.4\\\"}}},{\\\"name\\\":\\\"testNetworkInterface\\\",\\\"resourceId\\\":\\\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testNetworkInterface\\\",\\\"resourceType\\\":\\\"Microsoft.Network/networkInterfaces\\\",\\\"packet\\\":{\\\"destinationAddress\\\":\\\"10.1.0.4\\\",\\\"destinationPort\\\":\\\"0\\\",\\\"sourceAddress\\\":\\\"10.5.0.4\\\",\\\"sourcePort\\\":\\\"0\\\",\\\"protocol\\\":\\\"TCP\\\"},\\\"explanation\\\":{\\\"description\\\":\\\"Packet has source IP address matching one of the network interface IPs.\\\",\\\"explanationCode\\\":\\\"MATCHED_NETWORK_INTERFACE_IP_SOURCE\\\",\\\"matchedNetworkInterfaceAddress\\\":{\\\"networkInterface\\\":\\\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testNetworkInterface\\\",\\\"ipAddress\\\":\\\"10.5.0.4\\\"}}},{\\\"name\\\":\\\"testNetworkManager\\\",\\\"resourceId\\\":\\\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager\\\",\\\"resourceType\\\":\\\"Microsoft.Network/networkManagers\\\",\\\"packet\\\":{\\\"destinationAddress\\\":\\\"10.1.0.4\\\",\\\"destinationPort\\\":\\\"0\\\",\\\"sourceAddress\\\":\\\"10.5.0.4\\\",\\\"sourcePort\\\":\\\"0\\\",\\\"protocol\\\":\\\"TCP\\\"},\\\"explanation\\\":{\\\"description\\\":\\\"Packet matched an admin security rule.\\\",\\\"explanationCode\\\":\\\"MATCHED_ADMIN_SECURITY_RULE\\\",\\\"matchedSecurityRule\\\":{\\\"name\\\":\\\"AllowAllOutbound\\\",\\\"action\\\":\\\"Allow\\\",\\\"destinationAddress\\\":\\\"*\\\",\\\"sourceAddress\\\":\\\"*\\\",\\\"destinationPort\\\":\\\"1-65535\\\",\\\"sourcePort\\\":\\\"1-65535\\\",\\\"protocol\\\":\\\"Any\\\"}}},{\\\"name\\\":\\\"testnsg\\\",\\\"resourceId\\\":\\\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg-eus2\\\",\\\"resourceType\\\":\\\"Microsoft.Network/networkSecurityGroups\\\",\\\"packet\\\":{\\\"destinationAddress\\\":\\\"10.1.0.4\\\",\\\"destinationPort\\\":\\\"0\\\",\\\"sourceAddress\\\":\\\"10.5.0.4\\\",\\\"sourcePort\\\":\\\"0\\\",\\\"protocol\\\":\\\"TCP\\\"},\\\"explanation\\\":{\\\"description\\\":\\\"Packet matched a network security rule.\\\",\\\"explanationCode\\\":\\\"MATCHED_NETWORK_SECURITY_RULE\\\",\\\"matchedSecurityRule\\\":{\\\"name\\\":\\\"defaultSecurityRules/AllowVnetOutBound\\\",\\\"action\\\":\\\"allow\\\",\\\"destinationAddress\\\":\\\"VirtualNetwork\\\",\\\"sourceAddress\\\":\\\"VirtualNetwork\\\",\\\"destinationPort\\\":\\\"0-65535\\\",\\\"sourcePort\\\":\\\"0-65535\\\",\\\"protocol\\\":\\\"All\\\"}}},{\\\"name\\\":\\\"default\\\",\\\"resourceId\\\":\\\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/testvnet/subnets/default\\\",\\\"resourceType\\\":\\\"Microsoft.Network/virtualNetworks/subnets\\\",\\\"packet\\\":{\\\"destinationAddress\\\":\\\"10.1.0.4\\\",\\\"destinationPort\\\":\\\"0\\\",\\\"sourceAddress\\\":\\\"10.5.0.4\\\",\\\"sourcePort\\\":\\\"0\\\",\\\"protocol\\\":\\\"TCP\\\"},\\\"explanation\\\":{\\\"description\\\":\\\"Packet matched a system route.\\\",\\\"explanationCode\\\":\\\"MATCHED_SYSTEM_ROUTE\\\",\\\"matchedSubnetRoute\\\":{\\\"source\\\":\\\"Default\\\",\\\"addressPrefix\\\":\\\"10.1.0.0/16\\\",\\\"nextHopIpAddress\\\":[],\\\"nextHopType\\\":\\\"ConnectedGroup\\\"}}},{\\\"name\\\":\\\"testvnet1\\\",\\\"resourceId\\\":\\\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/testvnet1\\\",\\\"resourceType\\\":\\\"Microsoft.Network/virtualNetworks\\\",\\\"packet\\\":{\\\"destinationAddress\\\":\\\"10.1.0.4\\\",\\\"destinationPort\\\":\\\"0\\\",\\\"sourceAddress\\\":\\\"10.5.0.4\\\",\\\"sourcePort\\\":\\\"0\\\",\\\"protocol\\\":\\\"TCP\\\"},\\\"explanation\\\":{\\\"description\\\":\\\"Packet destination IP is destined to subnet prefix.\\\",\\\"explanationCode\\\":\\\"MATCHED_SUBNET_PREFIX\\\",\\\"matchedSubnetPrefix\\\":{\\\"subnet\\\":\\\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/testvnet-1/subnets/default\\\",\\\"subnetPrefix\\\":\\\"10.1.0.0/24\\\"}}},{\\\"name\\\":\\\"default\\\",\\\"resourceId\\\":\\\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/testvnet1/subnets/default\\\",\\\"resourceType\\\":\\\"Microsoft.Network/virtualNetworks/subnets\\\",\\\"packet\\\":{\\\"destinationAddress\\\":\\\"10.1.0.4\\\",\\\"destinationPort\\\":\\\"443\\\",\\\"sourceAddress\\\":\\\"10.5.0.4\\\",\\\"sourcePort\\\":\\\"0\\\"\\\"protocol\\\":\\\"TCP\\\"},\\\"explanation\\\":{\\\"description\\\":\\\"Packet denied due to VM not currently running.\\\",\\\"explanationCode\\\":\\\"VM_TURNED_OFF\\\"}}]\"}"), - // ErrorMessage: to.Ptr(""), - // IntentContent: &armnetwork.IntentContent{ - // DestinationResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/testVmDest"), - // IPTraffic: &armnetwork.IPTraffic{ - // DestinationIPs: []*string{ - // to.Ptr("10.4.0.1")}, - // DestinationPorts: []*string{ - // to.Ptr("0")}, - // Protocols: []*armnetwork.NetworkProtocol{ - // to.Ptr(armnetwork.NetworkProtocolAny)}, - // SourceIPs: []*string{ - // to.Ptr("10.4.0.0")}, - // SourcePorts: []*string{ - // to.Ptr("0")}, - // }, - // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/testVmSrc"), - // }, - // IntentID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/verifierWorkspaces/testVerifierWorkspace1/reachabilityAnalysisIntents/testReachabilityAnalysisIntenant1"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/ReachabilityAnalysisRunPut.json -func ExampleReachabilityAnalysisRunsClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain 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.NewReachabilityAnalysisRunsClient().Create(ctx, "rg1", "testNetworkManager", "testWorkspace", "testAnalysisRunName", armnetwork.ReachabilityAnalysisRun{ - Properties: &armnetwork.ReachabilityAnalysisRunProperties{ - Description: to.Ptr("A sample reachability analysis run"), - IntentID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/verifierWorkspaces/testVerifierWorkspace1/reachabilityAnalysisIntents/testReachabilityAnalysisIntenant1"), - }, - }, 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.ReachabilityAnalysisRun = armnetwork.ReachabilityAnalysisRun{ - // Name: to.Ptr("testAnalysisRunName"), - // Type: to.Ptr("Microsoft.Network/networkManagers/verifierWorkspaces/reachabilityAnalysisRuns"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/verifierWorkspaces/testWorkspace/reachabilityAnalysisRuns/testAnalysisRunName"), - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); 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:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // Properties: &armnetwork.ReachabilityAnalysisRunProperties{ - // Description: to.Ptr("A sample reachability analysis intent"), - // IntentContent: &armnetwork.IntentContent{ - // DestinationResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/testVmDest"), - // IPTraffic: &armnetwork.IPTraffic{ - // DestinationIPs: []*string{ - // to.Ptr("10.4.0.1")}, - // DestinationPorts: []*string{ - // to.Ptr("0")}, - // Protocols: []*armnetwork.NetworkProtocol{ - // to.Ptr(armnetwork.NetworkProtocolAny)}, - // SourceIPs: []*string{ - // to.Ptr("10.4.0.0")}, - // SourcePorts: []*string{ - // to.Ptr("0")}, - // }, - // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/testVmSrc"), - // }, - // IntentID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/verifierWorkspaces/testVerifierWorkspace1/reachabilityAnalysisIntents/testReachabilityAnalysisIntenant1"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/ReachabilityAnalysisRunDelete.json -func ExampleReachabilityAnalysisRunsClient_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.NewReachabilityAnalysisRunsClient().BeginDelete(ctx, "rg1", "testNetworkManager", "testWorkspace", "testAnalysisRun", 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/resourcenavigationlinks_client.go b/sdk/resourcemanager/network/armnetwork/resourcenavigationlinks_client.go index 5ffadc70787b..5ef96399cafa 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 2024-05-01 +// Generated from API version 2024-07-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", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 f3679e27d81c..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/responses.go b/sdk/resourcemanager/network/armnetwork/responses.go index 2ff4a9232d5c..5f2ec602e99b 100644 --- a/sdk/resourcemanager/network/armnetwork/responses.go +++ b/sdk/resourcemanager/network/armnetwork/responses.go @@ -3317,6 +3317,11 @@ type VirtualAppliancesClientDeleteResponse struct { // placeholder for future response values } +// VirtualAppliancesClientGetBootDiagnosticLogsResponse contains the response from method VirtualAppliancesClient.BeginGetBootDiagnosticLogs. +type VirtualAppliancesClientGetBootDiagnosticLogsResponse struct { + VirtualApplianceInstanceID +} + // VirtualAppliancesClientGetResponse contains the response from method VirtualAppliancesClient.Get. type VirtualAppliancesClientGetResponse struct { // NetworkVirtualAppliance Resource. @@ -3335,6 +3340,12 @@ type VirtualAppliancesClientListResponse struct { VirtualApplianceListResult } +// VirtualAppliancesClientReimageResponse contains the response from method VirtualAppliancesClient.BeginReimage. +type VirtualAppliancesClientReimageResponse struct { + // Specifies a list of virtual machine instance IDs from the Network Virtual Appliance VM instances. + VirtualApplianceInstanceIDs +} + // VirtualAppliancesClientRestartResponse contains the response from method VirtualAppliancesClient.BeginRestart. type VirtualAppliancesClientRestartResponse struct { // Specifies a list of virtual machine instance IDs from the Network Virtual Appliance VM instances. diff --git a/sdk/resourcemanager/network/armnetwork/routefilterrules_client.go b/sdk/resourcemanager/network/armnetwork/routefilterrules_client.go index ba54a5e0e1d2..4c9225cbaace 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - routeFilterName - The name of the route filter. // - ruleName - The name of the route filter rule. @@ -75,7 +75,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -121,7 +121,7 @@ func (client *RouteFilterRulesClient) createOrUpdateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, routeFilterRuleParameters); err != nil { @@ -133,7 +133,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - routeFilterName - The name of the route filter. // - ruleName - The name of the rule. @@ -160,7 +160,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -206,7 +206,7 @@ func (client *RouteFilterRulesClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -215,7 +215,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - routeFilterName - The name of the route filter. // - ruleName - The name of the rule. @@ -266,7 +266,7 @@ func (client *RouteFilterRulesClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -283,7 +283,7 @@ func (client *RouteFilterRulesClient) getHandleResponse(resp *http.Response) (Ro // NewListByRouteFilterPager - Gets all RouteFilterRules in a route filter. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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 @@ -331,7 +331,7 @@ func (client *RouteFilterRulesClient) listByRouteFilterCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 7cb35ca96c60..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 02c564a75af6..47b14192d08d 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 2024-05-01 +// Generated from API version 2024-07-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. @@ -74,7 +74,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -116,7 +116,7 @@ func (client *RouteFiltersClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, routeFilterParameters); err != nil { @@ -128,7 +128,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -154,7 +154,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *RouteFiltersClient) deleteOperation(ctx context.Context, resourceGroupName string, routeFilterName string, options *RouteFiltersClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "RouteFiltersClient.BeginDelete" @@ -196,7 +196,7 @@ func (client *RouteFiltersClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -205,7 +205,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -254,7 +254,7 @@ func (client *RouteFiltersClient) getCreateRequest(ctx context.Context, resource if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -271,7 +271,7 @@ func (client *RouteFiltersClient) getHandleResponse(resp *http.Response) (RouteF // NewListPager - Gets all route filters in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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]{ @@ -308,7 +308,7 @@ func (client *RouteFiltersClient) listCreateRequest(ctx context.Context, options return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -325,7 +325,7 @@ func (client *RouteFiltersClient) listHandleResponse(resp *http.Response) (Route // NewListByResourceGroupPager - Gets all route filters in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - RouteFiltersClientListByResourceGroupOptions contains the optional parameters for the RouteFiltersClient.NewListByResourceGroupPager // method. @@ -368,7 +368,7 @@ func (client *RouteFiltersClient) listByResourceGroupCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -386,7 +386,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - routeFilterName - The name of the route filter. // - parameters - Parameters supplied to update route filter tags. @@ -433,7 +433,7 @@ func (client *RouteFiltersClient) updateTagsCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 92e026c3dc16..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 95ae4730bced..da17dcfc03d7 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 2024-05-01 +// Generated from API version 2024-07-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. @@ -75,7 +75,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -121,7 +121,7 @@ func (client *RouteMapsClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, routeMapParameters); err != nil { @@ -133,7 +133,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -159,7 +159,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -205,7 +205,7 @@ func (client *RouteMapsClient) deleteCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -214,7 +214,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -265,7 +265,7 @@ func (client *RouteMapsClient) getCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -282,7 +282,7 @@ func (client *RouteMapsClient) getHandleResponse(resp *http.Response) (RouteMaps // NewListPager - Retrieves the details of all RouteMaps. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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. @@ -329,7 +329,7 @@ func (client *RouteMapsClient) listCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 eb8a9ba6cd1b..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 c36ccd11d94c..926fb015cfee 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - routeTableName - The name of the route table. // - routeName - The name of the route. @@ -75,7 +75,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -121,7 +121,7 @@ func (client *RoutesClient) createOrUpdateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, routeParameters); err != nil { @@ -133,7 +133,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - routeTableName - The name of the route table. // - routeName - The name of the route. @@ -159,7 +159,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -205,7 +205,7 @@ func (client *RoutesClient) deleteCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -214,7 +214,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - routeTableName - The name of the route table. // - routeName - The name of the route. @@ -265,7 +265,7 @@ func (client *RoutesClient) getCreateRequest(ctx context.Context, resourceGroupN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -282,7 +282,7 @@ func (client *RoutesClient) getHandleResponse(resp *http.Response) (RoutesClient // NewListPager - Gets all routes in a route table. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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. @@ -329,7 +329,7 @@ func (client *RoutesClient) listCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 cfbf687e3813..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/routetable_live_test.go b/sdk/resourcemanager/network/armnetwork/routetable_live_test.go index a5b3c3051ddb..1f73aef33d6d 100644 --- a/sdk/resourcemanager/network/armnetwork/routetable_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/routetable_live_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/routetables_client.go b/sdk/resourcemanager/network/armnetwork/routetables_client.go index c1f4a9cbf4b7..744c3f6b0d10 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 2024-05-01 +// Generated from API version 2024-07-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. @@ -74,7 +74,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -116,7 +116,7 @@ func (client *RouteTablesClient) createOrUpdateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -128,7 +128,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -153,7 +153,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *RouteTablesClient) deleteOperation(ctx context.Context, resourceGroupName string, routeTableName string, options *RouteTablesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "RouteTablesClient.BeginDelete" @@ -195,7 +195,7 @@ func (client *RouteTablesClient) deleteCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -204,7 +204,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -253,7 +253,7 @@ func (client *RouteTablesClient) getCreateRequest(ctx context.Context, resourceG if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -270,7 +270,7 @@ func (client *RouteTablesClient) getHandleResponse(resp *http.Response) (RouteTa // NewListPager - Gets all route tables in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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] { @@ -312,7 +312,7 @@ func (client *RouteTablesClient) listCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -329,7 +329,7 @@ func (client *RouteTablesClient) listHandleResponse(resp *http.Response) (RouteT // NewListAllPager - Gets all route tables in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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]{ @@ -366,7 +366,7 @@ func (client *RouteTablesClient) listAllCreateRequest(ctx context.Context, optio return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -384,7 +384,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - routeTableName - The name of the route table. // - parameters - Parameters supplied to update route table tags. @@ -431,7 +431,7 @@ func (client *RouteTablesClient) updateTagsCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 e1fe9a8dfac5..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 7b91c238441c..da6809e8c059 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 2024-05-01 +// Generated from API version 2024-07-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. @@ -75,7 +75,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -121,7 +121,7 @@ func (client *RoutingIntentClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, routingIntentParameters); err != nil { @@ -133,7 +133,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the RoutingIntent. // - virtualHubName - The name of the VirtualHub. // - routingIntentName - The name of the RoutingIntent. @@ -160,7 +160,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -206,7 +206,7 @@ func (client *RoutingIntentClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -215,7 +215,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the RoutingIntent. // - virtualHubName - The name of the VirtualHub. // - routingIntentName - The name of the RoutingIntent. @@ -266,7 +266,7 @@ func (client *RoutingIntentClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -283,7 +283,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -330,7 +330,7 @@ func (client *RoutingIntentClient) listCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 a4c6bc5d9911..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/routingrulecollections_client.go b/sdk/resourcemanager/network/armnetwork/routingrulecollections_client.go index ec5827697e6c..02a70b0435b4 100644 --- a/sdk/resourcemanager/network/armnetwork/routingrulecollections_client.go +++ b/sdk/resourcemanager/network/armnetwork/routingrulecollections_client.go @@ -48,7 +48,7 @@ func NewRoutingRuleCollectionsClient(subscriptionID string, credential azcore.To // CreateOrUpdate - Creates or updates a routing rule collection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Routing Configuration. @@ -106,7 +106,7 @@ func (client *RoutingRuleCollectionsClient) createOrUpdateCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 *RoutingRuleCollectionsClient) createOrUpdateHandleResponse(resp *h // BeginDelete - Deletes an routing rule collection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Routing Configuration. @@ -155,7 +155,7 @@ func (client *RoutingRuleCollectionsClient) BeginDelete(ctx context.Context, res // Delete - Deletes an routing rule collection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 func (client *RoutingRuleCollectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, options *RoutingRuleCollectionsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "RoutingRuleCollectionsClient.BeginDelete" @@ -205,7 +205,7 @@ func (client *RoutingRuleCollectionsClient) deleteCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } @@ -217,7 +217,7 @@ func (client *RoutingRuleCollectionsClient) deleteCreateRequest(ctx context.Cont // Get - Gets a network manager routing configuration rule collection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Routing Configuration. @@ -274,7 +274,7 @@ func (client *RoutingRuleCollectionsClient) getCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -291,7 +291,7 @@ func (client *RoutingRuleCollectionsClient) getHandleResponse(resp *http.Respons // NewListPager - Lists all the rule collections in a routing configuration, in a paginated format. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Routing Configuration. @@ -350,7 +350,7 @@ func (client *RoutingRuleCollectionsClient) listCreateRequest(ctx context.Contex if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/routingrulecollections_client_example_test.go b/sdk/resourcemanager/network/armnetwork/routingrulecollections_client_example_test.go deleted file mode 100644 index 647fde7511f0..000000000000 --- a/sdk/resourcemanager/network/armnetwork/routingrulecollections_client_example_test.go +++ /dev/null @@ -1,187 +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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/NetworkManagerRoutingRuleCollectionList.json -func ExampleRoutingRuleCollectionsClient_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.NewRoutingRuleCollectionsClient().NewListPager("rg1", "testNetworkManager", "myTestRoutingConfig", &armnetwork.RoutingRuleCollectionsClientListOptions{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.RoutingRuleCollectionListResult = armnetwork.RoutingRuleCollectionListResult{ - // Value: []*armnetwork.RoutingRuleCollection{ - // { - // Name: to.Ptr("testRuleCollection"), - // Type: to.Ptr("Microsoft.Network/networkManagers/routingConfigurations/ruleCollections"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/routingConfigurations/myTestRoutingConfig/ruleCollections/testRuleCollection"), - // Properties: &armnetwork.RoutingRuleCollectionPropertiesFormat{ - // Description: to.Ptr("A sample rule collection"), - // AppliesTo: []*armnetwork.ManagerRoutingGroupItem{ - // { - // NetworkGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/testGroup"), - // }}, - // DisableBgpRoutePropagation: to.Ptr(armnetwork.DisableBgpRoutePropagationFalse), - // 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:27.000Z"); 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:27.000Z"); 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/NetworkManagerRoutingRuleCollectionGet.json -func ExampleRoutingRuleCollectionsClient_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.NewRoutingRuleCollectionsClient().Get(ctx, "rg1", "testNetworkManager", "myTestRoutingConfig", "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.RoutingRuleCollection = armnetwork.RoutingRuleCollection{ - // Name: to.Ptr("testRuleCollection"), - // Type: to.Ptr("Microsoft.Network/networkManagers/routingConfigurations/ruleCollections"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/routingConfigurations/myTestRoutingConfig/ruleCollections/testRuleCollection"), - // Properties: &armnetwork.RoutingRuleCollectionPropertiesFormat{ - // Description: to.Ptr("A sample rule collection"), - // AppliesTo: []*armnetwork.ManagerRoutingGroupItem{ - // { - // NetworkGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/testGroup"), - // }}, - // DisableBgpRoutePropagation: to.Ptr(armnetwork.DisableBgpRoutePropagationFalse), - // 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:27.000Z"); 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:27.000Z"); 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/NetworkManagerRoutingRuleCollectionPut.json -func ExampleRoutingRuleCollectionsClient_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.NewRoutingRuleCollectionsClient().CreateOrUpdate(ctx, "rg1", "testNetworkManager", "myTestRoutingConfig", "testRuleCollection", armnetwork.RoutingRuleCollection{ - Properties: &armnetwork.RoutingRuleCollectionPropertiesFormat{ - Description: to.Ptr("A sample policy"), - AppliesTo: []*armnetwork.ManagerRoutingGroupItem{ - { - 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.RoutingRuleCollection = armnetwork.RoutingRuleCollection{ - // Name: to.Ptr("myTestRoutingConfig"), - // Type: to.Ptr("Microsoft.Network/networkManagers/routingConfigurations/ruleCollections"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManager/testNetworkManager/routingConfigurations/myTestRoutingConfig/ruleCollections/testRuleCollection"), - // Properties: &armnetwork.RoutingRuleCollectionPropertiesFormat{ - // Description: to.Ptr("A sample policy"), - // AppliesTo: []*armnetwork.ManagerRoutingGroupItem{ - // { - // NetworkGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/testGroup"), - // }}, - // DisableBgpRoutePropagation: to.Ptr(armnetwork.DisableBgpRoutePropagationFalse), - // 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:27.000Z"); 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:27.000Z"); 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/NetworkManagerRoutingRuleCollectionDelete.json -func ExampleRoutingRuleCollectionsClient_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.NewRoutingRuleCollectionsClient().BeginDelete(ctx, "rg1", "testNetworkManager", "myTestRoutingConfig", "testRuleCollection", &armnetwork.RoutingRuleCollectionsClientBeginDeleteOptions{Force: 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/routingrules_client.go b/sdk/resourcemanager/network/armnetwork/routingrules_client.go index 5db1470aa41c..7e3ccacc2bc3 100644 --- a/sdk/resourcemanager/network/armnetwork/routingrules_client.go +++ b/sdk/resourcemanager/network/armnetwork/routingrules_client.go @@ -48,7 +48,7 @@ func NewRoutingRulesClient(subscriptionID string, credential azcore.TokenCredent // CreateOrUpdate - Creates or updates an routing rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Routing Configuration. @@ -111,7 +111,7 @@ func (client *RoutingRulesClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, routingRule); err != nil { @@ -132,7 +132,7 @@ func (client *RoutingRulesClient) createOrUpdateHandleResponse(resp *http.Respon // BeginDelete - Deletes a routing rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Routing Configuration. @@ -161,7 +161,7 @@ func (client *RoutingRulesClient) BeginDelete(ctx context.Context, resourceGroup // Delete - Deletes a routing rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 func (client *RoutingRulesClient) deleteOperation(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, ruleName string, options *RoutingRulesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "RoutingRulesClient.BeginDelete" @@ -215,7 +215,7 @@ func (client *RoutingRulesClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } @@ -227,7 +227,7 @@ func (client *RoutingRulesClient) deleteCreateRequest(ctx context.Context, resou // Get - Gets a network manager routing configuration routing rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Routing Configuration. @@ -288,7 +288,7 @@ func (client *RoutingRulesClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -305,7 +305,7 @@ func (client *RoutingRulesClient) getHandleResponse(resp *http.Response) (Routin // NewListPager - List all network manager routing configuration routing rules. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Routing Configuration. @@ -368,7 +368,7 @@ func (client *RoutingRulesClient) listCreateRequest(ctx context.Context, resourc if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/routingrules_client_example_test.go b/sdk/resourcemanager/network/armnetwork/routingrules_client_example_test.go deleted file mode 100644 index 71a055e6756d..000000000000 --- a/sdk/resourcemanager/network/armnetwork/routingrules_client_example_test.go +++ /dev/null @@ -1,199 +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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/NetworkManagerRoutingRuleList.json -func ExampleRoutingRulesClient_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.NewRoutingRulesClient().NewListPager("rg1", "testNetworkManager", "myTestRoutingConfig", "testRuleCollection", &armnetwork.RoutingRulesClientListOptions{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.RoutingRuleListResult = armnetwork.RoutingRuleListResult{ - // Value: []*armnetwork.RoutingRule{ - // { - // Name: to.Ptr("SampleRoutingRule"), - // Type: to.Ptr("Microsoft.Network/networkManagers/routingConfigurations/ruleCollections/rules"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkmanagers/testNetworkManager/routingConfigurations/myTestRoutingConfig/ruleCollections/testRuleCollection/rules/SampleAdminRule"), - // Properties: &armnetwork.RoutingRulePropertiesFormat{ - // Description: to.Ptr("This is Sample Admin Rule"), - // Destination: &armnetwork.RoutingRuleRouteDestination{ - // Type: to.Ptr(armnetwork.RoutingRuleDestinationTypeAddressPrefix), - // DestinationAddress: to.Ptr("10.0.0.0/16"), - // }, - // NextHop: &armnetwork.RoutingRuleNextHop{ - // NextHopAddress: to.Ptr(""), - // NextHopType: to.Ptr(armnetwork.RoutingRuleNextHopTypeVirtualNetworkGateway), - // }, - // 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:27.000Z"); 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:27.000Z"); 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/NetworkManagerRoutingRuleGet.json -func ExampleRoutingRulesClient_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.NewRoutingRulesClient().Get(ctx, "rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", "SampleRoutingRule", 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.RoutingRule = armnetwork.RoutingRule{ - // Name: to.Ptr("SampleRoutingRule"), - // Type: to.Ptr("Microsoft.Network/networkManagers/routingConfigurations/ruleCollections/rules"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/routingConfigurations/myTestSecurityConfig/ruleCollections/testRuleCollection/rules/SampleRoutingRule"), - // Properties: &armnetwork.RoutingRulePropertiesFormat{ - // Description: to.Ptr("This is a routing rule"), - // Destination: &armnetwork.RoutingRuleRouteDestination{ - // Type: to.Ptr(armnetwork.RoutingRuleDestinationTypeAddressPrefix), - // DestinationAddress: to.Ptr("10.0.0.0/16"), - // }, - // NextHop: &armnetwork.RoutingRuleNextHop{ - // NextHopAddress: to.Ptr(""), - // NextHopType: to.Ptr(armnetwork.RoutingRuleNextHopTypeVirtualNetworkGateway), - // }, - // 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:27.000Z"); 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:27.000Z"); 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/NetworkManagerRoutingRulePut.json -func ExampleRoutingRulesClient_CreateOrUpdate_createADefaultRoutingRule() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain 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.NewRoutingRulesClient().CreateOrUpdate(ctx, "rg1", "testNetworkManager", "myTestRoutingConfig", "testRuleCollection", "SampleRoutingRule", armnetwork.RoutingRule{ - Properties: &armnetwork.RoutingRulePropertiesFormat{ - Description: to.Ptr("This is Sample Routing Rule"), - Destination: &armnetwork.RoutingRuleRouteDestination{ - Type: to.Ptr(armnetwork.RoutingRuleDestinationTypeAddressPrefix), - DestinationAddress: to.Ptr("10.0.0.0/16"), - }, - NextHop: &armnetwork.RoutingRuleNextHop{ - NextHopType: to.Ptr(armnetwork.RoutingRuleNextHopTypeVirtualNetworkGateway), - }, - }, - }, 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.RoutingRule = armnetwork.RoutingRule{ - // Name: to.Ptr("SampleRoutingRule"), - // Type: to.Ptr("Microsoft.Network/networkManagers/routingConfigurations/ruleCollections/rules"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/routingConfigurations/myTestRoutingConfig/ruleCollections/testRuleCollection/rules/SampleRoutingRule"), - // Properties: &armnetwork.RoutingRulePropertiesFormat{ - // Description: to.Ptr("This is Sample Routing Rule"), - // Destination: &armnetwork.RoutingRuleRouteDestination{ - // Type: to.Ptr(armnetwork.RoutingRuleDestinationTypeAddressPrefix), - // DestinationAddress: to.Ptr("10.0.0.0/16"), - // }, - // NextHop: &armnetwork.RoutingRuleNextHop{ - // NextHopAddress: to.Ptr(""), - // NextHopType: to.Ptr(armnetwork.RoutingRuleNextHopTypeVirtualNetworkGateway), - // }, - // 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:27.000Z"); 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:27.000Z"); 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/NetworkManagerRoutingRuleDelete.json -func ExampleRoutingRulesClient_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.NewRoutingRulesClient().BeginDelete(ctx, "rg1", "testNetworkManager", "myTestRoutingConfig", "testRuleCollection", "sampleRule", &armnetwork.RoutingRulesClientBeginDeleteOptions{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/scopeconnections_client.go b/sdk/resourcemanager/network/armnetwork/scopeconnections_client.go index 95db6b1bfa84..79a9b4e2cad0 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 2024-05-01 +// Generated from API version 2024-07-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", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 2024-05-01 +// Generated from API version 2024-07-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", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 2024-05-01 +// Generated from API version 2024-07-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", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 2024-05-01 +// Generated from API version 2024-07-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 @@ -303,7 +303,7 @@ func (client *ScopeConnectionsClient) listCreateRequest(ctx context.Context, res if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil 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 633d5d04fd96..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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:27.000Z"); 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:27.000Z"); 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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:27.000Z"); 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:27.000Z"); 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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:27.000Z"); 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:27.000Z"); 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 68e69278ece4..8b8c9960ce23 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 2024-05-01 +// Generated from API version 2024-07-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", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Security Configuration. @@ -149,7 +149,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -195,7 +195,7 @@ func (client *SecurityAdminConfigurationsClient) deleteCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } @@ -207,7 +207,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Security Configuration. @@ -259,7 +259,7 @@ func (client *SecurityAdminConfigurationsClient) getCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -276,7 +276,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -330,7 +330,7 @@ func (client *SecurityAdminConfigurationsClient) listCreateRequest(ctx context.C if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil 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 ecbec6811c72..000000000000 --- a/sdk/resourcemanager/network/armnetwork/securityadminconfigurations_client_example_test.go +++ /dev/null @@ -1,219 +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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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:27.000Z"); 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:27.000Z"); 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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:27.000Z"); 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:27.000Z"); 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/NetworkManagerSecurityAdminConfigurationPut_ManualAggregation.json -func ExampleSecurityAdminConfigurationsClient_CreateOrUpdate_createManualModeSecurityAdminConfiguration() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain 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 configuration which will update any network groups ip addresses at commit times."), - NetworkGroupAddressSpaceAggregationOption: to.Ptr(armnetwork.AddressSpaceAggregationOptionManual), - }, - }, 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/11111111-1111-1111-1111-111111111111/resourceGroups/rg1/providers/Microsoft.Network/networkManager/testNetworkManager/securityAdminConfigurations/myTestSecurityConfig"), - // Properties: &armnetwork.SecurityAdminConfigurationPropertiesFormat{ - // Description: to.Ptr("A sample policy"), - // NetworkGroupAddressSpaceAggregationOption: to.Ptr(armnetwork.AddressSpaceAggregationOptionManual), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); 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:27.000Z"); 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/NetworkManagerSecurityAdminConfigurationPut.json -func ExampleSecurityAdminConfigurationsClient_CreateOrUpdate_createNetworkManagerSecurityAdminConfiguration() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain 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:27.000Z"); 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:27.000Z"); 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 e231d3ab367d..6f5cd9987f16 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 2024-05-01 +// Generated from API version 2024-07-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. @@ -74,7 +74,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -116,7 +116,7 @@ func (client *SecurityGroupsClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -128,7 +128,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -154,7 +154,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *SecurityGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, options *SecurityGroupsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "SecurityGroupsClient.BeginDelete" @@ -196,7 +196,7 @@ func (client *SecurityGroupsClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -205,7 +205,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -254,7 +254,7 @@ func (client *SecurityGroupsClient) getCreateRequest(ctx context.Context, resour if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -271,7 +271,7 @@ func (client *SecurityGroupsClient) getHandleResponse(resp *http.Response) (Secu // NewListPager - Gets all network security groups in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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] { @@ -313,7 +313,7 @@ func (client *SecurityGroupsClient) listCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -330,7 +330,7 @@ func (client *SecurityGroupsClient) listHandleResponse(resp *http.Response) (Sec // NewListAllPager - Gets all network security groups in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - options - SecurityGroupsClientListAllOptions contains the optional parameters for the SecurityGroupsClient.NewListAllPager // method. func (client *SecurityGroupsClient) NewListAllPager(options *SecurityGroupsClientListAllOptions) *runtime.Pager[SecurityGroupsClientListAllResponse] { @@ -368,7 +368,7 @@ func (client *SecurityGroupsClient) listAllCreateRequest(ctx context.Context, op return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -386,7 +386,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -434,7 +434,7 @@ func (client *SecurityGroupsClient) updateTagsCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 2ce27637920e..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 ce86951714c9..d49dbb576c8c 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 2024-05-01 +// Generated from API version 2024-07-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. @@ -74,7 +74,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -116,7 +116,7 @@ func (client *SecurityPartnerProvidersClient) createOrUpdateCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -128,7 +128,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -154,7 +154,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *SecurityPartnerProvidersClient) deleteOperation(ctx context.Context, resourceGroupName string, securityPartnerProviderName string, options *SecurityPartnerProvidersClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "SecurityPartnerProvidersClient.BeginDelete" @@ -196,7 +196,7 @@ func (client *SecurityPartnerProvidersClient) deleteCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -205,7 +205,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -252,7 +252,7 @@ func (client *SecurityPartnerProvidersClient) getCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -269,7 +269,7 @@ func (client *SecurityPartnerProvidersClient) getHandleResponse(resp *http.Respo // NewListPager - Gets all the Security Partner Providers in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - options - SecurityPartnerProvidersClientListOptions contains the optional parameters for the SecurityPartnerProvidersClient.NewListPager // method. func (client *SecurityPartnerProvidersClient) NewListPager(options *SecurityPartnerProvidersClientListOptions) *runtime.Pager[SecurityPartnerProvidersClientListResponse] { @@ -307,7 +307,7 @@ func (client *SecurityPartnerProvidersClient) listCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -324,7 +324,7 @@ func (client *SecurityPartnerProvidersClient) listHandleResponse(resp *http.Resp // NewListByResourceGroupPager - Lists all Security Partner Providers in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - SecurityPartnerProvidersClientListByResourceGroupOptions contains the optional parameters for the SecurityPartnerProvidersClient.NewListByResourceGroupPager // method. @@ -367,7 +367,7 @@ func (client *SecurityPartnerProvidersClient) listByResourceGroupCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -385,7 +385,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -433,7 +433,7 @@ func (client *SecurityPartnerProvidersClient) updateTagsCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 228f523da716..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 293e80d8f0b6..f805bef23d6d 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkSecurityGroupName - The name of the network security group. // - securityRuleName - The name of the security rule. @@ -75,7 +75,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -121,7 +121,7 @@ func (client *SecurityRulesClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, securityRuleParameters); err != nil { @@ -133,7 +133,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkSecurityGroupName - The name of the network security group. // - securityRuleName - The name of the security rule. @@ -160,7 +160,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -206,7 +206,7 @@ func (client *SecurityRulesClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -215,7 +215,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkSecurityGroupName - The name of the network security group. // - securityRuleName - The name of the security rule. @@ -266,7 +266,7 @@ func (client *SecurityRulesClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -283,7 +283,7 @@ func (client *SecurityRulesClient) getHandleResponse(resp *http.Response) (Secur // NewListPager - Gets all security rules in a network security group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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. @@ -330,7 +330,7 @@ func (client *SecurityRulesClient) listCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 8f7c23f6129d..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/securityuserconfigurations_client.go b/sdk/resourcemanager/network/armnetwork/securityuserconfigurations_client.go index 35bff0c54d1d..3b9b1d16078a 100644 --- a/sdk/resourcemanager/network/armnetwork/securityuserconfigurations_client.go +++ b/sdk/resourcemanager/network/armnetwork/securityuserconfigurations_client.go @@ -48,7 +48,7 @@ func NewSecurityUserConfigurationsClient(subscriptionID string, credential azcor // CreateOrUpdate - Creates or updates a network manager security user configuration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Security Configuration. @@ -101,7 +101,7 @@ func (client *SecurityUserConfigurationsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, securityUserConfiguration); err != nil { @@ -122,7 +122,7 @@ func (client *SecurityUserConfigurationsClient) createOrUpdateHandleResponse(res // BeginDelete - Deletes a network manager security user configuration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Security Configuration. @@ -149,7 +149,7 @@ func (client *SecurityUserConfigurationsClient) BeginDelete(ctx context.Context, // Delete - Deletes a network manager security user configuration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 func (client *SecurityUserConfigurationsClient) deleteOperation(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, options *SecurityUserConfigurationsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "SecurityUserConfigurationsClient.BeginDelete" @@ -195,7 +195,7 @@ func (client *SecurityUserConfigurationsClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } @@ -207,7 +207,7 @@ func (client *SecurityUserConfigurationsClient) deleteCreateRequest(ctx context. // Get - Retrieves a network manager security user configuration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Security Configuration. @@ -259,7 +259,7 @@ func (client *SecurityUserConfigurationsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -276,7 +276,7 @@ func (client *SecurityUserConfigurationsClient) getHandleResponse(resp *http.Res // NewListPager - Lists all the network manager security user configurations in a network manager, in a paginated format. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - options - SecurityUserConfigurationsClientListOptions contains the optional parameters for the SecurityUserConfigurationsClient.NewListPager @@ -330,7 +330,7 @@ func (client *SecurityUserConfigurationsClient) listCreateRequest(ctx context.Co if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/securityuserconfigurations_client_example_test.go b/sdk/resourcemanager/network/armnetwork/securityuserconfigurations_client_example_test.go deleted file mode 100644 index e97d44cca84c..000000000000 --- a/sdk/resourcemanager/network/armnetwork/securityuserconfigurations_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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/NetworkManagerSecurityUserConfigurationList.json -func ExampleSecurityUserConfigurationsClient_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.NewSecurityUserConfigurationsClient().NewListPager("rg1", "testNetworkManager", &armnetwork.SecurityUserConfigurationsClientListOptions{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.SecurityUserConfigurationListResult = armnetwork.SecurityUserConfigurationListResult{ - // Value: []*armnetwork.SecurityUserConfiguration{ - // { - // Name: to.Ptr("myTestSecurityConfig"), - // Type: to.Ptr("Microsoft.Network/networkManagers/securityUserConfigurations"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/securityUserConfigurations/myTestSecurityConfig"), - // Properties: &armnetwork.SecurityUserConfigurationPropertiesFormat{ - // Description: to.Ptr("A sample policy"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("f506e3ca-4d68-41f1-9099-b50bc2c1b198"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); 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:27.000Z"); 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/NetworkManagerSecurityUserConfigurationGet.json -func ExampleSecurityUserConfigurationsClient_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.NewSecurityUserConfigurationsClient().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.SecurityUserConfiguration = armnetwork.SecurityUserConfiguration{ - // Name: to.Ptr("myTestSecurityConfig"), - // Type: to.Ptr("Microsoft.Network/networkManagers/securityUserConfigurations"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/securityUserConfigurations/myTestSecurityConfig"), - // Properties: &armnetwork.SecurityUserConfigurationPropertiesFormat{ - // Description: to.Ptr("A sample policy"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("f506e3ca-4d68-41f1-9099-b50bc2c1b198"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); 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:27.000Z"); 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/NetworkManagerSecurityUserConfigurationPut.json -func ExampleSecurityUserConfigurationsClient_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.NewSecurityUserConfigurationsClient().CreateOrUpdate(ctx, "rg1", "testNetworkManager", "myTestSecurityConfig", armnetwork.SecurityUserConfiguration{ - Properties: &armnetwork.SecurityUserConfigurationPropertiesFormat{ - Description: to.Ptr("A sample 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.SecurityUserConfiguration = armnetwork.SecurityUserConfiguration{ - // Name: to.Ptr("myTestSecurityConfig"), - // Type: to.Ptr("Microsoft.Network/networkManagers/securityConfigurations"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkManager/testNetworkManager/securityConfigurations/myTestSecurityConfig"), - // Properties: &armnetwork.SecurityUserConfigurationPropertiesFormat{ - // Description: to.Ptr("A sample policy"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("e74045ed-c817-48df-adb2-a06753ad4fff"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); 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:27.000Z"); 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/NetworkManagerSecurityUserConfigurationDelete.json -func ExampleSecurityUserConfigurationsClient_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.NewSecurityUserConfigurationsClient().BeginDelete(ctx, "rg1", "testNetworkManager", "myTestSecurityConfig", &armnetwork.SecurityUserConfigurationsClientBeginDeleteOptions{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/securityuserrulecollections_client.go b/sdk/resourcemanager/network/armnetwork/securityuserrulecollections_client.go index fb839eb34571..44933b045188 100644 --- a/sdk/resourcemanager/network/armnetwork/securityuserrulecollections_client.go +++ b/sdk/resourcemanager/network/armnetwork/securityuserrulecollections_client.go @@ -48,7 +48,7 @@ func NewSecurityUserRuleCollectionsClient(subscriptionID string, credential azco // CreateOrUpdate - Creates or updates a security user rule collection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Security Configuration. @@ -106,7 +106,7 @@ func (client *SecurityUserRuleCollectionsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, securityUserRuleCollection); err != nil { @@ -127,7 +127,7 @@ func (client *SecurityUserRuleCollectionsClient) createOrUpdateHandleResponse(re // BeginDelete - Deletes a Security User Rule collection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Security Configuration. @@ -155,7 +155,7 @@ func (client *SecurityUserRuleCollectionsClient) BeginDelete(ctx context.Context // Delete - Deletes a Security User Rule collection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 func (client *SecurityUserRuleCollectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, options *SecurityUserRuleCollectionsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "SecurityUserRuleCollectionsClient.BeginDelete" @@ -205,7 +205,7 @@ func (client *SecurityUserRuleCollectionsClient) deleteCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } @@ -217,7 +217,7 @@ func (client *SecurityUserRuleCollectionsClient) deleteCreateRequest(ctx context // Get - Gets a network manager security user configuration rule collection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Security Configuration. @@ -274,7 +274,7 @@ func (client *SecurityUserRuleCollectionsClient) getCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -291,7 +291,7 @@ func (client *SecurityUserRuleCollectionsClient) getHandleResponse(resp *http.Re // NewListPager - Lists all the security user rule collections in a security configuration, in a paginated format. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Security Configuration. @@ -350,7 +350,7 @@ func (client *SecurityUserRuleCollectionsClient) listCreateRequest(ctx context.C if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/securityuserrulecollections_client_example_test.go b/sdk/resourcemanager/network/armnetwork/securityuserrulecollections_client_example_test.go deleted file mode 100644 index 3bd9ffd4f340..000000000000 --- a/sdk/resourcemanager/network/armnetwork/securityuserrulecollections_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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/NetworkManagerSecurityUserRuleCollectionList.json -func ExampleSecurityUserRuleCollectionsClient_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.NewSecurityUserRuleCollectionsClient().NewListPager("rg1", "testNetworkManager", "myTestSecurityConfig", &armnetwork.SecurityUserRuleCollectionsClientListOptions{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.SecurityUserRuleCollectionListResult = armnetwork.SecurityUserRuleCollectionListResult{ - // Value: []*armnetwork.SecurityUserRuleCollection{ - // { - // Name: to.Ptr("testRuleCollection"), - // Type: to.Ptr("Microsoft.Network/networkManagers/securityUserConfigurations/ruleCollections"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/securityUserConfigurations/myTestSecurityConfig/ruleCollections/testRuleCollection"), - // Properties: &armnetwork.SecurityUserRuleCollectionPropertiesFormat{ - // Description: to.Ptr("A sample rule collection"), - // AppliesToGroups: []*armnetwork.SecurityUserGroupItem{ - // { - // NetworkGroupID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/testGroup"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("4224a5e7-d273-43d4-9bb0-b38e9b937ded"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); 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:27.000Z"); 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/NetworkManagerSecurityUserRuleCollectionGet.json -func ExampleSecurityUserRuleCollectionsClient_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.NewSecurityUserRuleCollectionsClient().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.SecurityUserRuleCollection = armnetwork.SecurityUserRuleCollection{ - // Name: to.Ptr("testRuleCollection"), - // Type: to.Ptr("Microsoft.Network/networkManagers/securityUserConfigurations/ruleCollections"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/securityUserConfigurations/myTestSecurityConfig/ruleCollections/testRuleCollection"), - // Properties: &armnetwork.SecurityUserRuleCollectionPropertiesFormat{ - // Description: to.Ptr("A sample rule collection"), - // AppliesToGroups: []*armnetwork.SecurityUserGroupItem{ - // { - // NetworkGroupID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/testGroup"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("4224a5e7-d273-43d4-9bb0-b38e9b937ded"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); 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:27.000Z"); 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/NetworkManagerSecurityUserRuleCollectionPut.json -func ExampleSecurityUserRuleCollectionsClient_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.NewSecurityUserRuleCollectionsClient().CreateOrUpdate(ctx, "rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", armnetwork.SecurityUserRuleCollection{ - Properties: &armnetwork.SecurityUserRuleCollectionPropertiesFormat{ - Description: to.Ptr("A sample policy"), - AppliesToGroups: []*armnetwork.SecurityUserGroupItem{ - { - NetworkGroupID: to.Ptr("/subscriptions/subId/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.SecurityUserRuleCollection = armnetwork.SecurityUserRuleCollection{ - // Name: to.Ptr("myTestSecurityConfig"), - // Type: to.Ptr("Microsoft.Network/networkManagers/securityUserConfigurations/ruleCollections"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkManager/testNetworkManager/securityUserConfigurations/myTestSecurityConfig/ruleCollections/testRuleCollection"), - // Properties: &armnetwork.SecurityUserRuleCollectionPropertiesFormat{ - // Description: to.Ptr("A sample policy"), - // AppliesToGroups: []*armnetwork.SecurityUserGroupItem{ - // { - // NetworkGroupID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/testGroup"), - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("4224a5e7-d273-43d4-9bb0-b38e9b937ded"), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); 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:27.000Z"); 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/NetworkManagerSecurityUserRuleCollectionDelete.json -func ExampleSecurityUserRuleCollectionsClient_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.NewSecurityUserRuleCollectionsClient().BeginDelete(ctx, "rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", &armnetwork.SecurityUserRuleCollectionsClientBeginDeleteOptions{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/securityuserrules_client.go b/sdk/resourcemanager/network/armnetwork/securityuserrules_client.go index 723deeff1b28..5f812e399c5f 100644 --- a/sdk/resourcemanager/network/armnetwork/securityuserrules_client.go +++ b/sdk/resourcemanager/network/armnetwork/securityuserrules_client.go @@ -48,7 +48,7 @@ func NewSecurityUserRulesClient(subscriptionID string, credential azcore.TokenCr // CreateOrUpdate - Creates or updates a security user rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Security Configuration. @@ -111,7 +111,7 @@ func (client *SecurityUserRulesClient) createOrUpdateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, securityUserRule); err != nil { @@ -132,7 +132,7 @@ func (client *SecurityUserRulesClient) createOrUpdateHandleResponse(resp *http.R // BeginDelete - Deletes a security user rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Security Configuration. @@ -161,7 +161,7 @@ func (client *SecurityUserRulesClient) BeginDelete(ctx context.Context, resource // Delete - Deletes a security user rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 func (client *SecurityUserRulesClient) deleteOperation(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, ruleName string, options *SecurityUserRulesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "SecurityUserRulesClient.BeginDelete" @@ -215,7 +215,7 @@ func (client *SecurityUserRulesClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } @@ -227,7 +227,7 @@ func (client *SecurityUserRulesClient) deleteCreateRequest(ctx context.Context, // Get - Gets a security user rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Security Configuration. @@ -288,7 +288,7 @@ func (client *SecurityUserRulesClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -305,7 +305,7 @@ func (client *SecurityUserRulesClient) getHandleResponse(resp *http.Response) (S // NewListPager - Lists all Security User Rules in a rule collection. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Security Configuration. @@ -369,7 +369,7 @@ func (client *SecurityUserRulesClient) listCreateRequest(ctx context.Context, re if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/network/armnetwork/securityuserrules_client_example_test.go b/sdk/resourcemanager/network/armnetwork/securityuserrules_client_example_test.go deleted file mode 100644 index de3755be0df4..000000000000 --- a/sdk/resourcemanager/network/armnetwork/securityuserrules_client_example_test.go +++ /dev/null @@ -1,232 +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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/NetworkManagerSecurityUserRuleList.json -func ExampleSecurityUserRulesClient_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.NewSecurityUserRulesClient().NewListPager("rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", &armnetwork.SecurityUserRulesClientListOptions{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.SecurityUserRuleListResult = armnetwork.SecurityUserRuleListResult{ - // Value: []*armnetwork.SecurityUserRule{ - // { - // Name: to.Ptr("SampleUserRule"), - // Type: to.Ptr("Microsoft.Network/networkManagers/securityConfigurations/ruleCollections/rules"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkmanagers/testNetworkManager/securityUserConfigurations/myTestSecurityConfig/ruleCollections/testRuleCollection/rules/SampleUserRule"), - // Properties: &armnetwork.SecurityUserRulePropertiesFormat{ - // Description: to.Ptr("Sample User Rule"), - // DestinationPortRanges: []*string{ - // to.Ptr("22")}, - // Destinations: []*armnetwork.AddressPrefixItem{ - // { - // AddressPrefix: to.Ptr("*"), - // AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeIPPrefix), - // }}, - // Direction: to.Ptr(armnetwork.SecurityConfigurationRuleDirectionInbound), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("f930553b-f78d-48c5-9445-6cf86b85e615"), - // SourcePortRanges: []*string{ - // to.Ptr("0-65535")}, - // Sources: []*armnetwork.AddressPrefixItem{ - // { - // AddressPrefix: to.Ptr("*"), - // AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeIPPrefix), - // }}, - // Protocol: to.Ptr(armnetwork.SecurityConfigurationRuleProtocolTCP), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); 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:27.000Z"); 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/NetworkManagerSecurityUserRuleGet.json -func ExampleSecurityUserRulesClient_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.NewSecurityUserRulesClient().Get(ctx, "rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", "SampleUserRule", 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.SecurityUserRule = armnetwork.SecurityUserRule{ - // Name: to.Ptr("SampleUserRule"), - // Type: to.Ptr("Microsoft.Network/networkManagers/SecurityUserConfigurations/ruleCollections/rules"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/SecurityUserConfigurations/myTestSecurityConfig/ruleCollections/testRuleCollection/rules/SampleUserRule"), - // Properties: &armnetwork.SecurityUserRulePropertiesFormat{ - // Description: to.Ptr("Sample User Rule"), - // DestinationPortRanges: []*string{ - // to.Ptr("22")}, - // Destinations: []*armnetwork.AddressPrefixItem{ - // { - // AddressPrefix: to.Ptr("*"), - // AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeIPPrefix), - // }}, - // Direction: to.Ptr(armnetwork.SecurityConfigurationRuleDirectionInbound), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("f930553b-f78d-48c5-9445-6cf86b85e615"), - // SourcePortRanges: []*string{ - // to.Ptr("0-65535")}, - // Sources: []*armnetwork.AddressPrefixItem{ - // { - // AddressPrefix: to.Ptr("*"), - // AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeIPPrefix), - // }}, - // Protocol: to.Ptr(armnetwork.SecurityConfigurationRuleProtocolTCP), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); 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:27.000Z"); 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/NetworkManagerSecurityUserRulePut.json -func ExampleSecurityUserRulesClient_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.NewSecurityUserRulesClient().CreateOrUpdate(ctx, "rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", "SampleUserRule", armnetwork.SecurityUserRule{ - Properties: &armnetwork.SecurityUserRulePropertiesFormat{ - Description: to.Ptr("Sample User Rule"), - DestinationPortRanges: []*string{ - to.Ptr("22")}, - Destinations: []*armnetwork.AddressPrefixItem{ - { - AddressPrefix: to.Ptr("*"), - AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeIPPrefix), - }}, - Direction: to.Ptr(armnetwork.SecurityConfigurationRuleDirectionInbound), - SourcePortRanges: []*string{ - to.Ptr("0-65535")}, - Sources: []*armnetwork.AddressPrefixItem{ - { - AddressPrefix: to.Ptr("*"), - AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeIPPrefix), - }}, - 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.SecurityUserRule = armnetwork.SecurityUserRule{ - // Name: to.Ptr("SampleUserRule"), - // Type: to.Ptr("Microsoft.Network/networkManagers/SecurityUserConfigurations/ruleCollections/rules"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/SecurityUserConfigurations/Policy1/ruleCollections/testRuleCollection/rules/SampleUserRule"), - // Properties: &armnetwork.SecurityUserRulePropertiesFormat{ - // Description: to.Ptr("Sample User Rule"), - // DestinationPortRanges: []*string{ - // to.Ptr("22")}, - // Destinations: []*armnetwork.AddressPrefixItem{ - // { - // AddressPrefix: to.Ptr("*"), - // AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeIPPrefix), - // }}, - // Direction: to.Ptr(armnetwork.SecurityConfigurationRuleDirectionInbound), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("f930553b-f78d-48c5-9445-6cf86b85e615"), - // SourcePortRanges: []*string{ - // to.Ptr("0-65535")}, - // Sources: []*armnetwork.AddressPrefixItem{ - // { - // AddressPrefix: to.Ptr("*"), - // AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeIPPrefix), - // }}, - // Protocol: to.Ptr(armnetwork.SecurityConfigurationRuleProtocolTCP), - // }, - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); 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:27.000Z"); 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/NetworkManagerSecurityUserRuleDelete.json -func ExampleSecurityUserRulesClient_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.NewSecurityUserRulesClient().BeginDelete(ctx, "rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", "SampleUserRule", &armnetwork.SecurityUserRulesClientBeginDeleteOptions{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/serviceassociationlinks_client.go b/sdk/resourcemanager/network/armnetwork/serviceassociationlinks_client.go index 88ec56573fd4..9b51ad0cccbd 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 2024-05-01 +// Generated from API version 2024-07-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", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 0eaa9e11ffa2..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/servicecommunity_live_test.go b/sdk/resourcemanager/network/armnetwork/servicecommunity_live_test.go index f1d7b8d84ae9..db57a445dc7a 100644 --- a/sdk/resourcemanager/network/armnetwork/servicecommunity_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/servicecommunity_live_test.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/serviceendpointpolicies_client.go b/sdk/resourcemanager/network/armnetwork/serviceendpointpolicies_client.go index 7191e5fc30b6..4bed21df7b5f 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 2024-05-01 +// Generated from API version 2024-07-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. @@ -74,7 +74,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -116,7 +116,7 @@ func (client *ServiceEndpointPoliciesClient) createOrUpdateCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -128,7 +128,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -154,7 +154,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *ServiceEndpointPoliciesClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, options *ServiceEndpointPoliciesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ServiceEndpointPoliciesClient.BeginDelete" @@ -196,7 +196,7 @@ func (client *ServiceEndpointPoliciesClient) deleteCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -205,7 +205,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -255,7 +255,7 @@ func (client *ServiceEndpointPoliciesClient) getCreateRequest(ctx context.Contex if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -272,7 +272,7 @@ func (client *ServiceEndpointPoliciesClient) getHandleResponse(resp *http.Respon // NewListPager - Gets all the service endpoint policies in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - options - ServiceEndpointPoliciesClientListOptions contains the optional parameters for the ServiceEndpointPoliciesClient.NewListPager // method. func (client *ServiceEndpointPoliciesClient) NewListPager(options *ServiceEndpointPoliciesClientListOptions) *runtime.Pager[ServiceEndpointPoliciesClientListResponse] { @@ -310,7 +310,7 @@ func (client *ServiceEndpointPoliciesClient) listCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -327,7 +327,7 @@ func (client *ServiceEndpointPoliciesClient) listHandleResponse(resp *http.Respo // NewListByResourceGroupPager - Gets all service endpoint Policies in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - ServiceEndpointPoliciesClientListByResourceGroupOptions contains the optional parameters for the ServiceEndpointPoliciesClient.NewListByResourceGroupPager // method. @@ -370,7 +370,7 @@ func (client *ServiceEndpointPoliciesClient) listByResourceGroupCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -388,7 +388,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -436,7 +436,7 @@ func (client *ServiceEndpointPoliciesClient) updateTagsCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 ef1bf3520f5a..000000000000 --- a/sdk/resourcemanager/network/armnetwork/serviceendpointpolicies_client_example_test.go +++ /dev/null @@ -1,397 +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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/serviceEndpointPolicies/testServiceEndpointPolicy/serviceEndpointPolicyDefinitions/StorageServiceEndpointPolicyDefinition"), - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/serviceEndpointPolicies/testServiceEndpointPolicy/serviceEndpointPolicyDefinitions/StorageServiceEndpointPolicyDefinition"), - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/serviceEndpointPolicies/testPolicy/serviceEndpointPolicyDefinitions/StorageServiceEndpointPolicyDefinition1"), - // 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{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/serviceEndpointPolicies/testPolicy1/serviceEndpointPolicyDefinitions/StorageServiceEndpointPolicyDefinition2"), - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/serviceEndpointPolicies/testServiceEndpointPolicy/serviceEndpointPolicyDefinitions/StorageServiceEndpointPolicyDefinition"), - // 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{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/serviceEndpointPolicies/testServiceEndpointPolicy1/serviceEndpointPolicyDefinitions/StorageServiceEndpointPolicyDefinition1"), - // 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/serviceendpointpolicy_live_test.go b/sdk/resourcemanager/network/armnetwork/serviceendpointpolicy_live_test.go index f87876a65cdd..d4f596ded0af 100644 --- a/sdk/resourcemanager/network/armnetwork/serviceendpointpolicy_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/serviceendpointpolicy_live_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/serviceendpointpolicydefinitions_client.go b/sdk/resourcemanager/network/armnetwork/serviceendpointpolicydefinitions_client.go index 6ebb5ac8706c..1ec80b19f0e0 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 2024-05-01 +// Generated from API version 2024-07-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. @@ -75,7 +75,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -121,7 +121,7 @@ func (client *ServiceEndpointPolicyDefinitionsClient) createOrUpdateCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, serviceEndpointPolicyDefinitions); err != nil { @@ -133,7 +133,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -160,7 +160,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -206,7 +206,7 @@ func (client *ServiceEndpointPolicyDefinitionsClient) deleteCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -215,7 +215,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -267,7 +267,7 @@ func (client *ServiceEndpointPolicyDefinitionsClient) getCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -284,7 +284,7 @@ func (client *ServiceEndpointPolicyDefinitionsClient) getHandleResponse(resp *ht // NewListByResourceGroupPager - Gets all service endpoint policy definitions in a service end point policy. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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 @@ -332,7 +332,7 @@ func (client *ServiceEndpointPolicyDefinitionsClient) listByResourceGroupCreateR return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 13f3c0fdda6d..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 f1ec9af1817b..c779a6674a91 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 2024-05-01 +// Generated from API version 2024-07-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). @@ -92,7 +92,7 @@ func (client *ServiceTagInformationClient) listCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 c4426e019ab3..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 0cabf8670061..c59800da986f 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 2024-05-01 +// Generated from API version 2024-07-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", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 666305a69c86..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/servicetags_live_test.go b/sdk/resourcemanager/network/armnetwork/servicetags_live_test.go index 4b663a631264..11147476a3af 100644 --- a/sdk/resourcemanager/network/armnetwork/servicetags_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/servicetags_live_test.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/staticcidrs_client.go b/sdk/resourcemanager/network/armnetwork/staticcidrs_client.go index edaf2fac7872..6fdca3391174 100644 --- a/sdk/resourcemanager/network/armnetwork/staticcidrs_client.go +++ b/sdk/resourcemanager/network/armnetwork/staticcidrs_client.go @@ -48,7 +48,7 @@ func NewStaticCidrsClient(subscriptionID string, credential azcore.TokenCredenti // Create - Creates/Updates the Static CIDR resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - poolName - IP Address Manager Pool resource name. @@ -104,7 +104,7 @@ func (client *StaticCidrsClient) createCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Body != nil { @@ -128,7 +128,7 @@ func (client *StaticCidrsClient) createHandleResponse(resp *http.Response) (Stat // BeginDelete - Delete the Static CIDR resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - poolName - Pool resource name. @@ -155,7 +155,7 @@ func (client *StaticCidrsClient) BeginDelete(ctx context.Context, resourceGroupN // Delete - Delete the Static CIDR resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 func (client *StaticCidrsClient) deleteOperation(ctx context.Context, resourceGroupName string, networkManagerName string, poolName string, staticCidrName string, options *StaticCidrsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "StaticCidrsClient.BeginDelete" @@ -205,7 +205,7 @@ func (client *StaticCidrsClient) deleteCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -214,7 +214,7 @@ func (client *StaticCidrsClient) deleteCreateRequest(ctx context.Context, resour // Get - Gets the specific Static CIDR resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - poolName - Pool resource name. @@ -270,7 +270,7 @@ func (client *StaticCidrsClient) getCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -287,7 +287,7 @@ func (client *StaticCidrsClient) getHandleResponse(resp *http.Response) (StaticC // NewListPager - Gets list of Static CIDR resources at Network Manager level. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - poolName - Pool resource name. @@ -339,7 +339,7 @@ func (client *StaticCidrsClient) listCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") if options != nil && options.Skip != nil { reqQP.Set("skip", strconv.FormatInt(int64(*options.Skip), 10)) } diff --git a/sdk/resourcemanager/network/armnetwork/staticcidrs_client_example_test.go b/sdk/resourcemanager/network/armnetwork/staticcidrs_client_example_test.go deleted file mode 100644 index b10c484a647b..000000000000 --- a/sdk/resourcemanager/network/armnetwork/staticcidrs_client_example_test.go +++ /dev/null @@ -1,174 +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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/StaticCidrs_List.json -func ExampleStaticCidrsClient_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.NewStaticCidrsClient().NewListPager("rg1", "TestNetworkManager", "TestPool", &armnetwork.StaticCidrsClientListOptions{SkipToken: nil, - Skip: nil, - Top: nil, - SortKey: nil, - SortValue: 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.StaticCidrList = armnetwork.StaticCidrList{ - // Value: []*armnetwork.StaticCidr{ - // { - // Name: to.Ptr("TestStaticCidr"), - // Type: to.Ptr("Microsoft.Network/networkManagers/ipamPools/staticCidrs"), - // ID: to.Ptr("/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/TestNetworkManager/ipamPools/TestPool/staticCidrs/TestStaticCidr"), - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); 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:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // Properties: &armnetwork.StaticCidrProperties{ - // Description: to.Ptr("test description"), - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/24")}, - // NumberOfIPAddressesToAllocate: to.Ptr(""), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // TotalNumberOfIPAddresses: to.Ptr("256"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/StaticCidrs_Create.json -func ExampleStaticCidrsClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain 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.NewStaticCidrsClient().Create(ctx, "rg1", "TestNetworkManager", "TestPool", "TestStaticCidr", &armnetwork.StaticCidrsClientCreateOptions{Body: 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.StaticCidr = armnetwork.StaticCidr{ - // Name: to.Ptr("OnPremResources"), - // Type: to.Ptr("Microsoft.Network/networkManagers/ipamPools/TestStaticCidr"), - // ID: to.Ptr("/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/TestNetworkManager/ipamPools/TestPool/staticCidrs/TestStaticCidr"), - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); 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:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // Properties: &armnetwork.StaticCidrProperties{ - // Description: to.Ptr("test description"), - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/24")}, - // NumberOfIPAddressesToAllocate: to.Ptr(""), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/StaticCidrs_Get.json -func ExampleStaticCidrsClient_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.NewStaticCidrsClient().Get(ctx, "rg1", "TestNetworkManager", "TestPool", "TestStaticCidr", 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.StaticCidr = armnetwork.StaticCidr{ - // Name: to.Ptr("TestStaticCidr"), - // Type: to.Ptr("Microsoft.Network/networkManagers/ipamPools/staticCidrs"), - // ID: to.Ptr("/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/TestNetworkManager/ipamPools/TestPool/staticCidrs/TestStaticCidr"), - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); 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:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // Properties: &armnetwork.StaticCidrProperties{ - // Description: to.Ptr("test description"), - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/24")}, - // NumberOfIPAddressesToAllocate: to.Ptr(""), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // TotalNumberOfIPAddresses: to.Ptr("256"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/StaticCidrs_Delete.json -func ExampleStaticCidrsClient_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.NewStaticCidrsClient().BeginDelete(ctx, "rg1", "TestNetworkManager", "TestPool", "TestStaticCidr", 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/staticmembers_client.go b/sdk/resourcemanager/network/armnetwork/staticmembers_client.go index 2679ade15584..d13fd4e805d8 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 2024-05-01 +// Generated from API version 2024-07-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", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 2024-05-01 +// Generated from API version 2024-07-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", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 2024-05-01 +// Generated from API version 2024-07-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", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - networkGroupName - The name of the network group. @@ -322,7 +322,7 @@ func (client *StaticMembersClient) listCreateRequest(ctx context.Context, resour if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil 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 503d94c4485d..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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:27.000Z"); 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:27.000Z"); 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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:27.000Z"); 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:27.000Z"); 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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:27.000Z"); 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:27.000Z"); 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 c2a1e3030408..e0c3014005be 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkName - The name of the virtual network. // - subnetName - The name of the subnet. @@ -75,7 +75,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -121,7 +121,7 @@ func (client *SubnetsClient) createOrUpdateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, subnetParameters); err != nil { @@ -133,7 +133,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkName - The name of the virtual network. // - subnetName - The name of the subnet. @@ -159,7 +159,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -205,7 +205,7 @@ func (client *SubnetsClient) deleteCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -214,7 +214,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkName - The name of the virtual network. // - subnetName - The name of the subnet. @@ -268,7 +268,7 @@ func (client *SubnetsClient) getCreateRequest(ctx context.Context, resourceGroup if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -285,7 +285,7 @@ func (client *SubnetsClient) getHandleResponse(resp *http.Response) (SubnetsClie // NewListPager - Gets all subnets in a virtual network. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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. @@ -332,7 +332,7 @@ func (client *SubnetsClient) listCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -350,7 +350,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkName - The name of the virtual network. // - subnetName - The name of the subnet. @@ -378,7 +378,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -424,7 +424,7 @@ func (client *SubnetsClient) prepareNetworkPoliciesCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, prepareNetworkPoliciesRequestParameters); err != nil { @@ -436,7 +436,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkName - The name of the virtual network. // - subnetName - The name of the subnet. @@ -464,7 +464,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -510,7 +510,7 @@ func (client *SubnetsClient) unprepareNetworkPoliciesCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 35df29329f02..000000000000 --- a/sdk/resourcemanager/network/armnetwork/subnets_client_example_test.go +++ /dev/null @@ -1,452 +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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/SubnetGetWithSharingScope.json -func ExampleSubnetsClient_Get_getSubnetWithSharingScope() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain 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"), - // DefaultOutboundAccess: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SharingScope: to.Ptr(armnetwork.SharingScopeTenant), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/SubnetCreateServiceEndpointNetworkIdentifier.json -func ExampleSubnetsClient_BeginCreateOrUpdate_createSubnetWithServiceEndpointsWithNetworkIdentifier() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", 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{ - { - NetworkIdentifier: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/subnet-test/providers/Microsoft.Network/publicIPAddresses/test-ip"), - }, - 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)")}, - // NetworkIdentifier: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/subnet-test/providers/Microsoft.Network/publicIPAddresses/test-ip"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Service: to.Ptr("Microsoft.Storage"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/SubnetCreateWithSharingScope.json -func ExampleSubnetsClient_BeginCreateOrUpdate_createSubnetWithSharingScope() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", 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"), - // DefaultOutboundAccess: to.Ptr(false), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SharingScope: to.Ptr(armnetwork.SharingScopeTenant), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 17cddc29cefb..7f1e20e0ce1f 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 2024-05-01 +// Generated from API version 2024-07-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", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 2024-05-01 +// Generated from API version 2024-07-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", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 2024-05-01 +// Generated from API version 2024-07-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", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 2024-05-01 +// Generated from API version 2024-07-01 // - options - SubscriptionNetworkManagerConnectionsClientListOptions contains the optional parameters for the SubscriptionNetworkManagerConnectionsClient.NewListPager // method. func (client *SubscriptionNetworkManagerConnectionsClient) NewListPager(options *SubscriptionNetworkManagerConnectionsClientListOptions) *runtime.Pager[SubscriptionNetworkManagerConnectionsClientListResponse] { @@ -265,7 +265,7 @@ func (client *SubscriptionNetworkManagerConnectionsClient) listCreateRequest(ctx if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil 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 2da2a71b0371..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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:27.000Z"); 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:27.000Z"); 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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:27.000Z"); 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:27.000Z"); 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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:27.000Z"); 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:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/usage_live_test.go b/sdk/resourcemanager/network/armnetwork/usage_live_test.go index 8209a2f17573..6ebb01fa8f55 100644 --- a/sdk/resourcemanager/network/armnetwork/usage_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/usage_live_test.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/usages_client.go b/sdk/resourcemanager/network/armnetwork/usages_client.go index 83fc19a28178..f21414baadf9 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 2024-05-01 +// Generated from API version 2024-07-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] { @@ -88,7 +88,7 @@ func (client *UsagesClient) listCreateRequest(ctx context.Context, location stri return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 c0ff109a20e9..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/verifierworkspaces_client.go b/sdk/resourcemanager/network/armnetwork/verifierworkspaces_client.go index e79397af3b1e..2058eb1949b3 100644 --- a/sdk/resourcemanager/network/armnetwork/verifierworkspaces_client.go +++ b/sdk/resourcemanager/network/armnetwork/verifierworkspaces_client.go @@ -48,7 +48,7 @@ func NewVerifierWorkspacesClient(subscriptionID string, credential azcore.TokenC // Create - Creates Verifier Workspace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - workspaceName - Workspace name. @@ -101,7 +101,7 @@ func (client *VerifierWorkspacesClient) createCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -122,7 +122,7 @@ func (client *VerifierWorkspacesClient) createHandleResponse(resp *http.Response // BeginDelete - Deletes Verifier Workspace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - workspaceName - Workspace name. @@ -149,7 +149,7 @@ func (client *VerifierWorkspacesClient) BeginDelete(ctx context.Context, resourc // Delete - Deletes Verifier Workspace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 func (client *VerifierWorkspacesClient) deleteOperation(ctx context.Context, resourceGroupName string, networkManagerName string, workspaceName string, options *VerifierWorkspacesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VerifierWorkspacesClient.BeginDelete" @@ -195,7 +195,7 @@ func (client *VerifierWorkspacesClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -204,7 +204,7 @@ func (client *VerifierWorkspacesClient) deleteCreateRequest(ctx context.Context, // Get - Gets Verifier Workspace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - workspaceName - Workspace name. @@ -255,7 +255,7 @@ func (client *VerifierWorkspacesClient) getCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -272,7 +272,7 @@ func (client *VerifierWorkspacesClient) getHandleResponse(resp *http.Response) ( // NewListPager - Gets list of Verifier Workspaces. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - options - VerifierWorkspacesClientListOptions contains the optional parameters for the VerifierWorkspacesClient.NewListPager @@ -320,7 +320,7 @@ func (client *VerifierWorkspacesClient) listCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") if options != nil && options.Skip != nil { reqQP.Set("skip", strconv.FormatInt(int64(*options.Skip), 10)) } @@ -353,7 +353,7 @@ func (client *VerifierWorkspacesClient) listHandleResponse(resp *http.Response) // Update - Updates Verifier Workspace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - workspaceName - Workspace name. @@ -405,7 +405,7 @@ func (client *VerifierWorkspacesClient) updateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Body != nil { diff --git a/sdk/resourcemanager/network/armnetwork/verifierworkspaces_client_example_test.go b/sdk/resourcemanager/network/armnetwork/verifierworkspaces_client_example_test.go deleted file mode 100644 index 72add1a1c6ca..000000000000 --- a/sdk/resourcemanager/network/armnetwork/verifierworkspaces_client_example_test.go +++ /dev/null @@ -1,213 +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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/VerifierWorkspaceList.json -func ExampleVerifierWorkspacesClient_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.NewVerifierWorkspacesClient().NewListPager("rg1", "testNetworkManager", &armnetwork.VerifierWorkspacesClientListOptions{SkipToken: nil, - Skip: nil, - Top: nil, - SortKey: nil, - SortValue: 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.VerifierWorkspaceListResult = armnetwork.VerifierWorkspaceListResult{ - // Value: []*armnetwork.VerifierWorkspace{ - // { - // Name: to.Ptr("testVerifierWorkspace1"), - // Type: to.Ptr("Microsoft.Network/networkManagers/verifierWorkspaces"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/verifierWorkspaces/testVerifierWorkspace1"), - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); 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:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.VerifierWorkspaceProperties{ - // Description: to.Ptr("A sample verfier workspace"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/VerifierWorkspaceGet.json -func ExampleVerifierWorkspacesClient_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.NewVerifierWorkspacesClient().Get(ctx, "rg1", "testNetworkManager", "testWorkspace", 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.VerifierWorkspace = armnetwork.VerifierWorkspace{ - // Name: to.Ptr("testWorkspace"), - // Type: to.Ptr("Microsoft.Network/networkManagers/verifierWorkspaces"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/verifierWorkspaces/testWorkspace"), - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); 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:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.VerifierWorkspaceProperties{ - // Description: to.Ptr("A sample workspace"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/VerifierWorkspacePut.json -func ExampleVerifierWorkspacesClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain 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.NewVerifierWorkspacesClient().Create(ctx, "rg1", "testNetworkManager", "testWorkspace", armnetwork.VerifierWorkspace{ - Location: to.Ptr("eastus"), - Properties: &armnetwork.VerifierWorkspaceProperties{ - Description: to.Ptr("A sample workspace"), - }, - }, 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.VerifierWorkspace = armnetwork.VerifierWorkspace{ - // Name: to.Ptr("testWorkspace"), - // Type: to.Ptr("Microsoft.Network/networkManagers/verifierWorkspaces"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/verifierWorkspaces/testWorkspace"), - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); 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:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Properties: &armnetwork.VerifierWorkspaceProperties{ - // Description: to.Ptr("A sample workspace"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/VerifierWorkspacePatch.json -func ExampleVerifierWorkspacesClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain 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.NewVerifierWorkspacesClient().Update(ctx, "rg1", "testNetworkManager", "testWorkspace", &armnetwork.VerifierWorkspacesClientUpdateOptions{Body: 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.VerifierWorkspace = armnetwork.VerifierWorkspace{ - // Name: to.Ptr("testWorkspace"), - // Type: to.Ptr("Microsoft.Network/networkManagers/verifierWorkspaces"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/verifierWorkspaces/testWorkspace"), - // SystemData: &armnetwork.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-11T18:52:27.000Z"); 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:27.000Z"); return t}()), - // LastModifiedBy: to.Ptr("b69a9388-9488-4534-b470-7ec6d41beef5"), - // LastModifiedByType: to.Ptr(armnetwork.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "color": to.Ptr("blue"), - // }, - // Properties: &armnetwork.VerifierWorkspaceProperties{ - // Description: to.Ptr("A sample workspace"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/VerifierWorkspaceDelete.json -func ExampleVerifierWorkspacesClient_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.NewVerifierWorkspacesClient().BeginDelete(ctx, "rg1", "testNetworkManager", "testWorkspace", 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/vipswap_client.go b/sdk/resourcemanager/network/armnetwork/vipswap_client.go index 22f2fc392351..1656410e4dde 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 2024-05-01 +// Generated from API version 2024-07-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. @@ -72,7 +72,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -115,7 +115,7 @@ func (client *VipSwapClient) createCreateRequest(ctx context.Context, groupName return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -128,7 +128,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -175,7 +175,7 @@ func (client *VipSwapClient) getCreateRequest(ctx context.Context, groupName str return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -194,7 +194,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -240,7 +240,7 @@ func (client *VipSwapClient) listCreateRequest(ctx context.Context, groupName st return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 6f6182a28bb2..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 eaec923da35e..f9ca6244a3b7 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkVirtualApplianceName - The name of the Network Virtual Appliance. // - connectionName - The name of the NVA connection. @@ -76,7 +76,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -122,7 +122,7 @@ func (client *VirtualApplianceConnectionsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, networkVirtualApplianceConnectionParameters); err != nil { @@ -134,7 +134,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkVirtualApplianceName - The name of the Network Virtual Appliance. // - connectionName - The name of the NVA connection. @@ -161,7 +161,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -207,7 +207,7 @@ func (client *VirtualApplianceConnectionsClient) deleteCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -216,7 +216,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkVirtualApplianceName - The name of the Network Virtual Appliance. // - connectionName - The name of the NVA connection. @@ -268,7 +268,7 @@ func (client *VirtualApplianceConnectionsClient) getCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -285,7 +285,7 @@ func (client *VirtualApplianceConnectionsClient) getHandleResponse(resp *http.Re // NewListPager - Lists NetworkVirtualApplianceConnections under the NVA. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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 @@ -333,7 +333,7 @@ func (client *VirtualApplianceConnectionsClient) listCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 b103e1289b73..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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.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")}, - }, - }, - 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.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")}, - // }, - // }, - // TunnelIdentifier: to.Ptr[int64](0), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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.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")}, - // }, - // }, - // TunnelIdentifier: to.Ptr[int64](0), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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.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")}, - // }, - // }, - // TunnelIdentifier: to.Ptr[int64](0), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/virtualappliances_client.go b/sdk/resourcemanager/network/armnetwork/virtualappliances_client.go index 980e7addad4a..4231c7323102 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 2024-05-01 +// Generated from API version 2024-07-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. @@ -74,7 +74,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -116,7 +116,7 @@ func (client *VirtualAppliancesClient) createOrUpdateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -128,7 +128,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -154,7 +154,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *VirtualAppliancesClient) deleteOperation(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, options *VirtualAppliancesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualAppliancesClient.BeginDelete" @@ -196,7 +196,7 @@ func (client *VirtualAppliancesClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -205,7 +205,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -254,7 +254,7 @@ func (client *VirtualAppliancesClient) getCreateRequest(ctx context.Context, res if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -269,9 +269,94 @@ func (client *VirtualAppliancesClient) getHandleResponse(resp *http.Response) (V return result, nil } +// BeginGetBootDiagnosticLogs - Retrieves the boot diagnostic logs for a VM instance belonging to the specified Network Virtual +// Appliance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-07-01 +// - resourceGroupName - The name of the resource group. +// - networkVirtualApplianceName - The name of Network Virtual Appliance. +// - options - VirtualAppliancesClientBeginGetBootDiagnosticLogsOptions contains the optional parameters for the VirtualAppliancesClient.BeginGetBootDiagnosticLogs +// method. +func (client *VirtualAppliancesClient) BeginGetBootDiagnosticLogs(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, options *VirtualAppliancesClientBeginGetBootDiagnosticLogsOptions) (*runtime.Poller[VirtualAppliancesClientGetBootDiagnosticLogsResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.getBootDiagnosticLogs(ctx, resourceGroupName, networkVirtualApplianceName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualAppliancesClientGetBootDiagnosticLogsResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualAppliancesClientGetBootDiagnosticLogsResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// GetBootDiagnosticLogs - Retrieves the boot diagnostic logs for a VM instance belonging to the specified Network Virtual +// Appliance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-07-01 +func (client *VirtualAppliancesClient) getBootDiagnosticLogs(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, options *VirtualAppliancesClientBeginGetBootDiagnosticLogsOptions) (*http.Response, error) { + var err error + const operationName = "VirtualAppliancesClient.BeginGetBootDiagnosticLogs" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getBootDiagnosticLogsCreateRequest(ctx, resourceGroupName, networkVirtualApplianceName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// getBootDiagnosticLogsCreateRequest creates the GetBootDiagnosticLogs request. +func (client *VirtualAppliancesClient) getBootDiagnosticLogsCreateRequest(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, options *VirtualAppliancesClientBeginGetBootDiagnosticLogsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/getBootDiagnosticLogs" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkVirtualApplianceName == "" { + return nil, errors.New("parameter networkVirtualApplianceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkVirtualApplianceName}", url.PathEscape(networkVirtualApplianceName)) + 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", "2024-07-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if options != nil && options.InstanceID != nil { + if err := runtime.MarshalAsJSON(req, *options.InstanceID); err != nil { + return nil, err + } + return req, nil + } + return req, nil +} + // NewListPager - Gets all Network Virtual Appliances in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - options - VirtualAppliancesClientListOptions contains the optional parameters for the VirtualAppliancesClient.NewListPager // method. func (client *VirtualAppliancesClient) NewListPager(options *VirtualAppliancesClientListOptions) *runtime.Pager[VirtualAppliancesClientListResponse] { @@ -309,7 +394,7 @@ func (client *VirtualAppliancesClient) listCreateRequest(ctx context.Context, op return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -326,7 +411,7 @@ func (client *VirtualAppliancesClient) listHandleResponse(resp *http.Response) ( // NewListByResourceGroupPager - Lists all Network Virtual Appliances in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - VirtualAppliancesClientListByResourceGroupOptions contains the optional parameters for the VirtualAppliancesClient.NewListByResourceGroupPager // method. @@ -369,7 +454,7 @@ func (client *VirtualAppliancesClient) listByResourceGroupCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -384,10 +469,93 @@ func (client *VirtualAppliancesClient) listByResourceGroupHandleResponse(resp *h return result, nil } +// BeginReimage - Reimages one VM belonging to the specified Network Virtual Appliance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-07-01 +// - resourceGroupName - The name of the resource group. +// - networkVirtualApplianceName - The name of Network Virtual Appliance. +// - options - VirtualAppliancesClientBeginReimageOptions contains the optional parameters for the VirtualAppliancesClient.BeginReimage +// method. +func (client *VirtualAppliancesClient) BeginReimage(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, options *VirtualAppliancesClientBeginReimageOptions) (*runtime.Poller[VirtualAppliancesClientReimageResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.reimage(ctx, resourceGroupName, networkVirtualApplianceName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualAppliancesClientReimageResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualAppliancesClientReimageResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Reimage - Reimages one VM belonging to the specified Network Virtual Appliance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-07-01 +func (client *VirtualAppliancesClient) reimage(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, options *VirtualAppliancesClientBeginReimageOptions) (*http.Response, error) { + var err error + const operationName = "VirtualAppliancesClient.BeginReimage" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.reimageCreateRequest(ctx, resourceGroupName, networkVirtualApplianceName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// reimageCreateRequest creates the Reimage request. +func (client *VirtualAppliancesClient) reimageCreateRequest(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, options *VirtualAppliancesClientBeginReimageOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/reimage" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkVirtualApplianceName == "" { + return nil, errors.New("parameter networkVirtualApplianceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkVirtualApplianceName}", url.PathEscape(networkVirtualApplianceName)) + 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", "2024-07-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if options != nil && options.NetworkVirtualApplianceInstanceIDs != nil { + if err := runtime.MarshalAsJSON(req, *options.NetworkVirtualApplianceInstanceIDs); err != nil { + return nil, err + } + return req, nil + } + return req, nil +} + // BeginRestart - Restarts one or more VMs belonging to the specified Network Virtual Appliance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkVirtualApplianceName - The name of Network Virtual Appliance. // - options - VirtualAppliancesClientBeginRestartOptions contains the optional parameters for the VirtualAppliancesClient.BeginRestart @@ -413,7 +581,7 @@ func (client *VirtualAppliancesClient) BeginRestart(ctx context.Context, resourc // Restart - Restarts one or more VMs belonging to the specified Network Virtual Appliance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 func (client *VirtualAppliancesClient) restart(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, options *VirtualAppliancesClientBeginRestartOptions) (*http.Response, error) { var err error const operationName = "VirtualAppliancesClient.BeginRestart" @@ -455,7 +623,7 @@ func (client *VirtualAppliancesClient) restartCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.NetworkVirtualApplianceInstanceIDs != nil { @@ -470,7 +638,7 @@ func (client *VirtualAppliancesClient) restartCreateRequest(ctx context.Context, // UpdateTags - Updates a Network Virtual Appliance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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. @@ -518,7 +686,7 @@ func (client *VirtualAppliancesClient) updateTagsCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 b8e29982c022..000000000000 --- a/sdk/resourcemanager/network/armnetwork/virtualappliances_client_example_test.go +++ /dev/null @@ -1,916 +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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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"), - // }}, - // InternetIngressPublicIPs: []*armnetwork.InternetIngressPublicIPsProperties{ - // { - // ID: to.Ptr("/subscriptions/{{subscriptionId}}/resourceGroups/{{rg}}/providers/Microsoft.Network/publicIPAddresses/slbip"), - // }}, - // NetworkProfile: &armnetwork.VirtualAppliancePropertiesFormatNetworkProfile{ - // NetworkInterfaceConfigurations: []*armnetwork.VirtualApplianceNetworkInterfaceConfiguration{ - // { - // NicType: to.Ptr(armnetwork.NicTypeInRequestPublicNic), - // Properties: &armnetwork.VirtualApplianceNetworkInterfaceConfigurationProperties{ - // IPConfigurations: []*armnetwork.VirtualApplianceIPConfiguration{ - // { - // Name: to.Ptr("publicnicipconfig"), - // Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ - // Primary: to.Ptr(true), - // }, - // }, - // { - // Name: to.Ptr("publicnicipconfig-2"), - // Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ - // Primary: to.Ptr(false), - // }, - // }}, - // }, - // }, - // { - // NicType: to.Ptr(armnetwork.NicTypeInRequestPrivateNic), - // Properties: &armnetwork.VirtualApplianceNetworkInterfaceConfigurationProperties{ - // IPConfigurations: []*armnetwork.VirtualApplianceIPConfiguration{ - // { - // Name: to.Ptr("privatenicipconfig"), - // Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ - // Primary: to.Ptr(true), - // }, - // }, - // { - // Name: to.Ptr("privatenicipconfig-2"), - // Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ - // Primary: to.Ptr(false), - // }, - // }}, - // }, - // }}, - // }, - // 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"), - // NicType: to.Ptr(armnetwork.NicTypeInResponsePublicNic), - // PrivateIPAddress: to.Ptr("192.168.12.1"), - // PublicIPAddress: to.Ptr("40.30.2.2"), - // }, - // { - // Name: to.Ptr("publicnicipconfig-2"), - // InstanceName: to.Ptr("nva_0"), - // NicType: to.Ptr(armnetwork.NicTypeInResponsePublicNic), - // PrivateIPAddress: to.Ptr("192.168.12.2"), - // PublicIPAddress: to.Ptr("40.30.2.3"), - // }, - // { - // Name: to.Ptr("privatenicipconfig"), - // InstanceName: to.Ptr("nva_0"), - // NicType: to.Ptr(armnetwork.NicTypeInResponsePrivateNic), - // PrivateIPAddress: to.Ptr("192.168.12.3"), - // PublicIPAddress: to.Ptr(""), - // }, - // { - // Name: to.Ptr("privatenicipconfig-2"), - // InstanceName: to.Ptr("nva_0"), - // NicType: to.Ptr(armnetwork.NicTypeInResponsePrivateNic), - // PrivateIPAddress: to.Ptr("192.168.12.4"), - // PublicIPAddress: to.Ptr(""), - // }, - // { - // Name: to.Ptr("exrsdwan"), - // InstanceName: to.Ptr("nva_0"), - // NicType: to.Ptr(armnetwork.NicTypeInResponseAdditionalNic), - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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")}, - InternetIngressPublicIPs: []*armnetwork.InternetIngressPublicIPsProperties{ - { - ID: to.Ptr("/subscriptions/{{subscriptionId}}/resourceGroups/{{rg}}/providers/Microsoft.Network/publicIPAddresses/slbip"), - }}, - NetworkProfile: &armnetwork.VirtualAppliancePropertiesFormatNetworkProfile{ - NetworkInterfaceConfigurations: []*armnetwork.VirtualApplianceNetworkInterfaceConfiguration{ - { - NicType: to.Ptr(armnetwork.NicTypeInRequestPublicNic), - Properties: &armnetwork.VirtualApplianceNetworkInterfaceConfigurationProperties{ - IPConfigurations: []*armnetwork.VirtualApplianceIPConfiguration{ - { - Name: to.Ptr("publicnicipconfig"), - Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ - Primary: to.Ptr(true), - }, - }, - { - Name: to.Ptr("publicnicipconfig-2"), - Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ - Primary: to.Ptr(false), - }, - }}, - }, - }, - { - NicType: to.Ptr(armnetwork.NicTypeInRequestPrivateNic), - Properties: &armnetwork.VirtualApplianceNetworkInterfaceConfigurationProperties{ - IPConfigurations: []*armnetwork.VirtualApplianceIPConfiguration{ - { - Name: to.Ptr("privatenicipconfig"), - Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ - Primary: to.Ptr(true), - }, - }, - { - Name: to.Ptr("privatenicipconfig-2"), - Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ - Primary: to.Ptr(false), - }, - }}, - }, - }}, - }, - 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{ - // 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"), - // }}, - // InternetIngressPublicIPs: []*armnetwork.InternetIngressPublicIPsProperties{ - // { - // ID: to.Ptr("/subscriptions/{{subscriptionId}}/resourceGroups/{{rg}}/providers/Microsoft.Network/publicIPAddresses/slbip"), - // }}, - // NetworkProfile: &armnetwork.VirtualAppliancePropertiesFormatNetworkProfile{ - // NetworkInterfaceConfigurations: []*armnetwork.VirtualApplianceNetworkInterfaceConfiguration{ - // { - // NicType: to.Ptr(armnetwork.NicTypeInRequestPublicNic), - // Properties: &armnetwork.VirtualApplianceNetworkInterfaceConfigurationProperties{ - // IPConfigurations: []*armnetwork.VirtualApplianceIPConfiguration{ - // { - // Name: to.Ptr("publicnicipconfig"), - // Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ - // Primary: to.Ptr(true), - // }, - // }, - // { - // Name: to.Ptr("publicnicipconfig-2"), - // Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ - // Primary: to.Ptr(false), - // }, - // }}, - // }, - // }, - // { - // NicType: to.Ptr(armnetwork.NicTypeInRequestPrivateNic), - // Properties: &armnetwork.VirtualApplianceNetworkInterfaceConfigurationProperties{ - // IPConfigurations: []*armnetwork.VirtualApplianceIPConfiguration{ - // { - // Name: to.Ptr("privatenicipconfig"), - // Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ - // Primary: to.Ptr(true), - // }, - // }, - // { - // Name: to.Ptr("privatenicipconfig-2"), - // Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ - // Primary: to.Ptr(false), - // }, - // }}, - // }, - // }}, - // }, - // 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"), - // NicType: to.Ptr(armnetwork.NicTypeInResponsePublicNic), - // PrivateIPAddress: to.Ptr("192.168.12.1"), - // PublicIPAddress: to.Ptr("40.30.2.2"), - // }, - // { - // Name: to.Ptr("publicnicipconfig-2"), - // InstanceName: to.Ptr("nva_0"), - // NicType: to.Ptr(armnetwork.NicTypeInResponsePublicNic), - // PrivateIPAddress: to.Ptr("192.168.12.2"), - // PublicIPAddress: to.Ptr("40.30.2.3"), - // }, - // { - // Name: to.Ptr("privatenicipconfig"), - // InstanceName: to.Ptr("nva_0"), - // NicType: to.Ptr(armnetwork.NicTypeInResponsePrivateNic), - // PrivateIPAddress: to.Ptr("192.168.12.3"), - // PublicIPAddress: to.Ptr(""), - // }, - // { - // Name: to.Ptr("privatenicipconfig-2"), - // InstanceName: to.Ptr("nva_0"), - // NicType: to.Ptr(armnetwork.NicTypeInResponsePrivateNic), - // PrivateIPAddress: to.Ptr("192.168.12.4"), - // PublicIPAddress: to.Ptr(""), - // }, - // { - // Name: to.Ptr("exrsdwan"), - // InstanceName: to.Ptr("nva_0"), - // NicType: to.Ptr(armnetwork.NicTypeInResponseAdditionalNic), - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/NetworkVirtualApplianceEmptyRestart.json -func ExampleVirtualAppliancesClient_BeginRestart_restartAllNetworkVirtualApplianceVMsInVmScaleSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", 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().BeginRestart(ctx, "rg1", "nva", &armnetwork.VirtualAppliancesClientBeginRestartOptions{NetworkVirtualApplianceInstanceIDs: 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.VirtualApplianceInstanceIDs = armnetwork.VirtualApplianceInstanceIDs{ - // InstanceIDs: []*string{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/NetworkVirtualApplianceSpecificRestart.json -func ExampleVirtualAppliancesClient_BeginRestart_restartSpecificNetworkVirtualApplianceVMsInVmScaleSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", 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().BeginRestart(ctx, "rg1", "nva", &armnetwork.VirtualAppliancesClientBeginRestartOptions{NetworkVirtualApplianceInstanceIDs: 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.VirtualApplianceInstanceIDs = armnetwork.VirtualApplianceInstanceIDs{ - // InstanceIDs: []*string{ - // to.Ptr("0"), - // to.Ptr("1")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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{ - // 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"), - // }}, - // InternetIngressPublicIPs: []*armnetwork.InternetIngressPublicIPsProperties{ - // { - // ID: to.Ptr("/subscriptions/{{subscriptionId}}/resourceGroups/{{rg}}/providers/Microsoft.Network/publicIPAddresses/slbip"), - // }}, - // NetworkProfile: &armnetwork.VirtualAppliancePropertiesFormatNetworkProfile{ - // NetworkInterfaceConfigurations: []*armnetwork.VirtualApplianceNetworkInterfaceConfiguration{ - // { - // NicType: to.Ptr(armnetwork.NicTypeInRequestPublicNic), - // Properties: &armnetwork.VirtualApplianceNetworkInterfaceConfigurationProperties{ - // IPConfigurations: []*armnetwork.VirtualApplianceIPConfiguration{ - // { - // Name: to.Ptr("publicnicipconfig"), - // Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ - // Primary: to.Ptr(true), - // }, - // }, - // { - // Name: to.Ptr("publicnicipconfig-2"), - // Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ - // Primary: to.Ptr(false), - // }, - // }}, - // }, - // }, - // { - // NicType: to.Ptr(armnetwork.NicTypeInRequestPrivateNic), - // Properties: &armnetwork.VirtualApplianceNetworkInterfaceConfigurationProperties{ - // IPConfigurations: []*armnetwork.VirtualApplianceIPConfiguration{ - // { - // Name: to.Ptr("privatenicipconfig"), - // Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ - // Primary: to.Ptr(true), - // }, - // }, - // { - // Name: to.Ptr("privatenicipconfig-2"), - // Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ - // Primary: to.Ptr(false), - // }, - // }}, - // }, - // }}, - // }, - // 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"), - // NicType: to.Ptr(armnetwork.NicTypeInResponsePublicNic), - // PrivateIPAddress: to.Ptr("192.168.12.1"), - // PublicIPAddress: to.Ptr("40.30.2.2"), - // }, - // { - // Name: to.Ptr("publicnicipconfig-2"), - // InstanceName: to.Ptr("nva_0"), - // NicType: to.Ptr(armnetwork.NicTypeInResponsePublicNic), - // PrivateIPAddress: to.Ptr("192.168.12.2"), - // PublicIPAddress: to.Ptr("40.30.2.3"), - // }, - // { - // Name: to.Ptr("privatenicipconfig"), - // InstanceName: to.Ptr("nva_0"), - // NicType: to.Ptr(armnetwork.NicTypeInResponsePrivateNic), - // PrivateIPAddress: to.Ptr("192.168.12.3"), - // PublicIPAddress: to.Ptr(""), - // }, - // { - // Name: to.Ptr("privatenicipconfig-2"), - // InstanceName: to.Ptr("nva_0"), - // NicType: to.Ptr(armnetwork.NicTypeInResponsePrivateNic), - // PrivateIPAddress: to.Ptr("192.168.12.4"), - // PublicIPAddress: to.Ptr(""), - // }, - // { - // Name: to.Ptr("exrsdwan"), - // InstanceName: to.Ptr("nva_0"), - // NicType: to.Ptr(armnetwork.NicTypeInResponseAdditionalNic), - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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{ - // 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"), - // }}, - // InternetIngressPublicIPs: []*armnetwork.InternetIngressPublicIPsProperties{ - // { - // ID: to.Ptr("/subscriptions/{{subscriptionId}}/resourceGroups/{{rg}}/providers/Microsoft.Network/publicIPAddresses/slbip"), - // }}, - // NetworkProfile: &armnetwork.VirtualAppliancePropertiesFormatNetworkProfile{ - // NetworkInterfaceConfigurations: []*armnetwork.VirtualApplianceNetworkInterfaceConfiguration{ - // { - // NicType: to.Ptr(armnetwork.NicTypeInRequestPublicNic), - // Properties: &armnetwork.VirtualApplianceNetworkInterfaceConfigurationProperties{ - // IPConfigurations: []*armnetwork.VirtualApplianceIPConfiguration{ - // { - // Name: to.Ptr("publicnicipconfig"), - // Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ - // Primary: to.Ptr(true), - // }, - // }, - // { - // Name: to.Ptr("publicnicipconfig-2"), - // Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ - // Primary: to.Ptr(false), - // }, - // }}, - // }, - // }, - // { - // NicType: to.Ptr(armnetwork.NicTypeInRequestPrivateNic), - // Properties: &armnetwork.VirtualApplianceNetworkInterfaceConfigurationProperties{ - // IPConfigurations: []*armnetwork.VirtualApplianceIPConfiguration{ - // { - // Name: to.Ptr("privatenicipconfig"), - // Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ - // Primary: to.Ptr(true), - // }, - // }, - // { - // Name: to.Ptr("privatenicipconfig-2"), - // Properties: &armnetwork.VirtualApplianceIPConfigurationProperties{ - // Primary: to.Ptr(false), - // }, - // }}, - // }, - // }}, - // }, - // 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"), - // NicType: to.Ptr(armnetwork.NicTypeInResponsePublicNic), - // PrivateIPAddress: to.Ptr("192.168.12.1"), - // PublicIPAddress: to.Ptr("40.30.2.2"), - // }, - // { - // Name: to.Ptr("publicnicipconfig-2"), - // InstanceName: to.Ptr("nva_0"), - // NicType: to.Ptr(armnetwork.NicTypeInResponsePublicNic), - // PrivateIPAddress: to.Ptr("192.168.12.2"), - // PublicIPAddress: to.Ptr("40.30.2.3"), - // }, - // { - // Name: to.Ptr("privatenicipconfig"), - // InstanceName: to.Ptr("nva_0"), - // NicType: to.Ptr(armnetwork.NicTypeInResponsePrivateNic), - // PrivateIPAddress: to.Ptr("192.168.12.3"), - // PublicIPAddress: to.Ptr(""), - // }, - // { - // Name: to.Ptr("privatenicipconfig-2"), - // InstanceName: to.Ptr("nva_0"), - // NicType: to.Ptr(armnetwork.NicTypeInResponsePrivateNic), - // PrivateIPAddress: to.Ptr("192.168.12.4"), - // PublicIPAddress: to.Ptr(""), - // }, - // { - // Name: to.Ptr("exrsdwan"), - // InstanceName: to.Ptr("nva_0"), - // NicType: to.Ptr(armnetwork.NicTypeInResponseAdditionalNic), - // 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"), - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/virtualappliancesites_client.go b/sdk/resourcemanager/network/armnetwork/virtualappliancesites_client.go index df655b0979cc..e50f62d39eb0 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkVirtualApplianceName - The name of the Network Virtual Appliance. // - siteName - The name of the site. @@ -75,7 +75,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -121,7 +121,7 @@ func (client *VirtualApplianceSitesClient) createOrUpdateCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -133,7 +133,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkVirtualApplianceName - The name of the Network Virtual Appliance. // - siteName - The name of the site. @@ -160,7 +160,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -206,7 +206,7 @@ func (client *VirtualApplianceSitesClient) deleteCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -215,7 +215,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkVirtualApplianceName - The name of the Network Virtual Appliance. // - siteName - The name of the site. @@ -267,7 +267,7 @@ func (client *VirtualApplianceSitesClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -284,7 +284,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -332,7 +332,7 @@ func (client *VirtualApplianceSitesClient) listCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 903fd02a26c8..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 eda4bf2c30e6..16fe97a13e07 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 2024-05-01 +// Generated from API version 2024-07-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", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 2024-05-01 +// Generated from API version 2024-07-01 // - options - VirtualApplianceSKUsClientListOptions contains the optional parameters for the VirtualApplianceSKUsClient.NewListPager // method. func (client *VirtualApplianceSKUsClient) NewListPager(options *VirtualApplianceSKUsClientListOptions) *runtime.Pager[VirtualApplianceSKUsClientListResponse] { @@ -144,7 +144,7 @@ func (client *VirtualApplianceSKUsClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 7d97591b192d..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 d9a2826d5d87..9ed011f583ac 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VirtualHub. // - virtualHubName - The name of the VirtualHub. // - connectionName - The name of the connection. @@ -75,7 +75,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -121,7 +121,7 @@ func (client *VirtualHubBgpConnectionClient) createOrUpdateCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -133,7 +133,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VirtualHubBgpConnection. // - virtualHubName - The name of the VirtualHub. // - connectionName - The name of the connection. @@ -160,7 +160,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -206,7 +206,7 @@ func (client *VirtualHubBgpConnectionClient) deleteCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -215,7 +215,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VirtualHub. // - virtualHubName - The name of the VirtualHub. // - connectionName - The name of the connection. @@ -267,7 +267,7 @@ func (client *VirtualHubBgpConnectionClient) getCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 200a16262803..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 fb9a530f13e2..1c1caf4802ba 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 2024-05-01 +// Generated from API version 2024-07-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 @@ -94,7 +94,7 @@ func (client *VirtualHubBgpConnectionsClient) listCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -112,7 +112,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - hubName - The name of the virtual hub. // - connectionName - The name of the virtual hub bgp connection. @@ -139,7 +139,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -185,7 +185,7 @@ func (client *VirtualHubBgpConnectionsClient) listAdvertisedRoutesCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -194,7 +194,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - hubName - The name of the virtual hub. // - connectionName - The name of the virtual hub bgp connection. @@ -221,7 +221,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -267,7 +267,7 @@ func (client *VirtualHubBgpConnectionsClient) listLearnedRoutesCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 59b54a36a7ac..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 3883354cfa51..0bab3050f0ac 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VirtualHub. // - virtualHubName - The name of the VirtualHub. // - ipConfigName - The name of the ipconfig. @@ -75,7 +75,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -121,7 +121,7 @@ func (client *VirtualHubIPConfigurationClient) createOrUpdateCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -133,7 +133,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VirtualHubBgpConnection. // - virtualHubName - The name of the VirtualHub. // - ipConfigName - The name of the ipconfig. @@ -160,7 +160,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -206,7 +206,7 @@ func (client *VirtualHubIPConfigurationClient) deleteCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -215,7 +215,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VirtualHub. // - virtualHubName - The name of the VirtualHub. // - ipConfigName - The name of the ipconfig. @@ -267,7 +267,7 @@ func (client *VirtualHubIPConfigurationClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -284,7 +284,7 @@ func (client *VirtualHubIPConfigurationClient) getHandleResponse(resp *http.Resp // NewListPager - Retrieves the details of all VirtualHubIpConfigurations. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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 @@ -332,7 +332,7 @@ func (client *VirtualHubIPConfigurationClient) listCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 ab9130d8c700..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 4db2ee781c96..36665a04e78c 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VirtualHub. // - virtualHubName - The name of the VirtualHub. // - routeTableName - The name of the VirtualHubRouteTableV2. @@ -75,7 +75,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -121,7 +121,7 @@ func (client *VirtualHubRouteTableV2SClient) createOrUpdateCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, virtualHubRouteTableV2Parameters); err != nil { @@ -133,7 +133,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VirtualHubRouteTableV2. // - virtualHubName - The name of the VirtualHub. // - routeTableName - The name of the VirtualHubRouteTableV2. @@ -160,7 +160,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -206,7 +206,7 @@ func (client *VirtualHubRouteTableV2SClient) deleteCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -215,7 +215,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VirtualHubRouteTableV2. // - virtualHubName - The name of the VirtualHub. // - routeTableName - The name of the VirtualHubRouteTableV2. @@ -267,7 +267,7 @@ func (client *VirtualHubRouteTableV2SClient) getCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -284,7 +284,7 @@ func (client *VirtualHubRouteTableV2SClient) getHandleResponse(resp *http.Respon // NewListPager - Retrieves the details of all VirtualHubRouteTableV2s. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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 @@ -332,7 +332,7 @@ func (client *VirtualHubRouteTableV2SClient) listCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 13aa74dc8482..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 d9fb4e8cf708..1f5a588fbdee 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VirtualHub. // - virtualHubName - The name of the VirtualHub. // - virtualHubParameters - Parameters supplied to create or update VirtualHub. @@ -74,7 +74,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -116,7 +116,7 @@ func (client *VirtualHubsClient) createOrUpdateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, virtualHubParameters); err != nil { @@ -128,7 +128,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -153,7 +153,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *VirtualHubsClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualHubName string, options *VirtualHubsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualHubsClient.BeginDelete" @@ -195,7 +195,7 @@ func (client *VirtualHubsClient) deleteCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -204,7 +204,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -250,7 +250,7 @@ func (client *VirtualHubsClient) getCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -269,7 +269,7 @@ func (client *VirtualHubsClient) getHandleResponse(resp *http.Response) (Virtual // resource . // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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 @@ -296,7 +296,7 @@ func (client *VirtualHubsClient) BeginGetEffectiveVirtualHubRoutes(ctx context.C // . // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 func (client *VirtualHubsClient) getEffectiveVirtualHubRoutes(ctx context.Context, resourceGroupName string, virtualHubName string, options *VirtualHubsClientBeginGetEffectiveVirtualHubRoutesOptions) (*http.Response, error) { var err error const operationName = "VirtualHubsClient.BeginGetEffectiveVirtualHubRoutes" @@ -338,7 +338,7 @@ func (client *VirtualHubsClient) getEffectiveVirtualHubRoutesCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.EffectiveRoutesParameters != nil { @@ -353,7 +353,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -380,7 +380,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -422,7 +422,7 @@ func (client *VirtualHubsClient) getInboundRoutesCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, getInboundRoutesParameters); err != nil { @@ -434,7 +434,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -461,7 +461,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -503,7 +503,7 @@ func (client *VirtualHubsClient) getOutboundRoutesCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, getOutboundRoutesParameters); err != nil { @@ -514,7 +514,7 @@ func (client *VirtualHubsClient) getOutboundRoutesCreateRequest(ctx context.Cont // NewListPager - Lists all the VirtualHubs in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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]{ @@ -551,7 +551,7 @@ func (client *VirtualHubsClient) listCreateRequest(ctx context.Context, options return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -568,7 +568,7 @@ func (client *VirtualHubsClient) listHandleResponse(resp *http.Response) (Virtua // NewListByResourceGroupPager - Lists all the VirtualHubs in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VirtualHub. // - options - VirtualHubsClientListByResourceGroupOptions contains the optional parameters for the VirtualHubsClient.NewListByResourceGroupPager // method. @@ -611,7 +611,7 @@ func (client *VirtualHubsClient) listByResourceGroupCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -629,7 +629,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VirtualHub. // - virtualHubName - The name of the VirtualHub. // - virtualHubParameters - Parameters supplied to update VirtualHub tags. @@ -676,7 +676,7 @@ func (client *VirtualHubsClient) updateTagsCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 692b74398cb1..000000000000 --- a/sdk/resourcemanager/network/armnetwork/virtualhubs_client_example_test.go +++ /dev/null @@ -1,706 +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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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{ - // Value: []*armnetwork.VirtualHubEffectiveRoute{ - // { - // AddressPrefixes: []*string{ - // to.Ptr("10.147.128.0/17")}, - // AsPath: to.Ptr("65520-65520"), - // NextHopType: to.Ptr("Remote Hub"), - // NextHops: []*string{ - // to.Ptr("/subscriptions/testSub/resourceGroups/testRg/providers/Microsoft.Network/virtualHubs/hub0")}, - // RouteOrigin: to.Ptr("/subscriptions/testSub/resourceGroups/testRg/providers/Microsoft.Network/virtualHubs/hub0"), - // }, - // { - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/16")}, - // AsPath: to.Ptr("12076-12076"), - // NextHopType: to.Ptr("ExpressRouteGateway"), - // NextHops: []*string{ - // to.Ptr("/subscriptions/testSub/resourceGroups/testRg/providers/Microsoft.Network/expressRouteGateways/ErGw1")}, - // RouteOrigin: to.Ptr("/subscriptions/testSub/resourceGroups/testRg/providers/Microsoft.Network/expressRouteGateways/ErGw1"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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{ - // Value: []*armnetwork.VirtualHubEffectiveRoute{ - // { - // AddressPrefixes: []*string{ - // to.Ptr("10.147.128.0/17")}, - // AsPath: to.Ptr("65520-65520"), - // NextHopType: to.Ptr("Remote Hub"), - // NextHops: []*string{ - // to.Ptr("/subscriptions/testSub/resourceGroups/testRg/providers/Microsoft.Network/virtualHubs/hub0")}, - // RouteOrigin: to.Ptr("/subscriptions/testSub/resourceGroups/testRg/providers/Microsoft.Network/virtualHubs/hub0"), - // }, - // { - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/16")}, - // AsPath: to.Ptr("12076-12076"), - // NextHopType: to.Ptr("ExpressRouteGateway"), - // NextHops: []*string{ - // to.Ptr("/subscriptions/testSub/resourceGroups/testRg/providers/Microsoft.Network/expressRouteGateways/ErGw1")}, - // RouteOrigin: to.Ptr("/subscriptions/testSub/resourceGroups/testRg/providers/Microsoft.Network/expressRouteGateways/ErGw1"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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{ - // Value: []*armnetwork.VirtualHubEffectiveRoute{ - // { - // AddressPrefixes: []*string{ - // to.Ptr("10.147.128.0/17")}, - // AsPath: to.Ptr("65520-65520"), - // NextHopType: to.Ptr("Remote Hub"), - // NextHops: []*string{ - // to.Ptr("/subscriptions/testSub/resourceGroups/testRg/providers/Microsoft.Network/virtualHubs/hub0")}, - // RouteOrigin: to.Ptr("/subscriptions/testSub/resourceGroups/testRg/providers/Microsoft.Network/virtualHubs/hub0"), - // }, - // { - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/16")}, - // AsPath: to.Ptr("12076-12076"), - // NextHopType: to.Ptr("ExpressRouteGateway"), - // NextHops: []*string{ - // to.Ptr("/subscriptions/testSub/resourceGroups/testRg/providers/Microsoft.Network/expressRouteGateways/ErGw1")}, - // RouteOrigin: to.Ptr("/subscriptions/testSub/resourceGroups/testRg/providers/Microsoft.Network/expressRouteGateways/ErGw1"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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{ - // Value: []*armnetwork.EffectiveRouteMapRoute{ - // { - // AsPath: to.Ptr("65520-65520"), - // BgpCommunities: to.Ptr("4293853166,12076,51004"), - // Prefix: to.Ptr("192.168.50.0/24"), - // }, - // { - // AsPath: to.Ptr("65520-65520-12076-12076"), - // BgpCommunities: to.Ptr("4293787629,12076,51027,4293734188"), - // Prefix: to.Ptr("10.200.0.0/16"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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{ - // Value: []*armnetwork.EffectiveRouteMapRoute{ - // { - // AsPath: to.Ptr("65520-65520"), - // BgpCommunities: to.Ptr("4293853166,12076,51004"), - // Prefix: to.Ptr("192.168.50.0/24"), - // }, - // { - // AsPath: to.Ptr("65520-65520-12076-12076"), - // BgpCommunities: to.Ptr("4293787629,12076,51027,4293734188"), - // Prefix: to.Ptr("10.200.0.0/16"), - // }}, - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/virtualnetwork_live_test.go b/sdk/resourcemanager/network/armnetwork/virtualnetwork_live_test.go index 8db5e9619900..333f62f2acbe 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualnetwork_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/virtualnetwork_live_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/virtualnetworkgateway_live_test.go b/sdk/resourcemanager/network/armnetwork/virtualnetworkgateway_live_test.go index 248784fac28f..80d5d97ddc99 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualnetworkgateway_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/virtualnetworkgateway_live_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/virtualnetworkgatewayconnections_client.go b/sdk/resourcemanager/network/armnetwork/virtualnetworkgatewayconnections_client.go index d91656dfd2c1..482cdbb0aad6 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 2024-05-01 +// Generated from API version 2024-07-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. @@ -74,7 +74,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -116,7 +116,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) createOrUpdateCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -128,7 +128,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -154,7 +154,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *VirtualNetworkGatewayConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, options *VirtualNetworkGatewayConnectionsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewayConnectionsClient.BeginDelete" @@ -196,7 +196,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) deleteCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -205,7 +205,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -252,7 +252,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) getCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -270,7 +270,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -296,7 +296,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *VirtualNetworkGatewayConnectionsClient) getIkeSas(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, options *VirtualNetworkGatewayConnectionsClientBeginGetIkeSasOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewayConnectionsClient.BeginGetIkeSas" @@ -338,7 +338,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) getIkeSasCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -348,7 +348,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -395,7 +395,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) getSharedKeyCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -413,7 +413,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) getSharedKeyHandleResponse // NewListPager - The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections // created. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - VirtualNetworkGatewayConnectionsClientListOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.NewListPager // method. @@ -456,7 +456,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) listCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -474,7 +474,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -500,7 +500,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *VirtualNetworkGatewayConnectionsClient) resetConnection(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, options *VirtualNetworkGatewayConnectionsClientBeginResetConnectionOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewayConnectionsClient.BeginResetConnection" @@ -542,7 +542,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) resetConnectionCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -553,7 +553,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) resetConnectionCreateReque // through Network resource provider. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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 @@ -583,7 +583,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -625,7 +625,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) resetSharedKeyCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -639,7 +639,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) resetSharedKeyCreateReques // Network resource provider. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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 @@ -669,7 +669,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) BeginSetSharedKey(ctx cont // Network resource provider. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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" @@ -711,7 +711,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) setSharedKeyCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -723,7 +723,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -749,7 +749,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *VirtualNetworkGatewayConnectionsClient) startPacketCapture(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, options *VirtualNetworkGatewayConnectionsClientBeginStartPacketCaptureOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewayConnectionsClient.BeginStartPacketCapture" @@ -791,7 +791,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) startPacketCaptureCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Parameters != nil { @@ -806,7 +806,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -833,7 +833,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -875,7 +875,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) stopPacketCaptureCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -887,7 +887,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -914,7 +914,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -956,7 +956,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) updateTagsCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 656f1c2eb251..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 4253dd3a146b..2b2fdd0b8083 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the Virtual Network Gateway. // - virtualNetworkGatewayName - The name of the gateway. // - natRuleName - The name of the nat rule. @@ -77,7 +77,7 @@ func (client *VirtualNetworkGatewayNatRulesClient) BeginCreateOrUpdate(ctx conte // nat rules. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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" @@ -123,7 +123,7 @@ func (client *VirtualNetworkGatewayNatRulesClient) createOrUpdateCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, natRuleParameters); err != nil { @@ -135,7 +135,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the Virtual Network Gateway. // - virtualNetworkGatewayName - The name of the gateway. // - natRuleName - The name of the nat rule. @@ -162,7 +162,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -208,7 +208,7 @@ func (client *VirtualNetworkGatewayNatRulesClient) deleteCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -217,7 +217,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the Virtual Network Gateway. // - virtualNetworkGatewayName - The name of the gateway. // - natRuleName - The name of the nat rule. @@ -269,7 +269,7 @@ func (client *VirtualNetworkGatewayNatRulesClient) getCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -286,7 +286,7 @@ func (client *VirtualNetworkGatewayNatRulesClient) getHandleResponse(resp *http. // NewListByVirtualNetworkGatewayPager - Retrieves all nat rules for a particular virtual network gateway. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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 @@ -334,7 +334,7 @@ func (client *VirtualNetworkGatewayNatRulesClient) listByVirtualNetworkGatewayCr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 fc432232fed7..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 2238f9338f28..54cc6732383b 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualnetworkgateways_client.go +++ b/sdk/resourcemanager/network/armnetwork/virtualnetworkgateways_client.go @@ -48,7 +48,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -75,7 +75,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -117,7 +117,7 @@ func (client *VirtualNetworkGatewaysClient) createOrUpdateCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -129,7 +129,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -155,7 +155,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *VirtualNetworkGatewaysClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginDelete" @@ -197,7 +197,7 @@ func (client *VirtualNetworkGatewaysClient) deleteCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -207,7 +207,7 @@ func (client *VirtualNetworkGatewaysClient) deleteCreateRequest(ctx context.Cont // resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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. @@ -235,7 +235,7 @@ func (client *VirtualNetworkGatewaysClient) BeginDisconnectVirtualNetworkGateway // resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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" @@ -277,7 +277,7 @@ func (client *VirtualNetworkGatewaysClient) disconnectVirtualNetworkGatewayVPNCo return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, request); err != nil { @@ -290,7 +290,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -318,7 +318,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -360,7 +360,7 @@ func (client *VirtualNetworkGatewaysClient) generateVPNProfileCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -373,7 +373,7 @@ func (client *VirtualNetworkGatewaysClient) generateVPNProfileCreateRequest(ctx // resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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. @@ -401,7 +401,7 @@ func (client *VirtualNetworkGatewaysClient) BeginGeneratevpnclientpackage(ctx co // resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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" @@ -443,7 +443,7 @@ func (client *VirtualNetworkGatewaysClient) generatevpnclientpackageCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -455,7 +455,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -502,7 +502,7 @@ func (client *VirtualNetworkGatewaysClient) getCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -521,7 +521,7 @@ func (client *VirtualNetworkGatewaysClient) getHandleResponse(resp *http.Respons // specified peer. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - peer - The IP address of the peer. @@ -549,7 +549,7 @@ func (client *VirtualNetworkGatewaysClient) BeginGetAdvertisedRoutes(ctx context // peer. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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" @@ -591,7 +591,7 @@ func (client *VirtualNetworkGatewaysClient) getAdvertisedRoutesCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") reqQP.Set("peer", peer) req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} @@ -601,7 +601,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -627,7 +627,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *VirtualNetworkGatewaysClient) getBgpPeerStatus(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginGetBgpPeerStatusOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginGetBgpPeerStatus" @@ -669,7 +669,7 @@ func (client *VirtualNetworkGatewaysClient) getBgpPeerStatusCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") if options != nil && options.Peer != nil { reqQP.Set("peer", *options.Peer) } @@ -682,7 +682,7 @@ func (client *VirtualNetworkGatewaysClient) getBgpPeerStatusCreateRequest(ctx co // for different peering locations // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - typeParam - The type of failover test @@ -711,7 +711,7 @@ func (client *VirtualNetworkGatewaysClient) BeginGetFailoverAllTestDetails(ctx c // different peering locations // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 func (client *VirtualNetworkGatewaysClient) getFailoverAllTestDetails(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, typeParam string, fetchLatest bool, options *VirtualNetworkGatewaysClientBeginGetFailoverAllTestDetailsOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginGetFailoverAllTestDetails" @@ -753,7 +753,7 @@ func (client *VirtualNetworkGatewaysClient) getFailoverAllTestDetailsCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") reqQP.Set("fetchLatest", strconv.FormatBool(fetchLatest)) reqQP.Set("type", typeParam) req.Raw().URL.RawQuery = reqQP.Encode() @@ -765,7 +765,7 @@ func (client *VirtualNetworkGatewaysClient) getFailoverAllTestDetailsCreateReque // gateway based on the test Guid // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - peeringLocation - Peering location of the test @@ -794,7 +794,7 @@ func (client *VirtualNetworkGatewaysClient) BeginGetFailoverSingleTestDetails(ct // based on the test Guid // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 func (client *VirtualNetworkGatewaysClient) getFailoverSingleTestDetails(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, peeringLocation string, failoverTestID string, options *VirtualNetworkGatewaysClientBeginGetFailoverSingleTestDetailsOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginGetFailoverSingleTestDetails" @@ -836,7 +836,7 @@ func (client *VirtualNetworkGatewaysClient) getFailoverSingleTestDetailsCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") reqQP.Set("failoverTestId", failoverTestID) reqQP.Set("peeringLocation", peeringLocation) req.Raw().URL.RawQuery = reqQP.Encode() @@ -848,7 +848,7 @@ func (client *VirtualNetworkGatewaysClient) getFailoverSingleTestDetailsCreateRe // learned from BGP peers. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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 @@ -875,7 +875,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *VirtualNetworkGatewaysClient) getLearnedRoutes(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginGetLearnedRoutesOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginGetLearnedRoutes" @@ -917,7 +917,7 @@ func (client *VirtualNetworkGatewaysClient) getLearnedRoutesCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -927,7 +927,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -954,7 +954,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *VirtualNetworkGatewaysClient) getVPNProfilePackageURL(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginGetVPNProfilePackageURLOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginGetVPNProfilePackageURL" @@ -996,7 +996,7 @@ func (client *VirtualNetworkGatewaysClient) getVPNProfilePackageURLCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1006,7 +1006,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - options - VirtualNetworkGatewaysClientBeginGetVpnclientConnectionHealthOptions contains the optional parameters for the @@ -1033,7 +1033,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *VirtualNetworkGatewaysClient) getVpnclientConnectionHealth(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginGetVpnclientConnectionHealthOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginGetVpnclientConnectionHealth" @@ -1075,7 +1075,7 @@ func (client *VirtualNetworkGatewaysClient) getVpnclientConnectionHealthCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1086,7 +1086,7 @@ func (client *VirtualNetworkGatewaysClient) getVpnclientConnectionHealthCreateRe // provider. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayName - The virtual network gateway name. // - options - VirtualNetworkGatewaysClientBeginGetVpnclientIPSecParametersOptions contains the optional parameters for the @@ -1114,7 +1114,7 @@ func (client *VirtualNetworkGatewaysClient) BeginGetVpnclientIPSecParameters(ctx // provider. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 func (client *VirtualNetworkGatewaysClient) getVpnclientIPSecParameters(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginGetVpnclientIPSecParametersOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginGetVpnclientIPSecParameters" @@ -1156,7 +1156,7 @@ func (client *VirtualNetworkGatewaysClient) getVpnclientIPSecParametersCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1164,7 +1164,7 @@ func (client *VirtualNetworkGatewaysClient) getVpnclientIPSecParametersCreateReq // NewListPager - Gets all virtual network gateways by resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - VirtualNetworkGatewaysClientListOptions contains the optional parameters for the VirtualNetworkGatewaysClient.NewListPager // method. @@ -1207,7 +1207,7 @@ func (client *VirtualNetworkGatewaysClient) listCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1224,7 +1224,7 @@ func (client *VirtualNetworkGatewaysClient) listHandleResponse(resp *http.Respon // NewListConnectionsPager - Gets all the connections in a virtual network gateway. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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 @@ -1272,7 +1272,7 @@ func (client *VirtualNetworkGatewaysClient) listConnectionsCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1290,7 +1290,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -1316,7 +1316,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *VirtualNetworkGatewaysClient) reset(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginResetOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginReset" @@ -1358,7 +1358,7 @@ func (client *VirtualNetworkGatewaysClient) resetCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") if options != nil && options.GatewayVip != nil { reqQP.Set("gatewayVip", *options.GatewayVip) } @@ -1371,7 +1371,7 @@ func (client *VirtualNetworkGatewaysClient) resetCreateRequest(ctx context.Conte // group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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 @@ -1397,7 +1397,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *VirtualNetworkGatewaysClient) resetVPNClientSharedKey(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginResetVPNClientSharedKeyOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginResetVPNClientSharedKey" @@ -1439,7 +1439,7 @@ func (client *VirtualNetworkGatewaysClient) resetVPNClientSharedKeyCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1449,7 +1449,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -1478,7 +1478,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -1520,7 +1520,7 @@ func (client *VirtualNetworkGatewaysClient) setVpnclientIPSecParametersCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, vpnclientIPSecParams); err != nil { @@ -1533,7 +1533,7 @@ func (client *VirtualNetworkGatewaysClient) setVpnclientIPSecParametersCreateReq // peering location // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - peeringLocation - Peering location of the test @@ -1561,7 +1561,7 @@ func (client *VirtualNetworkGatewaysClient) BeginStartExpressRouteSiteFailoverSi // location // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 func (client *VirtualNetworkGatewaysClient) startExpressRouteSiteFailoverSimulation(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, peeringLocation string, options *VirtualNetworkGatewaysClientBeginStartExpressRouteSiteFailoverSimulationOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginStartExpressRouteSiteFailoverSimulation" @@ -1603,7 +1603,7 @@ func (client *VirtualNetworkGatewaysClient) startExpressRouteSiteFailoverSimulat return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") reqQP.Set("peeringLocation", peeringLocation) req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} @@ -1613,7 +1613,7 @@ func (client *VirtualNetworkGatewaysClient) startExpressRouteSiteFailoverSimulat // 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 2024-05-01 +// Generated from API version 2024-07-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 @@ -1639,7 +1639,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *VirtualNetworkGatewaysClient) startPacketCapture(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginStartPacketCaptureOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginStartPacketCapture" @@ -1681,7 +1681,7 @@ func (client *VirtualNetworkGatewaysClient) startPacketCaptureCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Parameters != nil { @@ -1697,7 +1697,7 @@ func (client *VirtualNetworkGatewaysClient) startPacketCaptureCreateRequest(ctx // peering location // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - stopParameters - Virtual network gateway stop simulation parameters supplied to stop failover simulation on gateway. @@ -1725,7 +1725,7 @@ func (client *VirtualNetworkGatewaysClient) BeginStopExpressRouteSiteFailoverSim // location // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 func (client *VirtualNetworkGatewaysClient) stopExpressRouteSiteFailoverSimulation(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, stopParameters ExpressRouteFailoverStopAPIParameters, options *VirtualNetworkGatewaysClientBeginStopExpressRouteSiteFailoverSimulationOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginStopExpressRouteSiteFailoverSimulation" @@ -1767,7 +1767,7 @@ func (client *VirtualNetworkGatewaysClient) stopExpressRouteSiteFailoverSimulati return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, stopParameters); err != nil { @@ -1779,7 +1779,7 @@ func (client *VirtualNetworkGatewaysClient) stopExpressRouteSiteFailoverSimulati // 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 2024-05-01 +// Generated from API version 2024-07-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. @@ -1806,7 +1806,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -1848,7 +1848,7 @@ func (client *VirtualNetworkGatewaysClient) stopPacketCaptureCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -1860,7 +1860,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -1907,7 +1907,7 @@ func (client *VirtualNetworkGatewaysClient) supportedVPNDevicesCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1925,7 +1925,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -1952,7 +1952,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -1994,7 +1994,7 @@ func (client *VirtualNetworkGatewaysClient) updateTagsCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -2006,7 +2006,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayConnectionName - The name of the virtual network gateway connection for which the configuration script // is generated. @@ -2055,7 +2055,7 @@ func (client *VirtualNetworkGatewaysClient) vpnDeviceConfigurationScriptCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 496e6643cf2f..000000000000 --- a/sdk/resourcemanager/network/armnetwork/virtualnetworkgateways_client_example_test.go +++ /dev/null @@ -1,1703 +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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/VirtualNetworkGatewayUpdate.json -func ExampleVirtualNetworkGatewaysClient_BeginCreateOrUpdate_updateVirtualNetworkGateway() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/VirtualNetworkScalableGatewayUpdate.json -func ExampleVirtualNetworkGatewaysClient_BeginCreateOrUpdate_updateVirtualNetworkScalableGateway() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", 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", "ergw", armnetwork.VirtualNetworkGateway{ - Location: to.Ptr("centralus"), - Properties: &armnetwork.VirtualNetworkGatewayPropertiesFormat{ - Active: to.Ptr(false), - AllowRemoteVnetTraffic: to.Ptr(false), - AllowVirtualWanTraffic: to.Ptr(false), - DisableIPSecReplayProtection: to.Ptr(false), - EnableBgp: to.Ptr(false), - EnableBgpRouteTranslationForNat: to.Ptr(false), - GatewayType: to.Ptr(armnetwork.VirtualNetworkGatewayTypeExpressRoute), - IPConfigurations: []*armnetwork.VirtualNetworkGatewayIPConfiguration{ - { - Name: to.Ptr("gwipconfig1"), - Properties: &armnetwork.VirtualNetworkGatewayIPConfigurationPropertiesFormat{ - PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodStatic), - 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/ergw/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/ergw/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.VirtualNetworkGatewaySKUNameErGwScale), - Tier: to.Ptr(armnetwork.VirtualNetworkGatewaySKUTierErGwScale), - }, - VPNType: to.Ptr(armnetwork.VPNTypePolicyBased), - }, - }, 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("ergw"), - // Type: to.Ptr("Microsoft.Network/virtualNetworkGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/ergw"), - // 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), - // AutoScaleConfiguration: &armnetwork.VirtualNetworkGatewayAutoScaleConfiguration{ - // Bounds: &armnetwork.VirtualNetworkGatewayAutoScaleBounds{ - // Max: to.Ptr[int32](3), - // Min: to.Ptr[int32](2), - // }, - // }, - // DisableIPSecReplayProtection: to.Ptr(false), - // EnableBgp: to.Ptr(false), - // EnableBgpRouteTranslationForNat: to.Ptr(false), - // GatewayType: to.Ptr(armnetwork.VirtualNetworkGatewayTypeExpressRoute), - // IPConfigurations: []*armnetwork.VirtualNetworkGatewayIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/ergw/ipConfigurations/default"), - // 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/ergw/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/ergw/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.VirtualNetworkGatewaySKUNameErGwScale), - // Capacity: to.Ptr[int32](0), - // Tier: to.Ptr(armnetwork.VirtualNetworkGatewaySKUTierErGwScale), - // }, - // VPNGatewayGeneration: to.Ptr(armnetwork.VPNGatewayGenerationNone), - // VPNType: to.Ptr(armnetwork.VPNTypePolicyBased), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/VirtualNetworkGatewayGet.json -func ExampleVirtualNetworkGatewaysClient_Get_getVirtualNetworkGateway() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/VirtualNetworkScalableGatewayGet.json -func ExampleVirtualNetworkGatewaysClient_Get_getVirtualNetworkScalableGateway() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain 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", "ergw", 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("ergw"), - // Type: to.Ptr("Microsoft.Network/virtualNetworkGateways"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/ergw"), - // 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), - // AutoScaleConfiguration: &armnetwork.VirtualNetworkGatewayAutoScaleConfiguration{ - // Bounds: &armnetwork.VirtualNetworkGatewayAutoScaleBounds{ - // Max: to.Ptr[int32](3), - // Min: to.Ptr[int32](2), - // }, - // }, - // DisableIPSecReplayProtection: to.Ptr(false), - // EnableBgp: to.Ptr(false), - // EnableBgpRouteTranslationForNat: to.Ptr(false), - // EnablePrivateIPAddress: to.Ptr(false), - // GatewayType: to.Ptr(armnetwork.VirtualNetworkGatewayTypeExpressRoute), - // IPConfigurations: []*armnetwork.VirtualNetworkGatewayIPConfiguration{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/ergw/ipConfigurations/default"), - // Name: to.Ptr("gwipconfig1"), - // Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""), - // Properties: &armnetwork.VirtualNetworkGatewayIPConfigurationPropertiesFormat{ - // PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodStatic), - // 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/ergw/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/ergw/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.VirtualNetworkGatewaySKUNameErGwScale), - // Capacity: to.Ptr[int32](2), - // Tier: to.Ptr(armnetwork.VirtualNetworkGatewaySKUTierErGwScale), - // }, - // VPNGatewayGeneration: to.Ptr(armnetwork.VPNGatewayGenerationNone), - // VPNType: to.Ptr(armnetwork.VPNTypePolicyBased), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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"), - // }, - // 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.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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/VirtualNetworkGatewayGetFailoverAllTestsDetails.json -func ExampleVirtualNetworkGatewaysClient_BeginGetFailoverAllTestDetails() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", 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().BeginGetFailoverAllTestDetails(ctx, "rg1", "ergw", "SingleSiteFailover", 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.ExpressRouteFailoverTestDetailsArray = []*armnetwork.ExpressRouteFailoverTestDetails{ - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/VirtualNetworkGatewayGetFailoverSingleTestDetails.json -func ExampleVirtualNetworkGatewaysClient_BeginGetFailoverSingleTestDetails() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", 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().BeginGetFailoverSingleTestDetails(ctx, "rg1", "ergw", "Vancouver", "fe458ae8-d2ae-4520-a104-44bc233bde7e", 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.ExpressRouteFailoverSingleTestDetailsArray = []*armnetwork.ExpressRouteFailoverSingleTestDetails{ - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/VirtualNetworkGatewayStartSiteFailoverSimulation.json -func ExampleVirtualNetworkGatewaysClient_BeginStartExpressRouteSiteFailoverSimulation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", 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().BeginStartExpressRouteSiteFailoverSimulation(ctx, "rg1", "ergw", "Vancouver", 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 = "[object Object]" -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/VirtualNetworkGatewayStopSiteFailoverSimulation.json -func ExampleVirtualNetworkGatewaysClient_BeginStopExpressRouteSiteFailoverSimulation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", 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().BeginStopExpressRouteSiteFailoverSimulation(ctx, "rg1", "ergw", armnetwork.ExpressRouteFailoverStopAPIParameters{ - PeeringLocation: to.Ptr("Vancouver"), - WasSimulationSuccessful: to.Ptr(true), - Details: []*armnetwork.FailoverConnectionDetails{ - { - FailoverConnectionName: to.Ptr("conn1"), - FailoverLocation: to.Ptr("Denver"), - IsVerified: to.Ptr(false), - }, - { - FailoverConnectionName: to.Ptr("conn2"), - FailoverLocation: to.Ptr("Amsterdam"), - IsVerified: 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.Value = "[object Object]" -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 0e4b2016cf00..8afb42cfe36e 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkName - The name of the virtual network. // - virtualNetworkPeeringName - The name of the peering. @@ -75,7 +75,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 2024-05-01 +// Generated from API version 2024-07-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 return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") if options != nil && options.SyncRemoteAddressSpace != nil { reqQP.Set("syncRemoteAddressSpace", string(*options.SyncRemoteAddressSpace)) } @@ -136,7 +136,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkName - The name of the virtual network. // - virtualNetworkPeeringName - The name of the virtual network peering. @@ -163,7 +163,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -209,7 +209,7 @@ func (client *VirtualNetworkPeeringsClient) deleteCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -218,7 +218,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkName - The name of the virtual network. // - virtualNetworkPeeringName - The name of the virtual network peering. @@ -270,7 +270,7 @@ func (client *VirtualNetworkPeeringsClient) getCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -287,7 +287,7 @@ func (client *VirtualNetworkPeeringsClient) getHandleResponse(resp *http.Respons // NewListPager - Gets all virtual network peerings in a virtual network. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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 @@ -335,7 +335,7 @@ func (client *VirtualNetworkPeeringsClient) listCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 a4950e4ed080..000000000000 --- a/sdk/resourcemanager/network/armnetwork/virtualnetworkpeerings_client_example_test.go +++ /dev/null @@ -1,950 +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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/VirtualNetworkV6SubnetPeeringGet.json -func ExampleVirtualNetworkPeeringsClient_Get_getV6SubnetPeering() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain 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), - // EnableOnlyIPv6Peering: to.Ptr(true), - // LocalAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("2002:2002::/64")}, - // }, - // LocalSubnetNames: []*string{ - // to.Ptr("Subnet1")}, - // LocalVirtualNetworkAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("2002:2002::/64")}, - // }, - // PeerCompleteVnets: to.Ptr(false), - // PeeringState: to.Ptr(armnetwork.VirtualNetworkPeeringStateInitiated), - // PeeringSyncLevel: to.Ptr(armnetwork.VirtualNetworkPeeringLevelFullyInSync), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RemoteAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("2001:2001::/64")}, - // }, - // RemoteBgpCommunities: &armnetwork.VirtualNetworkBgpCommunities{ - // RegionalCommunity: to.Ptr("12076:50004"), - // VirtualNetworkCommunity: to.Ptr("12076:20002"), - // }, - // RemoteSubnetNames: []*string{ - // to.Ptr("Subnet2")}, - // RemoteVirtualNetwork: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2"), - // }, - // RemoteVirtualNetworkAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("2001:2001::/64")}, - // }, - // UseRemoteGateways: to.Ptr(false), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/VirtualNetworkSubnetPeeringGet.json -func ExampleVirtualNetworkPeeringsClient_Get_getSubnetPeering() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain 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), - // EnableOnlyIPv6Peering: to.Ptr(false), - // LocalAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("212.0.0.0/16"), - // to.Ptr("2002:2002::/64")}, - // }, - // LocalSubnetNames: []*string{ - // to.Ptr("Subnet1")}, - // LocalVirtualNetworkAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("212.0.0.0/16"), - // to.Ptr("2002:2002::/64")}, - // }, - // PeerCompleteVnets: to.Ptr(false), - // 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"), - // to.Ptr("2001:2001::/64")}, - // }, - // RemoteBgpCommunities: &armnetwork.VirtualNetworkBgpCommunities{ - // RegionalCommunity: to.Ptr("12076:50004"), - // VirtualNetworkCommunity: to.Ptr("12076:20002"), - // }, - // RemoteSubnetNames: []*string{ - // to.Ptr("Subnet2")}, - // 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"), - // to.Ptr("2001:2001::/64")}, - // }, - // UseRemoteGateways: to.Ptr(false), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/VirtualNetworkV6SubnetPeeringCreate.json -func ExampleVirtualNetworkPeeringsClient_BeginCreateOrUpdate_createV6SubnetPeering() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", 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), - EnableOnlyIPv6Peering: to.Ptr(true), - LocalSubnetNames: []*string{ - to.Ptr("Subnet1"), - to.Ptr("Subnet4")}, - PeerCompleteVnets: to.Ptr(false), - RemoteSubnetNames: []*string{ - to.Ptr("Subnet2")}, - 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), - // EnableOnlyIPv6Peering: to.Ptr(true), - // LocalAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("2002::/64"), - // to.Ptr("2003::/64")}, - // }, - // LocalSubnetNames: []*string{ - // to.Ptr("Subnet1"), - // to.Ptr("Subnet4")}, - // LocalVirtualNetworkAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("2002::/64"), - // to.Ptr("2003::/64")}, - // }, - // PeerCompleteVnets: to.Ptr(false), - // PeeringState: to.Ptr(armnetwork.VirtualNetworkPeeringStateInitiated), - // PeeringSyncLevel: to.Ptr(armnetwork.VirtualNetworkPeeringLevelFullyInSync), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RemoteAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("2001::/64")}, - // }, - // RemoteBgpCommunities: &armnetwork.VirtualNetworkBgpCommunities{ - // RegionalCommunity: to.Ptr("12076:50004"), - // VirtualNetworkCommunity: to.Ptr("12076:20002"), - // }, - // RemoteSubnetNames: []*string{ - // to.Ptr("Subnet2")}, - // RemoteVirtualNetwork: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2"), - // }, - // RemoteVirtualNetworkAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("2001::/64")}, - // }, - // UseRemoteGateways: to.Ptr(false), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/VirtualNetworkSubnetPeeringCreate.json -func ExampleVirtualNetworkPeeringsClient_BeginCreateOrUpdate_createSubnetPeering() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", 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), - EnableOnlyIPv6Peering: to.Ptr(false), - LocalSubnetNames: []*string{ - to.Ptr("Subnet1"), - to.Ptr("Subnet4")}, - PeerCompleteVnets: to.Ptr(false), - RemoteSubnetNames: []*string{ - to.Ptr("Subnet2")}, - 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), - // EnableOnlyIPv6Peering: to.Ptr(false), - // LocalAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("212.0.0.0/16"), - // to.Ptr("13.0.0.0/8"), - // to.Ptr("2002:2002::/64")}, - // }, - // LocalSubnetNames: []*string{ - // to.Ptr("Subnet1"), - // to.Ptr("Subnet4")}, - // LocalVirtualNetworkAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("212.0.0.0/16"), - // to.Ptr("13.0.0.0/8"), - // to.Ptr("2002:2002::/64")}, - // }, - // PeerCompleteVnets: to.Ptr(false), - // 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"), - // to.Ptr("2001:2001::/64")}, - // }, - // RemoteBgpCommunities: &armnetwork.VirtualNetworkBgpCommunities{ - // RegionalCommunity: to.Ptr("12076:50004"), - // VirtualNetworkCommunity: to.Ptr("12076:20002"), - // }, - // RemoteSubnetNames: []*string{ - // to.Ptr("Subnet2")}, - // 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"), - // to.Ptr("2001:2001::/64")}, - // }, - // UseRemoteGateways: to.Ptr(false), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/VirtualNetworkV6SubnetPeeringSync.json -func ExampleVirtualNetworkPeeringsClient_BeginCreateOrUpdate_syncV6SubnetPeering() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", 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), - EnableOnlyIPv6Peering: to.Ptr(true), - PeerCompleteVnets: to.Ptr(false), - 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), - // EnableOnlyIPv6Peering: to.Ptr(true), - // LocalAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("2002:2002::/64")}, - // }, - // LocalSubnetNames: []*string{ - // to.Ptr("Subnet1")}, - // LocalVirtualNetworkAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("2002:2002::/64")}, - // }, - // PeerCompleteVnets: to.Ptr(false), - // PeeringState: to.Ptr(armnetwork.VirtualNetworkPeeringStateInitiated), - // PeeringSyncLevel: to.Ptr(armnetwork.VirtualNetworkPeeringLevelFullyInSync), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RemoteAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("2001:2001::/64")}, - // }, - // RemoteBgpCommunities: &armnetwork.VirtualNetworkBgpCommunities{ - // RegionalCommunity: to.Ptr("12076:50004"), - // VirtualNetworkCommunity: to.Ptr("12076:20002"), - // }, - // RemoteSubnetNames: []*string{ - // to.Ptr("Subnet2")}, - // RemoteVirtualNetwork: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2"), - // }, - // RemoteVirtualNetworkAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("2001:2001::/64")}, - // }, - // UseRemoteGateways: to.Ptr(false), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/VirtualNetworkSubnetPeeringSync.json -func ExampleVirtualNetworkPeeringsClient_BeginCreateOrUpdate_syncSubnetPeering() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", 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), - EnableOnlyIPv6Peering: to.Ptr(false), - PeerCompleteVnets: to.Ptr(false), - 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), - // EnableOnlyIPv6Peering: to.Ptr(false), - // LocalAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("212.0.0.0/16"), - // to.Ptr("2002:2002::/64")}, - // }, - // LocalSubnetNames: []*string{ - // to.Ptr("Subnet1")}, - // LocalVirtualNetworkAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("212.0.0.0/16"), - // to.Ptr("2002:2002::/64")}, - // }, - // PeerCompleteVnets: to.Ptr(false), - // 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"), - // to.Ptr("2001:2001::/64")}, - // }, - // RemoteBgpCommunities: &armnetwork.VirtualNetworkBgpCommunities{ - // RegionalCommunity: to.Ptr("12076:50004"), - // VirtualNetworkCommunity: to.Ptr("12076:20002"), - // }, - // RemoteSubnetNames: []*string{ - // to.Ptr("Subnet2")}, - // 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"), - // to.Ptr("2001:2001::/64")}, - // }, - // UseRemoteGateways: to.Ptr(false), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 57152d4a1bf1..9063bb4c4467 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkName - The name of the virtual network. // - ipAddress - The private IP address to be verified. @@ -96,7 +96,7 @@ func (client *VirtualNetworksClient) checkIPAddressAvailabilityCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") reqQP.Set("ipAddress", ipAddress) req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} @@ -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 2024-05-01 +// Generated from API version 2024-07-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. @@ -142,7 +142,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -184,7 +184,7 @@ func (client *VirtualNetworksClient) createOrUpdateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -196,7 +196,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -222,7 +222,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *VirtualNetworksClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualNetworkName string, options *VirtualNetworksClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworksClient.BeginDelete" @@ -264,7 +264,7 @@ func (client *VirtualNetworksClient) deleteCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -273,7 +273,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -322,7 +322,7 @@ func (client *VirtualNetworksClient) getCreateRequest(ctx context.Context, resou if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -339,7 +339,7 @@ func (client *VirtualNetworksClient) getHandleResponse(resp *http.Response) (Vir // NewListPager - Gets all virtual networks in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - VirtualNetworksClientListOptions contains the optional parameters for the VirtualNetworksClient.NewListPager // method. @@ -382,7 +382,7 @@ func (client *VirtualNetworksClient) listCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -399,7 +399,7 @@ func (client *VirtualNetworksClient) listHandleResponse(resp *http.Response) (Vi // NewListAllPager - Gets all virtual networks in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - options - VirtualNetworksClientListAllOptions contains the optional parameters for the VirtualNetworksClient.NewListAllPager // method. func (client *VirtualNetworksClient) NewListAllPager(options *VirtualNetworksClientListAllOptions) *runtime.Pager[VirtualNetworksClientListAllResponse] { @@ -437,7 +437,7 @@ func (client *VirtualNetworksClient) listAllCreateRequest(ctx context.Context, o return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -454,7 +454,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -497,7 +497,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *VirtualNetworksClient) listDdosProtectionStatus(ctx context.Context, resourceGroupName string, virtualNetworkName string, options *VirtualNetworksClientBeginListDdosProtectionStatusOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworksClient.BeginListDdosProtectionStatus" @@ -539,7 +539,7 @@ func (client *VirtualNetworksClient) listDdosProtectionStatusCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") if options != nil && options.SkipToken != nil { reqQP.Set("skipToken", *options.SkipToken) } @@ -562,7 +562,7 @@ func (client *VirtualNetworksClient) listDdosProtectionStatusHandleResponse(resp // NewListUsagePager - Lists usage stats. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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 @@ -610,7 +610,7 @@ func (client *VirtualNetworksClient) listUsageCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -628,7 +628,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkName - The name of the virtual network. // - parameters - Parameters supplied to update virtual network tags. @@ -676,7 +676,7 @@ func (client *VirtualNetworksClient) updateTagsCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 5c3238b04b8b..000000000000 --- a/sdk/resourcemanager/network/armnetwork/virtualnetworks_client_example_test.go +++ /dev/null @@ -1,1209 +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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/VirtualNetworkCreateWithIpamPool.json -func ExampleVirtualNetworksClient_BeginCreateOrUpdate_createVirtualNetworkWithIpamPool() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", 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{ - IpamPoolPrefixAllocations: []*armnetwork.IpamPoolPrefixAllocation{ - { - NumberOfIPAddresses: to.Ptr("65536"), - Pool: &armnetwork.IpamPoolPrefixAllocationPool{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/nm1/ipamPools/testIpamPool"), - }, - }}, - }, - Subnets: []*armnetwork.Subnet{ - { - Name: to.Ptr("test-1"), - Properties: &armnetwork.SubnetPropertiesFormat{ - IpamPoolPrefixAllocations: []*armnetwork.IpamPoolPrefixAllocation{ - { - NumberOfIPAddresses: to.Ptr("80"), - Pool: &armnetwork.IpamPoolPrefixAllocationPool{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/nm1/ipamPools/testIpamPool"), - }, - }}, - }, - }}, - }, - }, 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("eastus2euap"), - // Properties: &armnetwork.VirtualNetworkPropertiesFormat{ - // AddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/22")}, - // IpamPoolPrefixAllocations: []*armnetwork.IpamPoolPrefixAllocation{ - // { - // AllocatedAddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/22")}, - // NumberOfIPAddresses: to.Ptr("800"), - // Pool: &armnetwork.IpamPoolPrefixAllocationPool{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/nm1/ipamPools/testIpamPool"), - // }, - // }}, - // }, - // 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{ - // AddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/26"), - // to.Ptr("10.0.0.64/28")}, - // IpamPoolPrefixAllocations: []*armnetwork.IpamPoolPrefixAllocation{ - // { - // AllocatedAddressPrefixes: []*string{ - // to.Ptr("10.0.0.0/26"), - // to.Ptr("10.0.0.64/28")}, - // NumberOfIPAddresses: to.Ptr("80"), - // Pool: &armnetwork.IpamPoolPrefixAllocationPool{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/nm1/ipamPools/testIpamPool"), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 744f363a084e..3c65e81ecedc 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 2024-05-01 +// Generated from API version 2024-07-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. @@ -74,7 +74,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -116,7 +116,7 @@ func (client *VirtualNetworkTapsClient) createOrUpdateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -128,7 +128,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -154,7 +154,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *VirtualNetworkTapsClient) deleteOperation(ctx context.Context, resourceGroupName string, tapName string, options *VirtualNetworkTapsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkTapsClient.BeginDelete" @@ -196,7 +196,7 @@ func (client *VirtualNetworkTapsClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -205,7 +205,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -251,7 +251,7 @@ func (client *VirtualNetworkTapsClient) getCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -268,7 +268,7 @@ func (client *VirtualNetworkTapsClient) getHandleResponse(resp *http.Response) ( // NewListAllPager - Gets all the VirtualNetworkTaps in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - options - VirtualNetworkTapsClientListAllOptions contains the optional parameters for the VirtualNetworkTapsClient.NewListAllPager // method. func (client *VirtualNetworkTapsClient) NewListAllPager(options *VirtualNetworkTapsClientListAllOptions) *runtime.Pager[VirtualNetworkTapsClientListAllResponse] { @@ -306,7 +306,7 @@ func (client *VirtualNetworkTapsClient) listAllCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -323,7 +323,7 @@ func (client *VirtualNetworkTapsClient) listAllHandleResponse(resp *http.Respons // NewListByResourceGroupPager - Gets all the VirtualNetworkTaps in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - VirtualNetworkTapsClientListByResourceGroupOptions contains the optional parameters for the VirtualNetworkTapsClient.NewListByResourceGroupPager // method. @@ -366,7 +366,7 @@ func (client *VirtualNetworkTapsClient) listByResourceGroupCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -384,7 +384,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - tapName - The name of the tap. // - tapParameters - Parameters supplied to update VirtualNetworkTap tags. @@ -432,7 +432,7 @@ func (client *VirtualNetworkTapsClient) updateTagsCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 3245c6e210e1..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 70a28996a3f4..76f8354fac1f 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualRouterName - The name of the Virtual Router. // - peeringName - The name of the Virtual Router Peering. @@ -75,7 +75,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -121,7 +121,7 @@ func (client *VirtualRouterPeeringsClient) createOrUpdateCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -133,7 +133,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualRouterName - The name of the Virtual Router. // - peeringName - The name of the peering. @@ -160,7 +160,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -206,7 +206,7 @@ func (client *VirtualRouterPeeringsClient) deleteCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -215,7 +215,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualRouterName - The name of the Virtual Router. // - peeringName - The name of the Virtual Router Peering. @@ -267,7 +267,7 @@ func (client *VirtualRouterPeeringsClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -284,7 +284,7 @@ func (client *VirtualRouterPeeringsClient) getHandleResponse(resp *http.Response // NewListPager - Lists all Virtual Router Peerings in a Virtual Router resource. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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 @@ -332,7 +332,7 @@ func (client *VirtualRouterPeeringsClient) listCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 7447ab69e651..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 2535e97af938..2e05b0b88696 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 2024-05-01 +// Generated from API version 2024-07-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. @@ -74,7 +74,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -116,7 +116,7 @@ func (client *VirtualRoutersClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -128,7 +128,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -154,7 +154,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *VirtualRoutersClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualRouterName string, options *VirtualRoutersClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualRoutersClient.BeginDelete" @@ -196,7 +196,7 @@ func (client *VirtualRoutersClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -205,7 +205,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -254,7 +254,7 @@ func (client *VirtualRoutersClient) getCreateRequest(ctx context.Context, resour if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -271,7 +271,7 @@ func (client *VirtualRoutersClient) getHandleResponse(resp *http.Response) (Virt // NewListPager - Gets all the Virtual Routers in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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]{ @@ -308,7 +308,7 @@ func (client *VirtualRoutersClient) listCreateRequest(ctx context.Context, optio return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -325,7 +325,7 @@ func (client *VirtualRoutersClient) listHandleResponse(resp *http.Response) (Vir // NewListByResourceGroupPager - Lists all Virtual Routers in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - VirtualRoutersClientListByResourceGroupOptions contains the optional parameters for the VirtualRoutersClient.NewListByResourceGroupPager // method. @@ -368,7 +368,7 @@ func (client *VirtualRoutersClient) listByResourceGroupCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 6a2a1be57b2f..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/virtualwan_live_test.go b/sdk/resourcemanager/network/armnetwork/virtualwan_live_test.go index 9006c95546ee..8790ae3355f6 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualwan_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/virtualwan_live_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/virtualwans_client.go b/sdk/resourcemanager/network/armnetwork/virtualwans_client.go index 29ea1f776142..d666c6a7f06c 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 2024-05-01 +// Generated from API version 2024-07-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. @@ -74,7 +74,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -116,7 +116,7 @@ func (client *VirtualWansClient) createOrUpdateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, wanParameters); err != nil { @@ -128,7 +128,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -153,7 +153,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *VirtualWansClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualWANName string, options *VirtualWansClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualWansClient.BeginDelete" @@ -195,7 +195,7 @@ func (client *VirtualWansClient) deleteCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -204,7 +204,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -250,7 +250,7 @@ func (client *VirtualWansClient) getCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -267,7 +267,7 @@ func (client *VirtualWansClient) getHandleResponse(resp *http.Response) (Virtual // NewListPager - Lists all the VirtualWANs in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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]{ @@ -304,7 +304,7 @@ func (client *VirtualWansClient) listCreateRequest(ctx context.Context, options return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -321,7 +321,7 @@ func (client *VirtualWansClient) listHandleResponse(resp *http.Response) (Virtua // NewListByResourceGroupPager - Lists all the VirtualWANs in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VirtualWan. // - options - VirtualWansClientListByResourceGroupOptions contains the optional parameters for the VirtualWansClient.NewListByResourceGroupPager // method. @@ -364,7 +364,7 @@ func (client *VirtualWansClient) listByResourceGroupCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -382,7 +382,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VirtualWan. // - virtualWANName - The name of the VirtualWAN being updated. // - wanParameters - Parameters supplied to Update VirtualWAN tags. @@ -429,7 +429,7 @@ func (client *VirtualWansClient) updateTagsCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 5942f9c9bdce..000000000000 --- a/sdk/resourcemanager/network/armnetwork/virtualwans_client_example_test.go +++ /dev/null @@ -1,374 +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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub2"), - // }}, - // VPNSites: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite2"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub2"), - // }}, - // VPNSites: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite2"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub2"), - // }}, - // VPNSites: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite2"), - // }}, - // }, - // }, - // { - // 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{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub3"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub4"), - // }}, - // VPNSites: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite3"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite4"), - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub2"), - // }}, - // VPNSites: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite2"), - // }}, - // }, - // }, - // { - // 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{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualHubs/hub1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualHubs/hub2"), - // }}, - // VPNSites: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/vpnSites/vpnSite1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/vpnSites/vpnSite2"), - // }}, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/vpnconnections_client.go b/sdk/resourcemanager/network/armnetwork/vpnconnections_client.go index dd743c926d26..b263e86f0699 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VpnGateway. // - gatewayName - The name of the gateway. // - connectionName - The name of the connection. @@ -76,7 +76,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -122,7 +122,7 @@ func (client *VPNConnectionsClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, vpnConnectionParameters); err != nil { @@ -134,7 +134,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VpnGateway. // - gatewayName - The name of the gateway. // - connectionName - The name of the connection. @@ -161,7 +161,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -207,7 +207,7 @@ func (client *VPNConnectionsClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -216,7 +216,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VpnGateway. // - gatewayName - The name of the gateway. // - connectionName - The name of the vpn connection. @@ -267,7 +267,7 @@ func (client *VPNConnectionsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -284,7 +284,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -332,7 +332,7 @@ func (client *VPNConnectionsClient) listByVPNGatewayCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -350,7 +350,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - gatewayName - The name of the gateway. // - vpnConnectionName - The name of the vpn connection. @@ -377,7 +377,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -423,7 +423,7 @@ func (client *VPNConnectionsClient) startPacketCaptureCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Parameters != nil { @@ -438,7 +438,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - gatewayName - The name of the gateway. // - vpnConnectionName - The name of the vpn connection. @@ -465,7 +465,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -511,7 +511,7 @@ func (client *VPNConnectionsClient) stopPacketCaptureCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 0d9fc8dc5149..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 8546254750ee..00dd364b2778 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 2024-05-01 +// Generated from API version 2024-07-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. @@ -74,7 +74,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -116,7 +116,7 @@ func (client *VPNGatewaysClient) createOrUpdateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, vpnGatewayParameters); err != nil { @@ -128,7 +128,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -153,7 +153,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *VPNGatewaysClient) deleteOperation(ctx context.Context, resourceGroupName string, gatewayName string, options *VPNGatewaysClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VPNGatewaysClient.BeginDelete" @@ -195,7 +195,7 @@ func (client *VPNGatewaysClient) deleteCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -204,7 +204,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -250,7 +250,7 @@ func (client *VPNGatewaysClient) getCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -267,7 +267,7 @@ func (client *VPNGatewaysClient) getHandleResponse(resp *http.Response) (VPNGate // NewListPager - Lists all the VpnGateways in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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]{ @@ -304,7 +304,7 @@ func (client *VPNGatewaysClient) listCreateRequest(ctx context.Context, options return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -321,7 +321,7 @@ func (client *VPNGatewaysClient) listHandleResponse(resp *http.Response) (VPNGat // NewListByResourceGroupPager - Lists all the VpnGateways in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VpnGateway. // - options - VPNGatewaysClientListByResourceGroupOptions contains the optional parameters for the VPNGatewaysClient.NewListByResourceGroupPager // method. @@ -364,7 +364,7 @@ func (client *VPNGatewaysClient) listByResourceGroupCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -382,7 +382,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -407,7 +407,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *VPNGatewaysClient) reset(ctx context.Context, resourceGroupName string, gatewayName string, options *VPNGatewaysClientBeginResetOptions) (*http.Response, error) { var err error const operationName = "VPNGatewaysClient.BeginReset" @@ -449,7 +449,7 @@ func (client *VPNGatewaysClient) resetCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") if options != nil && options.IPConfigurationID != nil { reqQP.Set("ipConfigurationId", *options.IPConfigurationID) } @@ -461,7 +461,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -487,7 +487,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *VPNGatewaysClient) startPacketCapture(ctx context.Context, resourceGroupName string, gatewayName string, options *VPNGatewaysClientBeginStartPacketCaptureOptions) (*http.Response, error) { var err error const operationName = "VPNGatewaysClient.BeginStartPacketCapture" @@ -529,7 +529,7 @@ func (client *VPNGatewaysClient) startPacketCaptureCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Parameters != nil { @@ -544,7 +544,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -570,7 +570,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *VPNGatewaysClient) stopPacketCapture(ctx context.Context, resourceGroupName string, gatewayName string, options *VPNGatewaysClientBeginStopPacketCaptureOptions) (*http.Response, error) { var err error const operationName = "VPNGatewaysClient.BeginStopPacketCapture" @@ -612,7 +612,7 @@ func (client *VPNGatewaysClient) stopPacketCaptureCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Parameters != nil { @@ -627,7 +627,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -654,7 +654,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -696,7 +696,7 @@ func (client *VPNGatewaysClient) updateTagsCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 46272975c48b..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 64b3adf16d3a..4dfa38ac3e51 100644 --- a/sdk/resourcemanager/network/armnetwork/vpnlinkconnections_client.go +++ b/sdk/resourcemanager/network/armnetwork/vpnlinkconnections_client.go @@ -46,7 +46,7 @@ func NewVPNLinkConnectionsClient(subscriptionID string, credential azcore.TokenC // NewGetAllSharedKeysPager - Lists all shared keys of VpnLink connection specified. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - gatewayName - The name of the gateway. // - connectionName - The name of the vpn connection. @@ -104,7 +104,7 @@ func (client *VPNLinkConnectionsClient) getAllSharedKeysCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -122,7 +122,7 @@ func (client *VPNLinkConnectionsClient) getAllSharedKeysHandleResponse(resp *htt // GetDefaultSharedKey - Gets the shared key of VpnLink connection specified. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - gatewayName - The name of the gateway. // - connectionName - The name of the vpn connection. @@ -179,7 +179,7 @@ func (client *VPNLinkConnectionsClient) getDefaultSharedKeyCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -197,7 +197,7 @@ func (client *VPNLinkConnectionsClient) getDefaultSharedKeyHandleResponse(resp * // 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - gatewayName - The name of the gateway. // - connectionName - The name of the vpn connection. @@ -225,7 +225,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -275,7 +275,7 @@ func (client *VPNLinkConnectionsClient) getIkeSasCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -283,7 +283,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the vpn gateway. // - gatewayName - The name of the gateway. // - connectionName - The name of the vpn connection. @@ -336,7 +336,7 @@ func (client *VPNLinkConnectionsClient) listByVPNConnectionCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -354,7 +354,7 @@ func (client *VPNLinkConnectionsClient) listByVPNConnectionHandleResponse(resp * // ListDefaultSharedKey - Gets the value of the shared key of VpnLink connection specified. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - gatewayName - The name of the gateway. // - connectionName - The name of the vpn connection. @@ -411,7 +411,7 @@ func (client *VPNLinkConnectionsClient) listDefaultSharedKeyCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -429,7 +429,7 @@ func (client *VPNLinkConnectionsClient) listDefaultSharedKeyHandleResponse(resp // BeginResetConnection - Resets the VpnLink connection specified. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - gatewayName - The name of the gateway. // - connectionName - The name of the vpn connection. @@ -457,7 +457,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -507,7 +507,7 @@ func (client *VPNLinkConnectionsClient) resetConnectionCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -518,7 +518,7 @@ func (client *VPNLinkConnectionsClient) resetConnectionCreateRequest(ctx context // pre-defined length. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VpnGateway. // - gatewayName - The name of the gateway. // - connectionName - The name of the connection. @@ -549,7 +549,7 @@ func (client *VPNLinkConnectionsClient) BeginSetOrInitDefaultSharedKey(ctx conte // pre-defined length. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 func (client *VPNLinkConnectionsClient) setOrInitDefaultSharedKey(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, linkConnectionName string, connectionSharedKeyParameters ConnectionSharedKeyResult, options *VPNLinkConnectionsClientBeginSetOrInitDefaultSharedKeyOptions) (*http.Response, error) { var err error const operationName = "VPNLinkConnectionsClient.BeginSetOrInitDefaultSharedKey" @@ -599,7 +599,7 @@ func (client *VPNLinkConnectionsClient) setOrInitDefaultSharedKeyCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, connectionSharedKeyParameters); err != 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 3a16406842f2..000000000000 --- a/sdk/resourcemanager/network/armnetwork/vpnlinkconnections_client_example_test.go +++ /dev/null @@ -1,221 +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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/VpnSiteLinkConnectionSharedKeysGet.json -func ExampleVPNLinkConnectionsClient_NewGetAllSharedKeysPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain 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().NewGetAllSharedKeysPager("rg1", "gateway1", "vpnConnection1", "Connection-Link1", 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.ConnectionSharedKeyResultList = armnetwork.ConnectionSharedKeyResultList{ - // Value: []*armnetwork.ConnectionSharedKeyResult{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/vpnLinkConnections/Connection-Link1/sharedKeys/default"), - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Network/vpnGateways/vpnConnections/vpnLinkConnections/sharedKeys"), - // Properties: &armnetwork.SharedKeyProperties{ - // SharedKeyLength: to.Ptr[int32](16), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/VpnSiteLinkConnectionDefaultSharedKeyGet.json -func ExampleVPNLinkConnectionsClient_GetDefaultSharedKey() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain 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.NewVPNLinkConnectionsClient().GetDefaultSharedKey(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.ConnectionSharedKeyResult = armnetwork.ConnectionSharedKeyResult{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/vpnLinkConnections/Connection-Link1/sharedKeys/default"), - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Network/vpnGateways/vpnConnections/vpnLinkConnections/sharedKeys"), - // Properties: &armnetwork.SharedKeyProperties{ - // SharedKeyLength: to.Ptr[int32](16), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/VpnSiteLinkConnectionDefaultSharedKeyPut.json -func ExampleVPNLinkConnectionsClient_BeginSetOrInitDefaultSharedKey() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", 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().BeginSetOrInitDefaultSharedKey(ctx, "rg1", "gateway1", "vpnConnection1", "Connection-Link1", armnetwork.ConnectionSharedKeyResult{ - Properties: &armnetwork.SharedKeyProperties{ - SharedKey: to.Ptr("ABCDEF123456"), - }, - }, 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.ConnectionSharedKeyResult = armnetwork.ConnectionSharedKeyResult{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/vpnLinkConnections/Connection-Link1/sharedKeys/default"), - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Network/vpnGateways/vpnConnections/vpnLinkConnections/sharedKeys"), - // Properties: &armnetwork.SharedKeyProperties{ - // SharedKeyLength: to.Ptr[int32](12), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/VpnSiteLinkConnectionDefaultSharedKeyList.json -func ExampleVPNLinkConnectionsClient_ListDefaultSharedKey() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain 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.NewVPNLinkConnectionsClient().ListDefaultSharedKey(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.ConnectionSharedKeyResult = armnetwork.ConnectionSharedKeyResult{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/vpnConnections/vpnConnection1/vpnLinkConnections/Connection-Link1/sharedKeys/default"), - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Network/vpnGateways/vpnConnections/vpnLinkConnections/sharedKeys"), - // Properties: &armnetwork.SharedKeyProperties{ - // SharedKey: to.Ptr("AzureAbc1234"), - // SharedKeyLength: to.Ptr[int32](12), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 f5eb3c6ab40c..43367fdf0eef 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 2024-05-01 +// Generated from API version 2024-07-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. @@ -74,7 +74,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -116,7 +116,7 @@ func (client *VPNServerConfigurationsClient) createOrUpdateCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, vpnServerConfigurationParameters); err != nil { @@ -128,7 +128,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -154,7 +154,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *VPNServerConfigurationsClient) deleteOperation(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, options *VPNServerConfigurationsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VPNServerConfigurationsClient.BeginDelete" @@ -196,7 +196,7 @@ func (client *VPNServerConfigurationsClient) deleteCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -205,7 +205,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 2024-05-01 +// Generated from API version 2024-07-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 @@ -252,7 +252,7 @@ func (client *VPNServerConfigurationsClient) getCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -269,7 +269,7 @@ func (client *VPNServerConfigurationsClient) getHandleResponse(resp *http.Respon // NewListPager - Lists all the VpnServerConfigurations in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - options - VPNServerConfigurationsClientListOptions contains the optional parameters for the VPNServerConfigurationsClient.NewListPager // method. func (client *VPNServerConfigurationsClient) NewListPager(options *VPNServerConfigurationsClientListOptions) *runtime.Pager[VPNServerConfigurationsClientListResponse] { @@ -307,7 +307,7 @@ func (client *VPNServerConfigurationsClient) listCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -324,7 +324,7 @@ func (client *VPNServerConfigurationsClient) listHandleResponse(resp *http.Respo // NewListByResourceGroupPager - Lists all the vpnServerConfigurations in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VpnServerConfiguration. // - options - VPNServerConfigurationsClientListByResourceGroupOptions contains the optional parameters for the VPNServerConfigurationsClient.NewListByResourceGroupPager // method. @@ -367,7 +367,7 @@ func (client *VPNServerConfigurationsClient) listByResourceGroupCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -385,7 +385,7 @@ func (client *VPNServerConfigurationsClient) listByResourceGroupHandleResponse(r // UpdateTags - Updates VpnServerConfiguration tags. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VpnServerConfiguration. // - vpnServerConfigurationName - The name of the VpnServerConfiguration being updated. // - vpnServerConfigurationParameters - Parameters supplied to update VpnServerConfiguration tags. @@ -433,7 +433,7 @@ func (client *VPNServerConfigurationsClient) updateTagsCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 28b65694a194..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 b862307b94ed..7d40570a25ea 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 2024-05-01 +// Generated from API version 2024-07-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 @@ -73,7 +73,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *VPNServerConfigurationsAssociatedWithVirtualWanClient) listOperation(ctx context.Context, resourceGroupName string, virtualWANName string, options *VPNServerConfigurationsAssociatedWithVirtualWanClientBeginListOptions) (*http.Response, error) { var err error const operationName = "VPNServerConfigurationsAssociatedWithVirtualWanClient.BeginList" @@ -115,7 +115,7 @@ func (client *VPNServerConfigurationsAssociatedWithVirtualWanClient) listCreateR return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 a00bda865350..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 7adeae48091c..5ad893bb63cd 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 2024-05-01 +// Generated from API version 2024-07-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", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 2ff608dec239..000000000000 --- a/sdk/resourcemanager/network/armnetwork/vpnsitelinkconnections_client_example_test.go +++ /dev/null @@ -1,72 +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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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), - // DpdTimeoutSeconds: to.Ptr[int32](0), - // 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 5e6c048c5c42..3951416d88c9 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 2024-05-01 +// Generated from API version 2024-07-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", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 2024-05-01 +// Generated from API version 2024-07-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 @@ -163,7 +163,7 @@ func (client *VPNSiteLinksClient) listByVPNSiteCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 f6429550572c..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 fb6ef2604c49..6bcbb3e0f9dc 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 2024-05-01 +// Generated from API version 2024-07-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. @@ -74,7 +74,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -116,7 +116,7 @@ func (client *VPNSitesClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, vpnSiteParameters); err != nil { @@ -128,7 +128,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -153,7 +153,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *VPNSitesClient) deleteOperation(ctx context.Context, resourceGroupName string, vpnSiteName string, options *VPNSitesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VPNSitesClient.BeginDelete" @@ -195,7 +195,7 @@ func (client *VPNSitesClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -204,7 +204,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -250,7 +250,7 @@ func (client *VPNSitesClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -267,7 +267,7 @@ func (client *VPNSitesClient) getHandleResponse(resp *http.Response) (VPNSitesCl // NewListPager - Lists all the VpnSites in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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]{ @@ -304,7 +304,7 @@ func (client *VPNSitesClient) listCreateRequest(ctx context.Context, options *VP return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -321,7 +321,7 @@ func (client *VPNSitesClient) listHandleResponse(resp *http.Response) (VPNSitesC // NewListByResourceGroupPager - Lists all the vpnSites in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VpnSite. // - options - VPNSitesClientListByResourceGroupOptions contains the optional parameters for the VPNSitesClient.NewListByResourceGroupPager // method. @@ -364,7 +364,7 @@ func (client *VPNSitesClient) listByResourceGroupCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -382,7 +382,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VpnSite. // - vpnSiteName - The name of the VpnSite being updated. // - vpnSiteParameters - Parameters supplied to update VpnSite tags. @@ -429,7 +429,7 @@ func (client *VPNSitesClient) updateTagsCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 dc78c900a69d..000000000000 --- a/sdk/resourcemanager/network/armnetwork/vpnsites_client_example_test.go +++ /dev/null @@ -1,464 +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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualWANs/wan1"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualWANs/wan1"), - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/vpnsitesconfiguration_client.go b/sdk/resourcemanager/network/armnetwork/vpnsitesconfiguration_client.go index 188692f1070b..e5a0f003ec60 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 2024-05-01 +// Generated from API version 2024-07-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. @@ -74,7 +74,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -116,7 +116,7 @@ func (client *VPNSitesConfigurationClient) downloadCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 3253a414212a..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 a362961040ba..a45c5939e936 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 2024-05-01 +// Generated from API version 2024-07-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. @@ -76,7 +76,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -118,7 +118,7 @@ func (client *WatchersClient) checkConnectivityCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 *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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkWatcherName - The name of the network watcher. // - parameters - Parameters that define the network watcher resource. @@ -177,7 +177,7 @@ func (client *WatchersClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -198,7 +198,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -223,7 +223,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *WatchersClient) deleteOperation(ctx context.Context, resourceGroupName string, networkWatcherName string, options *WatchersClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "WatchersClient.BeginDelete" @@ -265,7 +265,7 @@ func (client *WatchersClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -274,7 +274,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -320,7 +320,7 @@ func (client *WatchersClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -339,7 +339,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -367,7 +367,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -409,7 +409,7 @@ func (client *WatchersClient) getAzureReachabilityReportCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -421,7 +421,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -448,7 +448,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -490,7 +490,7 @@ func (client *WatchersClient) getFlowLogStatusCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -506,7 +506,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkWatcherName - The name of the network watcher. // - parameters - Parameters to get network configuration diagnostic. @@ -537,7 +537,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -579,7 +579,7 @@ func (client *WatchersClient) getNetworkConfigurationDiagnosticCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -591,7 +591,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkWatcherName - The name of the network watcher. // - parameters - Parameters that define the source and destination endpoint. @@ -618,7 +618,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -660,7 +660,7 @@ func (client *WatchersClient) getNextHopCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -672,7 +672,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkWatcherName - The name of the network watcher. // - parameters - Parameters that define the representation of topology. @@ -719,7 +719,7 @@ func (client *WatchersClient) getTopologyCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -740,7 +740,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkWatcherName - The name of the network watcher resource. // - parameters - Parameters that define the resource to troubleshoot. @@ -767,7 +767,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -809,7 +809,7 @@ func (client *WatchersClient) getTroubleshootingCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -821,7 +821,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -848,7 +848,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -890,7 +890,7 @@ func (client *WatchersClient) getTroubleshootingResultCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -902,7 +902,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -929,7 +929,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -971,7 +971,7 @@ func (client *WatchersClient) getVMSecurityRulesCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -982,7 +982,7 @@ func (client *WatchersClient) getVMSecurityRulesCreateRequest(ctx context.Contex // NewListPager - Gets all network watchers by resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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] { @@ -1025,7 +1025,7 @@ func (client *WatchersClient) listCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1042,7 +1042,7 @@ func (client *WatchersClient) listHandleResponse(resp *http.Response) (WatchersC // NewListAllPager - Gets all network watchers by subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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]{ @@ -1080,7 +1080,7 @@ func (client *WatchersClient) listAllCreateRequest(ctx context.Context, options return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1099,7 +1099,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -1127,7 +1127,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -1169,7 +1169,7 @@ func (client *WatchersClient) listAvailableProvidersCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -1181,7 +1181,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -1208,7 +1208,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -1250,7 +1250,7 @@ func (client *WatchersClient) setFlowLogConfigurationCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -1262,7 +1262,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkWatcherName - The name of the network watcher. // - parameters - Parameters supplied to update network watcher tags. @@ -1309,7 +1309,7 @@ func (client *WatchersClient) updateTagsCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -1330,7 +1330,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 2024-05-01 +// Generated from API version 2024-07-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. @@ -1357,7 +1357,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 2024-05-01 +// Generated from API version 2024-07-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" @@ -1399,7 +1399,7 @@ func (client *WatchersClient) verifyIPFlowCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 7f49659cc1fe..000000000000 --- a/sdk/resourcemanager/network/armnetwork/watchers_client_example_test.go +++ /dev/null @@ -1,933 +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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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.946Z"); 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.200Z"); 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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.044Z"); return t}()), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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.044Z"); return t}()), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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{ - Identity: &armnetwork.ManagedServiceIdentity{ - Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), - UserAssignedIdentities: map[string]*armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": {}, - }, - }, - 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{ - // Identity: &armnetwork.ManagedServiceIdentity{ - // Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - // "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": &armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - // ClientID: to.Ptr("c16d15e1-f60a-40e4-8a05-df3d3f655c14"), - // PrincipalID: to.Ptr("e3858881-e40c-43bd-9cde-88da39c05023"), - // }, - // }, - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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{ - // Identity: &armnetwork.ManagedServiceIdentity{ - // Type: to.Ptr(armnetwork.ResourceIdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - // "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": &armnetwork.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - // ClientID: to.Ptr("c16d15e1-f60a-40e4-8a05-df3d3f655c14"), - // PrincipalID: to.Ptr("e3858881-e40c-43bd-9cde-88da39c05023"), - // }, - // }, - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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:00.000Z"); 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:00.000Z"); 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:00.000Z"); return t}()), - // }, - // { - // Score: to.Ptr[int32](94), - // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-08T00:00:00.000Z"); return t}()), - // }, - // { - // Score: to.Ptr[int32](94), - // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-09T00:00:00.000Z"); 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/webapplicationfirewall_live_test.go b/sdk/resourcemanager/network/armnetwork/webapplicationfirewall_live_test.go index 843ed65556e0..70f1e67b6e78 100644 --- a/sdk/resourcemanager/network/armnetwork/webapplicationfirewall_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/webapplicationfirewall_live_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/webapplicationfirewallpolicies_client.go b/sdk/resourcemanager/network/armnetwork/webapplicationfirewallpolicies_client.go index d4d5049a6f81..fba5dcbdebed 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 2024-05-01 +// Generated from API version 2024-07-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", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - policyName - The name of the policy. // - options - WebApplicationFirewallPoliciesClientBeginDeleteOptions contains the optional parameters for the WebApplicationFirewallPoliciesClient.BeginDelete @@ -142,7 +142,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 2024-05-01 +// Generated from API version 2024-07-01 func (client *WebApplicationFirewallPoliciesClient) deleteOperation(ctx context.Context, resourceGroupName string, policyName string, options *WebApplicationFirewallPoliciesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "WebApplicationFirewallPoliciesClient.BeginDelete" @@ -184,7 +184,7 @@ func (client *WebApplicationFirewallPoliciesClient) deleteCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -193,7 +193,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - policyName - The name of the policy. // - options - WebApplicationFirewallPoliciesClientGetOptions contains the optional parameters for the WebApplicationFirewallPoliciesClient.Get @@ -240,7 +240,7 @@ func (client *WebApplicationFirewallPoliciesClient) getCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -257,7 +257,7 @@ func (client *WebApplicationFirewallPoliciesClient) getHandleResponse(resp *http // NewListPager - Lists all of the protection policies within a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - WebApplicationFirewallPoliciesClientListOptions contains the optional parameters for the WebApplicationFirewallPoliciesClient.NewListPager // method. @@ -300,7 +300,7 @@ func (client *WebApplicationFirewallPoliciesClient) listCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -317,7 +317,7 @@ func (client *WebApplicationFirewallPoliciesClient) listHandleResponse(resp *htt // NewListAllPager - Gets all the WAF policies in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - options - WebApplicationFirewallPoliciesClientListAllOptions contains the optional parameters for the WebApplicationFirewallPoliciesClient.NewListAllPager // method. func (client *WebApplicationFirewallPoliciesClient) NewListAllPager(options *WebApplicationFirewallPoliciesClientListAllOptions) *runtime.Pager[WebApplicationFirewallPoliciesClientListAllResponse] { @@ -355,7 +355,7 @@ func (client *WebApplicationFirewallPoliciesClient) listAllCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 e2a717d7cfb8..000000000000 --- a/sdk/resourcemanager/network/armnetwork/webapplicationfirewallpolicies_client_example_test.go +++ /dev/null @@ -1,1383 +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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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"), - // }}, - // Exceptions: []*armnetwork.ExceptionEntry{ - // { - // ExceptionManagedRuleSets: []*armnetwork.ExclusionManagedRuleSet{ - // { - // RuleSetType: to.Ptr("OWASP"), - // RuleSetVersion: to.Ptr("3.2"), - // }}, - // MatchVariable: to.Ptr(armnetwork.ExceptionEntryMatchVariableRequestURI), - // ValueMatchOperator: to.Ptr(armnetwork.ExceptionEntryValueMatchOperatorContains), - // Values: []*string{ - // to.Ptr("health"), - // to.Ptr("account/images"), - // to.Ptr("default.aspx")}, - // }, - // { - // ExceptionManagedRuleSets: []*armnetwork.ExclusionManagedRuleSet{ - // { - // RuleGroups: []*armnetwork.ExclusionManagedRuleGroup{ - // { - // RuleGroupName: to.Ptr("REQUEST-932-APPLICATION-ATTACK-RCE"), - // }}, - // RuleSetType: to.Ptr("OWASP"), - // RuleSetVersion: to.Ptr("3.2"), - // }}, - // MatchVariable: to.Ptr(armnetwork.ExceptionEntryMatchVariableRequestHeader), - // Selector: to.Ptr("User-Agent"), - // SelectorMatchOperator: to.Ptr(armnetwork.ExceptionEntrySelectorMatchOperatorStartsWith), - // ValueMatchOperator: to.Ptr(armnetwork.ExceptionEntryValueMatchOperatorContains), - // Values: []*string{ - // to.Ptr("Mozilla/5.0"), - // to.Ptr("Chrome/122.0.0.0")}, - // }, - // { - // ExceptionManagedRuleSets: []*armnetwork.ExclusionManagedRuleSet{ - // { - // RuleGroups: []*armnetwork.ExclusionManagedRuleGroup{ - // { - // RuleGroupName: to.Ptr("BadBots"), - // Rules: []*armnetwork.ExclusionManagedRule{ - // { - // RuleID: to.Ptr("100100"), - // }}, - // }}, - // RuleSetType: to.Ptr("Microsoft_BotManagerRuleSet"), - // RuleSetVersion: to.Ptr("1.0"), - // }}, - // MatchVariable: to.Ptr(armnetwork.ExceptionEntryMatchVariableRemoteAddr), - // ValueMatchOperator: to.Ptr(armnetwork.ExceptionEntryValueMatchOperatorIPMatch), - // Values: []*string{ - // to.Ptr("1.2.3.4"), - // to.Ptr("10.0.0.1/6")}, - // }}, - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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"), - // }}, - // Exceptions: []*armnetwork.ExceptionEntry{ - // { - // ExceptionManagedRuleSets: []*armnetwork.ExclusionManagedRuleSet{ - // { - // RuleSetType: to.Ptr("OWASP"), - // RuleSetVersion: to.Ptr("3.2"), - // }}, - // MatchVariable: to.Ptr(armnetwork.ExceptionEntryMatchVariableRequestURI), - // ValueMatchOperator: to.Ptr(armnetwork.ExceptionEntryValueMatchOperatorContains), - // Values: []*string{ - // to.Ptr("health"), - // to.Ptr("account/images"), - // to.Ptr("default.aspx")}, - // }, - // { - // ExceptionManagedRuleSets: []*armnetwork.ExclusionManagedRuleSet{ - // { - // RuleGroups: []*armnetwork.ExclusionManagedRuleGroup{ - // { - // RuleGroupName: to.Ptr("REQUEST-932-APPLICATION-ATTACK-RCE"), - // }}, - // RuleSetType: to.Ptr("OWASP"), - // RuleSetVersion: to.Ptr("3.2"), - // }}, - // MatchVariable: to.Ptr(armnetwork.ExceptionEntryMatchVariableRequestHeader), - // Selector: to.Ptr("User-Agent"), - // SelectorMatchOperator: to.Ptr(armnetwork.ExceptionEntrySelectorMatchOperatorStartsWith), - // ValueMatchOperator: to.Ptr(armnetwork.ExceptionEntryValueMatchOperatorContains), - // Values: []*string{ - // to.Ptr("Mozilla/5.0"), - // to.Ptr("Chrome/122.0.0.0")}, - // }, - // { - // ExceptionManagedRuleSets: []*armnetwork.ExclusionManagedRuleSet{ - // { - // RuleGroups: []*armnetwork.ExclusionManagedRuleGroup{ - // { - // RuleGroupName: to.Ptr("BadBots"), - // Rules: []*armnetwork.ExclusionManagedRule{ - // { - // RuleID: to.Ptr("100100"), - // }}, - // }}, - // RuleSetType: to.Ptr("Microsoft_BotManagerRuleSet"), - // RuleSetVersion: to.Ptr("1.0"), - // }}, - // MatchVariable: to.Ptr(armnetwork.ExceptionEntryMatchVariableRemoteAddr), - // ValueMatchOperator: to.Ptr(armnetwork.ExceptionEntryValueMatchOperatorIPMatch), - // Values: []*string{ - // to.Ptr("1.2.3.4"), - // to.Ptr("10.0.0.1/6")}, - // }}, - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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{ - // ApplicationGatewayForContainers: []*armnetwork.ApplicationGatewayForContainersReferenceDefinition{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/agc1"), - // }}, - // 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), - // }, - // { - // Name: to.Ptr("Rule4"), - // Action: to.Ptr(armnetwork.WebApplicationFirewallActionJSChallenge), - // 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("Bot")}, - // MatchVariables: []*armnetwork.MatchVariable{ - // { - // Selector: to.Ptr("UserAgent"), - // VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariableRequestHeaders), - // }}, - // NegationConditon: to.Ptr(false), - // Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorContains), - // }}, - // Priority: to.Ptr[int32](4), - // RuleType: to.Ptr(armnetwork.WebApplicationFirewallRuleTypeMatchRule), - // State: to.Ptr(armnetwork.WebApplicationFirewallStateEnabled), - // }}, - // 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"), - // }, - // { - // RuleGroupOverrides: []*armnetwork.ManagedRuleGroupOverride{ - // { - // RuleGroupName: to.Ptr("UnknownBots"), - // Rules: []*armnetwork.ManagedRuleOverride{ - // { - // Action: to.Ptr(armnetwork.ActionTypeJSChallenge), - // RuleID: to.Ptr("300700"), - // State: to.Ptr(armnetwork.ManagedRuleEnabledStateEnabled), - // }}, - // }}, - // RuleSetType: to.Ptr("Microsoft_BotManagerRuleSet"), - // RuleSetVersion: to.Ptr("1.0"), - // }, - // { - // RuleGroupOverrides: []*armnetwork.ManagedRuleGroupOverride{ - // { - // RuleGroupName: to.Ptr("ExcessiveRequests"), - // Rules: []*armnetwork.ManagedRuleOverride{ - // { - // Action: to.Ptr(armnetwork.ActionTypeBlock), - // RuleID: to.Ptr("500100"), - // Sensitivity: to.Ptr(armnetwork.SensitivityTypeHigh), - // State: to.Ptr(armnetwork.ManagedRuleEnabledStateEnabled), - // }}, - // }}, - // RuleSetType: to.Ptr("Microsoft_HTTPDDoSRuleSet"), - // RuleSetVersion: to.Ptr("1.0"), - // }}, - // Exceptions: []*armnetwork.ExceptionEntry{ - // { - // ExceptionManagedRuleSets: []*armnetwork.ExclusionManagedRuleSet{ - // { - // RuleSetType: to.Ptr("OWASP"), - // RuleSetVersion: to.Ptr("3.2"), - // }}, - // MatchVariable: to.Ptr(armnetwork.ExceptionEntryMatchVariableRequestURI), - // ValueMatchOperator: to.Ptr(armnetwork.ExceptionEntryValueMatchOperatorContains), - // Values: []*string{ - // to.Ptr("health"), - // to.Ptr("account/images"), - // to.Ptr("default.aspx")}, - // }, - // { - // ExceptionManagedRuleSets: []*armnetwork.ExclusionManagedRuleSet{ - // { - // RuleGroups: []*armnetwork.ExclusionManagedRuleGroup{ - // { - // RuleGroupName: to.Ptr("REQUEST-932-APPLICATION-ATTACK-RCE"), - // }}, - // RuleSetType: to.Ptr("OWASP"), - // RuleSetVersion: to.Ptr("3.2"), - // }}, - // MatchVariable: to.Ptr(armnetwork.ExceptionEntryMatchVariableRequestHeader), - // Selector: to.Ptr("User-Agent"), - // SelectorMatchOperator: to.Ptr(armnetwork.ExceptionEntrySelectorMatchOperatorStartsWith), - // ValueMatchOperator: to.Ptr(armnetwork.ExceptionEntryValueMatchOperatorContains), - // Values: []*string{ - // to.Ptr("Mozilla/5.0"), - // to.Ptr("Chrome/122.0.0.0")}, - // }, - // { - // ExceptionManagedRuleSets: []*armnetwork.ExclusionManagedRuleSet{ - // { - // RuleGroups: []*armnetwork.ExclusionManagedRuleGroup{ - // { - // RuleGroupName: to.Ptr("BadBots"), - // Rules: []*armnetwork.ExclusionManagedRule{ - // { - // RuleID: to.Ptr("100100"), - // }}, - // }}, - // RuleSetType: to.Ptr("Microsoft_BotManagerRuleSet"), - // RuleSetVersion: to.Ptr("1.0"), - // }}, - // MatchVariable: to.Ptr(armnetwork.ExceptionEntryMatchVariableRemoteAddr), - // ValueMatchOperator: to.Ptr(armnetwork.ExceptionEntryValueMatchOperatorIPMatch), - // Values: []*string{ - // to.Ptr("1.2.3.4"), - // to.Ptr("10.0.0.1/6")}, - // }}, - // }, - // PolicySettings: &armnetwork.PolicySettings{ - // CustomBlockResponseBody: to.Ptr("SGVsbG8="), - // CustomBlockResponseStatusCode: to.Ptr[int32](405), - // FileUploadEnforcement: to.Ptr(true), - // FileUploadLimitInMb: to.Ptr[int32](4000), - // JsChallengeCookieExpirationInMins: to.Ptr[int32](100), - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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), - }, - { - Name: to.Ptr("Rule4"), - Action: to.Ptr(armnetwork.WebApplicationFirewallActionJSChallenge), - 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("Bot")}, - MatchVariables: []*armnetwork.MatchVariable{ - { - Selector: to.Ptr("UserAgent"), - VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariableRequestHeaders), - }}, - Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorContains), - }}, - Priority: to.Ptr[int32](4), - RuleType: to.Ptr(armnetwork.WebApplicationFirewallRuleTypeMatchRule), - }}, - 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"), - }, - { - RuleGroupOverrides: []*armnetwork.ManagedRuleGroupOverride{ - { - RuleGroupName: to.Ptr("UnknownBots"), - Rules: []*armnetwork.ManagedRuleOverride{ - { - Action: to.Ptr(armnetwork.ActionTypeJSChallenge), - RuleID: to.Ptr("300700"), - State: to.Ptr(armnetwork.ManagedRuleEnabledStateEnabled), - }}, - }}, - RuleSetType: to.Ptr("Microsoft_BotManagerRuleSet"), - RuleSetVersion: to.Ptr("1.0"), - }, - { - RuleGroupOverrides: []*armnetwork.ManagedRuleGroupOverride{ - { - RuleGroupName: to.Ptr("ExcessiveRequests"), - Rules: []*armnetwork.ManagedRuleOverride{ - { - Action: to.Ptr(armnetwork.ActionTypeBlock), - RuleID: to.Ptr("500100"), - Sensitivity: to.Ptr(armnetwork.SensitivityTypeHigh), - State: to.Ptr(armnetwork.ManagedRuleEnabledStateEnabled), - }}, - }}, - RuleSetType: to.Ptr("Microsoft_HTTPDDoSRuleSet"), - RuleSetVersion: to.Ptr("1.0"), - }}, - Exceptions: []*armnetwork.ExceptionEntry{ - { - ExceptionManagedRuleSets: []*armnetwork.ExclusionManagedRuleSet{ - { - RuleSetType: to.Ptr("OWASP"), - RuleSetVersion: to.Ptr("3.2"), - }}, - MatchVariable: to.Ptr(armnetwork.ExceptionEntryMatchVariableRequestURI), - ValueMatchOperator: to.Ptr(armnetwork.ExceptionEntryValueMatchOperatorContains), - Values: []*string{ - to.Ptr("health"), - to.Ptr("account/images"), - to.Ptr("default.aspx")}, - }, - { - ExceptionManagedRuleSets: []*armnetwork.ExclusionManagedRuleSet{ - { - RuleGroups: []*armnetwork.ExclusionManagedRuleGroup{ - { - RuleGroupName: to.Ptr("REQUEST-932-APPLICATION-ATTACK-RCE"), - }}, - RuleSetType: to.Ptr("OWASP"), - RuleSetVersion: to.Ptr("3.2"), - }}, - MatchVariable: to.Ptr(armnetwork.ExceptionEntryMatchVariableRequestHeader), - Selector: to.Ptr("User-Agent"), - SelectorMatchOperator: to.Ptr(armnetwork.ExceptionEntrySelectorMatchOperatorStartsWith), - ValueMatchOperator: to.Ptr(armnetwork.ExceptionEntryValueMatchOperatorContains), - Values: []*string{ - to.Ptr("Mozilla/5.0"), - to.Ptr("Chrome/122.0.0.0")}, - }, - { - ExceptionManagedRuleSets: []*armnetwork.ExclusionManagedRuleSet{ - { - RuleGroups: []*armnetwork.ExclusionManagedRuleGroup{ - { - RuleGroupName: to.Ptr("BadBots"), - Rules: []*armnetwork.ExclusionManagedRule{ - { - RuleID: to.Ptr("100100"), - }}, - }}, - RuleSetType: to.Ptr("Microsoft_BotManagerRuleSet"), - RuleSetVersion: to.Ptr("1.0"), - }}, - MatchVariable: to.Ptr(armnetwork.ExceptionEntryMatchVariableRemoteAddr), - ValueMatchOperator: to.Ptr(armnetwork.ExceptionEntryValueMatchOperatorIPMatch), - Values: []*string{ - to.Ptr("1.2.3.4"), - to.Ptr("10.0.0.1/6")}, - }}, - }, - PolicySettings: &armnetwork.PolicySettings{ - JsChallengeCookieExpirationInMins: to.Ptr[int32](100), - 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), - // }, - // { - // Name: to.Ptr("Rule4"), - // Action: to.Ptr(armnetwork.WebApplicationFirewallActionJSChallenge), - // 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("Bot")}, - // MatchVariables: []*armnetwork.MatchVariable{ - // { - // Selector: to.Ptr("UserAgent"), - // VariableName: to.Ptr(armnetwork.WebApplicationFirewallMatchVariableRequestHeaders), - // }}, - // NegationConditon: to.Ptr(false), - // Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorContains), - // }}, - // Priority: to.Ptr[int32](4), - // RuleType: to.Ptr(armnetwork.WebApplicationFirewallRuleTypeMatchRule), - // State: to.Ptr(armnetwork.WebApplicationFirewallStateEnabled), - // }}, - // 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"), - // }, - // { - // RuleGroupOverrides: []*armnetwork.ManagedRuleGroupOverride{ - // { - // RuleGroupName: to.Ptr("UnknownBots"), - // Rules: []*armnetwork.ManagedRuleOverride{ - // { - // Action: to.Ptr(armnetwork.ActionTypeJSChallenge), - // RuleID: to.Ptr("300700"), - // State: to.Ptr(armnetwork.ManagedRuleEnabledStateEnabled), - // }}, - // }}, - // RuleSetType: to.Ptr("Microsoft_BotManagerRuleSet"), - // RuleSetVersion: to.Ptr("1.0"), - // }, - // { - // RuleGroupOverrides: []*armnetwork.ManagedRuleGroupOverride{ - // { - // RuleGroupName: to.Ptr("ExcessiveRequests"), - // Rules: []*armnetwork.ManagedRuleOverride{ - // { - // Action: to.Ptr(armnetwork.ActionTypeBlock), - // RuleID: to.Ptr("500100"), - // Sensitivity: to.Ptr(armnetwork.SensitivityTypeHigh), - // State: to.Ptr(armnetwork.ManagedRuleEnabledStateEnabled), - // }}, - // }}, - // RuleSetType: to.Ptr("Microsoft_HTTPDDoSRuleSet"), - // RuleSetVersion: to.Ptr("1.0"), - // }}, - // Exceptions: []*armnetwork.ExceptionEntry{ - // { - // ExceptionManagedRuleSets: []*armnetwork.ExclusionManagedRuleSet{ - // { - // RuleSetType: to.Ptr("OWASP"), - // RuleSetVersion: to.Ptr("3.2"), - // }}, - // MatchVariable: to.Ptr(armnetwork.ExceptionEntryMatchVariableRequestURI), - // ValueMatchOperator: to.Ptr(armnetwork.ExceptionEntryValueMatchOperatorContains), - // Values: []*string{ - // to.Ptr("health"), - // to.Ptr("account/images"), - // to.Ptr("default.aspx")}, - // }, - // { - // ExceptionManagedRuleSets: []*armnetwork.ExclusionManagedRuleSet{ - // { - // RuleGroups: []*armnetwork.ExclusionManagedRuleGroup{ - // { - // RuleGroupName: to.Ptr("REQUEST-932-APPLICATION-ATTACK-RCE"), - // }}, - // RuleSetType: to.Ptr("OWASP"), - // RuleSetVersion: to.Ptr("3.2"), - // }}, - // MatchVariable: to.Ptr(armnetwork.ExceptionEntryMatchVariableRequestHeader), - // Selector: to.Ptr("User-Agent"), - // SelectorMatchOperator: to.Ptr(armnetwork.ExceptionEntrySelectorMatchOperatorStartsWith), - // ValueMatchOperator: to.Ptr(armnetwork.ExceptionEntryValueMatchOperatorContains), - // Values: []*string{ - // to.Ptr("Mozilla/5.0"), - // to.Ptr("Chrome/122.0.0.0")}, - // }, - // { - // ExceptionManagedRuleSets: []*armnetwork.ExclusionManagedRuleSet{ - // { - // RuleGroups: []*armnetwork.ExclusionManagedRuleGroup{ - // { - // RuleGroupName: to.Ptr("BadBots"), - // Rules: []*armnetwork.ExclusionManagedRule{ - // { - // RuleID: to.Ptr("100100"), - // }}, - // }}, - // RuleSetType: to.Ptr("Microsoft_BotManagerRuleSet"), - // RuleSetVersion: to.Ptr("1.0"), - // }}, - // MatchVariable: to.Ptr(armnetwork.ExceptionEntryMatchVariableRemoteAddr), - // ValueMatchOperator: to.Ptr(armnetwork.ExceptionEntryValueMatchOperatorIPMatch), - // Values: []*string{ - // to.Ptr("1.2.3.4"), - // to.Ptr("10.0.0.1/6")}, - // }}, - // }, - // PolicySettings: &armnetwork.PolicySettings{ - // CustomBlockResponseBody: to.Ptr("SGVsbG8="), - // CustomBlockResponseStatusCode: to.Ptr[int32](405), - // FileUploadEnforcement: to.Ptr(true), - // FileUploadLimitInMb: to.Ptr[int32](4000), - // JsChallengeCookieExpirationInMins: to.Ptr[int32](100), - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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 dfeb408bb966..d1977fec32b0 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 2024-05-01 +// Generated from API version 2024-07-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) { @@ -91,7 +91,7 @@ func (client *WebCategoriesClient) getCreateRequest(ctx context.Context, name st if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -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 2024-05-01 +// Generated from API version 2024-07-01 // - options - WebCategoriesClientListBySubscriptionOptions contains the optional parameters for the WebCategoriesClient.NewListBySubscriptionPager // method. func (client *WebCategoriesClient) NewListBySubscriptionPager(options *WebCategoriesClientListBySubscriptionOptions) *runtime.Pager[WebCategoriesClientListBySubscriptionResponse] { @@ -146,7 +146,7 @@ func (client *WebCategoriesClient) listBySubscriptionCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-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 7024a0b8014a..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-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"), - // }, - // }}, - // } - } -}