From b74b270abbd67252e42c8307d7036b8460410db8 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 30 Aug 2023 13:36:42 +0000 Subject: [PATCH] CodeGen from PR 25580 in Azure/azure-rest-api-specs Merge afca02759e883bb365d48608d06bee429db173d9 into ea87e77e1caf628278b07b51e16650946422edff --- sdk/resourcemanager/sql/armsql/CHANGELOG.md | 171 + .../sql/armsql/agent_client.go | 8 +- .../sql/armsql/agent_client_example_test.go | 79 - sdk/resourcemanager/sql/armsql/autorest.md | 7 +- ...backupshorttermretentionpolicies_client.go | 20 +- ...rmretentionpolicies_client_example_test.go | 123 - .../sql/armsql/capabilities_client.go | 4 +- .../capabilities_client_example_test.go | 3048 --------------- .../sql/armsql/client_factory.go | 25 +- sdk/resourcemanager/sql/armsql/constants.go | 543 ++- ...advancedthreatprotectionsettings_client.go | 12 +- ...tprotectionsettings_client_example_test.go | 183 - .../sql/armsql/databaseadvisors_client.go | 12 +- .../databaseadvisors_client_example_test.go | 815 ---- .../armsql/databaseautomatictuning_client.go | 8 +- ...baseautomatictuning_client_example_test.go | 199 - .../databaseblobauditingpolicies_client.go | 12 +- ...lobauditingpolicies_client_example_test.go | 238 -- .../sql/armsql/databasecolumns_client.go | 12 +- .../databasecolumns_client_example_test.go | 205 - .../databaseencryptionprotectors_client.go | 12 +- ...ncryptionprotectors_client_example_test.go | 60 - .../sql/armsql/databaseextensions_client.go | 18 +- .../databaseextensions_client_example_test.go | 109 - .../sql/armsql/databaseoperations_client.go | 8 +- .../databaseoperations_client_example_test.go | 91 - .../databaserecommendedactions_client.go | 12 +- ...erecommendedactions_client_example_test.go | 372 -- .../sql/armsql/databases_client.go | 216 +- .../armsql/databases_client_example_test.go | 3318 ----------------- .../sql/armsql/databaseschemas_client.go | 8 +- .../databaseschemas_client_example_test.go | 81 - .../databasesecurityalertpolicies_client.go | 12 +- ...curityalertpolicies_client_example_test.go | 226 -- ...vulnerabilityassessmentbaselines_client.go | 12 +- ...assessmentbaselines_client_example_test.go | 324 -- ...lnerabilityassessmentexecutescan_client.go | 6 +- ...sessmentexecutescan_client_example_test.go | 39 - ...erabilityassessmentrulebaselines_client.go | 16 +- ...ssmentrulebaselines_client_example_test.go | 186 - ...ulnerabilityassessmentscanresult_client.go | 8 +- ...ssessmentscanresult_client_example_test.go | 213 -- ...esqlvulnerabilityassessmentscans_client.go | 8 +- ...lityassessmentscans_client_example_test.go | 158 - ...vulnerabilityassessmentssettings_client.go | 8 +- ...assessmentssettings_client_example_test.go | 82 - .../sql/armsql/databasetables_client.go | 8 +- .../databasetables_client_example_test.go | 81 - .../sql/armsql/databaseusages_client.go | 4 +- .../databaseusages_client_example_test.go | 57 - ...erabilityassessmentrulebaselines_client.go | 12 +- ...ssmentrulebaselines_client_example_test.go | 144 - ...databasevulnerabilityassessments_client.go | 16 +- ...rabilityassessments_client_example_test.go | 235 -- ...basevulnerabilityassessmentscans_client.go | 18 +- ...lityassessmentscans_client_example_test.go | 182 - .../sql/armsql/datamaskingpolicies_client.go | 54 +- ...datamaskingpolicies_client_example_test.go | 124 - .../sql/armsql/datamaskingrules_client.go | 56 +- .../datamaskingrules_client_example_test.go | 251 -- .../datawarehouseuseractivities_client.go | 8 +- ...houseuseractivities_client_example_test.go | 81 - .../sql/armsql/deletedservers_client.go | 18 +- .../deletedservers_client_example_test.go | 184 - .../distributedavailabilitygroups_client.go | 112 +- ...davailabilitygroups_client_example_test.go | 211 -- .../armsql/elasticpoolactivities_client.go | 114 - ...asticpoolactivities_client_example_test.go | 67 - .../elasticpooldatabaseactivities_client.go | 114 - ...ldatabaseactivities_client_example_test.go | 82 - .../armsql/elasticpooloperations_client.go | 8 +- ...asticpooloperations_client_example_test.go | 91 - .../sql/armsql/elasticpools_client.go | 174 +- .../elasticpools_client_example_test.go | 1547 -------- .../sql/armsql/encryptionprotectors_client.go | 20 +- ...ncryptionprotectors_client_example_test.go | 195 - .../sql/armsql/endpointcertificates_client.go | 8 +- ...ndpointcertificates_client_example_test.go | 90 - ...ndeddatabaseblobauditingpolicies_client.go | 12 +- ...lobauditingpolicies_client_example_test.go | 239 -- ...tendedserverblobauditingpolicies_client.go | 14 +- ...lobauditingpolicies_client_example_test.go | 207 - .../sql/armsql/failovergroups_client.go | 44 +- .../failovergroups_client_example_test.go | 438 --- .../sql/armsql/firewallrules_client.go | 20 +- .../firewallrules_client_example_test.go | 235 -- .../sql/armsql/geobackuppolicies_client.go | 86 +- .../geobackuppolicies_client_example_test.go | 119 - sdk/resourcemanager/sql/armsql/go.mod | 14 +- sdk/resourcemanager/sql/armsql/go.sum | 22 +- .../armsql/instancefailovergroups_client.go | 32 +- ...tancefailovergroups_client_example_test.go | 342 -- .../sql/armsql/instancepools_client.go | 30 +- .../instancepools_client_example_test.go | 370 -- .../sql/armsql/ipv6firewallrules_client.go | 16 +- .../ipv6firewallrules_client_example_test.go | 197 - .../sql/armsql/jobagents_client.go | 26 +- .../armsql/jobagents_client_example_test.go | 209 -- .../sql/armsql/jobcredentials_client.go | 16 +- .../jobcredentials_client_example_test.go | 141 - .../sql/armsql/jobexecutions_client.go | 36 +- .../jobexecutions_client_example_test.go | 355 -- sdk/resourcemanager/sql/armsql/jobs_client.go | 16 +- .../sql/armsql/jobs_client_example_test.go | 229 -- .../sql/armsql/jobstepexecutions_client.go | 12 +- .../jobstepexecutions_client_example_test.go | 111 - .../sql/armsql/jobsteps_client.go | 24 +- .../armsql/jobsteps_client_example_test.go | 454 --- .../sql/armsql/jobtargetexecutions_client.go | 20 +- ...jobtargetexecutions_client_example_test.go | 180 - .../sql/armsql/jobtargetgroups_client.go | 16 +- .../jobtargetgroups_client_example_test.go | 269 -- .../sql/armsql/jobversions_client.go | 8 +- .../armsql/jobversions_client_example_test.go | 81 - .../sql/armsql/ledgerdigestuploads_client.go | 20 +- ...ledgerdigestuploads_client_example_test.go | 154 - .../armsql/longtermretentionbackups_client.go | 68 +- ...ermretentionbackups_client_example_test.go | 689 ---- ...mretentionmanagedinstancebackups_client.go | 44 +- ...agedinstancebackups_client_example_test.go | 522 --- .../longtermretentionpolicies_client.go | 18 +- ...rmretentionpolicies_client_example_test.go | 131 - .../armsql/maintenancewindowoptions_client.go | 4 +- ...enancewindowoptions_client_example_test.go | 57 - .../sql/armsql/maintenancewindows_client.go | 8 +- .../maintenancewindows_client_example_test.go | 78 - ...backupshorttermretentionpolicies_client.go | 20 +- ...rmretentionpolicies_client_example_test.go | 119 - ...advancedthreatprotectionsettings_client.go | 12 +- ...tprotectionsettings_client_example_test.go | 183 - .../armsql/manageddatabasecolumns_client.go | 12 +- ...ageddatabasecolumns_client_example_test.go | 196 - .../manageddatabasemoveoperations_client.go | 8 +- ...abasemoveoperations_client_example_test.go | 262 -- .../armsql/manageddatabasequeries_client.go | 8 +- ...ageddatabasequeries_client_example_test.go | 538 --- ...baserecommendedsensitivitylabels_client.go | 4 +- ...edsensitivitylabels_client_example_test.go | 62 - .../manageddatabaserestoredetails_client.go | 4 +- ...abaserestoredetails_client_example_test.go | 168 - .../sql/armsql/manageddatabases_client.go | 54 +- .../manageddatabases_client_example_test.go | 786 ---- .../armsql/manageddatabaseschemas_client.go | 8 +- ...ageddatabaseschemas_client_example_test.go | 81 - ...geddatabasesecurityalertpolicies_client.go | 12 +- ...curityalertpolicies_client_example_test.go | 193 - .../manageddatabasesecurityevents_client.go | 8 +- ...abasesecurityevents_client_example_test.go | 179 - ...manageddatabasesensitivitylabels_client.go | 111 +- ...sesensitivitylabels_client_example_test.go | 327 -- .../armsql/manageddatabasetables_client.go | 8 +- ...nageddatabasetables_client_example_test.go | 81 - ...atabasetransparentdataencryption_client.go | 12 +- ...arentdataencryption_client_example_test.go | 115 - ...erabilityassessmentrulebaselines_client.go | 12 +- ...ssmentrulebaselines_client_example_test.go | 144 - ...databasevulnerabilityassessments_client.go | 16 +- ...rabilityassessments_client_example_test.go | 196 - ...basevulnerabilityassessmentscans_client.go | 18 +- ...lityassessmentscans_client_example_test.go | 182 - .../managedinstanceadministrators_client.go | 20 +- ...tanceadministrators_client_example_test.go | 194 - ...advancedthreatprotectionsettings_client.go | 14 +- ...tprotectionsettings_client_example_test.go | 191 - ...stanceazureadonlyauthentications_client.go | 20 +- ...onlyauthentications_client_example_test.go | 140 - .../sql/armsql/managedinstancedtcs_client.go | 14 +- ...managedinstancedtcs_client_example_test.go | 233 -- ...agedinstanceencryptionprotectors_client.go | 20 +- ...ncryptionprotectors_client_example_test.go | 190 - .../sql/armsql/managedinstancekeys_client.go | 20 +- ...managedinstancekeys_client_example_test.go | 169 - ...nstancelongtermretentionpolicies_client.go | 93 +- ...rmretentionpolicies_client_example_test.go | 131 - .../managedinstanceoperations_client.go | 12 +- ...dinstanceoperations_client_example_test.go | 230 -- ...stanceprivateendpointconnections_client.go | 20 +- ...endpointconnections_client_example_test.go | 183 - ...agedinstanceprivatelinkresources_client.go | 8 +- ...rivatelinkresources_client_example_test.go | 86 - .../sql/armsql/managedinstances_client.go | 137 +- .../managedinstances_client_example_test.go | 1826 --------- .../managedinstancetdecertificates_client.go | 6 +- ...ancetdecertificates_client_example_test.go | 44 - ...instancevulnerabilityassessments_client.go | 16 +- ...rabilityassessments_client_example_test.go | 235 -- .../managedledgerdigestuploads_client.go | 20 +- ...ledgerdigestuploads_client_example_test.go | 154 - ...backupshorttermretentionpolicies_client.go | 20 +- ...rmretentionpolicies_client_example_test.go | 127 - .../armsql/managedserverdnsaliases_client.go | 26 +- ...gedserverdnsaliases_client_example_test.go | 181 - ...nagedserversecurityalertpolicies_client.go | 24 +- ...curityalertpolicies_client_example_test.go | 231 -- sdk/resourcemanager/sql/armsql/models.go | 981 ++--- .../sql/armsql/models_serde.go | 2177 ++++++----- ...ksecurityperimeterconfigurations_client.go | 256 ++ .../sql/armsql/operations_client.go | 4 +- sdk/resourcemanager/sql/armsql/options.go | 152 +- .../armsql/outboundfirewallrules_client.go | 33 +- ...tboundfirewallrules_client_example_test.go | 143 - .../privateendpointconnections_client.go | 20 +- ...endpointconnections_client_example_test.go | 183 - .../sql/armsql/privatelinkresources_client.go | 8 +- ...rivatelinkresources_client_example_test.go | 86 - .../recommendedsensitivitylabels_client.go | 4 +- ...edsensitivitylabels_client_example_test.go | 62 - .../sql/armsql/recoverabledatabases_client.go | 8 +- ...ecoverabledatabases_client_example_test.go | 147 - .../recoverablemanageddatabases_client.go | 8 +- ...blemanageddatabases_client_example_test.go | 90 - .../sql/armsql/replicationlinks_client.go | 30 +- .../replicationlinks_client_example_test.go | 299 -- .../sql/armsql/response_types.go | 147 +- .../restorabledroppeddatabases_client.go | 8 +- ...bledroppeddatabases_client_example_test.go | 165 - ...estorabledroppedmanageddatabases_client.go | 8 +- ...pedmanageddatabases_client_example_test.go | 99 - .../sql/armsql/restorepoints_client.go | 18 +- .../restorepoints_client_example_test.go | 232 -- .../sql/armsql/sensitivitylabels_client.go | 111 +- .../sensitivitylabels_client_example_test.go | 329 -- ...advancedthreatprotectionsettings_client.go | 14 +- ...tprotectionsettings_client_example_test.go | 191 - .../sql/armsql/serveradvisors_client.go | 12 +- .../serveradvisors_client_example_test.go | 812 ---- .../armsql/serverautomatictuning_client.go | 8 +- ...rverautomatictuning_client_example_test.go | 199 - .../serverazureadadministrators_client.go | 20 +- ...ureadadministrators_client_example_test.go | 155 - ...serverazureadonlyauthentications_client.go | 20 +- ...onlyauthentications_client_example_test.go | 140 - .../serverblobauditingpolicies_client.go | 14 +- ...lobauditingpolicies_client_example_test.go | 202 - .../armsql/servercommunicationlinks_client.go | 310 -- ...rcommunicationlinks_client_example_test.go | 129 - .../serverconfigurationoptions_client.go | 14 +- ...onfigurationoptions_client_example_test.go | 122 - .../armsql/serverconnectionpolicies_client.go | 14 +- ...rconnectionpolicies_client_example_test.go | 122 - .../serverdevopsauditsettings_client.go | 14 +- ...devopsauditsettings_client_example_test.go | 174 - .../sql/armsql/serverdnsaliases_client.go | 26 +- .../serverdnsaliases_client_example_test.go | 178 - .../sql/armsql/serverkeys_client.go | 20 +- .../armsql/serverkeys_client_example_test.go | 174 - .../sql/armsql/serveroperations_client.go | 4 +- .../serveroperations_client_example_test.go | 72 - .../sql/armsql/servers_client.go | 46 +- .../sql/armsql/servers_client_example_test.go | 912 ----- .../serversecurityalertpolicies_client.go | 24 +- ...curityalertpolicies_client_example_test.go | 231 -- .../armsql/servertrustcertificates_client.go | 20 +- ...ertrustcertificates_client_example_test.go | 152 - .../sql/armsql/servertrustgroups_client.go | 24 +- .../servertrustgroups_client_example_test.go | 255 -- .../sql/armsql/serverusages_client.go | 24 +- .../serverusages_client_example_test.go | 62 - .../servervulnerabilityassessments_client.go | 16 +- ...rabilityassessments_client_example_test.go | 235 -- .../sql/armsql/serviceobjectives_client.go | 175 - .../serviceobjectives_client_example_test.go | 605 --- ...tartstopmanagedinstanceschedules_client.go | 16 +- ...edinstanceschedules_client_example_test.go | 286 -- .../sql/armsql/subscriptionusages_client.go | 8 +- .../subscriptionusages_client_example_test.go | 110 - .../armsql/synapselinkworkspaces_client.go | 4 +- ...napselinkworkspaces_client_example_test.go | 62 - .../sql/armsql/syncagents_client.go | 28 +- .../armsql/syncagents_client_example_test.go | 254 -- .../sql/armsql/syncgroups_client.go | 52 +- .../armsql/syncgroups_client_example_test.go | 460 --- .../sql/armsql/syncmembers_client.go | 36 +- .../armsql/syncmembers_client_example_test.go | 346 -- .../sql/armsql/tdecertificates_client.go | 6 +- .../tdecertificates_client_example_test.go | 44 - .../sql/armsql/timezones_client.go | 8 +- .../armsql/timezones_client_example_test.go | 1326 ------- .../transparentdataencryptions_client.go | 14 +- ...rentdataencryptions_client_example_test.go | 119 - .../sql/armsql/usages_client.go | 4 +- .../sql/armsql/usages_client_example_test.go | 207 - .../sql/armsql/virtualclusters_client.go | 30 +- .../virtualclusters_client_example_test.go | 278 -- .../sql/armsql/virtualnetworkrules_client.go | 20 +- ...virtualnetworkrules_client_example_test.go | 156 - .../vulnerabilityassessmentbaseline_client.go | 8 +- ...yassessmentbaseline_client_example_test.go | 140 - ...vulnerabilityassessmentbaselines_client.go | 4 +- ...assessmentbaselines_client_example_test.go | 136 - ...lnerabilityassessmentexecutescan_client.go | 6 +- ...sessmentexecutescan_client_example_test.go | 39 - ...nerabilityassessmentrulebaseline_client.go | 12 +- ...essmentrulebaseline_client_example_test.go | 169 - ...erabilityassessmentrulebaselines_client.go | 4 +- ...ssmentrulebaselines_client_example_test.go | 35 - .../armsql/vulnerabilityassessments_client.go | 4 +- ...rabilityassessments_client_example_test.go | 35 - ...ulnerabilityassessmentscanresult_client.go | 8 +- ...ssessmentscanresult_client_example_test.go | 213 -- .../vulnerabilityassessmentscans_client.go | 8 +- ...lityassessmentscans_client_example_test.go | 158 - ...vulnerabilityassessmentssettings_client.go | 12 +- ...assessmentssettings_client_example_test.go | 115 - .../sql/armsql/workloadclassifiers_client.go | 20 +- ...workloadclassifiers_client_example_test.go | 227 -- .../sql/armsql/workloadgroups_client.go | 20 +- .../workloadgroups_client_example_test.go | 229 -- 308 files changed, 4366 insertions(+), 44159 deletions(-) delete mode 100644 sdk/resourcemanager/sql/armsql/agent_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/backupshorttermretentionpolicies_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/capabilities_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/databaseadvancedthreatprotectionsettings_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/databaseadvisors_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/databaseautomatictuning_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/databaseblobauditingpolicies_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/databasecolumns_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/databaseencryptionprotectors_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/databaseextensions_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/databaseoperations_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/databaserecommendedactions_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/databases_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/databaseschemas_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/databasesecurityalertpolicies_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentbaselines_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentexecutescan_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentrulebaselines_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentscanresult_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentscans_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentssettings_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/databasetables_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/databaseusages_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/databasevulnerabilityassessmentrulebaselines_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/databasevulnerabilityassessments_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/databasevulnerabilityassessmentscans_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/datamaskingpolicies_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/datamaskingrules_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/datawarehouseuseractivities_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/deletedservers_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/distributedavailabilitygroups_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/elasticpoolactivities_client.go delete mode 100644 sdk/resourcemanager/sql/armsql/elasticpoolactivities_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/elasticpooldatabaseactivities_client.go delete mode 100644 sdk/resourcemanager/sql/armsql/elasticpooldatabaseactivities_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/elasticpooloperations_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/elasticpools_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/encryptionprotectors_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/endpointcertificates_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/extendeddatabaseblobauditingpolicies_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/extendedserverblobauditingpolicies_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/failovergroups_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/firewallrules_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/geobackuppolicies_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/instancefailovergroups_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/instancepools_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ipv6firewallrules_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/jobagents_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/jobcredentials_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/jobexecutions_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/jobs_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/jobstepexecutions_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/jobsteps_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/jobtargetexecutions_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/jobtargetgroups_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/jobversions_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ledgerdigestuploads_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/longtermretentionbackups_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/longtermretentionmanagedinstancebackups_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/longtermretentionpolicies_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/maintenancewindowoptions_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/maintenancewindows_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/managedbackupshorttermretentionpolicies_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/manageddatabaseadvancedthreatprotectionsettings_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/manageddatabasecolumns_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/manageddatabasemoveoperations_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/manageddatabasequeries_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/manageddatabaserecommendedsensitivitylabels_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/manageddatabaserestoredetails_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/manageddatabases_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/manageddatabaseschemas_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/manageddatabasesecurityalertpolicies_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/manageddatabasesecurityevents_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/manageddatabasesensitivitylabels_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/manageddatabasetables_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/manageddatabasetransparentdataencryption_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessmentrulebaselines_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessments_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessmentscans_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/managedinstanceadministrators_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/managedinstanceadvancedthreatprotectionsettings_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/managedinstanceazureadonlyauthentications_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/managedinstancedtcs_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/managedinstanceencryptionprotectors_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/managedinstancekeys_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/managedinstancelongtermretentionpolicies_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/managedinstanceoperations_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/managedinstanceprivateendpointconnections_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/managedinstanceprivatelinkresources_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/managedinstances_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/managedinstancetdecertificates_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/managedinstancevulnerabilityassessments_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/managedledgerdigestuploads_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/managedrestorabledroppeddatabasebackupshorttermretentionpolicies_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/managedserverdnsaliases_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/managedserversecurityalertpolicies_client_example_test.go create mode 100644 sdk/resourcemanager/sql/armsql/networksecurityperimeterconfigurations_client.go delete mode 100644 sdk/resourcemanager/sql/armsql/outboundfirewallrules_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/privateendpointconnections_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/privatelinkresources_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/recommendedsensitivitylabels_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/recoverabledatabases_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/recoverablemanageddatabases_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/replicationlinks_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/restorabledroppeddatabases_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/restorabledroppedmanageddatabases_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/restorepoints_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/sensitivitylabels_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/serveradvancedthreatprotectionsettings_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/serveradvisors_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/serverautomatictuning_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/serverazureadadministrators_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/serverazureadonlyauthentications_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/serverblobauditingpolicies_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/servercommunicationlinks_client.go delete mode 100644 sdk/resourcemanager/sql/armsql/servercommunicationlinks_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/serverconfigurationoptions_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/serverconnectionpolicies_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/serverdevopsauditsettings_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/serverdnsaliases_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/serverkeys_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/serveroperations_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/servers_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/serversecurityalertpolicies_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/servertrustcertificates_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/servertrustgroups_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/serverusages_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/servervulnerabilityassessments_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/serviceobjectives_client.go delete mode 100644 sdk/resourcemanager/sql/armsql/serviceobjectives_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/startstopmanagedinstanceschedules_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/subscriptionusages_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/synapselinkworkspaces_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/syncagents_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/syncgroups_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/syncmembers_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/tdecertificates_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/timezones_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/transparentdataencryptions_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/usages_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/virtualclusters_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/virtualnetworkrules_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/vulnerabilityassessmentbaseline_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/vulnerabilityassessmentbaselines_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/vulnerabilityassessmentexecutescan_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/vulnerabilityassessmentrulebaseline_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/vulnerabilityassessmentrulebaselines_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/vulnerabilityassessments_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/vulnerabilityassessmentscanresult_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/vulnerabilityassessmentscans_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/vulnerabilityassessmentssettings_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/workloadclassifiers_client_example_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/workloadgroups_client_example_test.go diff --git a/sdk/resourcemanager/sql/armsql/CHANGELOG.md b/sdk/resourcemanager/sql/armsql/CHANGELOG.md index 4d23c13a3b67..3456b154c846 100644 --- a/sdk/resourcemanager/sql/armsql/CHANGELOG.md +++ b/sdk/resourcemanager/sql/armsql/CHANGELOG.md @@ -1,5 +1,176 @@ # Release History +## 2.0.0-beta.2 (2023-08-30) +### Breaking Changes + +- Function `*DataMaskingPoliciesClient.CreateOrUpdate` parameter(s) have been changed from `(context.Context, string, string, string, DataMaskingPolicy, *DataMaskingPoliciesClientCreateOrUpdateOptions)` to `(context.Context, string, string, string, DataMaskingPolicyName, DataMaskingPolicy, *DataMaskingPoliciesClientCreateOrUpdateOptions)` +- Function `*DataMaskingPoliciesClient.Get` parameter(s) have been changed from `(context.Context, string, string, string, *DataMaskingPoliciesClientGetOptions)` to `(context.Context, string, string, string, DataMaskingPolicyName, *DataMaskingPoliciesClientGetOptions)` +- Function `*DataMaskingRulesClient.CreateOrUpdate` parameter(s) have been changed from `(context.Context, string, string, string, string, DataMaskingRule, *DataMaskingRulesClientCreateOrUpdateOptions)` to `(context.Context, string, string, string, DataMaskingPolicyName, string, DataMaskingRule, *DataMaskingRulesClientCreateOrUpdateOptions)` +- Function `*DataMaskingRulesClient.NewListByDatabasePager` parameter(s) have been changed from `(string, string, string, *DataMaskingRulesClientListByDatabaseOptions)` to `(string, string, string, DataMaskingPolicyName, *DataMaskingRulesClientListByDatabaseOptions)` +- Function `*DistributedAvailabilityGroupsClient.BeginCreateOrUpdate` parameter(s) have been changed from `(context.Context, string, string, string, DistributedAvailabilityGroup, *DistributedAvailabilityGroupsClientBeginCreateOrUpdateOptions)` to `(context.Context, string, string, string, DistributedAvailabilityGroupsCreateOrUpdateRequestBody, *DistributedAvailabilityGroupsClientBeginCreateOrUpdateOptions)` +- Function `*ManagedServerSecurityAlertPoliciesClient.BeginCreateOrUpdate` parameter(s) have been changed from `(context.Context, string, string, SecurityAlertPolicyName, ManagedServerSecurityAlertPolicy, *ManagedServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions)` to `(context.Context, string, string, SecurityAlertPolicyNameAutoGenerated, ManagedServerSecurityAlertPolicy, *ManagedServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions)` +- Function `*ManagedServerSecurityAlertPoliciesClient.Get` parameter(s) have been changed from `(context.Context, string, string, SecurityAlertPolicyName, *ManagedServerSecurityAlertPoliciesClientGetOptions)` to `(context.Context, string, string, SecurityAlertPolicyNameAutoGenerated, *ManagedServerSecurityAlertPoliciesClientGetOptions)` +- Function `*OutboundFirewallRulesClient.BeginCreateOrUpdate` parameter(s) have been changed from `(context.Context, string, string, string, OutboundFirewallRule, *OutboundFirewallRulesClientBeginCreateOrUpdateOptions)` to `(context.Context, string, string, string, *OutboundFirewallRulesClientBeginCreateOrUpdateOptions)` +- Function `*ServerSecurityAlertPoliciesClient.BeginCreateOrUpdate` parameter(s) have been changed from `(context.Context, string, string, SecurityAlertPolicyName, ServerSecurityAlertPolicy, *ServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions)` to `(context.Context, string, string, SecurityAlertPolicyNameAutoGenerated, ServerSecurityAlertPolicy, *ServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions)` +- Function `*ServerSecurityAlertPoliciesClient.Get` parameter(s) have been changed from `(context.Context, string, string, SecurityAlertPolicyName, *ServerSecurityAlertPoliciesClientGetOptions)` to `(context.Context, string, string, SecurityAlertPolicyNameAutoGenerated, *ServerSecurityAlertPoliciesClientGetOptions)` +- Type of `DistributedAvailabilityGroupProperties.ReplicationMode` has been changed from `*ReplicationMode` to `*ReplicationModeType` +- Type of `JobExecutionsClientListByAgentOptions.Skip` has been changed from `*int32` to `*int64` +- Type of `JobExecutionsClientListByAgentOptions.Top` has been changed from `*int32` to `*int64` +- Type of `JobExecutionsClientListByJobOptions.Skip` has been changed from `*int32` to `*int64` +- Type of `JobExecutionsClientListByJobOptions.Top` has been changed from `*int32` to `*int64` +- Type of `JobStepExecutionsClientListByJobExecutionOptions.Skip` has been changed from `*int32` to `*int64` +- Type of `JobStepExecutionsClientListByJobExecutionOptions.Top` has been changed from `*int32` to `*int64` +- Type of `JobTargetExecutionsClientListByJobExecutionOptions.Skip` has been changed from `*int32` to `*int64` +- Type of `JobTargetExecutionsClientListByJobExecutionOptions.Top` has been changed from `*int32` to `*int64` +- Type of `JobTargetExecutionsClientListByStepOptions.Skip` has been changed from `*int32` to `*int64` +- Type of `JobTargetExecutionsClientListByStepOptions.Top` has been changed from `*int32` to `*int64` +- Type of `LongTermRetentionPolicy.Properties` has been changed from `*BaseLongTermRetentionPolicyProperties` to `*LongTermRetentionPolicyProperties` +- Type of `ManagedDatabaseSecurityEventsClientListByDatabaseOptions.Skip` has been changed from `*int32` to `*int64` +- Type of `ManagedDatabaseSecurityEventsClientListByDatabaseOptions.Top` has been changed from `*int32` to `*int64` +- Type of `ManagedInstanceOperationSteps.StepsList` has been changed from `[]*UpsertManagedServerOperationStep` to `[]*UpsertManagedServerOperationStepWithEstimatesAndDuration` +- Type of `ManagedInstanceProperties.ProvisioningState` has been changed from `*ManagedInstancePropertiesProvisioningState` to `*ProvisioningState` +- Enum `ManagedInstancePropertiesProvisioningState` has been removed +- Enum `PrimaryAggregationType` has been removed +- Enum `ReplicationMode` has been removed +- Enum `ServiceObjectiveName` has been removed +- Enum `UnitDefinitionType` has been removed +- Enum `UnitType` has been removed +- Enum `UpsertManagedServerOperationStepStatus` has been removed +- Function `*ClientFactory.NewElasticPoolActivitiesClient` has been removed +- Function `*ClientFactory.NewElasticPoolDatabaseActivitiesClient` has been removed +- Function `*ClientFactory.NewServerCommunicationLinksClient` has been removed +- Function `*ClientFactory.NewServiceObjectivesClient` has been removed +- Function `*DatabasesClient.NewListMetricDefinitionsPager` has been removed +- Function `*DatabasesClient.NewListMetricsPager` has been removed +- Function `NewElasticPoolActivitiesClient` has been removed +- Function `*ElasticPoolActivitiesClient.NewListByElasticPoolPager` has been removed +- Function `NewElasticPoolDatabaseActivitiesClient` has been removed +- Function `*ElasticPoolDatabaseActivitiesClient.NewListByElasticPoolPager` has been removed +- Function `*ElasticPoolsClient.NewListMetricDefinitionsPager` has been removed +- Function `*ElasticPoolsClient.NewListMetricsPager` has been removed +- Function `*GeoBackupPoliciesClient.NewListByDatabasePager` has been removed +- Function `NewServerCommunicationLinksClient` has been removed +- Function `*ServerCommunicationLinksClient.BeginCreateOrUpdate` has been removed +- Function `*ServerCommunicationLinksClient.Delete` has been removed +- Function `*ServerCommunicationLinksClient.Get` has been removed +- Function `*ServerCommunicationLinksClient.NewListByServerPager` has been removed +- Function `NewServiceObjectivesClient` has been removed +- Function `*ServiceObjectivesClient.Get` has been removed +- Function `*ServiceObjectivesClient.NewListByServerPager` has been removed +- Struct `ElasticPoolActivity` has been removed +- Struct `ElasticPoolActivityListResult` has been removed +- Struct `ElasticPoolActivityProperties` has been removed +- Struct `ElasticPoolDatabaseActivity` has been removed +- Struct `ElasticPoolDatabaseActivityListResult` has been removed +- Struct `ElasticPoolDatabaseActivityProperties` has been removed +- Struct `Metric` has been removed +- Struct `MetricAvailability` has been removed +- Struct `MetricDefinition` has been removed +- Struct `MetricDefinitionListResult` has been removed +- Struct `MetricListResult` has been removed +- Struct `MetricName` has been removed +- Struct `MetricValue` has been removed +- Struct `OperationImpact` has been removed +- Struct `ServerCommunicationLink` has been removed +- Struct `ServerCommunicationLinkListResult` has been removed +- Struct `ServerCommunicationLinkProperties` has been removed +- Struct `ServiceObjective` has been removed +- Struct `ServiceObjectiveListResult` has been removed +- Struct `ServiceObjectiveProperties` has been removed +- Struct `SloUsageMetric` has been removed +- Struct `UpsertManagedServerOperationStep` has been removed +- Field `LastHardenedLsn`, `LinkState`, `PrimaryAvailabilityGroupName`, `SecondaryAvailabilityGroupName`, `SourceEndpoint`, `SourceReplicaID`, `TargetDatabase`, `TargetReplicaID` of struct `DistributedAvailabilityGroupProperties` has been removed +- Field `ZoneRedundant` of struct `ManagedInstanceEditionCapability` has been removed +- Field `CurrentValue`, `DisplayName`, `Limit`, `NextResetTime`, `ResourceName`, `Unit` of struct `ServerUsage` has been removed + +### Features Added + +- New value `OperationModeExport`, `OperationModeImport` added to enum type `OperationMode` +- New value `StorageCapabilityStorageAccountTypeGZRS` added to enum type `StorageCapabilityStorageAccountType` +- New enum type `ClientClassificationSource` with values `ClientClassificationSourceMIP`, `ClientClassificationSourceNative`, `ClientClassificationSourceNone`, `ClientClassificationSourceRecommended` +- New enum type `DataMaskingPolicyName` with values `DataMaskingPolicyNameDefault` +- New enum type `FreeLimitExhaustionBehavior` with values `FreeLimitExhaustionBehaviorAutoPause`, `FreeLimitExhaustionBehaviorBillOverUsage` +- New enum type `FreemiumType` with values `FreemiumTypeFreemium`, `FreemiumTypeRegular` +- New enum type `HybridSecondaryUsage` with values `HybridSecondaryUsageActive`, `HybridSecondaryUsagePassive` +- New enum type `HybridSecondaryUsageDetected` with values `HybridSecondaryUsageDetectedActive`, `HybridSecondaryUsageDetectedPassive` +- New enum type `InstanceRole` with values `InstanceRolePrimary`, `InstanceRoleSecondary` +- New enum type `LinkRole` with values `LinkRolePrimary`, `LinkRoleSecondary` +- New enum type `Phase` with values `PhaseCatchup`, `PhaseCopying`, `PhaseCutoverInProgress`, `PhaseWaitingForCutover` +- New enum type `ReplicaConnectedState` with values `ReplicaConnectedStateCONNECTED`, `ReplicaConnectedStateDISCONNECTED` +- New enum type `ReplicaSynchronizationHealth` with values `ReplicaSynchronizationHealthHEALTHY`, `ReplicaSynchronizationHealthNOTHEALTHY`, `ReplicaSynchronizationHealthPARTIALLYHEALTHY` +- New enum type `ReplicationModeType` with values `ReplicationModeTypeAsync`, `ReplicationModeTypeSync` +- New enum type `RoleChangeType` with values `RoleChangeTypeForced`, `RoleChangeTypePlanned` +- New enum type `SecurityAlertPolicyNameAutoGenerated` with values `SecurityAlertPolicyNameAutoGeneratedDefault` +- New enum type `Status` with values `StatusCanceled`, `StatusCompleted`, `StatusFailed`, `StatusInProgress`, `StatusNotStarted`, `StatusSlowedDown` +- New function `*ClientFactory.NewNetworkSecurityPerimeterConfigurationsClient() *NetworkSecurityPerimeterConfigurationsClient` +- New function `*DistributedAvailabilityGroupsClient.BeginSetRole(context.Context, string, string, string, DistributedAvailabilityGroupSetRole, *DistributedAvailabilityGroupsClientBeginSetRoleOptions) (*runtime.Poller[DistributedAvailabilityGroupsClientSetRoleResponse], error)` +- New function `*GeoBackupPoliciesClient.NewListPager(string, string, string, *GeoBackupPoliciesClientListOptions) *runtime.Pager[GeoBackupPoliciesClientListResponse]` +- New function `*ManagedDatabaseSensitivityLabelsClient.NewListByDatabasePager(string, string, string, *ManagedDatabaseSensitivityLabelsClientListByDatabaseOptions) *runtime.Pager[ManagedDatabaseSensitivityLabelsClientListByDatabaseResponse]` +- New function `*ManagedInstanceLongTermRetentionPoliciesClient.BeginDelete(context.Context, string, string, string, ManagedInstanceLongTermRetentionPolicyName, *ManagedInstanceLongTermRetentionPoliciesClientBeginDeleteOptions) (*runtime.Poller[ManagedInstanceLongTermRetentionPoliciesClientDeleteResponse], error)` +- New function `*ManagedInstancesClient.BeginRefreshStatus(context.Context, string, string, *ManagedInstancesClientBeginRefreshStatusOptions) (*runtime.Poller[ManagedInstancesClientRefreshStatusResponse], error)` +- New function `PossibleHybridSecondaryUsageValues() []HybridSecondaryUsage` +- New function `*SensitivityLabelsClient.NewListByDatabasePager(string, string, string, *SensitivityLabelsClientListByDatabaseOptions) *runtime.Pager[SensitivityLabelsClientListByDatabaseResponse]` +- New function `NewNetworkSecurityPerimeterConfigurationsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*NetworkSecurityPerimeterConfigurationsClient, error)` +- New function `*NetworkSecurityPerimeterConfigurationsClient.Get(context.Context, string, string, string, *NetworkSecurityPerimeterConfigurationsClientGetOptions) (NetworkSecurityPerimeterConfigurationsClientGetResponse, error)` +- New function `*NetworkSecurityPerimeterConfigurationsClient.NewListByServerPager(string, string, *NetworkSecurityPerimeterConfigurationsClientListByServerOptions) *runtime.Pager[NetworkSecurityPerimeterConfigurationsClientListByServerResponse]` +- New function `*NetworkSecurityPerimeterConfigurationsClient.BeginReconcile(context.Context, string, string, string, *NetworkSecurityPerimeterConfigurationsClientBeginReconcileOptions) (*runtime.Poller[NetworkSecurityPerimeterConfigurationsClientReconcileResponse], error)` +- New struct `CertificateInfo` +- New struct `CreateOrUpdateProperties` +- New struct `DistributedAvailabilityGroupDatabase` +- New struct `DistributedAvailabilityGroupSetRole` +- New struct `DistributedAvailabilityGroupsCreateOrUpdateRequestBody` +- New struct `ErrorAdditionalInfo` +- New struct `ErrorDetail` +- New struct `ErrorResponse` +- New struct `FreeLimitExhaustionBehaviorCapability` +- New struct `LongTermRetentionPolicyProperties` +- New struct `MaxLimitRangeCapability` +- New struct `NSPConfigAccessRule` +- New struct `NSPConfigAccessRuleProperties` +- New struct `NSPConfigAssociation` +- New struct `NSPConfigNetworkSecurityPerimeterRule` +- New struct `NSPConfigPerimeter` +- New struct `NSPConfigProfile` +- New struct `NSPProvisioningIssue` +- New struct `NSPProvisioningIssueProperties` +- New struct `NetworkSecurityPerimeterConfiguration` +- New struct `NetworkSecurityPerimeterConfigurationListResult` +- New struct `NetworkSecurityPerimeterConfigurationProperties` +- New struct `PhaseDetails` +- New struct `RefreshExternalGovernanceStatusOperationResultMI` +- New struct `RefreshExternalGovernanceStatusOperationResultPropertiesMI` +- New struct `ServerUsageProperties` +- New struct `UpsertManagedServerOperationStepWithEstimatesAndDuration` +- New field `NextLink` in struct `DataMaskingRuleListResult` +- New field `AdministratorLogin`, `AdministratorLoginPassword`, `AuthenticationType`, `DatabaseEdition`, `MaxSizeBytes`, `NetworkIsolation`, `ServiceObjectiveName` in struct `DatabaseExtensionsProperties` +- New field `OperationPhaseDetails` in struct `DatabaseOperationProperties` +- New field `EncryptionProtectorAutoRotation`, `FreeLimitExhaustionBehavior`, `UseFreeLimit` in struct `DatabaseProperties` +- New field `EncryptionProtectorAutoRotation`, `FreeLimitExhaustionBehavior`, `UseFreeLimit` in struct `DatabaseUpdateProperties` +- New field `Databases`, `DistributedAvailabilityGroupName`, `InstanceAvailabilityGroupName`, `InstanceLinkRole`, `PartnerAvailabilityGroupName`, `PartnerEndpoint`, `PartnerLinkRole` in struct `DistributedAvailabilityGroupProperties` +- New field `ZonePinning` in struct `EditionCapability` +- New field `ZonePinning` in struct `ElasticPoolEditionCapability` +- New field `TargetServer` in struct `FailoverGroupReadOnlyEndpoint` +- New field `PartnerServers` in struct `FailoverGroupUpdateProperties` +- New field `NextLink` in struct `GeoBackupPolicyListResult` +- New field `BlobURI`, `PrivateEndpointConnections`, `QueuedTime` in struct `ImportExportExtensionsOperationResultProperties` +- New field `DNSZone`, `MaintenanceConfigurationID` in struct `InstancePoolProperties` +- New field `Properties`, `SKU` in struct `InstancePoolUpdate` +- New field `IsBackupImmutable` in struct `LongTermRetentionBackupProperties` +- New field `IsGeneralPurposeV2` in struct `ManagedInstanceEditionCapability` +- New field `ZoneRedundant` in struct `ManagedInstanceFamilyCapability` +- New field `RequiredZoneNames` in struct `ManagedInstancePrivateLinkProperties` +- New field `CreateTime`, `ExternalGovernanceStatus`, `HybridSecondaryUsage`, `HybridSecondaryUsageDetected`, `IsGeneralPurposeV2`, `PricingModel`, `StorageIOps`, `StorageThroughputMBps`, `VirtualClusterID` in struct `ManagedInstanceProperties` +- New field `IncludedStorageIOps`, `IncludedStorageThroughputMBps`, `IopsIncludedValueOverrideFactorPerSelectedStorageGB`, `IopsMinValueOverrideFactorPerSelectedStorageGB`, `SupportedStorageIOps`, `SupportedStorageThroughputMBps`, `ThroughputMBpsIncludedValueOverrideFactorPerSelectedStorageGB`, `ThroughputMBpsMinValueOverrideFactorPerSelectedStorageGB` in struct `ManagedInstanceVcoresCapability` +- New anonymous field `ManagedInstance` in struct `ManagedInstancesClientStartResponse` +- New anonymous field `ManagedInstance` in struct `ManagedInstancesClientStopResponse` +- New field `PartnerDatabaseID` in struct `ReplicationLinkProperties` +- New field `ClientClassificationSource` in struct `SensitivityLabelProperties` +- New field `IsIPv6Enabled` in struct `ServerProperties` +- New field `ID`, `Properties`, `Type` in struct `ServerUsage` +- New field `NextLink` in struct `ServerUsageListResult` +- New field `SupportedFreeLimitExhaustionBehaviors`, `ZonePinning` in struct `ServiceObjectiveCapability` + + ## 2.0.0-beta.1 (2023-07-28) ### Breaking Changes diff --git a/sdk/resourcemanager/sql/armsql/agent_client.go b/sdk/resourcemanager/sql/armsql/agent_client.go index 181a3b7d35b6..08169c61693c 100644 --- a/sdk/resourcemanager/sql/armsql/agent_client.go +++ b/sdk/resourcemanager/sql/armsql/agent_client.go @@ -46,7 +46,7 @@ func NewAgentClient(subscriptionID string, credential azcore.TokenCredential, op // CreateOrUpdate - Puts new sql agent configuration to instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -89,7 +89,7 @@ func (client *AgentClient) createOrUpdateCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -110,7 +110,7 @@ func (client *AgentClient) createOrUpdateHandleResponse(resp *http.Response) (Ag // Get - Gets current instance sql agent configuration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -153,7 +153,7 @@ func (client *AgentClient) getCreateRequest(ctx context.Context, resourceGroupNa return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/agent_client_example_test.go b/sdk/resourcemanager/sql/armsql/agent_client_example_test.go deleted file mode 100644 index 8f561ab2a18a..000000000000 --- a/sdk/resourcemanager/sql/armsql/agent_client_example_test.go +++ /dev/null @@ -1,79 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SqlAgentConfigurationGet.json -func ExampleAgentClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAgentClient().Get(ctx, "sqlcrudtest-7398", "sqlcrudtest-4645", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AgentConfiguration = armsql.AgentConfiguration{ - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/sqlAgent"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/managedInstances/sqlcrudtest-4645/sqlAgent/current"), - // Properties: &armsql.AgentConfigurationProperties{ - // State: to.Ptr(armsql.SQLAgentConfigurationPropertiesStateEnabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SqlAgentConfigurationPut.json -func ExampleAgentClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAgentClient().CreateOrUpdate(ctx, "sqlcrudtest-7398", "sqlcrudtest-4645", armsql.AgentConfiguration{ - Properties: &armsql.AgentConfigurationProperties{ - State: to.Ptr(armsql.SQLAgentConfigurationPropertiesStateEnabled), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AgentConfiguration = armsql.AgentConfiguration{ - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/sqlAgent"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/managedInstances/sqlcrudtest-4645/sqlAgent/current"), - // Properties: &armsql.AgentConfigurationProperties{ - // State: to.Ptr(armsql.SQLAgentConfigurationPropertiesStateEnabled), - // }, - // } -} diff --git a/sdk/resourcemanager/sql/armsql/autorest.md b/sdk/resourcemanager/sql/armsql/autorest.md index 8aedd8bd4b72..939b9d8b6c7a 100644 --- a/sdk/resourcemanager/sql/armsql/autorest.md +++ b/sdk/resourcemanager/sql/armsql/autorest.md @@ -5,9 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/sql/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/sql/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 2.0.0-beta.1 -tag: package-composite-v5 +module-version: 2.0.0-beta.2 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/sql/armsql/backupshorttermretentionpolicies_client.go b/sdk/resourcemanager/sql/armsql/backupshorttermretentionpolicies_client.go index e470d3ad4b7c..4957d5186ae9 100644 --- a/sdk/resourcemanager/sql/armsql/backupshorttermretentionpolicies_client.go +++ b/sdk/resourcemanager/sql/armsql/backupshorttermretentionpolicies_client.go @@ -46,7 +46,7 @@ func NewBackupShortTermRetentionPoliciesClient(subscriptionID string, credential // BeginCreateOrUpdate - Updates a database's short term retention policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-02-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -71,7 +71,7 @@ func (client *BackupShortTermRetentionPoliciesClient) BeginCreateOrUpdate(ctx co // CreateOrUpdate - Updates a database's short term retention policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-02-01-preview +// Generated from API version 2023-05-01-preview func (client *BackupShortTermRetentionPoliciesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, policyName ShortTermRetentionPolicyName, parameters BackupShortTermRetentionPolicy, options *BackupShortTermRetentionPoliciesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, policyName, parameters, options) @@ -117,7 +117,7 @@ func (client *BackupShortTermRetentionPoliciesClient) createOrUpdateCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-02-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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 *BackupShortTermRetentionPoliciesClient) createOrUpdateCreateReques // Get - Gets a database's short term retention policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-02-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -183,7 +183,7 @@ func (client *BackupShortTermRetentionPoliciesClient) getCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-02-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -200,7 +200,7 @@ func (client *BackupShortTermRetentionPoliciesClient) getHandleResponse(resp *ht // NewListByDatabasePager - Gets a database's short term retention policy. // -// Generated from API version 2021-02-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -259,7 +259,7 @@ func (client *BackupShortTermRetentionPoliciesClient) listByDatabaseCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-02-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -277,7 +277,7 @@ func (client *BackupShortTermRetentionPoliciesClient) listByDatabaseHandleRespon // BeginUpdate - Updates a database's short term retention policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-02-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -302,7 +302,7 @@ func (client *BackupShortTermRetentionPoliciesClient) BeginUpdate(ctx context.Co // Update - Updates a database's short term retention policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-02-01-preview +// Generated from API version 2023-05-01-preview func (client *BackupShortTermRetentionPoliciesClient) update(ctx context.Context, resourceGroupName string, serverName string, databaseName string, policyName ShortTermRetentionPolicyName, parameters BackupShortTermRetentionPolicy, options *BackupShortTermRetentionPoliciesClientBeginUpdateOptions) (*http.Response, error) { var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, serverName, databaseName, policyName, parameters, options) @@ -348,7 +348,7 @@ func (client *BackupShortTermRetentionPoliciesClient) updateCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-02-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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/sql/armsql/backupshorttermretentionpolicies_client_example_test.go b/sdk/resourcemanager/sql/armsql/backupshorttermretentionpolicies_client_example_test.go deleted file mode 100644 index f0abbd46b0ec..000000000000 --- a/sdk/resourcemanager/sql/armsql/backupshorttermretentionpolicies_client_example_test.go +++ /dev/null @@ -1,123 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/GetShortTermRetentionPolicy.json -func ExampleBackupShortTermRetentionPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewBackupShortTermRetentionPoliciesClient().Get(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.ShortTermRetentionPolicyNameDefault, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.BackupShortTermRetentionPolicy = armsql.BackupShortTermRetentionPolicy{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/backupShortTermRetentionPolicies"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb/backupShortTermRetentionPolicies/default"), - // Properties: &armsql.BackupShortTermRetentionPolicyProperties{ - // DiffBackupIntervalInHours: to.Ptr(armsql.DiffBackupIntervalInHours(24)), - // RetentionDays: to.Ptr[int32](7), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/UpdateShortTermRetentionPolicy.json -func ExampleBackupShortTermRetentionPoliciesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewBackupShortTermRetentionPoliciesClient().BeginCreateOrUpdate(ctx, "resourceGroup", "testsvr", "testdb", armsql.ShortTermRetentionPolicyNameDefault, armsql.BackupShortTermRetentionPolicy{ - Properties: &armsql.BackupShortTermRetentionPolicyProperties{ - DiffBackupIntervalInHours: to.Ptr(armsql.DiffBackupIntervalInHours(24)), - RetentionDays: to.Ptr[int32](7), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.BackupShortTermRetentionPolicy = armsql.BackupShortTermRetentionPolicy{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/backupShortTermRetentionPolicies"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/resourceGroups/resourceGroup/servers/testsvr/databases/testdb/backupShortTermRetentionPolicies/default"), - // Properties: &armsql.BackupShortTermRetentionPolicyProperties{ - // DiffBackupIntervalInHours: to.Ptr(armsql.DiffBackupIntervalInHours(24)), - // RetentionDays: to.Ptr[int32](7), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ListShortTermRetentionPoliciesByDatabase.json -func ExampleBackupShortTermRetentionPoliciesClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewBackupShortTermRetentionPoliciesClient().NewListByDatabasePager("Default-SQL-SouthEastAsia", "testsvr", "testdb", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.BackupShortTermRetentionPolicyListResult = armsql.BackupShortTermRetentionPolicyListResult{ - // Value: []*armsql.BackupShortTermRetentionPolicy{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/backupShortTermRetentionPolicies"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb/backupShortTermRetentionPolicies/default"), - // Properties: &armsql.BackupShortTermRetentionPolicyProperties{ - // DiffBackupIntervalInHours: to.Ptr(armsql.DiffBackupIntervalInHours(24)), - // RetentionDays: to.Ptr[int32](7), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/sql/armsql/capabilities_client.go b/sdk/resourcemanager/sql/armsql/capabilities_client.go index 32412a56cb23..a0f08f14cb03 100644 --- a/sdk/resourcemanager/sql/armsql/capabilities_client.go +++ b/sdk/resourcemanager/sql/armsql/capabilities_client.go @@ -46,7 +46,7 @@ func NewCapabilitiesClient(subscriptionID string, credential azcore.TokenCredent // ListByLocation - Gets the subscription capabilities available for the specified location. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - locationName - The location name whose capabilities are retrieved. // - options - CapabilitiesClientListByLocationOptions contains the optional parameters for the CapabilitiesClient.ListByLocation // method. @@ -87,7 +87,7 @@ func (client *CapabilitiesClient) listByLocationCreateRequest(ctx context.Contex if options != nil && options.Include != nil { reqQP.Set("include", string(*options.Include)) } - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/capabilities_client_example_test.go b/sdk/resourcemanager/sql/armsql/capabilities_client_example_test.go deleted file mode 100644 index 4a6ddc2128a0..000000000000 --- a/sdk/resourcemanager/sql/armsql/capabilities_client_example_test.go +++ /dev/null @@ -1,3048 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/LocationCapabilityListByLocation.json -func ExampleCapabilitiesClient_ListByLocation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCapabilitiesClient().ListByLocation(ctx, "eastus", &armsql.CapabilitiesClientListByLocationOptions{Include: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LocationCapabilities = armsql.LocationCapabilities{ - // Name: to.Ptr("East US"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedManagedInstanceVersions: []*armsql.ManagedInstanceVersionCapability{ - // { - // Name: to.Ptr("12.0"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // SupportedEditions: []*armsql.ManagedInstanceEditionCapability{ - // { - // Name: to.Ptr("GeneralPurpose"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // SupportedFamilies: []*armsql.ManagedInstanceFamilyCapability{ - // { - // Name: to.Ptr("Gen4"), - // SKU: to.Ptr("GP_Gen4"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedLicenseTypes: []*armsql.LicenseTypeCapability{ - // { - // Name: to.Ptr("LicenseIncluded"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // }, - // { - // Name: to.Ptr("BasePrice"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }}, - // SupportedVcoresValues: []*armsql.ManagedInstanceVcoresCapability{ - // { - // Name: to.Ptr("8"), - // IncludedMaxSize: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](262144), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // InstancePoolSupported: to.Ptr(true), - // StandaloneSupported: to.Ptr(true), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // SupportedMaintenanceConfigurations: []*armsql.ManagedInstanceMaintenanceConfigurationCapability{ - // { - // Name: to.Ptr("SQL_Default"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // }, - // { - // Name: to.Ptr("SQL_EastUS_MI_1"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }, - // { - // Name: to.Ptr("SQL_EastUS_MI_2"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }}, - // SupportedStorageSizes: []*armsql.MaxSizeRangeCapability{ - // { - // MaxValue: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](8), - // Unit: to.Ptr(armsql.MaxSizeUnitTerabytes), - // }, - // MinValue: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](32), - // Unit: to.Ptr(armsql.MaxSizeUnitGigabytes), - // }, - // ScaleSize: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](32), - // Unit: to.Ptr(armsql.MaxSizeUnitGigabytes), - // }, - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }}, - // Value: to.Ptr[int32](8), - // }, - // { - // Name: to.Ptr("16"), - // IncludedMaxSize: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](262144), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // InstancePoolSupported: to.Ptr(true), - // StandaloneSupported: to.Ptr(true), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedMaintenanceConfigurations: []*armsql.ManagedInstanceMaintenanceConfigurationCapability{ - // { - // Name: to.Ptr("SQL_Default"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // }, - // { - // Name: to.Ptr("SQL_EastUS_MI_1"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }, - // { - // Name: to.Ptr("SQL_EastUS_MI_2"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }}, - // SupportedStorageSizes: []*armsql.MaxSizeRangeCapability{ - // { - // MaxValue: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](8), - // Unit: to.Ptr(armsql.MaxSizeUnitTerabytes), - // }, - // MinValue: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](32), - // Unit: to.Ptr(armsql.MaxSizeUnitGigabytes), - // }, - // ScaleSize: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](32), - // Unit: to.Ptr(armsql.MaxSizeUnitGigabytes), - // }, - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }}, - // Value: to.Ptr[int32](16), - // }, - // { - // Name: to.Ptr("24"), - // IncludedMaxSize: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](262144), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // InstancePoolSupported: to.Ptr(true), - // StandaloneSupported: to.Ptr(true), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedMaintenanceConfigurations: []*armsql.ManagedInstanceMaintenanceConfigurationCapability{ - // { - // Name: to.Ptr("SQL_Default"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // }, - // { - // Name: to.Ptr("SQL_EastUS_MI_1"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }, - // { - // Name: to.Ptr("SQL_EastUS_MI_2"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }}, - // SupportedStorageSizes: []*armsql.MaxSizeRangeCapability{ - // { - // MaxValue: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](8), - // Unit: to.Ptr(armsql.MaxSizeUnitTerabytes), - // }, - // MinValue: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](32), - // Unit: to.Ptr(armsql.MaxSizeUnitGigabytes), - // }, - // ScaleSize: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](32), - // Unit: to.Ptr(armsql.MaxSizeUnitGigabytes), - // }, - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }}, - // Value: to.Ptr[int32](24), - // }}, - // }, - // { - // Name: to.Ptr("Gen5"), - // SKU: to.Ptr("GP_Gen5"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // SupportedLicenseTypes: []*armsql.LicenseTypeCapability{ - // { - // Name: to.Ptr("LicenseIncluded"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // }, - // { - // Name: to.Ptr("BasePrice"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }}, - // SupportedVcoresValues: []*armsql.ManagedInstanceVcoresCapability{ - // { - // Name: to.Ptr("8"), - // IncludedMaxSize: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](262144), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // InstancePoolSupported: to.Ptr(true), - // StandaloneSupported: to.Ptr(true), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // SupportedMaintenanceConfigurations: []*armsql.ManagedInstanceMaintenanceConfigurationCapability{ - // { - // Name: to.Ptr("SQL_Default"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // }, - // { - // Name: to.Ptr("SQL_EastUS_MI_1"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }, - // { - // Name: to.Ptr("SQL_EastUS_MI_2"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }}, - // SupportedStorageSizes: []*armsql.MaxSizeRangeCapability{ - // { - // MaxValue: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](8), - // Unit: to.Ptr(armsql.MaxSizeUnitTerabytes), - // }, - // MinValue: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](32), - // Unit: to.Ptr(armsql.MaxSizeUnitGigabytes), - // }, - // ScaleSize: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](32), - // Unit: to.Ptr(armsql.MaxSizeUnitGigabytes), - // }, - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }}, - // Value: to.Ptr[int32](8), - // }, - // { - // Name: to.Ptr("16"), - // IncludedMaxSize: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](262144), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // InstancePoolSupported: to.Ptr(true), - // StandaloneSupported: to.Ptr(true), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedMaintenanceConfigurations: []*armsql.ManagedInstanceMaintenanceConfigurationCapability{ - // { - // Name: to.Ptr("SQL_Default"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // }, - // { - // Name: to.Ptr("SQL_EastUS_MI_1"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }, - // { - // Name: to.Ptr("SQL_EastUS_MI_2"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }}, - // SupportedStorageSizes: []*armsql.MaxSizeRangeCapability{ - // { - // MaxValue: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](8), - // Unit: to.Ptr(armsql.MaxSizeUnitTerabytes), - // }, - // MinValue: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](32), - // Unit: to.Ptr(armsql.MaxSizeUnitGigabytes), - // }, - // ScaleSize: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](32), - // Unit: to.Ptr(armsql.MaxSizeUnitGigabytes), - // }, - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }}, - // Value: to.Ptr[int32](16), - // }, - // { - // Name: to.Ptr("24"), - // IncludedMaxSize: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](262144), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // InstancePoolSupported: to.Ptr(true), - // StandaloneSupported: to.Ptr(true), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedMaintenanceConfigurations: []*armsql.ManagedInstanceMaintenanceConfigurationCapability{ - // { - // Name: to.Ptr("SQL_Default"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // }, - // { - // Name: to.Ptr("SQL_EastUS_MI_1"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }, - // { - // Name: to.Ptr("SQL_EastUS_MI_2"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }}, - // SupportedStorageSizes: []*armsql.MaxSizeRangeCapability{ - // { - // MaxValue: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](8), - // Unit: to.Ptr(armsql.MaxSizeUnitTerabytes), - // }, - // MinValue: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](32), - // Unit: to.Ptr(armsql.MaxSizeUnitGigabytes), - // }, - // ScaleSize: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](32), - // Unit: to.Ptr(armsql.MaxSizeUnitGigabytes), - // }, - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }}, - // Value: to.Ptr[int32](24), - // }}, - // }}, - // SupportedStorageCapabilities: []*armsql.StorageCapability{ - // { - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // StorageAccountType: to.Ptr(armsql.StorageCapabilityStorageAccountTypeGRS), - // }, - // { - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // StorageAccountType: to.Ptr(armsql.StorageCapabilityStorageAccountTypeLRS), - // }, - // { - // Reason: to.Ptr("ZRS is available in multi-az regions"), - // Status: to.Ptr(armsql.CapabilityStatusVisible), - // StorageAccountType: to.Ptr(armsql.StorageCapabilityStorageAccountTypeZRS), - // }}, - // }, - // { - // Name: to.Ptr("Hyperscale"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedFamilies: []*armsql.ManagedInstanceFamilyCapability{ - // { - // Name: to.Ptr("Gen4"), - // SKU: to.Ptr("HS_Gen4"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // SupportedLicenseTypes: []*armsql.LicenseTypeCapability{ - // { - // Name: to.Ptr("LicenseIncluded"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // }, - // { - // Name: to.Ptr("BasePrice"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }}, - // SupportedVcoresValues: []*armsql.ManagedInstanceVcoresCapability{ - // { - // Name: to.Ptr("4"), - // InstancePoolSupported: to.Ptr(true), - // StandaloneSupported: to.Ptr(true), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedMaintenanceConfigurations: []*armsql.ManagedInstanceMaintenanceConfigurationCapability{ - // { - // Name: to.Ptr("SQL_Default"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // }}, - // Value: to.Ptr[int32](4), - // }, - // { - // Name: to.Ptr("8"), - // InstancePoolSupported: to.Ptr(true), - // StandaloneSupported: to.Ptr(true), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // SupportedMaintenanceConfigurations: []*armsql.ManagedInstanceMaintenanceConfigurationCapability{ - // { - // Name: to.Ptr("SQL_Default"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // }}, - // Value: to.Ptr[int32](8), - // }, - // { - // Name: to.Ptr("16"), - // InstancePoolSupported: to.Ptr(true), - // StandaloneSupported: to.Ptr(true), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedMaintenanceConfigurations: []*armsql.ManagedInstanceMaintenanceConfigurationCapability{ - // { - // Name: to.Ptr("SQL_Default"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // }}, - // Value: to.Ptr[int32](16), - // }, - // { - // Name: to.Ptr("24"), - // InstancePoolSupported: to.Ptr(true), - // StandaloneSupported: to.Ptr(true), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedMaintenanceConfigurations: []*armsql.ManagedInstanceMaintenanceConfigurationCapability{ - // { - // Name: to.Ptr("SQL_Default"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // }}, - // Value: to.Ptr[int32](24), - // }}, - // }, - // { - // Name: to.Ptr("Gen5"), - // SKU: to.Ptr("HS_Gen5"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedLicenseTypes: []*armsql.LicenseTypeCapability{ - // { - // Name: to.Ptr("LicenseIncluded"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // }, - // { - // Name: to.Ptr("BasePrice"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }}, - // SupportedVcoresValues: []*armsql.ManagedInstanceVcoresCapability{ - // { - // Name: to.Ptr("4"), - // InstancePoolSupported: to.Ptr(true), - // StandaloneSupported: to.Ptr(true), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedMaintenanceConfigurations: []*armsql.ManagedInstanceMaintenanceConfigurationCapability{ - // { - // Name: to.Ptr("SQL_Default"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // }}, - // Value: to.Ptr[int32](4), - // }, - // { - // Name: to.Ptr("8"), - // InstancePoolSupported: to.Ptr(true), - // StandaloneSupported: to.Ptr(true), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // SupportedMaintenanceConfigurations: []*armsql.ManagedInstanceMaintenanceConfigurationCapability{ - // { - // Name: to.Ptr("SQL_Default"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // }}, - // Value: to.Ptr[int32](8), - // }, - // { - // Name: to.Ptr("16"), - // InstancePoolSupported: to.Ptr(true), - // StandaloneSupported: to.Ptr(true), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedMaintenanceConfigurations: []*armsql.ManagedInstanceMaintenanceConfigurationCapability{ - // { - // Name: to.Ptr("SQL_Default"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // }}, - // Value: to.Ptr[int32](16), - // }, - // { - // Name: to.Ptr("24"), - // InstancePoolSupported: to.Ptr(true), - // StandaloneSupported: to.Ptr(true), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedMaintenanceConfigurations: []*armsql.ManagedInstanceMaintenanceConfigurationCapability{ - // { - // Name: to.Ptr("SQL_Default"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // }}, - // Value: to.Ptr[int32](24), - // }, - // { - // Name: to.Ptr("32"), - // InstancePoolSupported: to.Ptr(true), - // StandaloneSupported: to.Ptr(true), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedMaintenanceConfigurations: []*armsql.ManagedInstanceMaintenanceConfigurationCapability{ - // { - // Name: to.Ptr("SQL_Default"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // }}, - // Value: to.Ptr[int32](32), - // }, - // { - // Name: to.Ptr("40"), - // InstancePoolSupported: to.Ptr(true), - // StandaloneSupported: to.Ptr(true), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedMaintenanceConfigurations: []*armsql.ManagedInstanceMaintenanceConfigurationCapability{ - // { - // Name: to.Ptr("SQL_Default"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // }}, - // Value: to.Ptr[int32](40), - // }, - // { - // Name: to.Ptr("48"), - // InstancePoolSupported: to.Ptr(true), - // StandaloneSupported: to.Ptr(true), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedMaintenanceConfigurations: []*armsql.ManagedInstanceMaintenanceConfigurationCapability{ - // { - // Name: to.Ptr("SQL_Default"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // }}, - // Value: to.Ptr[int32](48), - // }, - // { - // Name: to.Ptr("64"), - // InstancePoolSupported: to.Ptr(true), - // StandaloneSupported: to.Ptr(true), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedMaintenanceConfigurations: []*armsql.ManagedInstanceMaintenanceConfigurationCapability{ - // { - // Name: to.Ptr("SQL_Default"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // }}, - // Value: to.Ptr[int32](64), - // }, - // { - // Name: to.Ptr("80"), - // InstancePoolSupported: to.Ptr(true), - // StandaloneSupported: to.Ptr(true), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedMaintenanceConfigurations: []*armsql.ManagedInstanceMaintenanceConfigurationCapability{ - // { - // Name: to.Ptr("SQL_Default"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // }}, - // Value: to.Ptr[int32](80), - // }}, - // }}, - // SupportedStorageCapabilities: []*armsql.StorageCapability{ - // { - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // StorageAccountType: to.Ptr(armsql.StorageCapabilityStorageAccountTypeGRS), - // }, - // { - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // StorageAccountType: to.Ptr(armsql.StorageCapabilityStorageAccountTypeLRS), - // }, - // { - // Reason: to.Ptr("ZRS is available in multi-az regions"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // StorageAccountType: to.Ptr(armsql.StorageCapabilityStorageAccountTypeZRS), - // }}, - // }}, - // SupportedInstancePoolEditions: []*armsql.InstancePoolEditionCapability{ - // { - // Name: to.Ptr("GeneralPurpose"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // SupportedFamilies: []*armsql.InstancePoolFamilyCapability{ - // { - // Name: to.Ptr("Gen5"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // SupportedLicenseTypes: []*armsql.LicenseTypeCapability{ - // { - // Name: to.Ptr("LicenseIncluded"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // }, - // { - // Name: to.Ptr("BasePrice"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }}, - // SupportedVcoresValues: []*armsql.InstancePoolVcoresCapability{ - // { - // Name: to.Ptr("GP_Gen5_8"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // StorageLimit: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](8388608), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // Value: to.Ptr[int32](8), - // }, - // { - // Name: to.Ptr("GP_Gen5_16"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // StorageLimit: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](8388608), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // Value: to.Ptr[int32](16), - // }, - // { - // Name: to.Ptr("GP_Gen5_24"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // StorageLimit: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](8388608), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // Value: to.Ptr[int32](24), - // }, - // { - // Name: to.Ptr("GP_Gen5_32"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // StorageLimit: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](8388608), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // Value: to.Ptr[int32](32), - // }, - // { - // Name: to.Ptr("GP_Gen5_40"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // StorageLimit: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](8388608), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // Value: to.Ptr[int32](40), - // }, - // { - // Name: to.Ptr("GP_Gen5_64"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // StorageLimit: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](8388608), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // Value: to.Ptr[int32](64), - // }, - // { - // Name: to.Ptr("GP_Gen5_80"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // StorageLimit: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](8388608), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // Value: to.Ptr[int32](80), - // }}, - // }}, - // }}, - // }}, - // SupportedServerVersions: []*armsql.ServerVersionCapability{ - // { - // Name: to.Ptr("12.0"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // SupportedEditions: []*armsql.EditionCapability{ - // { - // Name: to.Ptr("Hyperscale"), - // ReadScale: &armsql.ReadScaleCapability{ - // MaxNumberOfReplicas: to.Ptr[int32](4), - // }, - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedServiceLevelObjectives: []*armsql.ServiceObjectiveCapability{ - // { - // Name: to.Ptr("HS_Gen4_1"), - // ComputeModel: to.Ptr("Provisioned"), - // ID: to.Ptr("9380cd0e-b025-4e9d-829c-c1918c1614bb"), - // PerformanceLevel: &armsql.PerformanceLevelCapability{ - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // Value: to.Ptr[float64](1), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("HS_Gen4"), - // Capacity: to.Ptr[int32](1), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr("Hyperscale"), - // }, - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedLicenseTypes: []*armsql.LicenseTypeCapability{ - // { - // Name: to.Ptr("LicenseIncluded"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // }, - // { - // Name: to.Ptr("BasePrice"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }}, - // SupportedMaintenanceConfigurations: []*armsql.MaintenanceConfigurationCapability{ - // { - // Name: to.Ptr("SQL_Default"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // ZoneRedundant: to.Ptr(false), - // }}, - // ZoneRedundant: to.Ptr(false), - // }, - // { - // Name: to.Ptr("HS_Gen4_2"), - // ComputeModel: to.Ptr("Provisioned"), - // ID: to.Ptr("34497c3f-24b9-4cee-968d-6e5e854670fe"), - // PerformanceLevel: &armsql.PerformanceLevelCapability{ - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // Value: to.Ptr[float64](2), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("HS_Gen4"), - // Capacity: to.Ptr[int32](2), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr("Hyperscale"), - // }, - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedLicenseTypes: []*armsql.LicenseTypeCapability{ - // { - // Name: to.Ptr("LicenseIncluded"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // }, - // { - // Name: to.Ptr("BasePrice"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }}, - // SupportedMaintenanceConfigurations: []*armsql.MaintenanceConfigurationCapability{ - // { - // Name: to.Ptr("SQL_Default"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // ZoneRedundant: to.Ptr(false), - // }}, - // ZoneRedundant: to.Ptr(false), - // }, - // { - // Name: to.Ptr("HS_Gen5_2"), - // ComputeModel: to.Ptr("Provisioned"), - // ID: to.Ptr("a420d2b2-ca32-4152-b1c6-dd8d4d9fd734"), - // PerformanceLevel: &armsql.PerformanceLevelCapability{ - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // Value: to.Ptr[float64](2), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("HS_Gen5"), - // Capacity: to.Ptr[int32](2), - // Family: to.Ptr("Gen5"), - // Tier: to.Ptr("Hyperscale"), - // }, - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // SupportedLicenseTypes: []*armsql.LicenseTypeCapability{ - // { - // Name: to.Ptr("LicenseIncluded"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // }, - // { - // Name: to.Ptr("BasePrice"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }}, - // SupportedMaintenanceConfigurations: []*armsql.MaintenanceConfigurationCapability{ - // { - // Name: to.Ptr("SQL_Default"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // ZoneRedundant: to.Ptr(false), - // }}, - // ZoneRedundant: to.Ptr(false), - // }, - // { - // Name: to.Ptr("HS_Gen4_3"), - // ComputeModel: to.Ptr("Provisioned"), - // ID: to.Ptr("5de845d2-2055-428c-b507-94131358cdd7"), - // PerformanceLevel: &armsql.PerformanceLevelCapability{ - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // Value: to.Ptr[float64](3), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("HS_Gen4"), - // Capacity: to.Ptr[int32](3), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr("Hyperscale"), - // }, - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedLicenseTypes: []*armsql.LicenseTypeCapability{ - // { - // Name: to.Ptr("LicenseIncluded"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // }, - // { - // Name: to.Ptr("BasePrice"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }}, - // SupportedMaintenanceConfigurations: []*armsql.MaintenanceConfigurationCapability{ - // { - // Name: to.Ptr("SQL_Default"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // ZoneRedundant: to.Ptr(false), - // }}, - // ZoneRedundant: to.Ptr(false), - // }, - // { - // Name: to.Ptr("HS_Gen4_4"), - // ComputeModel: to.Ptr("Provisioned"), - // ID: to.Ptr("d060b874-21f3-47b0-a9bd-a1a737cfcc6e"), - // PerformanceLevel: &armsql.PerformanceLevelCapability{ - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // Value: to.Ptr[float64](4), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("HS_Gen4"), - // Capacity: to.Ptr[int32](4), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr("Hyperscale"), - // }, - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedLicenseTypes: []*armsql.LicenseTypeCapability{ - // { - // Name: to.Ptr("LicenseIncluded"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // }, - // { - // Name: to.Ptr("BasePrice"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }}, - // SupportedMaintenanceConfigurations: []*armsql.MaintenanceConfigurationCapability{ - // { - // Name: to.Ptr("SQL_Default"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // ZoneRedundant: to.Ptr(false), - // }}, - // ZoneRedundant: to.Ptr(false), - // }, - // { - // Name: to.Ptr("HS_Gen5_4"), - // ComputeModel: to.Ptr("Provisioned"), - // ID: to.Ptr("60dba88b-2dfa-4123-be57-bd0dbfd92a72"), - // PerformanceLevel: &armsql.PerformanceLevelCapability{ - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // Value: to.Ptr[float64](4), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("HS_Gen5"), - // Capacity: to.Ptr[int32](4), - // Family: to.Ptr("Gen5"), - // Tier: to.Ptr("Hyperscale"), - // }, - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedLicenseTypes: []*armsql.LicenseTypeCapability{ - // { - // Name: to.Ptr("LicenseIncluded"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // }, - // { - // Name: to.Ptr("BasePrice"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }}, - // SupportedMaintenanceConfigurations: []*armsql.MaintenanceConfigurationCapability{ - // { - // Name: to.Ptr("SQL_Default"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // ZoneRedundant: to.Ptr(false), - // }}, - // ZoneRedundant: to.Ptr(false), - // }, - // { - // Name: to.Ptr("HS_Gen4_5"), - // ComputeModel: to.Ptr("Provisioned"), - // ID: to.Ptr("925a0916-15fb-4764-aa76-533d97f2d782"), - // PerformanceLevel: &armsql.PerformanceLevelCapability{ - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // Value: to.Ptr[float64](5), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("HS_Gen4"), - // Capacity: to.Ptr[int32](5), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr("Hyperscale"), - // }, - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedLicenseTypes: []*armsql.LicenseTypeCapability{ - // { - // Name: to.Ptr("LicenseIncluded"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // }, - // { - // Name: to.Ptr("BasePrice"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }}, - // SupportedMaintenanceConfigurations: []*armsql.MaintenanceConfigurationCapability{ - // { - // Name: to.Ptr("SQL_Default"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // ZoneRedundant: to.Ptr(false), - // }}, - // ZoneRedundant: to.Ptr(false), - // }, - // { - // Name: to.Ptr("HS_Gen4_6"), - // ComputeModel: to.Ptr("Provisioned"), - // ID: to.Ptr("d7aa11c2-e4c7-442a-962e-308b371f5ec1"), - // PerformanceLevel: &armsql.PerformanceLevelCapability{ - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // Value: to.Ptr[float64](6), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("HS_Gen4"), - // Capacity: to.Ptr[int32](6), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr("Hyperscale"), - // }, - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedLicenseTypes: []*armsql.LicenseTypeCapability{ - // { - // Name: to.Ptr("LicenseIncluded"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // }, - // { - // Name: to.Ptr("BasePrice"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }}, - // SupportedMaintenanceConfigurations: []*armsql.MaintenanceConfigurationCapability{ - // { - // Name: to.Ptr("SQL_Default"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // ZoneRedundant: to.Ptr(false), - // }}, - // ZoneRedundant: to.Ptr(false), - // }, - // { - // Name: to.Ptr("HS_Gen5_6"), - // ComputeModel: to.Ptr("Provisioned"), - // ID: to.Ptr("b9c594ec-a3fe-4bfe-808d-a595410d0a07"), - // PerformanceLevel: &armsql.PerformanceLevelCapability{ - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // Value: to.Ptr[float64](6), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("HS_Gen5"), - // Capacity: to.Ptr[int32](6), - // Family: to.Ptr("Gen5"), - // Tier: to.Ptr("Hyperscale"), - // }, - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedLicenseTypes: []*armsql.LicenseTypeCapability{ - // { - // Name: to.Ptr("LicenseIncluded"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // }, - // { - // Name: to.Ptr("BasePrice"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }}, - // SupportedMaintenanceConfigurations: []*armsql.MaintenanceConfigurationCapability{ - // { - // Name: to.Ptr("SQL_Default"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // ZoneRedundant: to.Ptr(false), - // }}, - // ZoneRedundant: to.Ptr(false), - // }, - // { - // Name: to.Ptr("HS_Gen4_7"), - // ComputeModel: to.Ptr("Provisioned"), - // ID: to.Ptr("d77eef57-6c00-4003-b140-822509b8736a"), - // PerformanceLevel: &armsql.PerformanceLevelCapability{ - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // Value: to.Ptr[float64](7), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("HS_Gen4"), - // Capacity: to.Ptr[int32](7), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr("Hyperscale"), - // }, - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedLicenseTypes: []*armsql.LicenseTypeCapability{ - // { - // Name: to.Ptr("LicenseIncluded"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // }, - // { - // Name: to.Ptr("BasePrice"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }}, - // SupportedMaintenanceConfigurations: []*armsql.MaintenanceConfigurationCapability{ - // { - // Name: to.Ptr("SQL_Default"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // ZoneRedundant: to.Ptr(false), - // }}, - // ZoneRedundant: to.Ptr(false), - // }, - // { - // Name: to.Ptr("HS_Gen4_8"), - // ComputeModel: to.Ptr("Provisioned"), - // ID: to.Ptr("694bf389-7cb2-4461-8fa2-0b06d8438315"), - // PerformanceLevel: &armsql.PerformanceLevelCapability{ - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // Value: to.Ptr[float64](8), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("HS_Gen4"), - // Capacity: to.Ptr[int32](8), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr("Hyperscale"), - // }, - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedLicenseTypes: []*armsql.LicenseTypeCapability{ - // { - // Name: to.Ptr("LicenseIncluded"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // }, - // { - // Name: to.Ptr("BasePrice"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }}, - // SupportedMaintenanceConfigurations: []*armsql.MaintenanceConfigurationCapability{ - // { - // Name: to.Ptr("SQL_Default"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // ZoneRedundant: to.Ptr(false), - // }}, - // ZoneRedundant: to.Ptr(false), - // }, - // { - // Name: to.Ptr("HS_Gen5_8"), - // ComputeModel: to.Ptr("Provisioned"), - // ID: to.Ptr("efdfac5f-3f8e-4500-95b1-684c07349860"), - // PerformanceLevel: &armsql.PerformanceLevelCapability{ - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // Value: to.Ptr[float64](8), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("HS_Gen5"), - // Capacity: to.Ptr[int32](8), - // Family: to.Ptr("Gen5"), - // Tier: to.Ptr("Hyperscale"), - // }, - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedLicenseTypes: []*armsql.LicenseTypeCapability{ - // { - // Name: to.Ptr("LicenseIncluded"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // }, - // { - // Name: to.Ptr("BasePrice"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }}, - // SupportedMaintenanceConfigurations: []*armsql.MaintenanceConfigurationCapability{ - // { - // Name: to.Ptr("SQL_Default"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // ZoneRedundant: to.Ptr(false), - // }}, - // ZoneRedundant: to.Ptr(false), - // }, - // { - // Name: to.Ptr("HS_Gen4_9"), - // ComputeModel: to.Ptr("Provisioned"), - // ID: to.Ptr("554ea52a-9ecc-4d87-bbc7-1e257705da3f"), - // PerformanceLevel: &armsql.PerformanceLevelCapability{ - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // Value: to.Ptr[float64](9), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("HS_Gen4"), - // Capacity: to.Ptr[int32](9), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr("Hyperscale"), - // }, - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedLicenseTypes: []*armsql.LicenseTypeCapability{ - // { - // Name: to.Ptr("LicenseIncluded"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // }, - // { - // Name: to.Ptr("BasePrice"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }}, - // SupportedMaintenanceConfigurations: []*armsql.MaintenanceConfigurationCapability{ - // { - // Name: to.Ptr("SQL_Default"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // ZoneRedundant: to.Ptr(false), - // }}, - // ZoneRedundant: to.Ptr(false), - // }, - // { - // Name: to.Ptr("HS_Gen4_10"), - // ComputeModel: to.Ptr("Provisioned"), - // ID: to.Ptr("576f3f38-b950-4eaa-b74e-33d831193441"), - // PerformanceLevel: &armsql.PerformanceLevelCapability{ - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // Value: to.Ptr[float64](10), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("HS_Gen4"), - // Capacity: to.Ptr[int32](10), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr("Hyperscale"), - // }, - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedLicenseTypes: []*armsql.LicenseTypeCapability{ - // { - // Name: to.Ptr("LicenseIncluded"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // }, - // { - // Name: to.Ptr("BasePrice"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }}, - // SupportedMaintenanceConfigurations: []*armsql.MaintenanceConfigurationCapability{ - // { - // Name: to.Ptr("SQL_Default"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // ZoneRedundant: to.Ptr(false), - // }}, - // ZoneRedundant: to.Ptr(false), - // }, - // { - // Name: to.Ptr("HS_Gen5_10"), - // ComputeModel: to.Ptr("Provisioned"), - // ID: to.Ptr("69697c3a-1946-4eb8-a5a4-a269168dde27"), - // PerformanceLevel: &armsql.PerformanceLevelCapability{ - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // Value: to.Ptr[float64](10), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("HS_Gen5"), - // Capacity: to.Ptr[int32](10), - // Family: to.Ptr("Gen5"), - // Tier: to.Ptr("Hyperscale"), - // }, - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedLicenseTypes: []*armsql.LicenseTypeCapability{ - // { - // Name: to.Ptr("LicenseIncluded"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // }, - // { - // Name: to.Ptr("BasePrice"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }}, - // SupportedMaintenanceConfigurations: []*armsql.MaintenanceConfigurationCapability{ - // { - // Name: to.Ptr("SQL_Default"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // ZoneRedundant: to.Ptr(false), - // }}, - // ZoneRedundant: to.Ptr(false), - // }, - // { - // Name: to.Ptr("HS_Gen5_12"), - // ComputeModel: to.Ptr("Provisioned"), - // ID: to.Ptr("1bee9dc8-68b4-44df-b870-8ab0e4d71e94"), - // PerformanceLevel: &armsql.PerformanceLevelCapability{ - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // Value: to.Ptr[float64](12), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("HS_Gen5"), - // Capacity: to.Ptr[int32](12), - // Family: to.Ptr("Gen5"), - // Tier: to.Ptr("Hyperscale"), - // }, - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedLicenseTypes: []*armsql.LicenseTypeCapability{ - // { - // Name: to.Ptr("LicenseIncluded"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // }, - // { - // Name: to.Ptr("BasePrice"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }}, - // SupportedMaintenanceConfigurations: []*armsql.MaintenanceConfigurationCapability{ - // { - // Name: to.Ptr("SQL_Default"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // ZoneRedundant: to.Ptr(false), - // }}, - // ZoneRedundant: to.Ptr(false), - // }, - // { - // Name: to.Ptr("HS_Gen5_14"), - // ComputeModel: to.Ptr("Provisioned"), - // ID: to.Ptr("07a8341d-c0b2-4000-bc7a-5b4dae2ad210"), - // PerformanceLevel: &armsql.PerformanceLevelCapability{ - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // Value: to.Ptr[float64](14), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("HS_Gen5"), - // Capacity: to.Ptr[int32](14), - // Family: to.Ptr("Gen5"), - // Tier: to.Ptr("Hyperscale"), - // }, - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedLicenseTypes: []*armsql.LicenseTypeCapability{ - // { - // Name: to.Ptr("LicenseIncluded"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // }, - // { - // Name: to.Ptr("BasePrice"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }}, - // SupportedMaintenanceConfigurations: []*armsql.MaintenanceConfigurationCapability{ - // { - // Name: to.Ptr("SQL_Default"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // ZoneRedundant: to.Ptr(false), - // }}, - // ZoneRedundant: to.Ptr(false), - // }, - // { - // Name: to.Ptr("HS_Gen4_16"), - // ComputeModel: to.Ptr("Provisioned"), - // ID: to.Ptr("7fc1f700-a45d-499e-901f-2a00645c54db"), - // PerformanceLevel: &armsql.PerformanceLevelCapability{ - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // Value: to.Ptr[float64](16), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("HS_Gen4"), - // Capacity: to.Ptr[int32](16), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr("Hyperscale"), - // }, - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedLicenseTypes: []*armsql.LicenseTypeCapability{ - // { - // Name: to.Ptr("LicenseIncluded"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // }, - // { - // Name: to.Ptr("BasePrice"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }}, - // SupportedMaintenanceConfigurations: []*armsql.MaintenanceConfigurationCapability{ - // { - // Name: to.Ptr("SQL_Default"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // ZoneRedundant: to.Ptr(false), - // }}, - // ZoneRedundant: to.Ptr(false), - // }, - // { - // Name: to.Ptr("HS_Gen5_16"), - // ComputeModel: to.Ptr("Provisioned"), - // ID: to.Ptr("6b56f70b-52e5-44ba-8cd5-4f63d224b206"), - // PerformanceLevel: &armsql.PerformanceLevelCapability{ - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // Value: to.Ptr[float64](16), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("HS_Gen5"), - // Capacity: to.Ptr[int32](16), - // Family: to.Ptr("Gen5"), - // Tier: to.Ptr("Hyperscale"), - // }, - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedLicenseTypes: []*armsql.LicenseTypeCapability{ - // { - // Name: to.Ptr("LicenseIncluded"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // }, - // { - // Name: to.Ptr("BasePrice"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }}, - // SupportedMaintenanceConfigurations: []*armsql.MaintenanceConfigurationCapability{ - // { - // Name: to.Ptr("SQL_Default"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // ZoneRedundant: to.Ptr(false), - // }}, - // ZoneRedundant: to.Ptr(false), - // }, - // { - // Name: to.Ptr("HS_Gen5_18"), - // ComputeModel: to.Ptr("Provisioned"), - // ID: to.Ptr("ba0029f2-3ff4-4ef6-9e65-e8f77b5dd1e2"), - // PerformanceLevel: &armsql.PerformanceLevelCapability{ - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // Value: to.Ptr[float64](18), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("HS_Gen5"), - // Capacity: to.Ptr[int32](18), - // Family: to.Ptr("Gen5"), - // Tier: to.Ptr("Hyperscale"), - // }, - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedLicenseTypes: []*armsql.LicenseTypeCapability{ - // { - // Name: to.Ptr("LicenseIncluded"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // }, - // { - // Name: to.Ptr("BasePrice"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }}, - // SupportedMaintenanceConfigurations: []*armsql.MaintenanceConfigurationCapability{ - // { - // Name: to.Ptr("SQL_Default"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // ZoneRedundant: to.Ptr(false), - // }}, - // ZoneRedundant: to.Ptr(false), - // }, - // { - // Name: to.Ptr("HS_Gen5_20"), - // ComputeModel: to.Ptr("Provisioned"), - // ID: to.Ptr("f1b2a082-f622-4fb8-bbef-e74deac3ec89"), - // PerformanceLevel: &armsql.PerformanceLevelCapability{ - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // Value: to.Ptr[float64](20), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("HS_Gen5"), - // Capacity: to.Ptr[int32](20), - // Family: to.Ptr("Gen5"), - // Tier: to.Ptr("Hyperscale"), - // }, - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedLicenseTypes: []*armsql.LicenseTypeCapability{ - // { - // Name: to.Ptr("LicenseIncluded"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // }, - // { - // Name: to.Ptr("BasePrice"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }}, - // SupportedMaintenanceConfigurations: []*armsql.MaintenanceConfigurationCapability{ - // { - // Name: to.Ptr("SQL_Default"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // ZoneRedundant: to.Ptr(false), - // }}, - // ZoneRedundant: to.Ptr(false), - // }, - // { - // Name: to.Ptr("HS_Gen4_24"), - // ComputeModel: to.Ptr("Provisioned"), - // ID: to.Ptr("f016d419-a031-4b93-ab62-7f3d2a789376"), - // PerformanceLevel: &armsql.PerformanceLevelCapability{ - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // Value: to.Ptr[float64](24), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("HS_Gen4"), - // Capacity: to.Ptr[int32](24), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr("Hyperscale"), - // }, - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedLicenseTypes: []*armsql.LicenseTypeCapability{ - // { - // Name: to.Ptr("LicenseIncluded"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // }, - // { - // Name: to.Ptr("BasePrice"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }}, - // SupportedMaintenanceConfigurations: []*armsql.MaintenanceConfigurationCapability{ - // { - // Name: to.Ptr("SQL_Default"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // ZoneRedundant: to.Ptr(false), - // }}, - // ZoneRedundant: to.Ptr(false), - // }, - // { - // Name: to.Ptr("HS_Gen5_24"), - // ComputeModel: to.Ptr("Provisioned"), - // ID: to.Ptr("222bc0ee-e195-4bbc-be05-3b849c3a8195"), - // PerformanceLevel: &armsql.PerformanceLevelCapability{ - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // Value: to.Ptr[float64](24), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("HS_Gen5"), - // Capacity: to.Ptr[int32](24), - // Family: to.Ptr("Gen5"), - // Tier: to.Ptr("Hyperscale"), - // }, - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedLicenseTypes: []*armsql.LicenseTypeCapability{ - // { - // Name: to.Ptr("LicenseIncluded"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // }, - // { - // Name: to.Ptr("BasePrice"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }}, - // SupportedMaintenanceConfigurations: []*armsql.MaintenanceConfigurationCapability{ - // { - // Name: to.Ptr("SQL_Default"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // ZoneRedundant: to.Ptr(false), - // }}, - // ZoneRedundant: to.Ptr(false), - // }, - // { - // Name: to.Ptr("HS_Gen5_32"), - // ComputeModel: to.Ptr("Provisioned"), - // ID: to.Ptr("05366cca-cc70-486e-a697-bb3fab877f75"), - // PerformanceLevel: &armsql.PerformanceLevelCapability{ - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // Value: to.Ptr[float64](32), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("HS_Gen5"), - // Capacity: to.Ptr[int32](32), - // Family: to.Ptr("Gen5"), - // Tier: to.Ptr("Hyperscale"), - // }, - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedLicenseTypes: []*armsql.LicenseTypeCapability{ - // { - // Name: to.Ptr("LicenseIncluded"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // }, - // { - // Name: to.Ptr("BasePrice"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }}, - // SupportedMaintenanceConfigurations: []*armsql.MaintenanceConfigurationCapability{ - // { - // Name: to.Ptr("SQL_Default"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // ZoneRedundant: to.Ptr(false), - // }}, - // ZoneRedundant: to.Ptr(false), - // }, - // { - // Name: to.Ptr("HS_Gen5_40"), - // ComputeModel: to.Ptr("Provisioned"), - // ID: to.Ptr("32542ef7-124d-4e66-8b41-9c6c0ab963c2"), - // PerformanceLevel: &armsql.PerformanceLevelCapability{ - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // Value: to.Ptr[float64](40), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("HS_Gen5"), - // Capacity: to.Ptr[int32](40), - // Family: to.Ptr("Gen5"), - // Tier: to.Ptr("Hyperscale"), - // }, - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedLicenseTypes: []*armsql.LicenseTypeCapability{ - // { - // Name: to.Ptr("LicenseIncluded"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // }, - // { - // Name: to.Ptr("BasePrice"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }}, - // SupportedMaintenanceConfigurations: []*armsql.MaintenanceConfigurationCapability{ - // { - // Name: to.Ptr("SQL_Default"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // ZoneRedundant: to.Ptr(false), - // }}, - // ZoneRedundant: to.Ptr(false), - // }, - // { - // Name: to.Ptr("HS_Gen5_80"), - // ComputeModel: to.Ptr("Provisioned"), - // ID: to.Ptr("6509db45-febe-44dd-a079-35f11d477984"), - // PerformanceLevel: &armsql.PerformanceLevelCapability{ - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // Value: to.Ptr[float64](80), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("HS_Gen5"), - // Capacity: to.Ptr[int32](80), - // Family: to.Ptr("Gen5"), - // Tier: to.Ptr("Hyperscale"), - // }, - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedLicenseTypes: []*armsql.LicenseTypeCapability{ - // { - // Name: to.Ptr("LicenseIncluded"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // }, - // { - // Name: to.Ptr("BasePrice"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }}, - // SupportedMaintenanceConfigurations: []*armsql.MaintenanceConfigurationCapability{ - // { - // Name: to.Ptr("SQL_Default"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // ZoneRedundant: to.Ptr(false), - // }}, - // ZoneRedundant: to.Ptr(false), - // }}, - // SupportedStorageCapabilities: []*armsql.StorageCapability{ - // { - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // StorageAccountType: to.Ptr(armsql.StorageCapabilityStorageAccountTypeGRS), - // }, - // { - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // StorageAccountType: to.Ptr(armsql.StorageCapabilityStorageAccountTypeLRS), - // }, - // { - // Reason: to.Ptr("ZRS is available in multi-az regions"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // StorageAccountType: to.Ptr(armsql.StorageCapabilityStorageAccountTypeZRS), - // }}, - // ZoneRedundant: to.Ptr(false), - // }}, - // SupportedElasticPoolEditions: []*armsql.ElasticPoolEditionCapability{ - // { - // Name: to.Ptr("BusinessCritical"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedElasticPoolPerformanceLevels: []*armsql.ElasticPoolPerformanceLevelCapability{ - // { - // MaxDatabaseCount: to.Ptr[int32](100), - // PerformanceLevel: &armsql.PerformanceLevelCapability{ - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // Value: to.Ptr[float64](3), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("BC_Gen4"), - // Capacity: to.Ptr[int32](3), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr("BusinessCritical"), - // }, - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedLicenseTypes: []*armsql.LicenseTypeCapability{ - // { - // Name: to.Ptr("LicenseIncluded"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // }, - // { - // Name: to.Ptr("BasePrice"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }}, - // SupportedMaintenanceConfigurations: []*armsql.MaintenanceConfigurationCapability{ - // { - // Name: to.Ptr("SQL_Default"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // ZoneRedundant: to.Ptr(false), - // }, - // { - // Name: to.Ptr("SQL_EastUS_DB_1"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // ZoneRedundant: to.Ptr(false), - // }, - // { - // Name: to.Ptr("SQL_EastUS_DB_2"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // ZoneRedundant: to.Ptr(false), - // }}, - // SupportedMaxSizes: []*armsql.MaxSizeRangeCapability{ - // { - // LogSize: &armsql.LogSizeCapability{ - // Limit: to.Ptr[int32](30), - // Unit: to.Ptr(armsql.LogSizeUnitPercent), - // }, - // MaxValue: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](31744), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // MinValue: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](1024), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // ScaleSize: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](1024), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }, - // { - // LogSize: &armsql.LogSizeCapability{ - // Limit: to.Ptr[int32](30), - // Unit: to.Ptr(armsql.LogSizeUnitPercent), - // }, - // MaxValue: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](32768), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // MinValue: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](32768), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // ScaleSize: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](0), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // }, - // { - // LogSize: &armsql.LogSizeCapability{ - // Limit: to.Ptr[int32](30), - // Unit: to.Ptr(armsql.LogSizeUnitPercent), - // }, - // MaxValue: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](1048576), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // MinValue: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](33792), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // ScaleSize: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](1024), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }}, - // SupportedPerDatabaseMaxPerformanceLevels: []*armsql.ElasticPoolPerDatabaseMaxPerformanceLevelCapability{ - // { - // Limit: to.Ptr[float64](0.25), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedPerDatabaseMinPerformanceLevels: []*armsql.ElasticPoolPerDatabaseMinPerformanceLevelCapability{ - // { - // Limit: to.Ptr[float64](0), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](0.25), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }}, - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](0.5), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedPerDatabaseMinPerformanceLevels: []*armsql.ElasticPoolPerDatabaseMinPerformanceLevelCapability{ - // { - // Limit: to.Ptr[float64](0), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](0.25), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](0.5), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }}, - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](1), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedPerDatabaseMinPerformanceLevels: []*armsql.ElasticPoolPerDatabaseMinPerformanceLevelCapability{ - // { - // Limit: to.Ptr[float64](0), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](0.25), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](0.5), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](1), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }}, - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](2), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedPerDatabaseMinPerformanceLevels: []*armsql.ElasticPoolPerDatabaseMinPerformanceLevelCapability{ - // { - // Limit: to.Ptr[float64](0), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](0.25), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](0.5), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](1), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](2), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }}, - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](3), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // SupportedPerDatabaseMinPerformanceLevels: []*armsql.ElasticPoolPerDatabaseMinPerformanceLevelCapability{ - // { - // Limit: to.Ptr[float64](0), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](0.25), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](0.5), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](1), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](2), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](3), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }}, - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }}, - // SupportedPerDatabaseMaxSizes: []*armsql.MaxSizeRangeCapability{ - // { - // MaxValue: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](31744), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // MinValue: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](1024), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // ScaleSize: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](1024), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }, - // { - // MaxValue: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](32768), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // MinValue: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](32768), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // ScaleSize: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](0), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // }, - // { - // MaxValue: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](1048576), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // MinValue: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](33792), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // ScaleSize: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](1024), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }}, - // ZoneRedundant: to.Ptr(false), - // }, - // { - // MaxDatabaseCount: to.Ptr[int32](100), - // PerformanceLevel: &armsql.PerformanceLevelCapability{ - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // Value: to.Ptr[float64](12), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("BC_Gen5"), - // Capacity: to.Ptr[int32](12), - // Family: to.Ptr("Gen5"), - // Tier: to.Ptr("BusinessCritical"), - // }, - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedLicenseTypes: []*armsql.LicenseTypeCapability{ - // { - // Name: to.Ptr("LicenseIncluded"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // }, - // { - // Name: to.Ptr("BasePrice"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }}, - // SupportedMaintenanceConfigurations: []*armsql.MaintenanceConfigurationCapability{ - // { - // Name: to.Ptr("SQL_Default"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // ZoneRedundant: to.Ptr(false), - // }, - // { - // Name: to.Ptr("SQL_EastUS_DB_1"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // ZoneRedundant: to.Ptr(false), - // }, - // { - // Name: to.Ptr("SQL_EastUS_DB_2"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // ZoneRedundant: to.Ptr(false), - // }}, - // SupportedMaxSizes: []*armsql.MaxSizeRangeCapability{ - // { - // LogSize: &armsql.LogSizeCapability{ - // Limit: to.Ptr[int32](30), - // Unit: to.Ptr(armsql.LogSizeUnitPercent), - // }, - // MaxValue: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](31744), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // MinValue: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](1024), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // ScaleSize: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](1024), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }, - // { - // LogSize: &armsql.LogSizeCapability{ - // Limit: to.Ptr[int32](30), - // Unit: to.Ptr(armsql.LogSizeUnitPercent), - // }, - // MaxValue: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](32768), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // MinValue: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](32768), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // ScaleSize: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](0), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // }, - // { - // LogSize: &armsql.LogSizeCapability{ - // Limit: to.Ptr[int32](30), - // Unit: to.Ptr(armsql.LogSizeUnitPercent), - // }, - // MaxValue: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](3144704), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // MinValue: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](33792), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // ScaleSize: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](1024), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }, - // { - // LogSize: &armsql.LogSizeCapability{ - // Limit: to.Ptr[int32](1048576), - // Unit: to.Ptr(armsql.LogSizeUnitMegabytes), - // }, - // MaxValue: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](3145728), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // MinValue: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](3145728), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // ScaleSize: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](0), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }}, - // SupportedPerDatabaseMaxPerformanceLevels: []*armsql.ElasticPoolPerDatabaseMaxPerformanceLevelCapability{ - // { - // Limit: to.Ptr[float64](0.25), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedPerDatabaseMinPerformanceLevels: []*armsql.ElasticPoolPerDatabaseMinPerformanceLevelCapability{ - // { - // Limit: to.Ptr[float64](0), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](0.25), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }}, - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](0.5), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedPerDatabaseMinPerformanceLevels: []*armsql.ElasticPoolPerDatabaseMinPerformanceLevelCapability{ - // { - // Limit: to.Ptr[float64](0), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](0.25), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](0.5), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }}, - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](1), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedPerDatabaseMinPerformanceLevels: []*armsql.ElasticPoolPerDatabaseMinPerformanceLevelCapability{ - // { - // Limit: to.Ptr[float64](0), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](0.25), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](0.5), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](1), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }}, - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](2), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedPerDatabaseMinPerformanceLevels: []*armsql.ElasticPoolPerDatabaseMinPerformanceLevelCapability{ - // { - // Limit: to.Ptr[float64](0), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](0.25), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](0.5), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](1), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](2), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }}, - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](4), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedPerDatabaseMinPerformanceLevels: []*armsql.ElasticPoolPerDatabaseMinPerformanceLevelCapability{ - // { - // Limit: to.Ptr[float64](0), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](0.25), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](0.5), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](1), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](2), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](4), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }}, - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](6), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedPerDatabaseMinPerformanceLevels: []*armsql.ElasticPoolPerDatabaseMinPerformanceLevelCapability{ - // { - // Limit: to.Ptr[float64](0), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](0.25), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](0.5), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](1), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](2), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](4), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](6), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }}, - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](8), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedPerDatabaseMinPerformanceLevels: []*armsql.ElasticPoolPerDatabaseMinPerformanceLevelCapability{ - // { - // Limit: to.Ptr[float64](0), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](0.25), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](0.5), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](1), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](2), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](4), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](6), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](8), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }}, - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](10), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedPerDatabaseMinPerformanceLevels: []*armsql.ElasticPoolPerDatabaseMinPerformanceLevelCapability{ - // { - // Limit: to.Ptr[float64](0), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](0.25), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](0.5), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](1), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](2), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](4), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](6), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](8), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](10), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }}, - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](12), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // SupportedPerDatabaseMinPerformanceLevels: []*armsql.ElasticPoolPerDatabaseMinPerformanceLevelCapability{ - // { - // Limit: to.Ptr[float64](0), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](0.25), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](0.5), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](1), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](2), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](4), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](6), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](8), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](10), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](12), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }}, - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }}, - // SupportedPerDatabaseMaxSizes: []*armsql.MaxSizeRangeCapability{ - // { - // MaxValue: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](31744), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // MinValue: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](1024), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // ScaleSize: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](1024), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }, - // { - // MaxValue: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](32768), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // MinValue: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](32768), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // ScaleSize: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](0), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // }, - // { - // MaxValue: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](3144704), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // MinValue: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](33792), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // ScaleSize: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](1024), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }, - // { - // MaxValue: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](3145728), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // MinValue: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](3145728), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // ScaleSize: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](0), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }}, - // ZoneRedundant: to.Ptr(true), - // }, - // { - // MaxDatabaseCount: to.Ptr[int32](100), - // PerformanceLevel: &armsql.PerformanceLevelCapability{ - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // Value: to.Ptr[float64](128), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("BC_M"), - // Capacity: to.Ptr[int32](128), - // Family: to.Ptr("M"), - // Tier: to.Ptr("BusinessCritical"), - // }, - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedLicenseTypes: []*armsql.LicenseTypeCapability{ - // { - // Name: to.Ptr("LicenseIncluded"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // }, - // { - // Name: to.Ptr("BasePrice"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }}, - // SupportedMaintenanceConfigurations: []*armsql.MaintenanceConfigurationCapability{ - // { - // Name: to.Ptr("SQL_Default"), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // ZoneRedundant: to.Ptr(false), - // }, - // { - // Name: to.Ptr("SQL_EastUS_DB_1"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // ZoneRedundant: to.Ptr(false), - // }, - // { - // Name: to.Ptr("SQL_EastUS_DB_2"), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // ZoneRedundant: to.Ptr(false), - // }}, - // SupportedMaxSizes: []*armsql.MaxSizeRangeCapability{ - // { - // LogSize: &armsql.LogSizeCapability{ - // Limit: to.Ptr[int32](30), - // Unit: to.Ptr(armsql.LogSizeUnitPercent), - // }, - // MaxValue: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](31744), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // MinValue: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](1024), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // ScaleSize: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](1024), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }, - // { - // LogSize: &armsql.LogSizeCapability{ - // Limit: to.Ptr[int32](30), - // Unit: to.Ptr(armsql.LogSizeUnitPercent), - // }, - // MaxValue: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](32768), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // MinValue: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](32768), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // ScaleSize: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](0), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // }, - // { - // LogSize: &armsql.LogSizeCapability{ - // Limit: to.Ptr[int32](30), - // Unit: to.Ptr(armsql.LogSizeUnitPercent), - // }, - // MaxValue: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](3144704), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // MinValue: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](33792), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // ScaleSize: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](1024), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }, - // { - // LogSize: &armsql.LogSizeCapability{ - // Limit: to.Ptr[int32](1048576), - // Unit: to.Ptr(armsql.LogSizeUnitMegabytes), - // }, - // MaxValue: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](4194304), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // MinValue: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](3145728), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // ScaleSize: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](1024), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }}, - // SupportedPerDatabaseMaxPerformanceLevels: []*armsql.ElasticPoolPerDatabaseMaxPerformanceLevelCapability{ - // { - // Limit: to.Ptr[float64](8), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedPerDatabaseMinPerformanceLevels: []*armsql.ElasticPoolPerDatabaseMinPerformanceLevelCapability{ - // { - // Limit: to.Ptr[float64](0), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](8), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }}, - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](10), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedPerDatabaseMinPerformanceLevels: []*armsql.ElasticPoolPerDatabaseMinPerformanceLevelCapability{ - // { - // Limit: to.Ptr[float64](0), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](8), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](10), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }}, - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](12), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedPerDatabaseMinPerformanceLevels: []*armsql.ElasticPoolPerDatabaseMinPerformanceLevelCapability{ - // { - // Limit: to.Ptr[float64](0), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](8), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](10), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](12), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }}, - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](14), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedPerDatabaseMinPerformanceLevels: []*armsql.ElasticPoolPerDatabaseMinPerformanceLevelCapability{ - // { - // Limit: to.Ptr[float64](0), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](8), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](10), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](12), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](14), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }}, - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](16), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedPerDatabaseMinPerformanceLevels: []*armsql.ElasticPoolPerDatabaseMinPerformanceLevelCapability{ - // { - // Limit: to.Ptr[float64](0), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](8), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](10), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](12), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](14), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](16), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }}, - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](18), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedPerDatabaseMinPerformanceLevels: []*armsql.ElasticPoolPerDatabaseMinPerformanceLevelCapability{ - // { - // Limit: to.Ptr[float64](0), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](8), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](10), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](12), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](14), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](16), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](18), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }}, - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](20), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedPerDatabaseMinPerformanceLevels: []*armsql.ElasticPoolPerDatabaseMinPerformanceLevelCapability{ - // { - // Limit: to.Ptr[float64](0), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](8), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](10), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](12), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](14), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](16), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](18), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](20), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }}, - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](24), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedPerDatabaseMinPerformanceLevels: []*armsql.ElasticPoolPerDatabaseMinPerformanceLevelCapability{ - // { - // Limit: to.Ptr[float64](0), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](8), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](10), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](12), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](14), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](16), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](18), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](20), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](24), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }}, - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](32), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedPerDatabaseMinPerformanceLevels: []*armsql.ElasticPoolPerDatabaseMinPerformanceLevelCapability{ - // { - // Limit: to.Ptr[float64](0), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](8), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](10), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](12), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](14), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](16), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](18), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](20), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](24), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](32), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }}, - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](40), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedPerDatabaseMinPerformanceLevels: []*armsql.ElasticPoolPerDatabaseMinPerformanceLevelCapability{ - // { - // Limit: to.Ptr[float64](0), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](8), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](10), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](12), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](14), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](16), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](18), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](20), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](24), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](32), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](40), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }}, - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](64), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedPerDatabaseMinPerformanceLevels: []*armsql.ElasticPoolPerDatabaseMinPerformanceLevelCapability{ - // { - // Limit: to.Ptr[float64](0), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](8), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](10), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](12), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](14), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](16), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](18), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](20), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](24), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](32), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](40), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](64), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }}, - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](80), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // SupportedPerDatabaseMinPerformanceLevels: []*armsql.ElasticPoolPerDatabaseMinPerformanceLevelCapability{ - // { - // Limit: to.Ptr[float64](0), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](8), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](10), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](12), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](14), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](16), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](18), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](20), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](24), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](32), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](40), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](64), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](80), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }}, - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](128), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // SupportedPerDatabaseMinPerformanceLevels: []*armsql.ElasticPoolPerDatabaseMinPerformanceLevelCapability{ - // { - // Limit: to.Ptr[float64](0), - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](8), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](10), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](12), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](14), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](16), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](18), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](20), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](24), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](32), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](40), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](64), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](80), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }, - // { - // Limit: to.Ptr[float64](128), - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }}, - // Unit: to.Ptr(armsql.PerformanceLevelUnitVCores), - // }}, - // SupportedPerDatabaseMaxSizes: []*armsql.MaxSizeRangeCapability{ - // { - // MaxValue: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](31744), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // MinValue: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](1024), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // ScaleSize: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](1024), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }, - // { - // MaxValue: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](32768), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // MinValue: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](32768), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // ScaleSize: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](0), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // Status: to.Ptr(armsql.CapabilityStatusDefault), - // }, - // { - // MaxValue: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](3144704), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // MinValue: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](33792), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // ScaleSize: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](1024), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }, - // { - // MaxValue: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](4194304), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // MinValue: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](3145728), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // ScaleSize: &armsql.MaxSizeCapability{ - // Limit: to.Ptr[int32](1024), - // Unit: to.Ptr(armsql.MaxSizeUnitMegabytes), - // }, - // Status: to.Ptr(armsql.CapabilityStatusAvailable), - // }}, - // ZoneRedundant: to.Ptr(false), - // }}, - // ZoneRedundant: to.Ptr(false), - // }}, - // }}, - // } -} diff --git a/sdk/resourcemanager/sql/armsql/client_factory.go b/sdk/resourcemanager/sql/armsql/client_factory.go index d2c1496ba904..2240ad002959 100644 --- a/sdk/resourcemanager/sql/armsql/client_factory.go +++ b/sdk/resourcemanager/sql/armsql/client_factory.go @@ -192,16 +192,6 @@ func (c *ClientFactory) NewDistributedAvailabilityGroupsClient() *DistributedAva return subClient } -func (c *ClientFactory) NewElasticPoolActivitiesClient() *ElasticPoolActivitiesClient { - subClient, _ := NewElasticPoolActivitiesClient(c.subscriptionID, c.credential, c.options) - return subClient -} - -func (c *ClientFactory) NewElasticPoolDatabaseActivitiesClient() *ElasticPoolDatabaseActivitiesClient { - subClient, _ := NewElasticPoolDatabaseActivitiesClient(c.subscriptionID, c.credential, c.options) - return subClient -} - func (c *ClientFactory) NewElasticPoolOperationsClient() *ElasticPoolOperationsClient { subClient, _ := NewElasticPoolOperationsClient(c.subscriptionID, c.credential, c.options) return subClient @@ -507,6 +497,11 @@ func (c *ClientFactory) NewManagedServerSecurityAlertPoliciesClient() *ManagedSe return subClient } +func (c *ClientFactory) NewNetworkSecurityPerimeterConfigurationsClient() *NetworkSecurityPerimeterConfigurationsClient { + subClient, _ := NewNetworkSecurityPerimeterConfigurationsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + func (c *ClientFactory) NewOperationsClient() *OperationsClient { subClient, _ := NewOperationsClient(c.credential, c.options) return subClient @@ -597,11 +592,6 @@ func (c *ClientFactory) NewServerBlobAuditingPoliciesClient() *ServerBlobAuditin return subClient } -func (c *ClientFactory) NewServerCommunicationLinksClient() *ServerCommunicationLinksClient { - subClient, _ := NewServerCommunicationLinksClient(c.subscriptionID, c.credential, c.options) - return subClient -} - func (c *ClientFactory) NewServerConfigurationOptionsClient() *ServerConfigurationOptionsClient { subClient, _ := NewServerConfigurationOptionsClient(c.subscriptionID, c.credential, c.options) return subClient @@ -662,11 +652,6 @@ func (c *ClientFactory) NewServersClient() *ServersClient { return subClient } -func (c *ClientFactory) NewServiceObjectivesClient() *ServiceObjectivesClient { - subClient, _ := NewServiceObjectivesClient(c.subscriptionID, c.credential, c.options) - return subClient -} - func (c *ClientFactory) NewStartStopManagedInstanceSchedulesClient() *StartStopManagedInstanceSchedulesClient { subClient, _ := NewStartStopManagedInstanceSchedulesClient(c.subscriptionID, c.credential, c.options) return subClient diff --git a/sdk/resourcemanager/sql/armsql/constants.go b/sdk/resourcemanager/sql/armsql/constants.go index 1225437f0bd4..070b85a2e738 100644 --- a/sdk/resourcemanager/sql/armsql/constants.go +++ b/sdk/resourcemanager/sql/armsql/constants.go @@ -10,7 +10,7 @@ package armsql const ( moduleName = "armsql" - moduleVersion = "v2.0.0-beta.1" + moduleVersion = "v2.0.0-beta.2" ) type AdministratorName string @@ -322,7 +322,7 @@ func PossibleAvailabilityZoneTypeValues() []AvailabilityZoneType { } } -// BackupStorageRedundancy - The storage redundancy type of the copied backup +// BackupStorageRedundancy - The storage account type used to store backups for this database. type BackupStorageRedundancy string const ( @@ -446,6 +446,25 @@ func PossibleCheckNameAvailabilityReasonValues() []CheckNameAvailabilityReason { } } +type ClientClassificationSource string + +const ( + ClientClassificationSourceMIP ClientClassificationSource = "MIP" + ClientClassificationSourceNative ClientClassificationSource = "Native" + ClientClassificationSourceNone ClientClassificationSource = "None" + ClientClassificationSourceRecommended ClientClassificationSource = "Recommended" +) + +// PossibleClientClassificationSourceValues returns the possible values for the ClientClassificationSource const type. +func PossibleClientClassificationSourceValues() []ClientClassificationSource { + return []ClientClassificationSource{ + ClientClassificationSourceMIP, + ClientClassificationSourceNative, + ClientClassificationSourceNone, + ClientClassificationSourceRecommended, + } +} + // ColumnDataType - The column data type. type ColumnDataType string @@ -651,6 +670,19 @@ func PossibleDataMaskingFunctionValues() []DataMaskingFunction { } } +type DataMaskingPolicyName string + +const ( + DataMaskingPolicyNameDefault DataMaskingPolicyName = "Default" +) + +// PossibleDataMaskingPolicyNameValues returns the possible values for the DataMaskingPolicyName const type. +func PossibleDataMaskingPolicyNameValues() []DataMaskingPolicyName { + return []DataMaskingPolicyName{ + DataMaskingPolicyNameDefault, + } +} + // DataMaskingRuleState - The rule state. Used to delete a rule. To delete an existing rule, specify the schemaName, tableName, // columnName, maskingFunction, and specify ruleState as disabled. However, if the rule doesn't // already exist, the rule will be created with ruleState set to enabled, regardless of the provided value of ruleState. @@ -988,6 +1020,40 @@ func PossibleFailoverGroupReplicationRoleValues() []FailoverGroupReplicationRole } } +// FreeLimitExhaustionBehavior - Specifies the behavior when monthly free limits are exhausted for the free database. +// AutoPause: The database will be auto paused upon exhaustion of free limits for remainder of the month. +// BillForUsage: The database will continue to be online upon exhaustion of free limits and any overage will be billed. +type FreeLimitExhaustionBehavior string + +const ( + FreeLimitExhaustionBehaviorAutoPause FreeLimitExhaustionBehavior = "AutoPause" + FreeLimitExhaustionBehaviorBillOverUsage FreeLimitExhaustionBehavior = "BillOverUsage" +) + +// PossibleFreeLimitExhaustionBehaviorValues returns the possible values for the FreeLimitExhaustionBehavior const type. +func PossibleFreeLimitExhaustionBehaviorValues() []FreeLimitExhaustionBehavior { + return []FreeLimitExhaustionBehavior{ + FreeLimitExhaustionBehaviorAutoPause, + FreeLimitExhaustionBehaviorBillOverUsage, + } +} + +// FreemiumType - Weather or not Managed Instance is freemium. +type FreemiumType string + +const ( + FreemiumTypeFreemium FreemiumType = "Freemium" + FreemiumTypeRegular FreemiumType = "Regular" +) + +// PossibleFreemiumTypeValues returns the possible values for the FreemiumType const type. +func PossibleFreemiumTypeValues() []FreemiumType { + return []FreemiumType{ + FreemiumTypeFreemium, + FreemiumTypeRegular, + } +} + type GeoBackupPolicyName string const ( @@ -1017,6 +1083,41 @@ func PossibleGeoBackupPolicyStateValues() []GeoBackupPolicyState { } } +// HybridSecondaryUsage - Hybrid secondary usage. Possible values are 'Active' (default value) and 'Passive' (customer uses +// the secondary as Passive DR). +type HybridSecondaryUsage string + +const ( + HybridSecondaryUsageActive HybridSecondaryUsage = "Active" + HybridSecondaryUsagePassive HybridSecondaryUsage = "Passive" +) + +// PossibleHybridSecondaryUsageValues returns the possible values for the HybridSecondaryUsage const type. +func PossibleHybridSecondaryUsageValues() []HybridSecondaryUsage { + return []HybridSecondaryUsage{ + HybridSecondaryUsageActive, + HybridSecondaryUsagePassive, + } +} + +// HybridSecondaryUsageDetected - Hybrid secondary usage detected. Possible values are 'Active' (customer does not meet the +// requirements to use the secondary as Passive DR) and 'Passive' (customer meets the requirements to use the +// secondary as Passive DR). +type HybridSecondaryUsageDetected string + +const ( + HybridSecondaryUsageDetectedActive HybridSecondaryUsageDetected = "Active" + HybridSecondaryUsageDetectedPassive HybridSecondaryUsageDetected = "Passive" +) + +// PossibleHybridSecondaryUsageDetectedValues returns the possible values for the HybridSecondaryUsageDetected const type. +func PossibleHybridSecondaryUsageDetectedValues() []HybridSecondaryUsageDetected { + return []HybridSecondaryUsageDetected{ + HybridSecondaryUsageDetectedActive, + HybridSecondaryUsageDetectedPassive, + } +} + // IdentityType - The identity type. Set this to 'SystemAssigned' in order to automatically create and assign an Azure Active // Directory principal for the resource. type IdentityType string @@ -1087,6 +1188,22 @@ func PossibleInstancePoolLicenseTypeValues() []InstancePoolLicenseType { } } +// InstanceRole - New role of managed instance in a distributed availability group, can be Primary or Secondary. +type InstanceRole string + +const ( + InstanceRolePrimary InstanceRole = "Primary" + InstanceRoleSecondary InstanceRole = "Secondary" +) + +// PossibleInstanceRoleValues returns the possible values for the InstanceRole const type. +func PossibleInstanceRoleValues() []InstanceRole { + return []InstanceRole{ + InstanceRolePrimary, + InstanceRoleSecondary, + } +} + // IsRetryable - Gets whether the error could be ignored and recommended action could be retried. Possible values are: Yes/No type IsRetryable string @@ -1282,6 +1399,22 @@ func PossibleLedgerDigestUploadsStateValues() []LedgerDigestUploadsState { } } +// LinkRole - SQL server side link role +type LinkRole string + +const ( + LinkRolePrimary LinkRole = "Primary" + LinkRoleSecondary LinkRole = "Secondary" +) + +// PossibleLinkRoleValues returns the possible values for the LinkRole const type. +func PossibleLinkRoleValues() []LinkRole { + return []LinkRole{ + LinkRolePrimary, + LinkRoleSecondary, + } +} + // LogSizeUnit - The units that the limit is expressed in. type LogSizeUnit string @@ -1425,47 +1558,6 @@ func PossibleManagedInstanceLongTermRetentionPolicyNameValues() []ManagedInstanc } } -type ManagedInstancePropertiesProvisioningState string - -const ( - ManagedInstancePropertiesProvisioningStateAccepted ManagedInstancePropertiesProvisioningState = "Accepted" - ManagedInstancePropertiesProvisioningStateCanceled ManagedInstancePropertiesProvisioningState = "Canceled" - ManagedInstancePropertiesProvisioningStateCreated ManagedInstancePropertiesProvisioningState = "Created" - ManagedInstancePropertiesProvisioningStateCreating ManagedInstancePropertiesProvisioningState = "Creating" - ManagedInstancePropertiesProvisioningStateDeleted ManagedInstancePropertiesProvisioningState = "Deleted" - ManagedInstancePropertiesProvisioningStateDeleting ManagedInstancePropertiesProvisioningState = "Deleting" - ManagedInstancePropertiesProvisioningStateFailed ManagedInstancePropertiesProvisioningState = "Failed" - ManagedInstancePropertiesProvisioningStateNotSpecified ManagedInstancePropertiesProvisioningState = "NotSpecified" - ManagedInstancePropertiesProvisioningStateRegistering ManagedInstancePropertiesProvisioningState = "Registering" - ManagedInstancePropertiesProvisioningStateRunning ManagedInstancePropertiesProvisioningState = "Running" - ManagedInstancePropertiesProvisioningStateSucceeded ManagedInstancePropertiesProvisioningState = "Succeeded" - ManagedInstancePropertiesProvisioningStateTimedOut ManagedInstancePropertiesProvisioningState = "TimedOut" - ManagedInstancePropertiesProvisioningStateUnknown ManagedInstancePropertiesProvisioningState = "Unknown" - ManagedInstancePropertiesProvisioningStateUnrecognized ManagedInstancePropertiesProvisioningState = "Unrecognized" - ManagedInstancePropertiesProvisioningStateUpdating ManagedInstancePropertiesProvisioningState = "Updating" -) - -// PossibleManagedInstancePropertiesProvisioningStateValues returns the possible values for the ManagedInstancePropertiesProvisioningState const type. -func PossibleManagedInstancePropertiesProvisioningStateValues() []ManagedInstancePropertiesProvisioningState { - return []ManagedInstancePropertiesProvisioningState{ - ManagedInstancePropertiesProvisioningStateAccepted, - ManagedInstancePropertiesProvisioningStateCanceled, - ManagedInstancePropertiesProvisioningStateCreated, - ManagedInstancePropertiesProvisioningStateCreating, - ManagedInstancePropertiesProvisioningStateDeleted, - ManagedInstancePropertiesProvisioningStateDeleting, - ManagedInstancePropertiesProvisioningStateFailed, - ManagedInstancePropertiesProvisioningStateNotSpecified, - ManagedInstancePropertiesProvisioningStateRegistering, - ManagedInstancePropertiesProvisioningStateRunning, - ManagedInstancePropertiesProvisioningStateSucceeded, - ManagedInstancePropertiesProvisioningStateTimedOut, - ManagedInstancePropertiesProvisioningStateUnknown, - ManagedInstancePropertiesProvisioningStateUnrecognized, - ManagedInstancePropertiesProvisioningStateUpdating, - } -} - // ManagedInstanceProxyOverride - Connection type used for connecting to the instance. type ManagedInstanceProxyOverride string @@ -1626,16 +1718,20 @@ func PossibleMoveOperationModeValues() []MoveOperationMode { } } -// OperationMode - Operation Mode. +// OperationMode - Operation mode of the operation: Import, Export, or PolybaseImport. type OperationMode string const ( + OperationModeExport OperationMode = "Export" + OperationModeImport OperationMode = "Import" OperationModePolybaseImport OperationMode = "PolybaseImport" ) // PossibleOperationModeValues returns the possible values for the OperationMode const type. func PossibleOperationModeValues() []OperationMode { return []OperationMode{ + OperationModeExport, + OperationModeImport, OperationModePolybaseImport, } } @@ -1686,27 +1782,23 @@ func PossiblePerformanceLevelUnitValues() []PerformanceLevelUnit { } } -// PrimaryAggregationType - The primary aggregation type defining how metric values are displayed. -type PrimaryAggregationType string +// Phase - The operation phase. +type Phase string const ( - PrimaryAggregationTypeAverage PrimaryAggregationType = "Average" - PrimaryAggregationTypeCount PrimaryAggregationType = "Count" - PrimaryAggregationTypeMaximum PrimaryAggregationType = "Maximum" - PrimaryAggregationTypeMinimum PrimaryAggregationType = "Minimum" - PrimaryAggregationTypeNone PrimaryAggregationType = "None" - PrimaryAggregationTypeTotal PrimaryAggregationType = "Total" + PhaseCatchup Phase = "Catchup" + PhaseCopying Phase = "Copying" + PhaseCutoverInProgress Phase = "CutoverInProgress" + PhaseWaitingForCutover Phase = "WaitingForCutover" ) -// PossiblePrimaryAggregationTypeValues returns the possible values for the PrimaryAggregationType const type. -func PossiblePrimaryAggregationTypeValues() []PrimaryAggregationType { - return []PrimaryAggregationType{ - PrimaryAggregationTypeAverage, - PrimaryAggregationTypeCount, - PrimaryAggregationTypeMaximum, - PrimaryAggregationTypeMinimum, - PrimaryAggregationTypeNone, - PrimaryAggregationTypeTotal, +// PossiblePhaseValues returns the possible values for the Phase const type. +func PossiblePhaseValues() []Phase { + return []Phase{ + PhaseCatchup, + PhaseCopying, + PhaseCutoverInProgress, + PhaseWaitingForCutover, } } @@ -1954,6 +2046,40 @@ func PossibleRecommendedSensitivityLabelUpdateKindValues() []RecommendedSensitiv } } +// ReplicaConnectedState - Link connected state +type ReplicaConnectedState string + +const ( + ReplicaConnectedStateCONNECTED ReplicaConnectedState = "CONNECTED" + ReplicaConnectedStateDISCONNECTED ReplicaConnectedState = "DISCONNECTED" +) + +// PossibleReplicaConnectedStateValues returns the possible values for the ReplicaConnectedState const type. +func PossibleReplicaConnectedStateValues() []ReplicaConnectedState { + return []ReplicaConnectedState{ + ReplicaConnectedStateCONNECTED, + ReplicaConnectedStateDISCONNECTED, + } +} + +// ReplicaSynchronizationHealth - Link health state +type ReplicaSynchronizationHealth string + +const ( + ReplicaSynchronizationHealthHEALTHY ReplicaSynchronizationHealth = "HEALTHY" + ReplicaSynchronizationHealthNOTHEALTHY ReplicaSynchronizationHealth = "NOT_HEALTHY" + ReplicaSynchronizationHealthPARTIALLYHEALTHY ReplicaSynchronizationHealth = "PARTIALLY_HEALTHY" +) + +// PossibleReplicaSynchronizationHealthValues returns the possible values for the ReplicaSynchronizationHealth const type. +func PossibleReplicaSynchronizationHealthValues() []ReplicaSynchronizationHealth { + return []ReplicaSynchronizationHealth{ + ReplicaSynchronizationHealthHEALTHY, + ReplicaSynchronizationHealthNOTHEALTHY, + ReplicaSynchronizationHealthPARTIALLYHEALTHY, + } +} + type ReplicaType string const ( @@ -1987,19 +2113,19 @@ func PossibleReplicationLinkTypeValues() []ReplicationLinkType { } } -// ReplicationMode - The replication mode of a distributed availability group. Parameter will be ignored during link creation. -type ReplicationMode string +// ReplicationModeType - The replication mode of a distributed availability group. Parameter will be ignored during link creation. +type ReplicationModeType string const ( - ReplicationModeAsync ReplicationMode = "Async" - ReplicationModeSync ReplicationMode = "Sync" + ReplicationModeTypeAsync ReplicationModeType = "Async" + ReplicationModeTypeSync ReplicationModeType = "Sync" ) -// PossibleReplicationModeValues returns the possible values for the ReplicationMode const type. -func PossibleReplicationModeValues() []ReplicationMode { - return []ReplicationMode{ - ReplicationModeAsync, - ReplicationModeSync, +// PossibleReplicationModeTypeValues returns the possible values for the ReplicationModeType const type. +func PossibleReplicationModeTypeValues() []ReplicationModeType { + return []ReplicationModeType{ + ReplicationModeTypeAsync, + ReplicationModeTypeSync, } } @@ -2074,6 +2200,22 @@ func PossibleRestorePointTypeValues() []RestorePointType { } } +// RoleChangeType - The type of the role change, can be Planned or Forced. +type RoleChangeType string + +const ( + RoleChangeTypeForced RoleChangeType = "Forced" + RoleChangeTypePlanned RoleChangeType = "Planned" +) + +// PossibleRoleChangeTypeValues returns the possible values for the RoleChangeType const type. +func PossibleRoleChangeTypeValues() []RoleChangeType { + return []RoleChangeType{ + RoleChangeTypeForced, + RoleChangeTypePlanned, + } +} + // RuleSeverity - SQL Vulnerability Assessment rule severity. type RuleSeverity string @@ -2235,7 +2377,7 @@ func PossibleSecondaryTypeValues() []SecondaryType { type SecurityAlertPolicyName string const ( - SecurityAlertPolicyNameDefault SecurityAlertPolicyName = "Default" + SecurityAlertPolicyNameDefault SecurityAlertPolicyName = "default" ) // PossibleSecurityAlertPolicyNameValues returns the possible values for the SecurityAlertPolicyName const type. @@ -2245,6 +2387,19 @@ func PossibleSecurityAlertPolicyNameValues() []SecurityAlertPolicyName { } } +type SecurityAlertPolicyNameAutoGenerated string + +const ( + SecurityAlertPolicyNameAutoGeneratedDefault SecurityAlertPolicyNameAutoGenerated = "Default" +) + +// PossibleSecurityAlertPolicyNameAutoGeneratedValues returns the possible values for the SecurityAlertPolicyNameAutoGenerated const type. +func PossibleSecurityAlertPolicyNameAutoGeneratedValues() []SecurityAlertPolicyNameAutoGenerated { + return []SecurityAlertPolicyNameAutoGenerated{ + SecurityAlertPolicyNameAutoGeneratedDefault, + } +} + // SecurityAlertPolicyState - Specifies the state of the policy, whether it is enabled or disabled or a policy has not been // applied yet on the specific database. type SecurityAlertPolicyState string @@ -2464,148 +2619,6 @@ func PossibleServerWorkspaceFeatureValues() []ServerWorkspaceFeature { } } -// ServiceObjectiveName - The serviceLevelObjective for SLO usage metric. -type ServiceObjectiveName string - -const ( - ServiceObjectiveNameBasic ServiceObjectiveName = "Basic" - ServiceObjectiveNameDS100 ServiceObjectiveName = "DS100" - ServiceObjectiveNameDS1000 ServiceObjectiveName = "DS1000" - ServiceObjectiveNameDS1200 ServiceObjectiveName = "DS1200" - ServiceObjectiveNameDS1500 ServiceObjectiveName = "DS1500" - ServiceObjectiveNameDS200 ServiceObjectiveName = "DS200" - ServiceObjectiveNameDS2000 ServiceObjectiveName = "DS2000" - ServiceObjectiveNameDS300 ServiceObjectiveName = "DS300" - ServiceObjectiveNameDS400 ServiceObjectiveName = "DS400" - ServiceObjectiveNameDS500 ServiceObjectiveName = "DS500" - ServiceObjectiveNameDS600 ServiceObjectiveName = "DS600" - ServiceObjectiveNameDW100 ServiceObjectiveName = "DW100" - ServiceObjectiveNameDW1000 ServiceObjectiveName = "DW1000" - ServiceObjectiveNameDW10000C ServiceObjectiveName = "DW10000c" - ServiceObjectiveNameDW1000C ServiceObjectiveName = "DW1000c" - ServiceObjectiveNameDW1200 ServiceObjectiveName = "DW1200" - ServiceObjectiveNameDW1500 ServiceObjectiveName = "DW1500" - ServiceObjectiveNameDW15000C ServiceObjectiveName = "DW15000c" - ServiceObjectiveNameDW1500C ServiceObjectiveName = "DW1500c" - ServiceObjectiveNameDW200 ServiceObjectiveName = "DW200" - ServiceObjectiveNameDW2000 ServiceObjectiveName = "DW2000" - ServiceObjectiveNameDW2000C ServiceObjectiveName = "DW2000c" - ServiceObjectiveNameDW2500C ServiceObjectiveName = "DW2500c" - ServiceObjectiveNameDW300 ServiceObjectiveName = "DW300" - ServiceObjectiveNameDW3000 ServiceObjectiveName = "DW3000" - ServiceObjectiveNameDW30000C ServiceObjectiveName = "DW30000c" - ServiceObjectiveNameDW3000C ServiceObjectiveName = "DW3000c" - ServiceObjectiveNameDW400 ServiceObjectiveName = "DW400" - ServiceObjectiveNameDW500 ServiceObjectiveName = "DW500" - ServiceObjectiveNameDW5000C ServiceObjectiveName = "DW5000c" - ServiceObjectiveNameDW600 ServiceObjectiveName = "DW600" - ServiceObjectiveNameDW6000 ServiceObjectiveName = "DW6000" - ServiceObjectiveNameDW6000C ServiceObjectiveName = "DW6000c" - ServiceObjectiveNameDW7500C ServiceObjectiveName = "DW7500c" - ServiceObjectiveNameElasticPool ServiceObjectiveName = "ElasticPool" - ServiceObjectiveNameFree ServiceObjectiveName = "Free" - ServiceObjectiveNameP1 ServiceObjectiveName = "P1" - ServiceObjectiveNameP11 ServiceObjectiveName = "P11" - ServiceObjectiveNameP15 ServiceObjectiveName = "P15" - ServiceObjectiveNameP2 ServiceObjectiveName = "P2" - ServiceObjectiveNameP3 ServiceObjectiveName = "P3" - ServiceObjectiveNameP4 ServiceObjectiveName = "P4" - ServiceObjectiveNameP6 ServiceObjectiveName = "P6" - ServiceObjectiveNamePRS1 ServiceObjectiveName = "PRS1" - ServiceObjectiveNamePRS2 ServiceObjectiveName = "PRS2" - ServiceObjectiveNamePRS4 ServiceObjectiveName = "PRS4" - ServiceObjectiveNamePRS6 ServiceObjectiveName = "PRS6" - ServiceObjectiveNameS0 ServiceObjectiveName = "S0" - ServiceObjectiveNameS1 ServiceObjectiveName = "S1" - ServiceObjectiveNameS12 ServiceObjectiveName = "S12" - ServiceObjectiveNameS2 ServiceObjectiveName = "S2" - ServiceObjectiveNameS3 ServiceObjectiveName = "S3" - ServiceObjectiveNameS4 ServiceObjectiveName = "S4" - ServiceObjectiveNameS6 ServiceObjectiveName = "S6" - ServiceObjectiveNameS7 ServiceObjectiveName = "S7" - ServiceObjectiveNameS9 ServiceObjectiveName = "S9" - ServiceObjectiveNameSystem ServiceObjectiveName = "System" - ServiceObjectiveNameSystem0 ServiceObjectiveName = "System0" - ServiceObjectiveNameSystem1 ServiceObjectiveName = "System1" - ServiceObjectiveNameSystem2 ServiceObjectiveName = "System2" - ServiceObjectiveNameSystem2L ServiceObjectiveName = "System2L" - ServiceObjectiveNameSystem3 ServiceObjectiveName = "System3" - ServiceObjectiveNameSystem3L ServiceObjectiveName = "System3L" - ServiceObjectiveNameSystem4 ServiceObjectiveName = "System4" - ServiceObjectiveNameSystem4L ServiceObjectiveName = "System4L" -) - -// PossibleServiceObjectiveNameValues returns the possible values for the ServiceObjectiveName const type. -func PossibleServiceObjectiveNameValues() []ServiceObjectiveName { - return []ServiceObjectiveName{ - ServiceObjectiveNameBasic, - ServiceObjectiveNameDS100, - ServiceObjectiveNameDS1000, - ServiceObjectiveNameDS1200, - ServiceObjectiveNameDS1500, - ServiceObjectiveNameDS200, - ServiceObjectiveNameDS2000, - ServiceObjectiveNameDS300, - ServiceObjectiveNameDS400, - ServiceObjectiveNameDS500, - ServiceObjectiveNameDS600, - ServiceObjectiveNameDW100, - ServiceObjectiveNameDW1000, - ServiceObjectiveNameDW10000C, - ServiceObjectiveNameDW1000C, - ServiceObjectiveNameDW1200, - ServiceObjectiveNameDW1500, - ServiceObjectiveNameDW15000C, - ServiceObjectiveNameDW1500C, - ServiceObjectiveNameDW200, - ServiceObjectiveNameDW2000, - ServiceObjectiveNameDW2000C, - ServiceObjectiveNameDW2500C, - ServiceObjectiveNameDW300, - ServiceObjectiveNameDW3000, - ServiceObjectiveNameDW30000C, - ServiceObjectiveNameDW3000C, - ServiceObjectiveNameDW400, - ServiceObjectiveNameDW500, - ServiceObjectiveNameDW5000C, - ServiceObjectiveNameDW600, - ServiceObjectiveNameDW6000, - ServiceObjectiveNameDW6000C, - ServiceObjectiveNameDW7500C, - ServiceObjectiveNameElasticPool, - ServiceObjectiveNameFree, - ServiceObjectiveNameP1, - ServiceObjectiveNameP11, - ServiceObjectiveNameP15, - ServiceObjectiveNameP2, - ServiceObjectiveNameP3, - ServiceObjectiveNameP4, - ServiceObjectiveNameP6, - ServiceObjectiveNamePRS1, - ServiceObjectiveNamePRS2, - ServiceObjectiveNamePRS4, - ServiceObjectiveNamePRS6, - ServiceObjectiveNameS0, - ServiceObjectiveNameS1, - ServiceObjectiveNameS12, - ServiceObjectiveNameS2, - ServiceObjectiveNameS3, - ServiceObjectiveNameS4, - ServiceObjectiveNameS6, - ServiceObjectiveNameS7, - ServiceObjectiveNameS9, - ServiceObjectiveNameSystem, - ServiceObjectiveNameSystem0, - ServiceObjectiveNameSystem1, - ServiceObjectiveNameSystem2, - ServiceObjectiveNameSystem2L, - ServiceObjectiveNameSystem3, - ServiceObjectiveNameSystem3L, - ServiceObjectiveNameSystem4, - ServiceObjectiveNameSystem4L, - } -} - // ServicePrincipalType - Service principal type. type ServicePrincipalType string @@ -2648,25 +2661,50 @@ func PossibleStartStopScheduleNameValues() []StartStopScheduleName { } } +type Status string + +const ( + StatusCanceled Status = "Canceled" + StatusCompleted Status = "Completed" + StatusFailed Status = "Failed" + StatusInProgress Status = "InProgress" + StatusNotStarted Status = "NotStarted" + StatusSlowedDown Status = "SlowedDown" +) + +// PossibleStatusValues returns the possible values for the Status const type. +func PossibleStatusValues() []Status { + return []Status{ + StatusCanceled, + StatusCompleted, + StatusFailed, + StatusInProgress, + StatusNotStarted, + StatusSlowedDown, + } +} + // StorageCapabilityStorageAccountType - The storage account type for the database's backups. type StorageCapabilityStorageAccountType string const ( - StorageCapabilityStorageAccountTypeGRS StorageCapabilityStorageAccountType = "GRS" - StorageCapabilityStorageAccountTypeLRS StorageCapabilityStorageAccountType = "LRS" - StorageCapabilityStorageAccountTypeZRS StorageCapabilityStorageAccountType = "ZRS" + StorageCapabilityStorageAccountTypeGRS StorageCapabilityStorageAccountType = "GRS" + StorageCapabilityStorageAccountTypeGZRS StorageCapabilityStorageAccountType = "GZRS" + StorageCapabilityStorageAccountTypeLRS StorageCapabilityStorageAccountType = "LRS" + StorageCapabilityStorageAccountTypeZRS StorageCapabilityStorageAccountType = "ZRS" ) // PossibleStorageCapabilityStorageAccountTypeValues returns the possible values for the StorageCapabilityStorageAccountType const type. func PossibleStorageCapabilityStorageAccountTypeValues() []StorageCapabilityStorageAccountType { return []StorageCapabilityStorageAccountType{ StorageCapabilityStorageAccountTypeGRS, + StorageCapabilityStorageAccountTypeGZRS, StorageCapabilityStorageAccountTypeLRS, StorageCapabilityStorageAccountTypeZRS, } } -// StorageKeyType - Storage key type. +// StorageKeyType - Storage key type: StorageAccessKey or SharedAccessKey. type StorageKeyType string const ( @@ -2906,77 +2944,6 @@ func PossibleTransparentDataEncryptionStateValues() []TransparentDataEncryptionS } } -// UnitDefinitionType - The unit of the metric. -type UnitDefinitionType string - -const ( - UnitDefinitionTypeBytes UnitDefinitionType = "Bytes" - UnitDefinitionTypeBytesPerSecond UnitDefinitionType = "BytesPerSecond" - UnitDefinitionTypeCount UnitDefinitionType = "Count" - UnitDefinitionTypeCountPerSecond UnitDefinitionType = "CountPerSecond" - UnitDefinitionTypePercent UnitDefinitionType = "Percent" - UnitDefinitionTypeSeconds UnitDefinitionType = "Seconds" -) - -// PossibleUnitDefinitionTypeValues returns the possible values for the UnitDefinitionType const type. -func PossibleUnitDefinitionTypeValues() []UnitDefinitionType { - return []UnitDefinitionType{ - UnitDefinitionTypeBytes, - UnitDefinitionTypeBytesPerSecond, - UnitDefinitionTypeCount, - UnitDefinitionTypeCountPerSecond, - UnitDefinitionTypePercent, - UnitDefinitionTypeSeconds, - } -} - -// UnitType - The unit of the metric. -type UnitType string - -const ( - UnitTypeBytes UnitType = "bytes" - UnitTypeBytesPerSecond UnitType = "bytesPerSecond" - UnitTypeCount UnitType = "count" - UnitTypeCountPerSecond UnitType = "countPerSecond" - UnitTypePercent UnitType = "percent" - UnitTypeSeconds UnitType = "seconds" -) - -// PossibleUnitTypeValues returns the possible values for the UnitType const type. -func PossibleUnitTypeValues() []UnitType { - return []UnitType{ - UnitTypeBytes, - UnitTypeBytesPerSecond, - UnitTypeCount, - UnitTypeCountPerSecond, - UnitTypePercent, - UnitTypeSeconds, - } -} - -type UpsertManagedServerOperationStepStatus string - -const ( - UpsertManagedServerOperationStepStatusCanceled UpsertManagedServerOperationStepStatus = "Canceled" - UpsertManagedServerOperationStepStatusCompleted UpsertManagedServerOperationStepStatus = "Completed" - UpsertManagedServerOperationStepStatusFailed UpsertManagedServerOperationStepStatus = "Failed" - UpsertManagedServerOperationStepStatusInProgress UpsertManagedServerOperationStepStatus = "InProgress" - UpsertManagedServerOperationStepStatusNotStarted UpsertManagedServerOperationStepStatus = "NotStarted" - UpsertManagedServerOperationStepStatusSlowedDown UpsertManagedServerOperationStepStatus = "SlowedDown" -) - -// PossibleUpsertManagedServerOperationStepStatusValues returns the possible values for the UpsertManagedServerOperationStepStatus const type. -func PossibleUpsertManagedServerOperationStepStatusValues() []UpsertManagedServerOperationStepStatus { - return []UpsertManagedServerOperationStepStatus{ - UpsertManagedServerOperationStepStatusCanceled, - UpsertManagedServerOperationStepStatusCompleted, - UpsertManagedServerOperationStepStatusFailed, - UpsertManagedServerOperationStepStatusInProgress, - UpsertManagedServerOperationStepStatusNotStarted, - UpsertManagedServerOperationStepStatusSlowedDown, - } -} - // VirtualNetworkRuleState - Virtual Network Rule State type VirtualNetworkRuleState string diff --git a/sdk/resourcemanager/sql/armsql/databaseadvancedthreatprotectionsettings_client.go b/sdk/resourcemanager/sql/armsql/databaseadvancedthreatprotectionsettings_client.go index 13545b1724f3..13ec10190bb8 100644 --- a/sdk/resourcemanager/sql/armsql/databaseadvancedthreatprotectionsettings_client.go +++ b/sdk/resourcemanager/sql/armsql/databaseadvancedthreatprotectionsettings_client.go @@ -46,7 +46,7 @@ func NewDatabaseAdvancedThreatProtectionSettingsClient(subscriptionID string, cr // CreateOrUpdate - Creates or updates a database's Advanced Threat Protection state. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -101,7 +101,7 @@ func (client *DatabaseAdvancedThreatProtectionSettingsClient) createOrUpdateCrea return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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 *DatabaseAdvancedThreatProtectionSettingsClient) createOrUpdateHand // Get - Gets a database's Advanced Threat Protection state. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -176,7 +176,7 @@ func (client *DatabaseAdvancedThreatProtectionSettingsClient) getCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -193,7 +193,7 @@ func (client *DatabaseAdvancedThreatProtectionSettingsClient) getHandleResponse( // NewListByDatabasePager - Gets a list of database's Advanced Threat Protection states. // -// Generated from API version 2021-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -252,7 +252,7 @@ func (client *DatabaseAdvancedThreatProtectionSettingsClient) listByDatabaseCrea return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/databaseadvancedthreatprotectionsettings_client_example_test.go b/sdk/resourcemanager/sql/armsql/databaseadvancedthreatprotectionsettings_client_example_test.go deleted file mode 100644 index 75c22d158faf..000000000000 --- a/sdk/resourcemanager/sql/armsql/databaseadvancedthreatprotectionsettings_client_example_test.go +++ /dev/null @@ -1,183 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseAdvancedThreatProtectionSettingsListByDatabase.json -func ExampleDatabaseAdvancedThreatProtectionSettingsClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDatabaseAdvancedThreatProtectionSettingsClient().NewListByDatabasePager("threatprotection-6852", "threatprotection-2080", "testdb", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DatabaseAdvancedThreatProtectionListResult = armsql.DatabaseAdvancedThreatProtectionListResult{ - // Value: []*armsql.DatabaseAdvancedThreatProtection{ - // { - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/advancedThreatProtectionSettings"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/threatprotection-6852/providers/Microsoft.Sql/servers/threatprotection-2080/databases/testdb/advancedThreatProtectionSettings/Default"), - // Properties: &armsql.AdvancedThreatProtectionProperties{ - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // State: to.Ptr(armsql.AdvancedThreatProtectionStateEnabled), - // }, - // SystemData: &armsql.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsql.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsql.CreatedByTypeUser), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseAdvancedThreatProtectionSettingsGet.json -func ExampleDatabaseAdvancedThreatProtectionSettingsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatabaseAdvancedThreatProtectionSettingsClient().Get(ctx, "threatprotection-6852", "threatprotection-2080", "testdb", armsql.AdvancedThreatProtectionNameDefault, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DatabaseAdvancedThreatProtection = armsql.DatabaseAdvancedThreatProtection{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/advancedThreatProtectionSettings"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/threatprotection-4799/providers/Microsoft.Sql/servers/threatprotection-6440/advancedThreatProtectionSettings/Default"), - // Properties: &armsql.AdvancedThreatProtectionProperties{ - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // State: to.Ptr(armsql.AdvancedThreatProtectionStateEnabled), - // }, - // SystemData: &armsql.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsql.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsql.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseAdvancedThreatProtectionSettingsCreateMax.json -func ExampleDatabaseAdvancedThreatProtectionSettingsClient_CreateOrUpdate_updateADatabasesAdvancedThreatProtectionSettingsWithAllParameters() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatabaseAdvancedThreatProtectionSettingsClient().CreateOrUpdate(ctx, "threatprotection-4799", "threatprotection-6440", "testdb", armsql.AdvancedThreatProtectionNameDefault, armsql.DatabaseAdvancedThreatProtection{ - Properties: &armsql.AdvancedThreatProtectionProperties{ - State: to.Ptr(armsql.AdvancedThreatProtectionStateEnabled), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DatabaseAdvancedThreatProtection = armsql.DatabaseAdvancedThreatProtection{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/advancedThreatProtectionSettings"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/threatprotection-4799/providers/Microsoft.Sql/servers/threatprotection-6440/advancedThreatProtectionSettings/Default"), - // Properties: &armsql.AdvancedThreatProtectionProperties{ - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // State: to.Ptr(armsql.AdvancedThreatProtectionStateEnabled), - // }, - // SystemData: &armsql.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsql.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsql.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseAdvancedThreatProtectionSettingsCreateMin.json -func ExampleDatabaseAdvancedThreatProtectionSettingsClient_CreateOrUpdate_updateADatabasesAdvancedThreatProtectionSettingsWithMinimalParameters() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatabaseAdvancedThreatProtectionSettingsClient().CreateOrUpdate(ctx, "threatprotection-4799", "threatprotection-6440", "testdb", armsql.AdvancedThreatProtectionNameDefault, armsql.DatabaseAdvancedThreatProtection{ - Properties: &armsql.AdvancedThreatProtectionProperties{ - State: to.Ptr(armsql.AdvancedThreatProtectionStateDisabled), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DatabaseAdvancedThreatProtection = armsql.DatabaseAdvancedThreatProtection{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/advancedThreatProtectionSettings"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/threatprotection-4799/providers/Microsoft.Sql/servers/threatprotection-6440/advancedThreatProtectionSettings/Default"), - // Properties: &armsql.AdvancedThreatProtectionProperties{ - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // State: to.Ptr(armsql.AdvancedThreatProtectionStateDisabled), - // }, - // SystemData: &armsql.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsql.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsql.CreatedByTypeUser), - // }, - // } -} diff --git a/sdk/resourcemanager/sql/armsql/databaseadvisors_client.go b/sdk/resourcemanager/sql/armsql/databaseadvisors_client.go index b6383a005106..0ac08f8ddbd7 100644 --- a/sdk/resourcemanager/sql/armsql/databaseadvisors_client.go +++ b/sdk/resourcemanager/sql/armsql/databaseadvisors_client.go @@ -46,7 +46,7 @@ func NewDatabaseAdvisorsClient(subscriptionID string, credential azcore.TokenCre // Get - Gets a database advisor. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -99,7 +99,7 @@ func (client *DatabaseAdvisorsClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -117,7 +117,7 @@ func (client *DatabaseAdvisorsClient) getHandleResponse(resp *http.Response) (Da // ListByDatabase - Gets a list of database advisors. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -169,7 +169,7 @@ func (client *DatabaseAdvisorsClient) listByDatabaseCreateRequest(ctx context.Co if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -187,7 +187,7 @@ func (client *DatabaseAdvisorsClient) listByDatabaseHandleResponse(resp *http.Re // Update - Updates a database advisor. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -241,7 +241,7 @@ func (client *DatabaseAdvisorsClient) updateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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/sql/armsql/databaseadvisors_client_example_test.go b/sdk/resourcemanager/sql/armsql/databaseadvisors_client_example_test.go deleted file mode 100644 index 6800f25e0568..000000000000 --- a/sdk/resourcemanager/sql/armsql/databaseadvisors_client_example_test.go +++ /dev/null @@ -1,815 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseAdvisorList.json -func ExampleDatabaseAdvisorsClient_ListByDatabase_listOfDatabaseAdvisors() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatabaseAdvisorsClient().ListByDatabase(ctx, "workloadinsight-demos", "misosisvr", "IndexAdvisor_test_3", &armsql.DatabaseAdvisorsClientListByDatabaseOptions{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.AdvisorArray = []*armsql.Advisor{ - // { - // Name: to.Ptr("CreateIndex"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/advisors"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workloadinsight-demos/providers/Microsoft.Sql/servers/misosisvr/databases/IndexAdvisor_test_3/advisors/CreateIndex"), - // Kind: to.Ptr(""), - // Location: to.Ptr("East Asia"), - // Properties: &armsql.AdvisorProperties{ - // AdvisorStatus: to.Ptr(armsql.AdvisorStatusGA), - // AutoExecuteStatus: to.Ptr(armsql.AutoExecuteStatusDisabled), - // AutoExecuteStatusInheritedFrom: to.Ptr(armsql.AutoExecuteStatusInheritedFromDatabase), - // LastChecked: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-20T00:24:39Z"); return t}()), - // RecommendationsStatus: to.Ptr("Ok"), - // }, - // }, - // { - // Name: to.Ptr("DropIndex"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/advisors"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workloadinsight-demos/providers/Microsoft.Sql/servers/misosisvr/databases/IndexAdvisor_test_3/advisors/DropIndex"), - // Kind: to.Ptr(""), - // Location: to.Ptr("East Asia"), - // Properties: &armsql.AdvisorProperties{ - // AdvisorStatus: to.Ptr(armsql.AdvisorStatusGA), - // AutoExecuteStatus: to.Ptr(armsql.AutoExecuteStatusDisabled), - // AutoExecuteStatusInheritedFrom: to.Ptr(armsql.AutoExecuteStatusInheritedFromDatabase), - // LastChecked: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-19T20:42:43Z"); return t}()), - // RecommendationsStatus: to.Ptr("DbSeemsTuned"), - // }, - // }, - // { - // Name: to.Ptr("DbParameterization"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/advisors"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workloadinsight-demos/providers/Microsoft.Sql/servers/misosisvr/databases/IndexAdvisor_test_3/advisors/DbParameterization"), - // Kind: to.Ptr(""), - // Location: to.Ptr("East Asia"), - // Properties: &armsql.AdvisorProperties{ - // AdvisorStatus: to.Ptr(armsql.AdvisorStatusGA), - // AutoExecuteStatus: to.Ptr(armsql.AutoExecuteStatusEnabled), - // AutoExecuteStatusInheritedFrom: to.Ptr(armsql.AutoExecuteStatusInheritedFromDatabase), - // LastChecked: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-19T19:13:03Z"); return t}()), - // RecommendationsStatus: to.Ptr("DbParameterizationIssue"), - // }, - // }, - // { - // Name: to.Ptr("SchemaIssue"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/advisors"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workloadinsight-demos/providers/Microsoft.Sql/servers/misosisvr/databases/IndexAdvisor_test_3/advisors/SchemaIssue"), - // Kind: to.Ptr(""), - // Location: to.Ptr("East Asia"), - // Properties: &armsql.AdvisorProperties{ - // AdvisorStatus: to.Ptr(armsql.AdvisorStatusPublicPreview), - // AutoExecuteStatus: to.Ptr(armsql.AutoExecuteStatusDisabled), - // AutoExecuteStatusInheritedFrom: to.Ptr(armsql.AutoExecuteStatusInheritedFromDefault), - // LastChecked: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-20T14:00:32Z"); return t}()), - // RecommendationsStatus: to.Ptr("SchemaIsNotConsistent"), - // }, - // }, - // { - // Name: to.Ptr("ForceLastGoodPlan"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/advisors"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workloadinsight-demos/providers/Microsoft.Sql/servers/misosisvr/databases/IndexAdvisor_test_3/advisors/ForceLastGoodPlan"), - // Kind: to.Ptr(""), - // Location: to.Ptr("East Asia"), - // Properties: &armsql.AdvisorProperties{ - // AdvisorStatus: to.Ptr(armsql.AdvisorStatusPrivatePreview), - // AutoExecuteStatus: to.Ptr(armsql.AutoExecuteStatusDisabled), - // AutoExecuteStatusInheritedFrom: to.Ptr(armsql.AutoExecuteStatusInheritedFromDefault), - // }, - // }} -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRecommendedActionListExpand.json -func ExampleDatabaseAdvisorsClient_ListByDatabase_listOfDatabaseRecommendedActionsForAllAdvisors() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatabaseAdvisorsClient().ListByDatabase(ctx, "workloadinsight-demos", "misosisvr", "IndexAdvisor_test_3", &armsql.DatabaseAdvisorsClientListByDatabaseOptions{Expand: to.Ptr("recommendedActions")}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AdvisorArray = []*armsql.Advisor{ - // { - // Name: to.Ptr("CreateIndex"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/advisors"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workloadinsight-demos/providers/Microsoft.Sql/servers/misosisvr/databases/IndexAdvisor_test_3/advisors/CreateIndex"), - // Kind: to.Ptr(""), - // Location: to.Ptr("East Asia"), - // Properties: &armsql.AdvisorProperties{ - // AdvisorStatus: to.Ptr(armsql.AdvisorStatusGA), - // AutoExecuteStatus: to.Ptr(armsql.AutoExecuteStatusDisabled), - // AutoExecuteStatusInheritedFrom: to.Ptr(armsql.AutoExecuteStatusInheritedFromDatabase), - // LastChecked: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-20T16:39:16Z"); return t}()), - // RecommendationsStatus: to.Ptr("Ok"), - // RecommendedActions: []*armsql.RecommendedAction{ - // { - // Name: to.Ptr("IR_[CRM]_[DataPoints]_4821CD2F9510D98184BB"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/advisors/recommendedActions"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workloadinsight-demos/providers/Microsoft.Sql/servers/misosisvr/databases/IndexAdvisor_test_3/advisors/CreateIndex/recommendedActions/IR_[CRM]_[DataPoints]_4821CD2F9510D98184BB"), - // Kind: to.Ptr(""), - // Location: to.Ptr("East Asia"), - // Properties: &armsql.RecommendedActionProperties{ - // ErrorDetails: &armsql.RecommendedActionErrorInfo{ - // }, - // EstimatedImpact: []*armsql.RecommendedActionImpactRecord{ - // { - // AbsoluteValue: to.Ptr[float64](1440), - // DimensionName: to.Ptr("ActionDuration"), - // Unit: to.Ptr("Seconds"), - // }, - // { - // AbsoluteValue: to.Ptr[float64](209.3125), - // DimensionName: to.Ptr("SpaceChange"), - // Unit: to.Ptr("Megabytes"), - // }}, - // ImplementationDetails: &armsql.RecommendedActionImplementationInfo{ - // Method: to.Ptr(armsql.ImplementationMethodTSQL), - // Script: to.Ptr("CREATE NONCLUSTERED INDEX [nci_wi_DataPoints_B892614093BAC56295EF6018BD4CB51B] ON [CRM].[DataPoints] ([Name],[Money],[Power]) INCLUDE ([Hour], [System], [LastChanged]) WITH (ONLINE = ON)"), - // }, - // IsArchivedAction: to.Ptr(false), - // IsExecutableAction: to.Ptr(true), - // IsRevertableAction: to.Ptr(true), - // LastRefresh: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:04Z"); return t}()), - // ObservedImpact: []*armsql.RecommendedActionImpactRecord{ - // }, - // RecommendationReason: to.Ptr(""), - // Score: to.Ptr[int32](1), - // State: &armsql.RecommendedActionStateInfo{ - // CurrentValue: to.Ptr(armsql.RecommendedActionCurrentStateActive), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-20T15:15:40Z"); return t}()), - // }, - // TimeSeries: []*armsql.RecommendedActionMetricInfo{ - // }, - // ValidSince: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:04Z"); return t}()), - // Details: map[string]any{ - // "schema": "[CRM]", - // "includedColumns": "[Hour], [System], [LastChanged]", - // "indexColumns": "[Name],[Money],[Power]", - // "indexName": "nci_wi_DataPoints_B892614093BAC56295EF6018BD4CB51B", - // "indexType": "NONCLUSTERED", - // "table": "[DataPoints]", - // }, - // }, - // }, - // { - // Name: to.Ptr("IR_[dbo]_[DataPoints]_F5D2F347AA22DB46E4CC"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/advisors/recommendedActions"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workloadinsight-demos/providers/Microsoft.Sql/servers/misosisvr/databases/IndexAdvisor_test_3/advisors/CreateIndex/recommendedActions/IR_[dbo]_[DataPoints]_F5D2F347AA22DB46E4CC"), - // Kind: to.Ptr(""), - // Location: to.Ptr("East Asia"), - // Properties: &armsql.RecommendedActionProperties{ - // ErrorDetails: &armsql.RecommendedActionErrorInfo{ - // }, - // EstimatedImpact: []*armsql.RecommendedActionImpactRecord{ - // { - // AbsoluteValue: to.Ptr[float64](5040), - // DimensionName: to.Ptr("ActionDuration"), - // Unit: to.Ptr("Seconds"), - // }, - // { - // AbsoluteValue: to.Ptr[float64](120), - // DimensionName: to.Ptr("SpaceChange"), - // Unit: to.Ptr("Megabytes"), - // }}, - // ExecuteActionDuration: to.Ptr("PT1M"), - // ExecuteActionInitiatedBy: to.Ptr(armsql.RecommendedActionInitiatedByUser), - // ExecuteActionInitiatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05Z"); return t}()), - // ExecuteActionStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05Z"); return t}()), - // ImplementationDetails: &armsql.RecommendedActionImplementationInfo{ - // Method: to.Ptr(armsql.ImplementationMethodTSQL), - // Script: to.Ptr("DROP INDEX [nci_wi_DataPoints_609E4B7D6A3813990ED44B28B340C8FC] ON [dbo].[DataPoints]"), - // }, - // IsArchivedAction: to.Ptr(false), - // IsExecutableAction: to.Ptr(true), - // IsRevertableAction: to.Ptr(true), - // LastRefresh: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05Z"); return t}()), - // ObservedImpact: []*armsql.RecommendedActionImpactRecord{ - // { - // ChangeValueAbsolute: to.Ptr[float64](-12.7), - // ChangeValueRelative: to.Ptr[float64](-0.9), - // DimensionName: to.Ptr("AffectedQueriesCpuUtilization"), - // Unit: to.Ptr("CpuCores"), - // }, - // { - // ChangeValueAbsolute: to.Ptr[float64](-12.7), - // ChangeValueRelative: to.Ptr[float64](-0.3175), - // DimensionName: to.Ptr("CpuUtilization"), - // Unit: to.Ptr("CpuCores"), - // }, - // { - // AbsoluteValue: to.Ptr[float64](12), - // DimensionName: to.Ptr("QueriesWithImprovedPerformance"), - // Unit: to.Ptr("Count"), - // }, - // { - // AbsoluteValue: to.Ptr[float64](1), - // DimensionName: to.Ptr("QueriesWithRegressedPerformance"), - // Unit: to.Ptr("Count"), - // }, - // { - // AbsoluteValue: to.Ptr[float64](130.742187), - // DimensionName: to.Ptr("SpaceChange"), - // Unit: to.Ptr("Megabytes"), - // }, - // { - // AbsoluteValue: to.Ptr[float64](0), - // DimensionName: to.Ptr("VerificationProgress"), - // Unit: to.Ptr("Percent"), - // }}, - // RecommendationReason: to.Ptr(""), - // Score: to.Ptr[int32](3), - // State: &armsql.RecommendedActionStateInfo{ - // ActionInitiatedBy: to.Ptr(armsql.RecommendedActionInitiatedByUser), - // CurrentValue: to.Ptr(armsql.RecommendedActionCurrentStateSuccess), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05Z"); return t}()), - // }, - // TimeSeries: []*armsql.RecommendedActionMetricInfo{ - // }, - // ValidSince: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05Z"); return t}()), - // Details: map[string]any{ - // "schema": "[dbo]", - // "includedColumns": "[Power],[Pineapple]", - // "indexActionDuration": "00:01:00", - // "indexActionStartTime": "2017-03-01T14:38:05.337", - // "indexColumns": "[Name],[Money]", - // "indexName": "nci_wi_DataPoints_609E4B7D6A3813990ED44B28B340C8FC", - // "indexType": "NONCLUSTERED", - // "table": "[DataPoints]", - // }, - // }, - // }, - // { - // Name: to.Ptr("IR_[dbo]_[Employees]_560E15A98D14CA09BDFB"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/advisors/recommendedActions"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workloadinsight-demos/providers/Microsoft.Sql/servers/misosisvr/databases/IndexAdvisor_test_3/advisors/CreateIndex/recommendedActions/IR_[dbo]_[Employees]_560E15A98D14CA09BDFB"), - // Kind: to.Ptr(""), - // Location: to.Ptr("East Asia"), - // Properties: &armsql.RecommendedActionProperties{ - // ErrorDetails: &armsql.RecommendedActionErrorInfo{ - // }, - // EstimatedImpact: []*armsql.RecommendedActionImpactRecord{ - // { - // AbsoluteValue: to.Ptr[float64](17), - // DimensionName: to.Ptr("ActionDuration"), - // Unit: to.Ptr("Seconds"), - // }, - // { - // AbsoluteValue: to.Ptr[float64](128), - // DimensionName: to.Ptr("SpaceChange"), - // Unit: to.Ptr("Megabytes"), - // }}, - // ImplementationDetails: &armsql.RecommendedActionImplementationInfo{ - // Method: to.Ptr(armsql.ImplementationMethodTSQL), - // Script: to.Ptr("CREATE NONCLUSTERED INDEX [nci_wi_Employees_8C18C2AF4267DC77793040782641CCDE] ON [dbo].[Employees] ([City], [State]) INCLUDE ([Postal]) WITH (ONLINE = ON)"), - // }, - // IsArchivedAction: to.Ptr(false), - // IsExecutableAction: to.Ptr(true), - // IsRevertableAction: to.Ptr(true), - // LastRefresh: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05Z"); return t}()), - // ObservedImpact: []*armsql.RecommendedActionImpactRecord{ - // }, - // RecommendationReason: to.Ptr(""), - // Score: to.Ptr[int32](3), - // State: &armsql.RecommendedActionStateInfo{ - // CurrentValue: to.Ptr(armsql.RecommendedActionCurrentStateActive), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05Z"); return t}()), - // }, - // TimeSeries: []*armsql.RecommendedActionMetricInfo{ - // }, - // ValidSince: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05Z"); return t}()), - // Details: map[string]any{ - // "schema": "[dbo]", - // "includedColumns": "[Postal]", - // "indexColumns": "[City], [State]", - // "indexName": "nci_wi_Employees_8C18C2AF4267DC77793040782641CCDE", - // "indexType": "NONCLUSTERED", - // "table": "[Employees]", - // }, - // }, - // }}, - // }, - // }, - // { - // Name: to.Ptr("DropIndex"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/advisors"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workloadinsight-demos/providers/Microsoft.Sql/servers/misosisvr/databases/IndexAdvisor_test_3/advisors/DropIndex"), - // Kind: to.Ptr(""), - // Location: to.Ptr("East Asia"), - // Properties: &armsql.AdvisorProperties{ - // AdvisorStatus: to.Ptr(armsql.AdvisorStatusGA), - // AutoExecuteStatus: to.Ptr(armsql.AutoExecuteStatusDisabled), - // AutoExecuteStatusInheritedFrom: to.Ptr(armsql.AutoExecuteStatusInheritedFromDatabase), - // LastChecked: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-19T20:42:43Z"); return t}()), - // RecommendationsStatus: to.Ptr("DbSeemsTuned"), - // RecommendedActions: []*armsql.RecommendedAction{ - // { - // Name: to.Ptr("IR_[CRM]_[DataPoints1]_13ADA5F354E9E14A983B"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/advisors/recommendedActions"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workloadinsight-demos/providers/Microsoft.Sql/servers/misosisvr/databases/IndexAdvisor_test_3/advisors/DropIndex/recommendedActions/IR_[CRM]_[DataPoints1]_13ADA5F354E9E14A983B"), - // Kind: to.Ptr(""), - // Location: to.Ptr("East Asia"), - // Properties: &armsql.RecommendedActionProperties{ - // ErrorDetails: &armsql.RecommendedActionErrorInfo{ - // }, - // EstimatedImpact: []*armsql.RecommendedActionImpactRecord{ - // { - // AbsoluteValue: to.Ptr[float64](645), - // DimensionName: to.Ptr("ActionDuration"), - // Unit: to.Ptr("Seconds"), - // }, - // { - // AbsoluteValue: to.Ptr[float64](342), - // DimensionName: to.Ptr("SpaceChange"), - // Unit: to.Ptr("Megabytes"), - // }}, - // ExecuteActionInitiatedBy: to.Ptr(armsql.RecommendedActionInitiatedBySystem), - // ExecuteActionInitiatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-23T14:14:35Z"); return t}()), - // ImplementationDetails: &armsql.RecommendedActionImplementationInfo{ - // Method: to.Ptr(armsql.ImplementationMethodTSQL), - // Script: to.Ptr("DROP INDEX [IX_FF] ON [CRM].[DataPoints1]"), - // }, - // IsArchivedAction: to.Ptr(false), - // IsExecutableAction: to.Ptr(true), - // IsRevertableAction: to.Ptr(true), - // LastRefresh: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05Z"); return t}()), - // ObservedImpact: []*armsql.RecommendedActionImpactRecord{ - // }, - // RecommendationReason: to.Ptr("Unused"), - // Score: to.Ptr[int32](1), - // State: &armsql.RecommendedActionStateInfo{ - // ActionInitiatedBy: to.Ptr(armsql.RecommendedActionInitiatedBySystem), - // CurrentValue: to.Ptr(armsql.RecommendedActionCurrentStatePending), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-23T14:14:35Z"); return t}()), - // }, - // TimeSeries: []*armsql.RecommendedActionMetricInfo{ - // }, - // ValidSince: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05Z"); return t}()), - // Details: map[string]any{ - // "schema": "[CRM]", - // "includedColumns": "[Apple]", - // "indexColumns": "[Protocol],[SessionId]", - // "indexName": "IX_FF", - // "indexType": "NONCLUSTERED", - // "originalIndexName": "IX_COM_SKU_SKUDepartmentID", - // "table": "[DataPoints1]", - // }, - // }, - // }, - // { - // Name: to.Ptr("IR_[CRM]_[DataPoints1]_29AEA82685D24704DE1A"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/advisors/recommendedActions"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workloadinsight-demos/providers/Microsoft.Sql/servers/misosisvr/databases/IndexAdvisor_test_3/advisors/DropIndex/recommendedActions/IR_[CRM]_[DataPoints1]_29AEA82685D24704DE1A"), - // Kind: to.Ptr(""), - // Location: to.Ptr("East Asia"), - // Properties: &armsql.RecommendedActionProperties{ - // ErrorDetails: &armsql.RecommendedActionErrorInfo{ - // }, - // EstimatedImpact: []*armsql.RecommendedActionImpactRecord{ - // { - // AbsoluteValue: to.Ptr[float64](803), - // DimensionName: to.Ptr("ActionDuration"), - // Unit: to.Ptr("Seconds"), - // }, - // { - // AbsoluteValue: to.Ptr[float64](144.6875), - // DimensionName: to.Ptr("SpaceChange"), - // Unit: to.Ptr("Megabytes"), - // }}, - // ExecuteActionInitiatedBy: to.Ptr(armsql.RecommendedActionInitiatedBySystem), - // ExecuteActionInitiatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05Z"); return t}()), - // ImplementationDetails: &armsql.RecommendedActionImplementationInfo{ - // Method: to.Ptr(armsql.ImplementationMethodTSQL), - // Script: to.Ptr("DROP INDEX [MyIndex123] ON [CRM].[DataPoints1]"), - // }, - // IsArchivedAction: to.Ptr(false), - // IsExecutableAction: to.Ptr(true), - // IsRevertableAction: to.Ptr(true), - // LastRefresh: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05Z"); return t}()), - // ObservedImpact: []*armsql.RecommendedActionImpactRecord{ - // }, - // RecommendationReason: to.Ptr("Duplicate"), - // Score: to.Ptr[int32](1), - // State: &armsql.RecommendedActionStateInfo{ - // ActionInitiatedBy: to.Ptr(armsql.RecommendedActionInitiatedBySystem), - // CurrentValue: to.Ptr(armsql.RecommendedActionCurrentStatePending), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05Z"); return t}()), - // }, - // TimeSeries: []*armsql.RecommendedActionMetricInfo{ - // }, - // ValidSince: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05Z"); return t}()), - // Details: map[string]any{ - // "schema": "[CRM]", - // "includedColumns": "[Apple]", - // "indexColumns": "[Cookies],[SessionId]", - // "indexName": "MyIndex123", - // "indexType": "NONCLUSTERED", - // "originalIndexName": "IX_COM_SKU_SKUDepartmentID", - // "table": "[DataPoints1]", - // }, - // }, - // }, - // { - // Name: to.Ptr("IR_[CRM]_[DataPoints2]_E4B21F229379807E531A"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/advisors/recommendedActions"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workloadinsight-demos/providers/Microsoft.Sql/servers/misosisvr/databases/IndexAdvisor_test_3/advisors/DropIndex/recommendedActions/IR_[CRM]_[DataPoints2]_E4B21F229379807E531A"), - // Kind: to.Ptr(""), - // Location: to.Ptr("East Asia"), - // Properties: &armsql.RecommendedActionProperties{ - // ErrorDetails: &armsql.RecommendedActionErrorInfo{ - // }, - // EstimatedImpact: []*armsql.RecommendedActionImpactRecord{ - // { - // AbsoluteValue: to.Ptr[float64](705), - // DimensionName: to.Ptr("ActionDuration"), - // Unit: to.Ptr("Seconds"), - // }, - // { - // AbsoluteValue: to.Ptr[float64](342), - // DimensionName: to.Ptr("SpaceChange"), - // Unit: to.Ptr("Megabytes"), - // }}, - // ExecuteActionDuration: to.Ptr("PT1M"), - // ExecuteActionInitiatedBy: to.Ptr(armsql.RecommendedActionInitiatedByUser), - // ExecuteActionInitiatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05Z"); return t}()), - // ExecuteActionStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05Z"); return t}()), - // ImplementationDetails: &armsql.RecommendedActionImplementationInfo{ - // Method: to.Ptr(armsql.ImplementationMethodTSQL), - // Script: to.Ptr("CREATE NONCLUSTERED INDEX [MyIndex321] ON [CRM].[DataPoints2] ([Cookies],[SessionId],[Protocol]) INCLUDE ([Apple]) WITH (ONLINE = ON)"), - // }, - // IsArchivedAction: to.Ptr(false), - // IsExecutableAction: to.Ptr(true), - // IsRevertableAction: to.Ptr(true), - // LastRefresh: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05Z"); return t}()), - // ObservedImpact: []*armsql.RecommendedActionImpactRecord{ - // { - // ChangeValueAbsolute: to.Ptr[float64](0), - // ChangeValueRelative: to.Ptr[float64](0), - // DimensionName: to.Ptr("AffectedQueriesCpuUtilization"), - // Unit: to.Ptr("CpuCores"), - // }, - // { - // ChangeValueAbsolute: to.Ptr[float64](0), - // ChangeValueRelative: to.Ptr[float64](0), - // DimensionName: to.Ptr("CpuUtilization"), - // Unit: to.Ptr("CpuCores"), - // }, - // { - // AbsoluteValue: to.Ptr[float64](0), - // DimensionName: to.Ptr("QueriesWithImprovedPerformance"), - // Unit: to.Ptr("Count"), - // }, - // { - // AbsoluteValue: to.Ptr[float64](0), - // DimensionName: to.Ptr("QueriesWithRegressedPerformance"), - // Unit: to.Ptr("Count"), - // }, - // { - // AbsoluteValue: to.Ptr[float64](-342), - // DimensionName: to.Ptr("SpaceChange"), - // Unit: to.Ptr("Megabytes"), - // }, - // { - // AbsoluteValue: to.Ptr[float64](0), - // DimensionName: to.Ptr("VerificationProgress"), - // Unit: to.Ptr("Percent"), - // }}, - // RecommendationReason: to.Ptr("Duplicate"), - // Score: to.Ptr[int32](1), - // State: &armsql.RecommendedActionStateInfo{ - // ActionInitiatedBy: to.Ptr(armsql.RecommendedActionInitiatedByUser), - // CurrentValue: to.Ptr(armsql.RecommendedActionCurrentStateSuccess), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05Z"); return t}()), - // }, - // TimeSeries: []*armsql.RecommendedActionMetricInfo{ - // }, - // ValidSince: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05Z"); return t}()), - // Details: map[string]any{ - // "schema": "[CRM]", - // "includedColumns": "[Apple]", - // "indexActionDuration": "00:01:00", - // "indexActionStartTime": "2017-03-01T14:38:05.697", - // "indexColumns": "[Cookies],[SessionId],[Protocol]", - // "indexName": "MyIndex321", - // "indexType": "NONCLUSTERED", - // "originalIndexName": "IX_COM_SKU_SKUDepartmentID", - // "table": "[DataPoints2]", - // }, - // }, - // }, - // { - // Name: to.Ptr("IR_[dbo]_[FactFinance]_13ADA5F354E9E14A983B"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/advisors/recommendedActions"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workloadinsight-demos/providers/Microsoft.Sql/servers/misosisvr/databases/IndexAdvisor_test_3/advisors/DropIndex/recommendedActions/IR_[dbo]_[FactFinance]_13ADA5F354E9E14A983B"), - // Kind: to.Ptr(""), - // Location: to.Ptr("East Asia"), - // Properties: &armsql.RecommendedActionProperties{ - // ErrorDetails: &armsql.RecommendedActionErrorInfo{ - // }, - // EstimatedImpact: []*armsql.RecommendedActionImpactRecord{ - // { - // AbsoluteValue: to.Ptr[float64](705), - // DimensionName: to.Ptr("ActionDuration"), - // Unit: to.Ptr("Seconds"), - // }, - // { - // AbsoluteValue: to.Ptr[float64](342), - // DimensionName: to.Ptr("SpaceChange"), - // Unit: to.Ptr("Megabytes"), - // }}, - // ExecuteActionDuration: to.Ptr("PT1M"), - // ExecuteActionInitiatedBy: to.Ptr(armsql.RecommendedActionInitiatedBySystem), - // ExecuteActionInitiatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05Z"); return t}()), - // ExecuteActionStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05Z"); return t}()), - // ImplementationDetails: &armsql.RecommendedActionImplementationInfo{ - // Method: to.Ptr(armsql.ImplementationMethodTSQL), - // Script: to.Ptr("CREATE NONCLUSTERED INDEX [IX_FF] ON [dbo].[FactFinance] ([FinanceKey],[DateKey]) INCLUDE ([OrganizationKey]) WITH (ONLINE = ON)"), - // }, - // IsArchivedAction: to.Ptr(false), - // IsExecutableAction: to.Ptr(true), - // IsRevertableAction: to.Ptr(true), - // LastRefresh: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05Z"); return t}()), - // ObservedImpact: []*armsql.RecommendedActionImpactRecord{ - // { - // ChangeValueAbsolute: to.Ptr[float64](0), - // ChangeValueRelative: to.Ptr[float64](0), - // DimensionName: to.Ptr("AffectedQueriesCpuUtilization"), - // Unit: to.Ptr("CpuCores"), - // }, - // { - // ChangeValueAbsolute: to.Ptr[float64](0), - // ChangeValueRelative: to.Ptr[float64](0), - // DimensionName: to.Ptr("CpuUtilization"), - // Unit: to.Ptr("CpuCores"), - // }, - // { - // AbsoluteValue: to.Ptr[float64](0), - // DimensionName: to.Ptr("QueriesWithImprovedPerformance"), - // Unit: to.Ptr("Count"), - // }, - // { - // AbsoluteValue: to.Ptr[float64](0), - // DimensionName: to.Ptr("QueriesWithRegressedPerformance"), - // Unit: to.Ptr("Count"), - // }, - // { - // AbsoluteValue: to.Ptr[float64](-342), - // DimensionName: to.Ptr("SpaceChange"), - // Unit: to.Ptr("Megabytes"), - // }, - // { - // AbsoluteValue: to.Ptr[float64](0), - // DimensionName: to.Ptr("VerificationProgress"), - // Unit: to.Ptr("Percent"), - // }}, - // RecommendationReason: to.Ptr("Duplicate"), - // Score: to.Ptr[int32](1), - // State: &armsql.RecommendedActionStateInfo{ - // ActionInitiatedBy: to.Ptr(armsql.RecommendedActionInitiatedBySystem), - // CurrentValue: to.Ptr(armsql.RecommendedActionCurrentStateSuccess), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-28T14:38:05Z"); return t}()), - // }, - // TimeSeries: []*armsql.RecommendedActionMetricInfo{ - // }, - // ValidSince: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05Z"); return t}()), - // Details: map[string]any{ - // "schema": "[dbo]", - // "includedColumns": "[OrganizationKey]", - // "indexActionDuration": "00:01:00", - // "indexActionStartTime": "2017-03-01T14:38:05.837", - // "indexColumns": "[FinanceKey],[DateKey]", - // "indexName": "IX_FF", - // "indexType": "NONCLUSTERED", - // "originalIndexName": "IX_COM_SKU_SKUDepartmentID", - // "table": "[FactFinance]", - // }, - // }, - // }}, - // }, - // }, - // { - // Name: to.Ptr("DbParameterization"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/advisors"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workloadinsight-demos/providers/Microsoft.Sql/servers/misosisvr/databases/IndexAdvisor_test_3/advisors/DbParameterization"), - // Kind: to.Ptr(""), - // Location: to.Ptr("East Asia"), - // Properties: &armsql.AdvisorProperties{ - // AdvisorStatus: to.Ptr(armsql.AdvisorStatusGA), - // AutoExecuteStatus: to.Ptr(armsql.AutoExecuteStatusEnabled), - // AutoExecuteStatusInheritedFrom: to.Ptr(armsql.AutoExecuteStatusInheritedFromDatabase), - // LastChecked: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-19T19:13:03Z"); return t}()), - // RecommendationsStatus: to.Ptr("DbParameterizationIssue"), - // RecommendedActions: []*armsql.RecommendedAction{ - // { - // Name: to.Ptr("ForceDbParameterization"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/advisors/recommendedActions"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workloadinsight-demos/providers/Microsoft.Sql/servers/misosisvr/databases/IndexAdvisor_test_3/advisors/DbParameterization/recommendedActions/ForceDbParameterization"), - // Kind: to.Ptr(""), - // Location: to.Ptr("East Asia"), - // Properties: &armsql.RecommendedActionProperties{ - // ErrorDetails: &armsql.RecommendedActionErrorInfo{ - // }, - // EstimatedImpact: []*armsql.RecommendedActionImpactRecord{ - // { - // ChangeValueAbsolute: to.Ptr[float64](22.5613696939135), - // DimensionName: to.Ptr("CpuSavings"), - // Unit: to.Ptr("Percent"), - // }, - // { - // ChangeValueAbsolute: to.Ptr[float64](0.701823681806341), - // DimensionName: to.Ptr("QueryDurationDecrease"), - // Unit: to.Ptr("secs"), - // }}, - // ExecuteActionInitiatedBy: to.Ptr(armsql.RecommendedActionInitiatedBySystem), - // ExecuteActionInitiatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-11T15:08:31Z"); return t}()), - // ImplementationDetails: &armsql.RecommendedActionImplementationInfo{ - // Method: to.Ptr(armsql.ImplementationMethodTSQL), - // Script: to.Ptr("ALTER DATABASE [IndexAdvisor_test_3] SET PARAMETERIZATION FORCED"), - // }, - // IsArchivedAction: to.Ptr(false), - // IsExecutableAction: to.Ptr(true), - // IsRevertableAction: to.Ptr(true), - // LastRefresh: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:37:44Z"); return t}()), - // ObservedImpact: []*armsql.RecommendedActionImpactRecord{ - // }, - // RecommendationReason: to.Ptr(""), - // Score: to.Ptr[int32](3), - // State: &armsql.RecommendedActionStateInfo{ - // ActionInitiatedBy: to.Ptr(armsql.RecommendedActionInitiatedBySystem), - // CurrentValue: to.Ptr(armsql.RecommendedActionCurrentStatePending), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-11T15:08:31Z"); return t}()), - // }, - // TimeSeries: []*armsql.RecommendedActionMetricInfo{ - // }, - // ValidSince: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:37:44Z"); return t}()), - // }, - // }}, - // }, - // }, - // { - // Name: to.Ptr("SchemaIssue"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/advisors"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workloadinsight-demos/providers/Microsoft.Sql/servers/misosisvr/databases/IndexAdvisor_test_3/advisors/SchemaIssue"), - // Kind: to.Ptr(""), - // Location: to.Ptr("East Asia"), - // Properties: &armsql.AdvisorProperties{ - // AdvisorStatus: to.Ptr(armsql.AdvisorStatusPublicPreview), - // AutoExecuteStatus: to.Ptr(armsql.AutoExecuteStatusDisabled), - // AutoExecuteStatusInheritedFrom: to.Ptr(armsql.AutoExecuteStatusInheritedFromDefault), - // LastChecked: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-20T18:50:21Z"); return t}()), - // RecommendationsStatus: to.Ptr("SchemaIsNotConsistent"), - // RecommendedActions: []*armsql.RecommendedAction{ - // { - // Name: to.Ptr("SchemaProblem_1A258C5714A7410C9D23"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/advisors/recommendedActions"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workloadinsight-demos/providers/Microsoft.Sql/servers/misosisvr/databases/IndexAdvisor_test_3/advisors/SchemaIssue/recommendedActions/SchemaProblem_1A258C5714A7410C9D23"), - // Kind: to.Ptr(""), - // Location: to.Ptr("East Asia"), - // Properties: &armsql.RecommendedActionProperties{ - // ErrorDetails: &armsql.RecommendedActionErrorInfo{ - // }, - // EstimatedImpact: []*armsql.RecommendedActionImpactRecord{ - // }, - // ImplementationDetails: &armsql.RecommendedActionImplementationInfo{ - // }, - // IsArchivedAction: to.Ptr(false), - // IsExecutableAction: to.Ptr(false), - // IsRevertableAction: to.Ptr(false), - // LastRefresh: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T22:19:53Z"); return t}()), - // ObservedImpact: []*armsql.RecommendedActionImpactRecord{ - // }, - // RecommendationReason: to.Ptr("SchemaProblem"), - // Score: to.Ptr[int32](3), - // State: &armsql.RecommendedActionStateInfo{ - // CurrentValue: to.Ptr(armsql.RecommendedActionCurrentStateActive), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:37:48Z"); return t}()), - // }, - // TimeSeries: []*armsql.RecommendedActionMetricInfo{ - // }, - // ValidSince: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:37:48Z"); return t}()), - // Details: map[string]any{ - // "sqlErrorCount": float64(342482), - // "sqlErrorMessage": "Invalid object name 'dbo.Companies'.", - // "sqlErrorNumber": float64(208), - // }, - // }, - // }}, - // }, - // }, - // { - // Name: to.Ptr("ForceLastGoodPlan"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/advisors"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workloadinsight-demos/providers/Microsoft.Sql/servers/misosisvr/databases/IndexAdvisor_test_3/advisors/ForceLastGoodPlan"), - // Kind: to.Ptr(""), - // Location: to.Ptr("East Asia"), - // Properties: &armsql.AdvisorProperties{ - // AdvisorStatus: to.Ptr(armsql.AdvisorStatusPrivatePreview), - // AutoExecuteStatus: to.Ptr(armsql.AutoExecuteStatusDisabled), - // AutoExecuteStatusInheritedFrom: to.Ptr(armsql.AutoExecuteStatusInheritedFromDefault), - // RecommendedActions: []*armsql.RecommendedAction{ - // }, - // }, - // }} -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseAdvisorGet.json -func ExampleDatabaseAdvisorsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatabaseAdvisorsClient().Get(ctx, "workloadinsight-demos", "misosisvr", "IndexAdvisor_test_3", "CreateIndex", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Advisor = armsql.Advisor{ - // Name: to.Ptr("CreateIndex"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/advisors"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workloadinsight-demos/providers/Microsoft.Sql/servers/misosisvr/databases/IndexAdvisor_test_3/advisors/CreateIndex"), - // Properties: &armsql.AdvisorProperties{ - // AdvisorStatus: to.Ptr(armsql.AdvisorStatusGA), - // AutoExecuteStatus: to.Ptr(armsql.AutoExecuteStatusDisabled), - // LastChecked: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-20T00:24:39Z"); return t}()), - // RecommendationsStatus: to.Ptr("Ok"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseAdvisorUpdate.json -func ExampleDatabaseAdvisorsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatabaseAdvisorsClient().Update(ctx, "workloadinsight-demos", "misosisvr", "IndexAdvisor_test_3", "CreateIndex", armsql.Advisor{ - Properties: &armsql.AdvisorProperties{ - AutoExecuteStatus: to.Ptr(armsql.AutoExecuteStatusDisabled), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Advisor = armsql.Advisor{ - // Name: to.Ptr("CreateIndex"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/advisors"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workloadinsight-demos/providers/Microsoft.Sql/servers/misosisvr/databases/IndexAdvisor_test_3/advisors/CreateIndex"), - // Properties: &armsql.AdvisorProperties{ - // AdvisorStatus: to.Ptr(armsql.AdvisorStatusGA), - // AutoExecuteStatus: to.Ptr(armsql.AutoExecuteStatusDisabled), - // LastChecked: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-20T00:24:39Z"); return t}()), - // RecommendationsStatus: to.Ptr("Ok"), - // }, - // } -} diff --git a/sdk/resourcemanager/sql/armsql/databaseautomatictuning_client.go b/sdk/resourcemanager/sql/armsql/databaseautomatictuning_client.go index 774809ec7e1e..27a6e68f04c6 100644 --- a/sdk/resourcemanager/sql/armsql/databaseautomatictuning_client.go +++ b/sdk/resourcemanager/sql/armsql/databaseautomatictuning_client.go @@ -46,7 +46,7 @@ func NewDatabaseAutomaticTuningClient(subscriptionID string, credential azcore.T // Get - Gets a database's automatic tuning. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -95,7 +95,7 @@ func (client *DatabaseAutomaticTuningClient) getCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -113,7 +113,7 @@ func (client *DatabaseAutomaticTuningClient) getHandleResponse(resp *http.Respon // Update - Update automatic tuning properties for target database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -163,7 +163,7 @@ func (client *DatabaseAutomaticTuningClient) updateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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/sql/armsql/databaseautomatictuning_client_example_test.go b/sdk/resourcemanager/sql/armsql/databaseautomatictuning_client_example_test.go deleted file mode 100644 index 7a43e39b9934..000000000000 --- a/sdk/resourcemanager/sql/armsql/databaseautomatictuning_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 armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseAutomaticTuningGet.json -func ExampleDatabaseAutomaticTuningClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatabaseAutomaticTuningClient().Get(ctx, "default-sql-onebox", "testsvr11", "db1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DatabaseAutomaticTuning = armsql.DatabaseAutomaticTuning{ - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/automaticTuning"), - // ID: to.Ptr("/subscriptions/c3aa9078-0000-0000-0000-e36f151182d7/resourceGroups/default-sql-onebox/providers/Microsoft.Sql/servers/testsvr11/databases/db1/automaticTuning/current"), - // Properties: &armsql.DatabaseAutomaticTuningProperties{ - // ActualState: to.Ptr(armsql.AutomaticTuningModeAuto), - // DesiredState: to.Ptr(armsql.AutomaticTuningModeAuto), - // Options: map[string]*armsql.AutomaticTuningOptions{ - // "createIndex": &armsql.AutomaticTuningOptions{ - // ActualState: to.Ptr(armsql.AutomaticTuningOptionModeActualOn), - // DesiredState: to.Ptr(armsql.AutomaticTuningOptionModeDesiredDefault), - // ReasonCode: to.Ptr[int32](2), - // ReasonDesc: to.Ptr(armsql.AutomaticTuningDisabledReasonAutoConfigured), - // }, - // "dropIndex": &armsql.AutomaticTuningOptions{ - // ActualState: to.Ptr(armsql.AutomaticTuningOptionModeActualOff), - // DesiredState: to.Ptr(armsql.AutomaticTuningOptionModeDesiredDefault), - // ReasonCode: to.Ptr[int32](2), - // ReasonDesc: to.Ptr(armsql.AutomaticTuningDisabledReasonAutoConfigured), - // }, - // "forceLastGoodPlan": &armsql.AutomaticTuningOptions{ - // ActualState: to.Ptr(armsql.AutomaticTuningOptionModeActualOn), - // DesiredState: to.Ptr(armsql.AutomaticTuningOptionModeDesiredDefault), - // ReasonCode: to.Ptr[int32](2), - // ReasonDesc: to.Ptr(armsql.AutomaticTuningDisabledReasonAutoConfigured), - // }, - // "maintainIndex": &armsql.AutomaticTuningOptions{ - // ActualState: to.Ptr(armsql.AutomaticTuningOptionModeActualOff), - // DesiredState: to.Ptr(armsql.AutomaticTuningOptionModeDesiredDefault), - // ReasonCode: to.Ptr[int32](2), - // ReasonDesc: to.Ptr(armsql.AutomaticTuningDisabledReasonAutoConfigured), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseAutomaticTuningUpdateMax.json -func ExampleDatabaseAutomaticTuningClient_Update_updatesDatabaseAutomaticTuningSettingsWithAllProperties() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatabaseAutomaticTuningClient().Update(ctx, "default-sql-onebox", "testsvr11", "db1", armsql.DatabaseAutomaticTuning{ - Properties: &armsql.DatabaseAutomaticTuningProperties{ - DesiredState: to.Ptr(armsql.AutomaticTuningModeAuto), - Options: map[string]*armsql.AutomaticTuningOptions{ - "createIndex": { - DesiredState: to.Ptr(armsql.AutomaticTuningOptionModeDesiredOff), - }, - "dropIndex": { - DesiredState: to.Ptr(armsql.AutomaticTuningOptionModeDesiredOn), - }, - "forceLastGoodPlan": { - DesiredState: to.Ptr(armsql.AutomaticTuningOptionModeDesiredDefault), - }, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DatabaseAutomaticTuning = armsql.DatabaseAutomaticTuning{ - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/automaticTuning"), - // ID: to.Ptr("/subscriptions/c3aa9078-0000-0000-0000-e36f151182d7/resourceGroups/default-sql-onebox/providers/Microsoft.Sql/servers/testsvr11/databases/db1/automaticTuning/current"), - // Properties: &armsql.DatabaseAutomaticTuningProperties{ - // ActualState: to.Ptr(armsql.AutomaticTuningModeAuto), - // DesiredState: to.Ptr(armsql.AutomaticTuningModeAuto), - // Options: map[string]*armsql.AutomaticTuningOptions{ - // "createIndex": &armsql.AutomaticTuningOptions{ - // ActualState: to.Ptr(armsql.AutomaticTuningOptionModeActualOff), - // DesiredState: to.Ptr(armsql.AutomaticTuningOptionModeDesiredOff), - // }, - // "dropIndex": &armsql.AutomaticTuningOptions{ - // ActualState: to.Ptr(armsql.AutomaticTuningOptionModeActualOn), - // DesiredState: to.Ptr(armsql.AutomaticTuningOptionModeDesiredOn), - // }, - // "forceLastGoodPlan": &armsql.AutomaticTuningOptions{ - // ActualState: to.Ptr(armsql.AutomaticTuningOptionModeActualOn), - // DesiredState: to.Ptr(armsql.AutomaticTuningOptionModeDesiredDefault), - // ReasonCode: to.Ptr[int32](2), - // ReasonDesc: to.Ptr(armsql.AutomaticTuningDisabledReasonAutoConfigured), - // }, - // "maintainIndex": &armsql.AutomaticTuningOptions{ - // ActualState: to.Ptr(armsql.AutomaticTuningOptionModeActualOff), - // DesiredState: to.Ptr(armsql.AutomaticTuningOptionModeDesiredDefault), - // ReasonCode: to.Ptr[int32](2), - // ReasonDesc: to.Ptr(armsql.AutomaticTuningDisabledReasonAutoConfigured), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseAutomaticTuningUpdateMin.json -func ExampleDatabaseAutomaticTuningClient_Update_updatesDatabaseAutomaticTuningSettingsWithMinimalProperties() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatabaseAutomaticTuningClient().Update(ctx, "default-sql-onebox", "testsvr11", "db1", armsql.DatabaseAutomaticTuning{ - Properties: &armsql.DatabaseAutomaticTuningProperties{ - DesiredState: to.Ptr(armsql.AutomaticTuningModeAuto), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DatabaseAutomaticTuning = armsql.DatabaseAutomaticTuning{ - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/automaticTuning"), - // ID: to.Ptr("/subscriptions/c3aa9078-0000-0000-0000-e36f151182d7/resourceGroups/default-sql-onebox/providers/Microsoft.Sql/servers/testsvr11/databases/db1/automaticTuning/current"), - // Properties: &armsql.DatabaseAutomaticTuningProperties{ - // ActualState: to.Ptr(armsql.AutomaticTuningModeAuto), - // DesiredState: to.Ptr(armsql.AutomaticTuningModeAuto), - // Options: map[string]*armsql.AutomaticTuningOptions{ - // "createIndex": &armsql.AutomaticTuningOptions{ - // ActualState: to.Ptr(armsql.AutomaticTuningOptionModeActualOn), - // DesiredState: to.Ptr(armsql.AutomaticTuningOptionModeDesiredDefault), - // ReasonCode: to.Ptr[int32](2), - // ReasonDesc: to.Ptr(armsql.AutomaticTuningDisabledReasonAutoConfigured), - // }, - // "dropIndex": &armsql.AutomaticTuningOptions{ - // ActualState: to.Ptr(armsql.AutomaticTuningOptionModeActualOff), - // DesiredState: to.Ptr(armsql.AutomaticTuningOptionModeDesiredDefault), - // ReasonCode: to.Ptr[int32](2), - // ReasonDesc: to.Ptr(armsql.AutomaticTuningDisabledReasonAutoConfigured), - // }, - // "forceLastGoodPlan": &armsql.AutomaticTuningOptions{ - // ActualState: to.Ptr(armsql.AutomaticTuningOptionModeActualOn), - // DesiredState: to.Ptr(armsql.AutomaticTuningOptionModeDesiredDefault), - // ReasonCode: to.Ptr[int32](2), - // ReasonDesc: to.Ptr(armsql.AutomaticTuningDisabledReasonAutoConfigured), - // }, - // "maintainIndex": &armsql.AutomaticTuningOptions{ - // ActualState: to.Ptr(armsql.AutomaticTuningOptionModeActualOff), - // DesiredState: to.Ptr(armsql.AutomaticTuningOptionModeDesiredDefault), - // ReasonCode: to.Ptr[int32](2), - // ReasonDesc: to.Ptr(armsql.AutomaticTuningDisabledReasonAutoConfigured), - // }, - // }, - // }, - // } -} diff --git a/sdk/resourcemanager/sql/armsql/databaseblobauditingpolicies_client.go b/sdk/resourcemanager/sql/armsql/databaseblobauditingpolicies_client.go index b1db184e9293..67c12f4478a4 100644 --- a/sdk/resourcemanager/sql/armsql/databaseblobauditingpolicies_client.go +++ b/sdk/resourcemanager/sql/armsql/databaseblobauditingpolicies_client.go @@ -46,7 +46,7 @@ func NewDatabaseBlobAuditingPoliciesClient(subscriptionID string, credential azc // CreateOrUpdate - Creates or updates a database's blob auditing policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -97,7 +97,7 @@ func (client *DatabaseBlobAuditingPoliciesClient) createOrUpdateCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -118,7 +118,7 @@ func (client *DatabaseBlobAuditingPoliciesClient) createOrUpdateHandleResponse(r // Get - Gets a database's blob auditing policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -168,7 +168,7 @@ func (client *DatabaseBlobAuditingPoliciesClient) getCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -185,7 +185,7 @@ func (client *DatabaseBlobAuditingPoliciesClient) getHandleResponse(resp *http.R // NewListByDatabasePager - Lists auditing settings of a database. // -// Generated from API version 2021-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -244,7 +244,7 @@ func (client *DatabaseBlobAuditingPoliciesClient) listByDatabaseCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/databaseblobauditingpolicies_client_example_test.go b/sdk/resourcemanager/sql/armsql/databaseblobauditingpolicies_client_example_test.go deleted file mode 100644 index 0c716870a7bd..000000000000 --- a/sdk/resourcemanager/sql/armsql/databaseblobauditingpolicies_client_example_test.go +++ /dev/null @@ -1,238 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseAuditingSettingsList.json -func ExampleDatabaseBlobAuditingPoliciesClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDatabaseBlobAuditingPoliciesClient().NewListByDatabasePager("blobauditingtest-6852", "blobauditingtest-2080", "testdb", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DatabaseBlobAuditingPolicyListResult = armsql.DatabaseBlobAuditingPolicyListResult{ - // Value: []*armsql.DatabaseBlobAuditingPolicy{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/auditingSettings"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/blobauditingtest-6852/providers/Microsoft.Sql/servers/blobauditingtest-2080/databases/testdb/auditingSettings/default"), - // Kind: to.Ptr("V12"), - // Properties: &armsql.DatabaseBlobAuditingPolicyProperties{ - // AuditActionsAndGroups: []*string{ - // }, - // IsAzureMonitorTargetEnabled: to.Ptr(false), - // IsStorageSecondaryKeyInUse: to.Ptr(false), - // RetentionDays: to.Ptr[int32](0), - // State: to.Ptr(armsql.BlobAuditingPolicyStateDisabled), - // StorageAccountSubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // StorageEndpoint: to.Ptr(""), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseBlobAuditingGet.json -func ExampleDatabaseBlobAuditingPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatabaseBlobAuditingPoliciesClient().Get(ctx, "blobauditingtest-6852", "blobauditingtest-2080", "testdb", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DatabaseBlobAuditingPolicy = armsql.DatabaseBlobAuditingPolicy{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/auditingSettings"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/blobauditingtest-6852/providers/Microsoft.Sql/servers/blobauditingtest-2080/databases/testdb"), - // Kind: to.Ptr("V12"), - // Properties: &armsql.DatabaseBlobAuditingPolicyProperties{ - // AuditActionsAndGroups: []*string{ - // }, - // IsAzureMonitorTargetEnabled: to.Ptr(false), - // IsStorageSecondaryKeyInUse: to.Ptr(false), - // RetentionDays: to.Ptr[int32](0), - // State: to.Ptr(armsql.BlobAuditingPolicyStateDisabled), - // StorageAccountSubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // StorageEndpoint: to.Ptr(""), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseAzureMonitorAuditingCreateMin.json -func ExampleDatabaseBlobAuditingPoliciesClient_CreateOrUpdate_createOrUpdateADatabasesAzureMonitorAuditingPolicyWithMinimalParameters() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatabaseBlobAuditingPoliciesClient().CreateOrUpdate(ctx, "blobauditingtest-4799", "blobauditingtest-6440", "testdb", armsql.DatabaseBlobAuditingPolicy{ - Properties: &armsql.DatabaseBlobAuditingPolicyProperties{ - IsAzureMonitorTargetEnabled: to.Ptr(true), - State: to.Ptr(armsql.BlobAuditingPolicyStateEnabled), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DatabaseBlobAuditingPolicy = armsql.DatabaseBlobAuditingPolicy{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/auditingSettings"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/blobauditingtest-4799/providers/Microsoft.Sql/servers/blobauditingtest-6440/databases/testdb"), - // Kind: to.Ptr("V12"), - // Properties: &armsql.DatabaseBlobAuditingPolicyProperties{ - // AuditActionsAndGroups: []*string{ - // to.Ptr("SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP"), - // to.Ptr("FAILED_DATABASE_AUTHENTICATION_GROUP"), - // to.Ptr("BATCH_COMPLETED_GROUP")}, - // IsAzureMonitorTargetEnabled: to.Ptr(true), - // RetentionDays: to.Ptr[int32](0), - // State: to.Ptr(armsql.BlobAuditingPolicyStateEnabled), - // StorageAccountSubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseBlobAuditingCreateMax.json -func ExampleDatabaseBlobAuditingPoliciesClient_CreateOrUpdate_createOrUpdateADatabasesBlobAuditingPolicyWithAllParameters() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatabaseBlobAuditingPoliciesClient().CreateOrUpdate(ctx, "blobauditingtest-4799", "blobauditingtest-6440", "testdb", armsql.DatabaseBlobAuditingPolicy{ - Properties: &armsql.DatabaseBlobAuditingPolicyProperties{ - AuditActionsAndGroups: []*string{ - to.Ptr("DATABASE_LOGOUT_GROUP"), - to.Ptr("DATABASE_ROLE_MEMBER_CHANGE_GROUP"), - to.Ptr("UPDATE on database::TestDatabaseName by public")}, - IsAzureMonitorTargetEnabled: to.Ptr(true), - IsStorageSecondaryKeyInUse: to.Ptr(false), - QueueDelayMs: to.Ptr[int32](4000), - RetentionDays: to.Ptr[int32](6), - State: to.Ptr(armsql.BlobAuditingPolicyStateEnabled), - StorageAccountAccessKey: to.Ptr("sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD=="), - StorageAccountSubscriptionID: to.Ptr("00000000-1234-0000-5678-000000000000"), - StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DatabaseBlobAuditingPolicy = armsql.DatabaseBlobAuditingPolicy{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/auditingSettings"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/blobauditingtest-4799/providers/Microsoft.Sql/servers/blobauditingtest-6440/databases/testdb"), - // Kind: to.Ptr("V12"), - // Properties: &armsql.DatabaseBlobAuditingPolicyProperties{ - // AuditActionsAndGroups: []*string{ - // to.Ptr("DATABASE_LOGOUT_GROUP"), - // to.Ptr("DATABASE_ROLE_MEMBER_CHANGE_GROUP"), - // to.Ptr("UPDATE on database::TestDatabaseName by public")}, - // IsAzureMonitorTargetEnabled: to.Ptr(true), - // IsStorageSecondaryKeyInUse: to.Ptr(false), - // QueueDelayMs: to.Ptr[int32](4000), - // RetentionDays: to.Ptr[int32](0), - // State: to.Ptr(armsql.BlobAuditingPolicyStateEnabled), - // StorageAccountSubscriptionID: to.Ptr("00000000-1234-0000-5678-000000000000"), - // StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseBlobAuditingCreateMin.json -func ExampleDatabaseBlobAuditingPoliciesClient_CreateOrUpdate_createOrUpdateADatabasesBlobAuditingPolicyWithMinimalParameters() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatabaseBlobAuditingPoliciesClient().CreateOrUpdate(ctx, "blobauditingtest-4799", "blobauditingtest-6440", "testdb", armsql.DatabaseBlobAuditingPolicy{ - Properties: &armsql.DatabaseBlobAuditingPolicyProperties{ - State: to.Ptr(armsql.BlobAuditingPolicyStateEnabled), - StorageAccountAccessKey: to.Ptr("sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD=="), - StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DatabaseBlobAuditingPolicy = armsql.DatabaseBlobAuditingPolicy{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/auditingSettings"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/blobauditingtest-4799/providers/Microsoft.Sql/servers/blobauditingtest-6440/databases/testdb"), - // Kind: to.Ptr("V12"), - // Properties: &armsql.DatabaseBlobAuditingPolicyProperties{ - // AuditActionsAndGroups: []*string{ - // to.Ptr("SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP"), - // to.Ptr("FAILED_DATABASE_AUTHENTICATION_GROUP"), - // to.Ptr("BATCH_COMPLETED_GROUP")}, - // IsAzureMonitorTargetEnabled: to.Ptr(false), - // IsStorageSecondaryKeyInUse: to.Ptr(false), - // RetentionDays: to.Ptr[int32](0), - // State: to.Ptr(armsql.BlobAuditingPolicyStateEnabled), - // StorageAccountSubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - // }, - // } -} diff --git a/sdk/resourcemanager/sql/armsql/databasecolumns_client.go b/sdk/resourcemanager/sql/armsql/databasecolumns_client.go index 139a1843b87c..42ef606d6539 100644 --- a/sdk/resourcemanager/sql/armsql/databasecolumns_client.go +++ b/sdk/resourcemanager/sql/armsql/databasecolumns_client.go @@ -46,7 +46,7 @@ func NewDatabaseColumnsClient(subscriptionID string, credential azcore.TokenCred // Get - Get database column // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -109,7 +109,7 @@ func (client *DatabaseColumnsClient) getCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -126,7 +126,7 @@ func (client *DatabaseColumnsClient) getHandleResponse(resp *http.Response) (Dat // NewListByDatabasePager - List database columns // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -208,7 +208,7 @@ func (client *DatabaseColumnsClient) listByDatabaseCreateRequest(ctx context.Con if options != nil && options.Skiptoken != nil { reqQP.Set("$skiptoken", *options.Skiptoken) } - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -225,7 +225,7 @@ func (client *DatabaseColumnsClient) listByDatabaseHandleResponse(resp *http.Res // NewListByTablePager - List database columns // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -297,7 +297,7 @@ func (client *DatabaseColumnsClient) listByTableCreateRequest(ctx context.Contex if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/databasecolumns_client_example_test.go b/sdk/resourcemanager/sql/armsql/databasecolumns_client_example_test.go deleted file mode 100644 index e1206bb4c5ae..000000000000 --- a/sdk/resourcemanager/sql/armsql/databasecolumns_client_example_test.go +++ /dev/null @@ -1,205 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ColumnsListByDatabaseMax.json -func ExampleDatabaseColumnsClient_NewListByDatabasePager_filterDatabaseColumns() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDatabaseColumnsClient().NewListByDatabasePager("myRG", "serverName", "myDatabase", &armsql.DatabaseColumnsClientListByDatabaseOptions{Schema: []string{ - "dbo"}, - Table: []string{ - "customer", - "address"}, - Column: []string{ - "username"}, - OrderBy: []string{ - "schema asc", - "table", - "column desc"}, - 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.DatabaseColumnListResult = armsql.DatabaseColumnListResult{ - // Value: []*armsql.DatabaseColumn{ - // { - // Name: to.Ptr("username"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/schemas/tables/columns"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myRG/providers/Microsoft.Sql/servers/serverName/databases/myDatabase/schemas/dbo/tables/customer/columns/username"), - // Properties: &armsql.DatabaseColumnProperties{ - // ColumnType: to.Ptr(armsql.ColumnDataTypeNvarchar), - // IsComputed: to.Ptr(false), - // MemoryOptimized: to.Ptr(false), - // TemporalType: to.Ptr(armsql.TableTemporalTypeNonTemporalTable), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ColumnsListByDatabaseMin.json -func ExampleDatabaseColumnsClient_NewListByDatabasePager_listDatabaseColumns() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDatabaseColumnsClient().NewListByDatabasePager("myRG", "serverName", "myDatabase", &armsql.DatabaseColumnsClientListByDatabaseOptions{Schema: []string{}, - Table: []string{}, - Column: []string{}, - OrderBy: []string{}, - 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.DatabaseColumnListResult = armsql.DatabaseColumnListResult{ - // Value: []*armsql.DatabaseColumn{ - // { - // Name: to.Ptr("col1"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/schemas/tables/columns"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myRG/providers/Microsoft.Sql/servers/serverName/databases/myDatabase/schemas/dbo/tables/table1/columns/col1"), - // Properties: &armsql.DatabaseColumnProperties{ - // ColumnType: to.Ptr(armsql.ColumnDataTypeInt), - // IsComputed: to.Ptr(false), - // MemoryOptimized: to.Ptr(false), - // TemporalType: to.Ptr(armsql.TableTemporalTypeNonTemporalTable), - // }, - // }, - // { - // Name: to.Ptr("col2"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/schemas/tables/columns"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myRG/providers/Microsoft.Sql/servers/serverName/databases/myDatabase/schemas/dbo/tables/table1/columns/col2"), - // Properties: &armsql.DatabaseColumnProperties{ - // ColumnType: to.Ptr(armsql.ColumnDataTypeBit), - // IsComputed: to.Ptr(false), - // MemoryOptimized: to.Ptr(false), - // TemporalType: to.Ptr(armsql.TableTemporalTypeSystemVersionedTemporalTable), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseColumnListByTable.json -func ExampleDatabaseColumnsClient_NewListByTablePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDatabaseColumnsClient().NewListByTablePager("myRG", "serverName", "myDatabase", "dbo", "table1", &armsql.DatabaseColumnsClientListByTableOptions{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.DatabaseColumnListResult = armsql.DatabaseColumnListResult{ - // Value: []*armsql.DatabaseColumn{ - // { - // Name: to.Ptr("col1"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/schemas/tables/columns"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myRG/providers/Microsoft.Sql/servers/serverName/databases/myDatabase/schemas/dbo/tables/table1/columns/col1"), - // Properties: &armsql.DatabaseColumnProperties{ - // ColumnType: to.Ptr(armsql.ColumnDataTypeNvarchar), - // IsComputed: to.Ptr(false), - // MemoryOptimized: to.Ptr(false), - // TemporalType: to.Ptr(armsql.TableTemporalTypeNonTemporalTable), - // }, - // }, - // { - // Name: to.Ptr("col2"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/schemas/tables/columns"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myRG/providers/Microsoft.Sql/servers/serverName/databases/myDatabase/schemas/dbo/tables/table1/columns/col2"), - // Properties: &armsql.DatabaseColumnProperties{ - // ColumnType: to.Ptr(armsql.ColumnDataTypeBit), - // IsComputed: to.Ptr(false), - // MemoryOptimized: to.Ptr(false), - // TemporalType: to.Ptr(armsql.TableTemporalTypeNonTemporalTable), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseColumnGet.json -func ExampleDatabaseColumnsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatabaseColumnsClient().Get(ctx, "myRG", "serverName", "myDatabase", "dbo", "table1", "column1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DatabaseColumn = armsql.DatabaseColumn{ - // Name: to.Ptr("column1"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/schemas/tables/columns"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myRG/providers/Microsoft.Sql/servers/serverName/databases/myDatabase/schemas/dbo/tables/table1/columns/column1"), - // Properties: &armsql.DatabaseColumnProperties{ - // ColumnType: to.Ptr(armsql.ColumnDataTypeBit), - // IsComputed: to.Ptr(false), - // MemoryOptimized: to.Ptr(false), - // TemporalType: to.Ptr(armsql.TableTemporalTypeSystemVersionedTemporalTable), - // }, - // } -} diff --git a/sdk/resourcemanager/sql/armsql/databaseencryptionprotectors_client.go b/sdk/resourcemanager/sql/armsql/databaseencryptionprotectors_client.go index c80c09da37e2..8bdc78caae8c 100644 --- a/sdk/resourcemanager/sql/armsql/databaseencryptionprotectors_client.go +++ b/sdk/resourcemanager/sql/armsql/databaseencryptionprotectors_client.go @@ -46,7 +46,7 @@ func NewDatabaseEncryptionProtectorsClient(subscriptionID string, credential azc // BeginRevalidate - Revalidates an existing encryption protector for a particular database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -72,7 +72,7 @@ func (client *DatabaseEncryptionProtectorsClient) BeginRevalidate(ctx context.Co // Revalidate - Revalidates an existing encryption protector for a particular database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview func (client *DatabaseEncryptionProtectorsClient) revalidate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, encryptionProtectorName EncryptionProtectorName, options *DatabaseEncryptionProtectorsClientBeginRevalidateOptions) (*http.Response, error) { var err error req, err := client.revalidateCreateRequest(ctx, resourceGroupName, serverName, databaseName, encryptionProtectorName, options) @@ -118,7 +118,7 @@ func (client *DatabaseEncryptionProtectorsClient) revalidateCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -126,7 +126,7 @@ func (client *DatabaseEncryptionProtectorsClient) revalidateCreateRequest(ctx co // BeginRevert - Reverts an existing encryption protector for a particular database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -152,7 +152,7 @@ func (client *DatabaseEncryptionProtectorsClient) BeginRevert(ctx context.Contex // Revert - Reverts an existing encryption protector for a particular database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview func (client *DatabaseEncryptionProtectorsClient) revert(ctx context.Context, resourceGroupName string, serverName string, databaseName string, encryptionProtectorName EncryptionProtectorName, options *DatabaseEncryptionProtectorsClientBeginRevertOptions) (*http.Response, error) { var err error req, err := client.revertCreateRequest(ctx, resourceGroupName, serverName, databaseName, encryptionProtectorName, options) @@ -198,7 +198,7 @@ func (client *DatabaseEncryptionProtectorsClient) revertCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } diff --git a/sdk/resourcemanager/sql/armsql/databaseencryptionprotectors_client_example_test.go b/sdk/resourcemanager/sql/armsql/databaseencryptionprotectors_client_example_test.go deleted file mode 100644 index 082e0f2d734b..000000000000 --- a/sdk/resourcemanager/sql/armsql/databaseencryptionprotectors_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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/DatabaseEncryptionProtectorRevalidate.json -func ExampleDatabaseEncryptionProtectorsClient_BeginRevalidate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatabaseEncryptionProtectorsClient().BeginRevalidate(ctx, "sqlcrudtest-7398", "sqlcrudtest-4645", "sqlcrudtestdb-2342", armsql.EncryptionProtectorNameCurrent, 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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/DatabaseEncryptionProtectorRevert.json -func ExampleDatabaseEncryptionProtectorsClient_BeginRevert() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatabaseEncryptionProtectorsClient().BeginRevert(ctx, "sqlcrudtest-7398", "sqlcrudtest-4645", "sqlcrudtestdb-2342", armsql.EncryptionProtectorNameCurrent, 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/sql/armsql/databaseextensions_client.go b/sdk/resourcemanager/sql/armsql/databaseextensions_client.go index 4699e40a9a9e..a663d28f0065 100644 --- a/sdk/resourcemanager/sql/armsql/databaseextensions_client.go +++ b/sdk/resourcemanager/sql/armsql/databaseextensions_client.go @@ -43,10 +43,10 @@ func NewDatabaseExtensionsClient(subscriptionID string, credential azcore.TokenC return client, nil } -// BeginCreateOrUpdate - Perform a database extension operation, like polybase import +// BeginCreateOrUpdate - Perform a database extension operation, like database import, database export, or polybase import // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-02-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -67,10 +67,10 @@ func (client *DatabaseExtensionsClient) BeginCreateOrUpdate(ctx context.Context, } } -// CreateOrUpdate - Perform a database extension operation, like polybase import +// CreateOrUpdate - Perform a database extension operation, like database import, database export, or polybase import // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-02-01-preview +// Generated from API version 2023-05-01-preview func (client *DatabaseExtensionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, extensionName string, parameters DatabaseExtensions, options *DatabaseExtensionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, extensionName, parameters, options) @@ -116,7 +116,7 @@ func (client *DatabaseExtensionsClient) createOrUpdateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-02-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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 *DatabaseExtensionsClient) createOrUpdateCreateRequest(ctx context. // Get - Gets a database extension. This will return resource not found as it is not supported. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-02-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -179,14 +179,14 @@ func (client *DatabaseExtensionsClient) getCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-02-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // NewListByDatabasePager - List database extension. This will return an empty list as it is not supported. // -// Generated from API version 2021-02-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -245,7 +245,7 @@ func (client *DatabaseExtensionsClient) listByDatabaseCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-02-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/databaseextensions_client_example_test.go b/sdk/resourcemanager/sql/armsql/databaseextensions_client_example_test.go deleted file mode 100644 index 8b7997aacfee..000000000000 --- a/sdk/resourcemanager/sql/armsql/databaseextensions_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 armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/GetDatabaseExtensions.json -func ExampleDatabaseExtensionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewDatabaseExtensionsClient().Get(ctx, "rg_a1f9d6f8-30d5-4228-9504-8a364361bca3", "srv_65858e0f-b1d1-4bdc-8351-a7da86ca4939", "11aa6c5e-58ed-4693-b303-3b8e3131deaa", "polybaseimport", 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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/CreateOrUpdateDatabaseExtensions.json -func ExampleDatabaseExtensionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatabaseExtensionsClient().BeginCreateOrUpdate(ctx, "rg_20cbe0f0-c2d9-4522-9177-5469aad53029", "srv_1ffd1cf8-9951-47fb-807d-a9c384763849", "878e303f-1ea0-4f17-aa3d-a22ac5e9da08", "polybaseimport", armsql.DatabaseExtensions{ - Properties: &armsql.DatabaseExtensionsProperties{ - OperationMode: to.Ptr(armsql.OperationModePolybaseImport), - StorageKey: to.Ptr("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"), - StorageKeyType: to.Ptr(armsql.StorageKeyTypeStorageAccessKey), - StorageURI: to.Ptr("https://teststorage.blob.core.windows.net/testcontainer/Manifest.xml"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ImportExportExtensionsOperationResult = armsql.ImportExportExtensionsOperationResult{ - // Name: to.Ptr("10000000-0000-0000-0000-000000000002"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/extensions"), - // ID: to.Ptr("10000000-0000-0000-0000-000000000002"), - // Properties: &armsql.ImportExportExtensionsOperationResultProperties{ - // DatabaseName: to.Ptr("878e303f-1ea0-4f17-aa3d-a22ac5e9da08"), - // LastModifiedTime: to.Ptr("lastModifiedTime"), - // RequestID: to.Ptr("10000000-0000-0000-0000-000000000002"), - // RequestType: to.Ptr("PolybaseImport"), - // ServerName: to.Ptr("srv_1ffd1cf8-9951-47fb-807d-a9c384763849"), - // Status: to.Ptr("succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ListDatabaseExtensions.json -func ExampleDatabaseExtensionsClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDatabaseExtensionsClient().NewListByDatabasePager("rg_4007c5a9-b3b0-41e1-bd46-9eef38768a4a", "srv_3b67ec2a-519b-43a7-8533-fb62dce3431e", "719d8fa4-bf0f-48fc-8cd3-ef40fe6ba1fe", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ImportExportExtensionsOperationListResult = armsql.ImportExportExtensionsOperationListResult{ - // Value: []*armsql.ImportExportExtensionsOperationResult{ - // }, - // } - } -} diff --git a/sdk/resourcemanager/sql/armsql/databaseoperations_client.go b/sdk/resourcemanager/sql/armsql/databaseoperations_client.go index de1ea3632b0f..006a60306028 100644 --- a/sdk/resourcemanager/sql/armsql/databaseoperations_client.go +++ b/sdk/resourcemanager/sql/armsql/databaseoperations_client.go @@ -46,7 +46,7 @@ func NewDatabaseOperationsClient(subscriptionID string, credential azcore.TokenC // Cancel - Cancels the asynchronous operation on the database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-02-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -96,14 +96,14 @@ func (client *DatabaseOperationsClient) cancelCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-02-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // NewListByDatabasePager - Gets a list of operations performed on the database. // -// Generated from API version 2021-02-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -162,7 +162,7 @@ func (client *DatabaseOperationsClient) listByDatabaseCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-02-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/databaseoperations_client_example_test.go b/sdk/resourcemanager/sql/armsql/databaseoperations_client_example_test.go deleted file mode 100644 index 19c58eaa577a..000000000000 --- a/sdk/resourcemanager/sql/armsql/databaseoperations_client_example_test.go +++ /dev/null @@ -1,91 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/CancelDatabaseOperation.json -func ExampleDatabaseOperationsClient_Cancel() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewDatabaseOperationsClient().Cancel(ctx, "sqlcrudtest-7398", "sqlcrudtest-6661", "testdb", "f779414b-e748-4925-8cfe-c8598f7660ae", 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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ListDatabaseOperations.json -func ExampleDatabaseOperationsClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDatabaseOperationsClient().NewListByDatabasePager("sqlcrudtest-7398", "sqlcrudtest-4645", "testdb", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DatabaseOperationListResult = armsql.DatabaseOperationListResult{ - // Value: []*armsql.DatabaseOperation{ - // { - // Name: to.Ptr("11111111-1111-1111-1111-111111111111"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/operations"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645/databases/testdb/operations/11111111-1111-1111-1111-111111111111"), - // Properties: &armsql.DatabaseOperationProperties{ - // DatabaseName: to.Ptr("testdb"), - // Operation: to.Ptr("UpdateLogicalDatabase"), - // OperationFriendlyName: to.Ptr("ALTER DATABASE"), - // PercentComplete: to.Ptr[int32](100), - // ServerName: to.Ptr("sqlcrudtest-4645"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-01T09:10:08.1Z"); return t}()), - // State: to.Ptr(armsql.ManagementOperationStateSucceeded), - // }, - // }, - // { - // Name: to.Ptr("55555555-5555-5555-5555-555555555555"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/operations"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645/databases/testdb/operations/55555555-5555-5555-5555-555555555555"), - // Properties: &armsql.DatabaseOperationProperties{ - // DatabaseName: to.Ptr("testdb"), - // Operation: to.Ptr("UpdateLogicalDatabase"), - // OperationFriendlyName: to.Ptr("ALTER DATABASE"), - // PercentComplete: to.Ptr[int32](19), - // ServerName: to.Ptr("sqlcrudtest-4645"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-01T10:10:08.1Z"); return t}()), - // State: to.Ptr(armsql.ManagementOperationStateInProgress), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/sql/armsql/databaserecommendedactions_client.go b/sdk/resourcemanager/sql/armsql/databaserecommendedactions_client.go index 537ff91dcc62..3676f9a0a6d5 100644 --- a/sdk/resourcemanager/sql/armsql/databaserecommendedactions_client.go +++ b/sdk/resourcemanager/sql/armsql/databaserecommendedactions_client.go @@ -46,7 +46,7 @@ func NewDatabaseRecommendedActionsClient(subscriptionID string, credential azcor // Get - Gets a database recommended action. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -105,7 +105,7 @@ func (client *DatabaseRecommendedActionsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -123,7 +123,7 @@ func (client *DatabaseRecommendedActionsClient) getHandleResponse(resp *http.Res // ListByDatabaseAdvisor - Gets list of Database Recommended Actions. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -177,7 +177,7 @@ func (client *DatabaseRecommendedActionsClient) listByDatabaseAdvisorCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -195,7 +195,7 @@ func (client *DatabaseRecommendedActionsClient) listByDatabaseAdvisorHandleRespo // Update - Updates a database recommended action. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -255,7 +255,7 @@ func (client *DatabaseRecommendedActionsClient) updateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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/sql/armsql/databaserecommendedactions_client_example_test.go b/sdk/resourcemanager/sql/armsql/databaserecommendedactions_client_example_test.go deleted file mode 100644 index 6c925ab13ab2..000000000000 --- a/sdk/resourcemanager/sql/armsql/databaserecommendedactions_client_example_test.go +++ /dev/null @@ -1,372 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRecommendedActionList.json -func ExampleDatabaseRecommendedActionsClient_ListByDatabaseAdvisor() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatabaseRecommendedActionsClient().ListByDatabaseAdvisor(ctx, "workloadinsight-demos", "misosisvr", "IndexAdvisor_test_3", "CreateIndex", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RecommendedActionArray = []*armsql.RecommendedAction{ - // { - // Name: to.Ptr("IR_[CRM]_[DataPoints]_4821CD2F9510D98184BB"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/advisors/recommendedActions"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workloadinsight-demos/providers/Microsoft.Sql/servers/misosisvr/databases/IndexAdvisor_test_3/advisors/CreateIndex/recommendedActions/IR_[CRM]_[DataPoints]_4821CD2F9510D98184BB"), - // Kind: to.Ptr(""), - // Location: to.Ptr("East Asia"), - // Properties: &armsql.RecommendedActionProperties{ - // ErrorDetails: &armsql.RecommendedActionErrorInfo{ - // }, - // EstimatedImpact: []*armsql.RecommendedActionImpactRecord{ - // { - // AbsoluteValue: to.Ptr[float64](1440), - // DimensionName: to.Ptr("ActionDuration"), - // Unit: to.Ptr("Seconds"), - // }, - // { - // AbsoluteValue: to.Ptr[float64](209.3125), - // DimensionName: to.Ptr("SpaceChange"), - // Unit: to.Ptr("Megabytes"), - // }}, - // ImplementationDetails: &armsql.RecommendedActionImplementationInfo{ - // Method: to.Ptr(armsql.ImplementationMethodTSQL), - // Script: to.Ptr("CREATE NONCLUSTERED INDEX [nci_wi_DataPoints_B892614093BAC56295EF6018BD4CB51B] ON [CRM].[DataPoints] ([Name],[Money],[Power]) INCLUDE ([Hour], [System], [LastChanged]) WITH (ONLINE = ON)"), - // }, - // IsArchivedAction: to.Ptr(false), - // IsExecutableAction: to.Ptr(true), - // IsRevertableAction: to.Ptr(true), - // LastRefresh: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:04Z"); return t}()), - // ObservedImpact: []*armsql.RecommendedActionImpactRecord{ - // }, - // RecommendationReason: to.Ptr(""), - // Score: to.Ptr[int32](1), - // State: &armsql.RecommendedActionStateInfo{ - // CurrentValue: to.Ptr(armsql.RecommendedActionCurrentStateActive), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05Z"); return t}()), - // }, - // TimeSeries: []*armsql.RecommendedActionMetricInfo{ - // }, - // ValidSince: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:04Z"); return t}()), - // Details: map[string]any{ - // "schema": "[CRM]", - // "includedColumns": "[Hour], [System], [LastChanged]", - // "indexColumns": "[Name],[Money],[Power]", - // "indexName": "nci_wi_DataPoints_B892614093BAC56295EF6018BD4CB51B", - // "indexType": "NONCLUSTERED", - // "table": "[DataPoints]", - // }, - // }, - // }, - // { - // Name: to.Ptr("IR_[dbo]_[DataPoints]_F5D2F347AA22DB46E4CC"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/advisors/recommendedActions"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workloadinsight-demos/providers/Microsoft.Sql/servers/misosisvr/databases/IndexAdvisor_test_3/advisors/CreateIndex/recommendedActions/IR_[dbo]_[DataPoints]_F5D2F347AA22DB46E4CC"), - // Kind: to.Ptr(""), - // Location: to.Ptr("East Asia"), - // Properties: &armsql.RecommendedActionProperties{ - // ErrorDetails: &armsql.RecommendedActionErrorInfo{ - // }, - // EstimatedImpact: []*armsql.RecommendedActionImpactRecord{ - // { - // AbsoluteValue: to.Ptr[float64](5040), - // DimensionName: to.Ptr("ActionDuration"), - // Unit: to.Ptr("Seconds"), - // }, - // { - // AbsoluteValue: to.Ptr[float64](120), - // DimensionName: to.Ptr("SpaceChange"), - // Unit: to.Ptr("Megabytes"), - // }}, - // ExecuteActionDuration: to.Ptr("PT1M"), - // ExecuteActionInitiatedBy: to.Ptr(armsql.RecommendedActionInitiatedByUser), - // ExecuteActionInitiatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05Z"); return t}()), - // ExecuteActionStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05Z"); return t}()), - // ImplementationDetails: &armsql.RecommendedActionImplementationInfo{ - // Method: to.Ptr(armsql.ImplementationMethodTSQL), - // Script: to.Ptr("DROP INDEX [nci_wi_DataPoints_609E4B7D6A3813990ED44B28B340C8FC] ON [dbo].[DataPoints]"), - // }, - // IsArchivedAction: to.Ptr(false), - // IsExecutableAction: to.Ptr(true), - // IsRevertableAction: to.Ptr(true), - // LastRefresh: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05Z"); return t}()), - // ObservedImpact: []*armsql.RecommendedActionImpactRecord{ - // { - // ChangeValueAbsolute: to.Ptr[float64](-12.7), - // ChangeValueRelative: to.Ptr[float64](-0.9), - // DimensionName: to.Ptr("AffectedQueriesCpuUtilization"), - // Unit: to.Ptr("CpuCores"), - // }, - // { - // ChangeValueAbsolute: to.Ptr[float64](-12.7), - // ChangeValueRelative: to.Ptr[float64](-0.3175), - // DimensionName: to.Ptr("CpuUtilization"), - // Unit: to.Ptr("CpuCores"), - // }, - // { - // AbsoluteValue: to.Ptr[float64](12), - // DimensionName: to.Ptr("QueriesWithImprovedPerformance"), - // Unit: to.Ptr("Count"), - // }, - // { - // AbsoluteValue: to.Ptr[float64](1), - // DimensionName: to.Ptr("QueriesWithRegressedPerformance"), - // Unit: to.Ptr("Count"), - // }, - // { - // AbsoluteValue: to.Ptr[float64](130.742187), - // DimensionName: to.Ptr("SpaceChange"), - // Unit: to.Ptr("Megabytes"), - // }, - // { - // AbsoluteValue: to.Ptr[float64](0), - // DimensionName: to.Ptr("VerificationProgress"), - // Unit: to.Ptr("Percent"), - // }}, - // RecommendationReason: to.Ptr(""), - // Score: to.Ptr[int32](3), - // State: &armsql.RecommendedActionStateInfo{ - // ActionInitiatedBy: to.Ptr(armsql.RecommendedActionInitiatedByUser), - // CurrentValue: to.Ptr(armsql.RecommendedActionCurrentStateSuccess), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05Z"); return t}()), - // }, - // TimeSeries: []*armsql.RecommendedActionMetricInfo{ - // }, - // ValidSince: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05Z"); return t}()), - // Details: map[string]any{ - // "schema": "[dbo]", - // "includedColumns": "[Power],[Pineapple]", - // "indexActionDuration": "00:01:00", - // "indexActionStartTime": "2017-03-01T14:38:05.337", - // "indexColumns": "[Name],[Money]", - // "indexName": "nci_wi_DataPoints_609E4B7D6A3813990ED44B28B340C8FC", - // "indexType": "NONCLUSTERED", - // "table": "[DataPoints]", - // }, - // }, - // }, - // { - // Name: to.Ptr("IR_[dbo]_[Employees]_560E15A98D14CA09BDFB"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/advisors/recommendedActions"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workloadinsight-demos/providers/Microsoft.Sql/servers/misosisvr/databases/IndexAdvisor_test_3/advisors/CreateIndex/recommendedActions/IR_[dbo]_[Employees]_560E15A98D14CA09BDFB"), - // Kind: to.Ptr(""), - // Location: to.Ptr("East Asia"), - // Properties: &armsql.RecommendedActionProperties{ - // ErrorDetails: &armsql.RecommendedActionErrorInfo{ - // }, - // EstimatedImpact: []*armsql.RecommendedActionImpactRecord{ - // { - // AbsoluteValue: to.Ptr[float64](17), - // DimensionName: to.Ptr("ActionDuration"), - // Unit: to.Ptr("Seconds"), - // }, - // { - // AbsoluteValue: to.Ptr[float64](128), - // DimensionName: to.Ptr("SpaceChange"), - // Unit: to.Ptr("Megabytes"), - // }}, - // ImplementationDetails: &armsql.RecommendedActionImplementationInfo{ - // Method: to.Ptr(armsql.ImplementationMethodTSQL), - // Script: to.Ptr("CREATE NONCLUSTERED INDEX [nci_wi_Employees_8C18C2AF4267DC77793040782641CCDE] ON [dbo].[Employees] ([City], [State]) INCLUDE ([Postal]) WITH (ONLINE = ON)"), - // }, - // IsArchivedAction: to.Ptr(false), - // IsExecutableAction: to.Ptr(true), - // IsRevertableAction: to.Ptr(true), - // LastRefresh: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05Z"); return t}()), - // ObservedImpact: []*armsql.RecommendedActionImpactRecord{ - // }, - // RecommendationReason: to.Ptr(""), - // Score: to.Ptr[int32](3), - // State: &armsql.RecommendedActionStateInfo{ - // CurrentValue: to.Ptr(armsql.RecommendedActionCurrentStateActive), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05Z"); return t}()), - // }, - // TimeSeries: []*armsql.RecommendedActionMetricInfo{ - // }, - // ValidSince: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05Z"); return t}()), - // Details: map[string]any{ - // "schema": "[dbo]", - // "includedColumns": "[Postal]", - // "indexColumns": "[City], [State]", - // "indexName": "nci_wi_Employees_8C18C2AF4267DC77793040782641CCDE", - // "indexType": "NONCLUSTERED", - // "table": "[Employees]", - // }, - // }, - // }} -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRecommendedActionGet.json -func ExampleDatabaseRecommendedActionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatabaseRecommendedActionsClient().Get(ctx, "workloadinsight-demos", "misosisvr", "IndexAdvisor_test_3", "CreateIndex", "IR_[CRM]_[DataPoints]_4821CD2F9510D98184BB", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RecommendedAction = armsql.RecommendedAction{ - // Name: to.Ptr("IR_[CRM]_[DataPoints]_4821CD2F9510D98184BB"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/advisors/recommendedActions"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workloadinsight-demos/providers/Microsoft.Sql/servers/misosisvr/databases/IndexAdvisor_test_3/advisors/CreateIndex/recommendedActions/IR_[CRM]_[DataPoints]_4821CD2F9510D98184BB"), - // Kind: to.Ptr(""), - // Location: to.Ptr("East Asia"), - // Properties: &armsql.RecommendedActionProperties{ - // ErrorDetails: &armsql.RecommendedActionErrorInfo{ - // }, - // EstimatedImpact: []*armsql.RecommendedActionImpactRecord{ - // { - // AbsoluteValue: to.Ptr[float64](1440), - // DimensionName: to.Ptr("ActionDuration"), - // Unit: to.Ptr("Seconds"), - // }, - // { - // AbsoluteValue: to.Ptr[float64](209.3125), - // DimensionName: to.Ptr("SpaceChange"), - // Unit: to.Ptr("Megabytes"), - // }}, - // ImplementationDetails: &armsql.RecommendedActionImplementationInfo{ - // Method: to.Ptr(armsql.ImplementationMethodTSQL), - // Script: to.Ptr("CREATE NONCLUSTERED INDEX [nci_wi_DataPoints_B892614093BAC56295EF6018BD4CB51B] ON [CRM].[DataPoints] ([Name],[Money],[Power]) INCLUDE ([Hour], [System], [LastChanged]) WITH (ONLINE = ON)"), - // }, - // IsArchivedAction: to.Ptr(false), - // IsExecutableAction: to.Ptr(true), - // IsRevertableAction: to.Ptr(true), - // LastRefresh: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:04Z"); return t}()), - // ObservedImpact: []*armsql.RecommendedActionImpactRecord{ - // }, - // RecommendationReason: to.Ptr(""), - // Score: to.Ptr[int32](1), - // State: &armsql.RecommendedActionStateInfo{ - // CurrentValue: to.Ptr(armsql.RecommendedActionCurrentStateActive), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05Z"); return t}()), - // }, - // TimeSeries: []*armsql.RecommendedActionMetricInfo{ - // }, - // ValidSince: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:04Z"); return t}()), - // Details: map[string]any{ - // "schema": "[CRM]", - // "includedColumns": "[Hour], [System], [LastChanged]", - // "indexColumns": "[Name],[Money],[Power]", - // "indexName": "nci_wi_DataPoints_B892614093BAC56295EF6018BD4CB51B", - // "indexType": "NONCLUSTERED", - // "table": "[DataPoints]", - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRecommendedActionUpdate.json -func ExampleDatabaseRecommendedActionsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatabaseRecommendedActionsClient().Update(ctx, "workloadinsight-demos", "misosisvr", "IndexAdvisor_test_3", "CreateIndex", "IR_[CRM]_[DataPoints]_4821CD2F9510D98184BB", armsql.RecommendedAction{ - Properties: &armsql.RecommendedActionProperties{ - State: &armsql.RecommendedActionStateInfo{ - CurrentValue: to.Ptr(armsql.RecommendedActionCurrentStatePending), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RecommendedAction = armsql.RecommendedAction{ - // Name: to.Ptr("IR_[CRM]_[DataPoints]_4821CD2F9510D98184BB"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/advisors/recommendedActions"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workloadinsight-demos/providers/Microsoft.Sql/servers/misosisvr/databases/IndexAdvisor_test_3/advisors/CreateIndex/recommendedActions/IR_[CRM]_[DataPoints]_4821CD2F9510D98184BB"), - // Kind: to.Ptr(""), - // Location: to.Ptr("East Asia"), - // Properties: &armsql.RecommendedActionProperties{ - // ErrorDetails: &armsql.RecommendedActionErrorInfo{ - // }, - // EstimatedImpact: []*armsql.RecommendedActionImpactRecord{ - // { - // AbsoluteValue: to.Ptr[float64](1440), - // DimensionName: to.Ptr("ActionDuration"), - // Unit: to.Ptr("Seconds"), - // }, - // { - // AbsoluteValue: to.Ptr[float64](209.3125), - // DimensionName: to.Ptr("SpaceChange"), - // Unit: to.Ptr("Megabytes"), - // }}, - // ExecuteActionInitiatedBy: to.Ptr(armsql.RecommendedActionInitiatedByUser), - // ExecuteActionInitiatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-20T15:11:15Z"); return t}()), - // ImplementationDetails: &armsql.RecommendedActionImplementationInfo{ - // Method: to.Ptr(armsql.ImplementationMethodTSQL), - // Script: to.Ptr("CREATE NONCLUSTERED INDEX [nci_wi_DataPoints_B892614093BAC56295EF6018BD4CB51B] ON [CRM].[DataPoints] ([Name],[Money],[Power]) INCLUDE ([Hour], [System], [LastChanged]) WITH (ONLINE = ON)"), - // }, - // IsArchivedAction: to.Ptr(false), - // IsExecutableAction: to.Ptr(true), - // IsRevertableAction: to.Ptr(true), - // LastRefresh: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:04Z"); return t}()), - // ObservedImpact: []*armsql.RecommendedActionImpactRecord{ - // }, - // RecommendationReason: to.Ptr(""), - // Score: to.Ptr[int32](1), - // State: &armsql.RecommendedActionStateInfo{ - // ActionInitiatedBy: to.Ptr(armsql.RecommendedActionInitiatedByUser), - // CurrentValue: to.Ptr(armsql.RecommendedActionCurrentStatePending), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-20T15:11:15Z"); return t}()), - // }, - // TimeSeries: []*armsql.RecommendedActionMetricInfo{ - // }, - // ValidSince: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:04Z"); return t}()), - // Details: map[string]any{ - // "schema": "[CRM]", - // "includedColumns": "[Hour], [System], [LastChanged]", - // "indexColumns": "[Name],[Money],[Power]", - // "indexName": "nci_wi_DataPoints_B892614093BAC56295EF6018BD4CB51B", - // "indexType": "NONCLUSTERED", - // "table": "[DataPoints]", - // }, - // }, - // } -} diff --git a/sdk/resourcemanager/sql/armsql/databases_client.go b/sdk/resourcemanager/sql/armsql/databases_client.go index b8707e14f342..ed03be4ab968 100644 --- a/sdk/resourcemanager/sql/armsql/databases_client.go +++ b/sdk/resourcemanager/sql/armsql/databases_client.go @@ -46,7 +46,7 @@ func NewDatabasesClient(subscriptionID string, credential azcore.TokenCredential // BeginCreateOrUpdate - Creates a new database or updates an existing database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -72,7 +72,7 @@ func (client *DatabasesClient) BeginCreateOrUpdate(ctx context.Context, resource // CreateOrUpdate - Creates a new database or updates an existing database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview func (client *DatabasesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters Database, options *DatabasesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, parameters, options) @@ -114,7 +114,7 @@ func (client *DatabasesClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -126,7 +126,7 @@ func (client *DatabasesClient) createOrUpdateCreateRequest(ctx context.Context, // BeginDelete - Deletes the database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -150,7 +150,7 @@ func (client *DatabasesClient) BeginDelete(ctx context.Context, resourceGroupNam // Delete - Deletes the database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview func (client *DatabasesClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DatabasesClientBeginDeleteOptions) (*http.Response, error) { var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, databaseName, options) @@ -192,7 +192,7 @@ func (client *DatabasesClient) deleteCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -200,7 +200,7 @@ func (client *DatabasesClient) deleteCreateRequest(ctx context.Context, resource // BeginExport - Exports a database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -223,7 +223,7 @@ func (client *DatabasesClient) BeginExport(ctx context.Context, resourceGroupNam // Export - Exports a database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview func (client *DatabasesClient) export(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters ExportDatabaseDefinition, options *DatabasesClientBeginExportOptions) (*http.Response, error) { var err error req, err := client.exportCreateRequest(ctx, resourceGroupName, serverName, databaseName, parameters, options) @@ -265,7 +265,7 @@ func (client *DatabasesClient) exportCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -277,7 +277,7 @@ func (client *DatabasesClient) exportCreateRequest(ctx context.Context, resource // BeginFailover - Failovers a database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -299,7 +299,7 @@ func (client *DatabasesClient) BeginFailover(ctx context.Context, resourceGroupN // Failover - Failovers a database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview func (client *DatabasesClient) failover(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DatabasesClientBeginFailoverOptions) (*http.Response, error) { var err error req, err := client.failoverCreateRequest(ctx, resourceGroupName, serverName, databaseName, options) @@ -344,7 +344,7 @@ func (client *DatabasesClient) failoverCreateRequest(ctx context.Context, resour if options != nil && options.ReplicaType != nil { reqQP.Set("replicaType", string(*options.ReplicaType)) } - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -352,7 +352,7 @@ func (client *DatabasesClient) failoverCreateRequest(ctx context.Context, resour // Get - Gets a database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -406,7 +406,7 @@ func (client *DatabasesClient) getCreateRequest(ctx context.Context, resourceGro if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -424,7 +424,7 @@ func (client *DatabasesClient) getHandleResponse(resp *http.Response) (Databases // BeginImport - Imports a bacpac into a new database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -447,7 +447,7 @@ func (client *DatabasesClient) BeginImport(ctx context.Context, resourceGroupNam // Import - Imports a bacpac into a new database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview func (client *DatabasesClient) importOperation(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters ImportExistingDatabaseDefinition, options *DatabasesClientBeginImportOptions) (*http.Response, error) { var err error req, err := client.importCreateRequest(ctx, resourceGroupName, serverName, databaseName, parameters, options) @@ -489,7 +489,7 @@ func (client *DatabasesClient) importCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -500,7 +500,7 @@ func (client *DatabasesClient) importCreateRequest(ctx context.Context, resource // NewListByElasticPoolPager - Gets a list of databases in an elastic pool. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -559,7 +559,7 @@ func (client *DatabasesClient) listByElasticPoolCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -576,7 +576,7 @@ func (client *DatabasesClient) listByElasticPoolHandleResponse(resp *http.Respon // NewListByServerPager - Gets a list of databases. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -633,7 +633,7 @@ func (client *DatabasesClient) listByServerCreateRequest(ctx context.Context, re if options != nil && options.SkipToken != nil { reqQP.Set("$skipToken", *options.SkipToken) } - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -650,7 +650,7 @@ func (client *DatabasesClient) listByServerHandleResponse(resp *http.Response) ( // NewListInaccessibleByServerPager - Gets a list of inaccessible databases in a logical server // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -704,7 +704,7 @@ func (client *DatabasesClient) listInaccessibleByServerCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -719,152 +719,10 @@ func (client *DatabasesClient) listInaccessibleByServerHandleResponse(resp *http return result, nil } -// NewListMetricDefinitionsPager - Returns database metric definitions. -// -// Generated from API version 2014-04-01 -// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// - serverName - The name of the server. -// - databaseName - The name of the database. -// - options - DatabasesClientListMetricDefinitionsOptions contains the optional parameters for the DatabasesClient.NewListMetricDefinitionsPager -// method. -func (client *DatabasesClient) NewListMetricDefinitionsPager(resourceGroupName string, serverName string, databaseName string, options *DatabasesClientListMetricDefinitionsOptions) *runtime.Pager[DatabasesClientListMetricDefinitionsResponse] { - return runtime.NewPager(runtime.PagingHandler[DatabasesClientListMetricDefinitionsResponse]{ - More: func(page DatabasesClientListMetricDefinitionsResponse) bool { - return false - }, - Fetcher: func(ctx context.Context, page *DatabasesClientListMetricDefinitionsResponse) (DatabasesClientListMetricDefinitionsResponse, error) { - req, err := client.listMetricDefinitionsCreateRequest(ctx, resourceGroupName, serverName, databaseName, options) - if err != nil { - return DatabasesClientListMetricDefinitionsResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return DatabasesClientListMetricDefinitionsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DatabasesClientListMetricDefinitionsResponse{}, runtime.NewResponseError(resp) - } - return client.listMetricDefinitionsHandleResponse(resp) - }, - }) -} - -// listMetricDefinitionsCreateRequest creates the ListMetricDefinitions request. -func (client *DatabasesClient) listMetricDefinitionsCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DatabasesClientListMetricDefinitionsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/metricDefinitions" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if serverName == "" { - return nil, errors.New("parameter serverName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) - if databaseName == "" { - return nil, errors.New("parameter databaseName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2014-04-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listMetricDefinitionsHandleResponse handles the ListMetricDefinitions response. -func (client *DatabasesClient) listMetricDefinitionsHandleResponse(resp *http.Response) (DatabasesClientListMetricDefinitionsResponse, error) { - result := DatabasesClientListMetricDefinitionsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.MetricDefinitionListResult); err != nil { - return DatabasesClientListMetricDefinitionsResponse{}, err - } - return result, nil -} - -// NewListMetricsPager - Returns database metrics. -// -// Generated from API version 2014-04-01 -// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// - serverName - The name of the server. -// - databaseName - The name of the database. -// - filter - An OData filter expression that describes a subset of metrics to return. -// - options - DatabasesClientListMetricsOptions contains the optional parameters for the DatabasesClient.NewListMetricsPager -// method. -func (client *DatabasesClient) NewListMetricsPager(resourceGroupName string, serverName string, databaseName string, filter string, options *DatabasesClientListMetricsOptions) *runtime.Pager[DatabasesClientListMetricsResponse] { - return runtime.NewPager(runtime.PagingHandler[DatabasesClientListMetricsResponse]{ - More: func(page DatabasesClientListMetricsResponse) bool { - return false - }, - Fetcher: func(ctx context.Context, page *DatabasesClientListMetricsResponse) (DatabasesClientListMetricsResponse, error) { - req, err := client.listMetricsCreateRequest(ctx, resourceGroupName, serverName, databaseName, filter, options) - if err != nil { - return DatabasesClientListMetricsResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return DatabasesClientListMetricsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DatabasesClientListMetricsResponse{}, runtime.NewResponseError(resp) - } - return client.listMetricsHandleResponse(resp) - }, - }) -} - -// listMetricsCreateRequest creates the ListMetrics request. -func (client *DatabasesClient) listMetricsCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, filter string, options *DatabasesClientListMetricsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/metrics" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if serverName == "" { - return nil, errors.New("parameter serverName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) - if databaseName == "" { - return nil, errors.New("parameter databaseName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2014-04-01") - reqQP.Set("$filter", filter) - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listMetricsHandleResponse handles the ListMetrics response. -func (client *DatabasesClient) listMetricsHandleResponse(resp *http.Response) (DatabasesClientListMetricsResponse, error) { - result := DatabasesClientListMetricsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.MetricListResult); err != nil { - return DatabasesClientListMetricsResponse{}, err - } - return result, nil -} - // BeginPause - Pauses a database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -886,7 +744,7 @@ func (client *DatabasesClient) BeginPause(ctx context.Context, resourceGroupName // Pause - Pauses a database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview func (client *DatabasesClient) pause(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DatabasesClientBeginPauseOptions) (*http.Response, error) { var err error req, err := client.pauseCreateRequest(ctx, resourceGroupName, serverName, databaseName, options) @@ -928,7 +786,7 @@ func (client *DatabasesClient) pauseCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -937,7 +795,7 @@ func (client *DatabasesClient) pauseCreateRequest(ctx context.Context, resourceG // Rename - Renames a database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -985,7 +843,7 @@ func (client *DatabasesClient) renameCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err @@ -996,7 +854,7 @@ func (client *DatabasesClient) renameCreateRequest(ctx context.Context, resource // BeginResume - Resumes a database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -1018,7 +876,7 @@ func (client *DatabasesClient) BeginResume(ctx context.Context, resourceGroupNam // Resume - Resumes a database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview func (client *DatabasesClient) resume(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DatabasesClientBeginResumeOptions) (*http.Response, error) { var err error req, err := client.resumeCreateRequest(ctx, resourceGroupName, serverName, databaseName, options) @@ -1060,7 +918,7 @@ func (client *DatabasesClient) resumeCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1069,7 +927,7 @@ func (client *DatabasesClient) resumeCreateRequest(ctx context.Context, resource // BeginUpdate - Updates an existing database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -1094,7 +952,7 @@ func (client *DatabasesClient) BeginUpdate(ctx context.Context, resourceGroupNam // Update - Updates an existing database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview func (client *DatabasesClient) update(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters DatabaseUpdate, options *DatabasesClientBeginUpdateOptions) (*http.Response, error) { var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, serverName, databaseName, parameters, options) @@ -1136,7 +994,7 @@ func (client *DatabasesClient) updateCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -1148,7 +1006,7 @@ func (client *DatabasesClient) updateCreateRequest(ctx context.Context, resource // BeginUpgradeDataWarehouse - Upgrades a data warehouse. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -1171,7 +1029,7 @@ func (client *DatabasesClient) BeginUpgradeDataWarehouse(ctx context.Context, re // UpgradeDataWarehouse - Upgrades a data warehouse. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview func (client *DatabasesClient) upgradeDataWarehouse(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DatabasesClientBeginUpgradeDataWarehouseOptions) (*http.Response, error) { var err error req, err := client.upgradeDataWarehouseCreateRequest(ctx, resourceGroupName, serverName, databaseName, options) @@ -1213,7 +1071,7 @@ func (client *DatabasesClient) upgradeDataWarehouseCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } diff --git a/sdk/resourcemanager/sql/armsql/databases_client_example_test.go b/sdk/resourcemanager/sql/armsql/databases_client_example_test.go deleted file mode 100644 index 61e097f013da..000000000000 --- a/sdk/resourcemanager/sql/armsql/databases_client_example_test.go +++ /dev/null @@ -1,3318 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DatabaseMetricsListWithFilter.json -func ExampleDatabasesClient_NewListMetricsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDatabasesClient().NewListMetricsPager("sqlcrudtest-6730", "sqlcrudtest-9007", "3481", "name/value eq 'cpu_percent' and timeGrain eq '00:10:00' and startTime eq '2017-06-02T18:35:00Z' and endTime eq '2017-06-02T18:55:00Z'", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.MetricListResult = armsql.MetricListResult{ - // Value: []*armsql.Metric{ - // { - // Name: &armsql.MetricName{ - // LocalizedValue: to.Ptr("CPU percentage"), - // Value: to.Ptr("cpu_percent"), - // }, - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-02T18:55:00Z"); return t}()), - // MetricValues: []*armsql.MetricValue{ - // { - // Average: to.Ptr[float64](0), - // Count: to.Ptr[int32](1), - // Maximum: to.Ptr[float64](0), - // Minimum: to.Ptr[float64](0), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-02T18:30:01Z"); return t}()), - // Total: to.Ptr[float64](0), - // }, - // { - // Average: to.Ptr[float64](0), - // Count: to.Ptr[int32](1), - // Maximum: to.Ptr[float64](0), - // Minimum: to.Ptr[float64](0), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-02T18:40:01Z"); return t}()), - // Total: to.Ptr[float64](0), - // }, - // { - // Average: to.Ptr[float64](0), - // Count: to.Ptr[int32](1), - // Maximum: to.Ptr[float64](0), - // Minimum: to.Ptr[float64](0), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-02T18:50:01Z"); return t}()), - // Total: to.Ptr[float64](0), - // }}, - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-02T18:35:00Z"); return t}()), - // TimeGrain: to.Ptr("00:10:00"), - // Unit: to.Ptr(armsql.UnitTypePercent), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DatabaseMetricsDefinitionsList.json -func ExampleDatabasesClient_NewListMetricDefinitionsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDatabasesClient().NewListMetricDefinitionsPager("sqlcrudtest-6730", "sqlcrudtest-9007", "3481", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.MetricDefinitionListResult = armsql.MetricDefinitionListResult{ - // Value: []*armsql.MetricDefinition{ - // { - // Name: &armsql.MetricName{ - // LocalizedValue: to.Ptr("CPU percentage"), - // Value: to.Ptr("cpu_percent"), - // }, - // MetricAvailabilities: []*armsql.MetricAvailability{ - // { - // Retention: to.Ptr("PT1H"), - // TimeGrain: to.Ptr("PT15S"), - // }, - // { - // Retention: to.Ptr("PT1H"), - // TimeGrain: to.Ptr("PT60S"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("PT5M"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("PT1H"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("P1D"), - // }}, - // PrimaryAggregationType: to.Ptr(armsql.PrimaryAggregationTypeAverage), - // ResourceURI: to.Ptr("/subscriptions/b6a6e0c5-e79c-4c6d-a878-72eafbca4cf2/resourceGroups/QA/providers/Microsoft.Sql/servers/nafantest/databases/db1"), - // Unit: to.Ptr(armsql.UnitDefinitionTypePercent), - // }, - // { - // Name: &armsql.MetricName{ - // LocalizedValue: to.Ptr("Data IO percentage"), - // Value: to.Ptr("physical_data_read_percent"), - // }, - // MetricAvailabilities: []*armsql.MetricAvailability{ - // { - // Retention: to.Ptr("PT1H"), - // TimeGrain: to.Ptr("PT15S"), - // }, - // { - // Retention: to.Ptr("PT1H"), - // TimeGrain: to.Ptr("PT60S"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("PT5M"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("PT1H"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("P1D"), - // }}, - // PrimaryAggregationType: to.Ptr(armsql.PrimaryAggregationTypeAverage), - // ResourceURI: to.Ptr("/subscriptions/b6a6e0c5-e79c-4c6d-a878-72eafbca4cf2/resourceGroups/QA/providers/Microsoft.Sql/servers/nafantest/databases/db1"), - // Unit: to.Ptr(armsql.UnitDefinitionTypePercent), - // }, - // { - // Name: &armsql.MetricName{ - // LocalizedValue: to.Ptr("Log IO percentage"), - // Value: to.Ptr("log_write_percent"), - // }, - // MetricAvailabilities: []*armsql.MetricAvailability{ - // { - // Retention: to.Ptr("PT1H"), - // TimeGrain: to.Ptr("PT15S"), - // }, - // { - // Retention: to.Ptr("PT1H"), - // TimeGrain: to.Ptr("PT60S"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("PT5M"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("PT1H"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("P1D"), - // }}, - // PrimaryAggregationType: to.Ptr(armsql.PrimaryAggregationTypeAverage), - // ResourceURI: to.Ptr("/subscriptions/b6a6e0c5-e79c-4c6d-a878-72eafbca4cf2/resourceGroups/QA/providers/Microsoft.Sql/servers/nafantest/databases/db1"), - // Unit: to.Ptr(armsql.UnitDefinitionTypePercent), - // }, - // { - // Name: &armsql.MetricName{ - // LocalizedValue: to.Ptr("DTU percentage"), - // Value: to.Ptr("dtu_consumption_percent"), - // }, - // MetricAvailabilities: []*armsql.MetricAvailability{ - // { - // Retention: to.Ptr("PT1H"), - // TimeGrain: to.Ptr("PT15S"), - // }, - // { - // Retention: to.Ptr("PT1H"), - // TimeGrain: to.Ptr("PT60S"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("PT5M"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("PT1H"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("P1D"), - // }}, - // PrimaryAggregationType: to.Ptr(armsql.PrimaryAggregationTypeAverage), - // ResourceURI: to.Ptr("/subscriptions/b6a6e0c5-e79c-4c6d-a878-72eafbca4cf2/resourceGroups/QA/providers/Microsoft.Sql/servers/nafantest/databases/db1"), - // Unit: to.Ptr(armsql.UnitDefinitionTypePercent), - // }, - // { - // Name: &armsql.MetricName{ - // LocalizedValue: to.Ptr("Total database size"), - // Value: to.Ptr("storage"), - // }, - // MetricAvailabilities: []*armsql.MetricAvailability{ - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("PT5M"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("PT1H"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("P1D"), - // }}, - // PrimaryAggregationType: to.Ptr(armsql.PrimaryAggregationTypeMaximum), - // ResourceURI: to.Ptr("/subscriptions/b6a6e0c5-e79c-4c6d-a878-72eafbca4cf2/resourceGroups/QA/providers/Microsoft.Sql/servers/nafantest/databases/db1"), - // Unit: to.Ptr(armsql.UnitDefinitionTypeBytes), - // }, - // { - // Name: &armsql.MetricName{ - // LocalizedValue: to.Ptr("In-Memory OLTP storage percent"), - // Value: to.Ptr("xtp_storage_percent"), - // }, - // MetricAvailabilities: []*armsql.MetricAvailability{ - // { - // Retention: to.Ptr("PT1H"), - // TimeGrain: to.Ptr("PT15S"), - // }, - // { - // Retention: to.Ptr("PT1H"), - // TimeGrain: to.Ptr("PT60S"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("PT5M"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("PT1H"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("P1D"), - // }}, - // PrimaryAggregationType: to.Ptr(armsql.PrimaryAggregationTypeAverage), - // ResourceURI: to.Ptr("/subscriptions/b6a6e0c5-e79c-4c6d-a878-72eafbca4cf2/resourceGroups/QA/providers/Microsoft.Sql/servers/nafantest/databases/db1"), - // Unit: to.Ptr(armsql.UnitDefinitionTypePercent), - // }, - // { - // Name: &armsql.MetricName{ - // LocalizedValue: to.Ptr("Workers percentage"), - // Value: to.Ptr("workers_percent"), - // }, - // MetricAvailabilities: []*armsql.MetricAvailability{ - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("PT5M"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("PT1H"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("P1D"), - // }}, - // PrimaryAggregationType: to.Ptr(armsql.PrimaryAggregationTypeAverage), - // ResourceURI: to.Ptr("/subscriptions/b6a6e0c5-e79c-4c6d-a878-72eafbca4cf2/resourceGroups/QA/providers/Microsoft.Sql/servers/nafantest/databases/db1"), - // Unit: to.Ptr(armsql.UnitDefinitionTypePercent), - // }, - // { - // Name: &armsql.MetricName{ - // LocalizedValue: to.Ptr("Sessions percentage"), - // Value: to.Ptr("sessions_percent"), - // }, - // MetricAvailabilities: []*armsql.MetricAvailability{ - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("PT5M"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("PT1H"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("P1D"), - // }}, - // PrimaryAggregationType: to.Ptr(armsql.PrimaryAggregationTypeAverage), - // ResourceURI: to.Ptr("/subscriptions/b6a6e0c5-e79c-4c6d-a878-72eafbca4cf2/resourceGroups/QA/providers/Microsoft.Sql/servers/nafantest/databases/db1"), - // Unit: to.Ptr(armsql.UnitDefinitionTypePercent), - // }, - // { - // Name: &armsql.MetricName{ - // LocalizedValue: to.Ptr("DTU limit"), - // Value: to.Ptr("dtu_limit"), - // }, - // MetricAvailabilities: []*armsql.MetricAvailability{ - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("PT5M"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("PT1H"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("P1D"), - // }}, - // PrimaryAggregationType: to.Ptr(armsql.PrimaryAggregationTypeAverage), - // ResourceURI: to.Ptr("/subscriptions/b6a6e0c5-e79c-4c6d-a878-72eafbca4cf2/resourceGroups/QA/providers/Microsoft.Sql/servers/nafantest/databases/db1"), - // Unit: to.Ptr(armsql.UnitDefinitionTypeCount), - // }, - // { - // Name: &armsql.MetricName{ - // LocalizedValue: to.Ptr("DTU used"), - // Value: to.Ptr("dtu_used"), - // }, - // MetricAvailabilities: []*armsql.MetricAvailability{ - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("PT5M"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("PT1H"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("P1D"), - // }}, - // PrimaryAggregationType: to.Ptr(armsql.PrimaryAggregationTypeAverage), - // ResourceURI: to.Ptr("/subscriptions/b6a6e0c5-e79c-4c6d-a878-72eafbca4cf2/resourceGroups/QA/providers/Microsoft.Sql/servers/nafantest/databases/db1"), - // Unit: to.Ptr(armsql.UnitDefinitionTypeCount), - // }, - // { - // Name: &armsql.MetricName{ - // LocalizedValue: to.Ptr("Successful Connections"), - // Value: to.Ptr("connection_successful"), - // }, - // MetricAvailabilities: []*armsql.MetricAvailability{ - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("PT5M"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("PT1H"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("P1D"), - // }}, - // PrimaryAggregationType: to.Ptr(armsql.PrimaryAggregationTypeTotal), - // ResourceURI: to.Ptr("/subscriptions/b6a6e0c5-e79c-4c6d-a878-72eafbca4cf2/resourceGroups/QA/providers/Microsoft.Sql/servers/nafantest/databases/db1"), - // Unit: to.Ptr(armsql.UnitDefinitionTypeCount), - // }, - // { - // Name: &armsql.MetricName{ - // LocalizedValue: to.Ptr("Failed Connections"), - // Value: to.Ptr("connection_failed"), - // }, - // MetricAvailabilities: []*armsql.MetricAvailability{ - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("PT5M"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("PT1H"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("P1D"), - // }}, - // PrimaryAggregationType: to.Ptr(armsql.PrimaryAggregationTypeTotal), - // ResourceURI: to.Ptr("/subscriptions/b6a6e0c5-e79c-4c6d-a878-72eafbca4cf2/resourceGroups/QA/providers/Microsoft.Sql/servers/nafantest/databases/db1"), - // Unit: to.Ptr(armsql.UnitDefinitionTypeCount), - // }, - // { - // Name: &armsql.MetricName{ - // LocalizedValue: to.Ptr("Blocked by Firewall"), - // Value: to.Ptr("blocked_by_firewall"), - // }, - // MetricAvailabilities: []*armsql.MetricAvailability{ - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("PT5M"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("PT1H"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("P1D"), - // }}, - // PrimaryAggregationType: to.Ptr(armsql.PrimaryAggregationTypeTotal), - // ResourceURI: to.Ptr("/subscriptions/b6a6e0c5-e79c-4c6d-a878-72eafbca4cf2/resourceGroups/QA/providers/Microsoft.Sql/servers/nafantest/databases/db1"), - // Unit: to.Ptr(armsql.UnitDefinitionTypeCount), - // }, - // { - // Name: &armsql.MetricName{ - // LocalizedValue: to.Ptr("Deadlocks"), - // Value: to.Ptr("deadlock"), - // }, - // MetricAvailabilities: []*armsql.MetricAvailability{ - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("PT5M"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("PT1H"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("P1D"), - // }}, - // PrimaryAggregationType: to.Ptr(armsql.PrimaryAggregationTypeTotal), - // ResourceURI: to.Ptr("/subscriptions/b6a6e0c5-e79c-4c6d-a878-72eafbca4cf2/resourceGroups/QA/providers/Microsoft.Sql/servers/nafantest/databases/db1"), - // Unit: to.Ptr(armsql.UnitDefinitionTypeCount), - // }, - // { - // Name: &armsql.MetricName{ - // LocalizedValue: to.Ptr("Database size percentage"), - // Value: to.Ptr("storage_percent"), - // }, - // MetricAvailabilities: []*armsql.MetricAvailability{ - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("PT5M"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("PT1H"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("P1D"), - // }}, - // PrimaryAggregationType: to.Ptr(armsql.PrimaryAggregationTypeMaximum), - // ResourceURI: to.Ptr("/subscriptions/b6a6e0c5-e79c-4c6d-a878-72eafbca4cf2/resourceGroups/QA/providers/Microsoft.Sql/servers/nafantest/databases/db1"), - // Unit: to.Ptr(armsql.UnitDefinitionTypePercent), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ListVCoreDatabasesEnclaveTypeByServer.json -func ExampleDatabasesClient_NewListByServerPager_getsAListOfDatabasesConfiguredWithEnclaveType() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDatabasesClient().NewListByServerPager("Default-SQL-SouthEastAsia", "testsvr", &armsql.DatabasesClientListByServerOptions{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.DatabaseListResult = armsql.DatabaseListResult{ - // Value: []*armsql.Database{ - // { - // Name: to.Ptr("testdb"), - // Type: to.Ptr("Microsoft.Sql/servers/databases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"), - // Location: to.Ptr("southeastasia"), - // Kind: to.Ptr("v12.0,user,vcore"), - // Properties: &armsql.DatabaseProperties{ - // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyZone), - // CurrentServiceObjectiveName: to.Ptr("BC_Gen4_2"), - // CurrentSKU: &armsql.SKU{ - // Name: to.Ptr("BC_Gen4"), - // Capacity: to.Ptr[int32](2), - // Tier: to.Ptr("BusinessCritical"), - // }, - // DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"), - // DefaultSecondaryLocation: to.Ptr("North Europe"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()), - // IsInfraEncryptionEnabled: to.Ptr(false), - // IsLedgerOn: to.Ptr(false), - // LicenseType: to.Ptr(armsql.DatabaseLicenseTypeLicenseIncluded), - // MaxLogSizeBytes: to.Ptr[int64](104857600), - // MaxSizeBytes: to.Ptr[int64](268435456000), - // PreferredEnclaveType: to.Ptr(armsql.AlwaysEncryptedEnclaveTypeDefault), - // ReadScale: to.Ptr(armsql.DatabaseReadScaleEnabled), - // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyZone), - // RequestedServiceObjectiveName: to.Ptr("BC_Gen4_2"), - // Status: to.Ptr(armsql.DatabaseStatusOnline), - // ZoneRedundant: to.Ptr(false), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("BC_Gen4"), - // Capacity: to.Ptr[int32](2), - // Tier: to.Ptr("BusinessCritical"), - // }, - // }, - // { - // Name: to.Ptr("master"), - // Type: to.Ptr("Microsoft.Sql/servers/databases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/master"), - // Location: to.Ptr("southeastasia"), - // Kind: to.Ptr("v12.0,system"), - // Properties: &armsql.DatabaseProperties{ - // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:23:42.537Z"); return t}()), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyLocal), - // CurrentServiceObjectiveName: to.Ptr("System0"), - // CurrentSKU: &armsql.SKU{ - // Name: to.Ptr("System0"), - // Capacity: to.Ptr[int32](0), - // Tier: to.Ptr("System"), - // }, - // DatabaseID: to.Ptr("e6be351f-2cc9-4604-9e52-b0b28b2710b0"), - // DefaultSecondaryLocation: to.Ptr("North Europe"), - // IsInfraEncryptionEnabled: to.Ptr(false), - // IsLedgerOn: to.Ptr(false), - // MaxSizeBytes: to.Ptr[int64](32212254720), - // PreferredEnclaveType: to.Ptr(armsql.AlwaysEncryptedEnclaveTypeVBS), - // ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled), - // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyLocal), - // RequestedServiceObjectiveName: to.Ptr("System0"), - // Status: to.Ptr(armsql.DatabaseStatusOnline), - // ZoneRedundant: to.Ptr(false), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("System0"), - // Capacity: to.Ptr[int32](0), - // Tier: to.Ptr("System"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ListVCoreDatabasesByServer.json -func ExampleDatabasesClient_NewListByServerPager_getsAListOfDatabases() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDatabasesClient().NewListByServerPager("Default-SQL-SouthEastAsia", "testsvr", &armsql.DatabasesClientListByServerOptions{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.DatabaseListResult = armsql.DatabaseListResult{ - // Value: []*armsql.Database{ - // { - // Name: to.Ptr("testdb"), - // Type: to.Ptr("Microsoft.Sql/servers/databases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"), - // Location: to.Ptr("southeastasia"), - // Kind: to.Ptr("v12.0,user,vcore"), - // Properties: &armsql.DatabaseProperties{ - // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyZone), - // CurrentServiceObjectiveName: to.Ptr("BC_Gen4_2"), - // CurrentSKU: &armsql.SKU{ - // Name: to.Ptr("BC_Gen4"), - // Capacity: to.Ptr[int32](2), - // Tier: to.Ptr("BusinessCritical"), - // }, - // DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"), - // DefaultSecondaryLocation: to.Ptr("North Europe"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()), - // IsInfraEncryptionEnabled: to.Ptr(false), - // IsLedgerOn: to.Ptr(false), - // LicenseType: to.Ptr(armsql.DatabaseLicenseTypeLicenseIncluded), - // MaxLogSizeBytes: to.Ptr[int64](104857600), - // MaxSizeBytes: to.Ptr[int64](268435456000), - // ReadScale: to.Ptr(armsql.DatabaseReadScaleEnabled), - // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyZone), - // RequestedServiceObjectiveName: to.Ptr("BC_Gen4_2"), - // Status: to.Ptr(armsql.DatabaseStatusOnline), - // ZoneRedundant: to.Ptr(false), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("BC_Gen4"), - // Capacity: to.Ptr[int32](2), - // Tier: to.Ptr("BusinessCritical"), - // }, - // }, - // { - // Name: to.Ptr("master"), - // Type: to.Ptr("Microsoft.Sql/servers/databases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/master"), - // Location: to.Ptr("southeastasia"), - // Kind: to.Ptr("v12.0,system"), - // Properties: &armsql.DatabaseProperties{ - // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:23:42.537Z"); return t}()), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyLocal), - // CurrentServiceObjectiveName: to.Ptr("System0"), - // CurrentSKU: &armsql.SKU{ - // Name: to.Ptr("System0"), - // Capacity: to.Ptr[int32](0), - // Tier: to.Ptr("System"), - // }, - // DatabaseID: to.Ptr("e6be351f-2cc9-4604-9e52-b0b28b2710b0"), - // DefaultSecondaryLocation: to.Ptr("North Europe"), - // IsInfraEncryptionEnabled: to.Ptr(false), - // IsLedgerOn: to.Ptr(false), - // MaxSizeBytes: to.Ptr[int64](32212254720), - // ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled), - // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyLocal), - // RequestedServiceObjectiveName: to.Ptr("System0"), - // Status: to.Ptr(armsql.DatabaseStatusOnline), - // ZoneRedundant: to.Ptr(false), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("System0"), - // Capacity: to.Ptr[int32](0), - // Tier: to.Ptr("System"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/GetVCoreDatabaseDefaultEnclave.json -func ExampleDatabasesClient_Get_getsADatabaseConfiguredWithDefaultEnclaveType() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatabasesClient().Get(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", &armsql.DatabasesClientGetOptions{Expand: nil, - 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.Database = armsql.Database{ - // Name: to.Ptr("testdb"), - // Type: to.Ptr("Microsoft.Sql/servers/databases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"), - // Location: to.Ptr("southeastasia"), - // Kind: to.Ptr("v12.0,user,vcore"), - // Properties: &armsql.DatabaseProperties{ - // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // CurrentServiceObjectiveName: to.Ptr("BC_Gen5_2"), - // CurrentSKU: &armsql.SKU{ - // Name: to.Ptr("BC_Gen5"), - // Capacity: to.Ptr[int32](2), - // Tier: to.Ptr("BusinessCritical"), - // }, - // DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"), - // DefaultSecondaryLocation: to.Ptr("North Europe"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()), - // IsInfraEncryptionEnabled: to.Ptr(false), - // IsLedgerOn: to.Ptr(false), - // LicenseType: to.Ptr(armsql.DatabaseLicenseTypeLicenseIncluded), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_SouthEastAsia_1"), - // MaxLogSizeBytes: to.Ptr[int64](104857600), - // MaxSizeBytes: to.Ptr[int64](268435456000), - // PreferredEnclaveType: to.Ptr(armsql.AlwaysEncryptedEnclaveTypeDefault), - // ReadScale: to.Ptr(armsql.DatabaseReadScaleEnabled), - // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // RequestedServiceObjectiveName: to.Ptr("BC_Gen5_2"), - // Status: to.Ptr(armsql.DatabaseStatusOnline), - // ZoneRedundant: to.Ptr(false), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("BC_Gen5"), - // Capacity: to.Ptr[int32](2), - // Tier: to.Ptr("BusinessCritical"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/GetVCoreDatabaseVBSEnclave.json -func ExampleDatabasesClient_Get_getsADatabaseConfiguredWithVbsEnclaveType() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatabasesClient().Get(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", &armsql.DatabasesClientGetOptions{Expand: nil, - 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.Database = armsql.Database{ - // Name: to.Ptr("testdb"), - // Type: to.Ptr("Microsoft.Sql/servers/databases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"), - // Location: to.Ptr("southeastasia"), - // Kind: to.Ptr("v12.0,user,vcore"), - // Properties: &armsql.DatabaseProperties{ - // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // CurrentServiceObjectiveName: to.Ptr("BC_Gen5_2"), - // CurrentSKU: &armsql.SKU{ - // Name: to.Ptr("BC_Gen5"), - // Capacity: to.Ptr[int32](2), - // Tier: to.Ptr("BusinessCritical"), - // }, - // DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"), - // DefaultSecondaryLocation: to.Ptr("North Europe"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()), - // IsInfraEncryptionEnabled: to.Ptr(false), - // IsLedgerOn: to.Ptr(false), - // LicenseType: to.Ptr(armsql.DatabaseLicenseTypeLicenseIncluded), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_SouthEastAsia_1"), - // MaxLogSizeBytes: to.Ptr[int64](104857600), - // MaxSizeBytes: to.Ptr[int64](268435456000), - // PreferredEnclaveType: to.Ptr(armsql.AlwaysEncryptedEnclaveTypeVBS), - // ReadScale: to.Ptr(armsql.DatabaseReadScaleEnabled), - // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // RequestedServiceObjectiveName: to.Ptr("BC_Gen5_2"), - // Status: to.Ptr(armsql.DatabaseStatusOnline), - // ZoneRedundant: to.Ptr(false), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("BC_Gen5"), - // Capacity: to.Ptr[int32](2), - // Tier: to.Ptr("BusinessCritical"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/GetDatabaseWithAvailabilityZone.json -func ExampleDatabasesClient_Get_getsADatabaseWithAvailabilityZoneSpecified() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatabasesClient().Get(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", &armsql.DatabasesClientGetOptions{Expand: nil, - 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.Database = armsql.Database{ - // Name: to.Ptr("testdb"), - // Type: to.Ptr("Microsoft.Sql/servers/databases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"), - // Location: to.Ptr("southeastasia"), - // Kind: to.Ptr("v12.0,user"), - // Properties: &armsql.DatabaseProperties{ - // AvailabilityZone: to.Ptr(armsql.AvailabilityZoneTypeOne), - // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // CurrentServiceObjectiveName: to.Ptr("S0"), - // CurrentSKU: &armsql.SKU{ - // Name: to.Ptr("Standard"), - // Capacity: to.Ptr[int32](10), - // Tier: to.Ptr("Standard"), - // }, - // DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"), - // DefaultSecondaryLocation: to.Ptr("North Europe"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()), - // IsInfraEncryptionEnabled: to.Ptr(false), - // IsLedgerOn: to.Ptr(false), - // MaxSizeBytes: to.Ptr[int64](1073741824), - // ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled), - // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // RequestedServiceObjectiveName: to.Ptr("S0"), - // Status: to.Ptr(armsql.DatabaseStatusOnline), - // ZoneRedundant: to.Ptr(false), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("S0"), - // Capacity: to.Ptr[int32](10), - // Tier: to.Ptr("Standard"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/GetVCoreDatabaseWithExpandEqualsKeys.json -func ExampleDatabasesClient_Get_getsADatabaseWithDatabaseLevelKeysExpanded() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatabasesClient().Get(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", &armsql.DatabasesClientGetOptions{Expand: to.Ptr("keys"), - 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.Database = armsql.Database{ - // Name: to.Ptr("testdb"), - // Type: to.Ptr("Microsoft.Sql/servers/databases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"), - // Location: to.Ptr("southeastasia"), - // Kind: to.Ptr("v12.0,user,vcore"), - // Properties: &armsql.DatabaseProperties{ - // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // CurrentServiceObjectiveName: to.Ptr("BC_Gen5_2"), - // CurrentSKU: &armsql.SKU{ - // Name: to.Ptr("BC_Gen5"), - // Capacity: to.Ptr[int32](2), - // Tier: to.Ptr("BusinessCritical"), - // }, - // DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"), - // DefaultSecondaryLocation: to.Ptr("North Europe"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()), - // EncryptionProtector: to.Ptr("https://your-key-vault-name.vault.azure.net/yourKey/yourKeyVersion"), - // IsInfraEncryptionEnabled: to.Ptr(false), - // IsLedgerOn: to.Ptr(false), - // Keys: map[string]*armsql.DatabaseKey{ - // "https://your-key-vault-name.vault.azure.net/yourKey/yourKeyVersion": &armsql.DatabaseKey{ - // }, - // "https://your-key-vault-name.vault.azure.net/yourKey2/yourKey2Version": &armsql.DatabaseKey{ - // }, - // }, - // LicenseType: to.Ptr(armsql.DatabaseLicenseTypeLicenseIncluded), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_SouthEastAsia_1"), - // MaxLogSizeBytes: to.Ptr[int64](104857600), - // MaxSizeBytes: to.Ptr[int64](268435456000), - // ReadScale: to.Ptr(armsql.DatabaseReadScaleEnabled), - // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // RequestedServiceObjectiveName: to.Ptr("BC_Gen5_2"), - // Status: to.Ptr(armsql.DatabaseStatusOnline), - // ZoneRedundant: to.Ptr(false), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("BC_Gen5"), - // Capacity: to.Ptr[int32](2), - // Tier: to.Ptr("BusinessCritical"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/GetVCoreDatabase.json -func ExampleDatabasesClient_Get_getsADatabase() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatabasesClient().Get(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", &armsql.DatabasesClientGetOptions{Expand: nil, - 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.Database = armsql.Database{ - // Name: to.Ptr("testdb"), - // Type: to.Ptr("Microsoft.Sql/servers/databases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"), - // Location: to.Ptr("southeastasia"), - // Kind: to.Ptr("v12.0,user,vcore"), - // Properties: &armsql.DatabaseProperties{ - // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // CurrentServiceObjectiveName: to.Ptr("BC_Gen5_2"), - // CurrentSKU: &armsql.SKU{ - // Name: to.Ptr("BC_Gen5"), - // Capacity: to.Ptr[int32](2), - // Tier: to.Ptr("BusinessCritical"), - // }, - // DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"), - // DefaultSecondaryLocation: to.Ptr("North Europe"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()), - // IsInfraEncryptionEnabled: to.Ptr(false), - // IsLedgerOn: to.Ptr(false), - // LicenseType: to.Ptr(armsql.DatabaseLicenseTypeLicenseIncluded), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_SouthEastAsia_1"), - // MaxLogSizeBytes: to.Ptr[int64](104857600), - // MaxSizeBytes: to.Ptr[int64](268435456000), - // ReadScale: to.Ptr(armsql.DatabaseReadScaleEnabled), - // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // RequestedServiceObjectiveName: to.Ptr("BC_Gen5_2"), - // Status: to.Ptr(armsql.DatabaseStatusOnline), - // ZoneRedundant: to.Ptr(false), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("BC_Gen5"), - // Capacity: to.Ptr[int32](2), - // Tier: to.Ptr("BusinessCritical"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CreateVCoreDatabaseByServiceObjective.json -func ExampleDatabasesClient_BeginCreateOrUpdate_createsAVCoreDatabaseBySpecifyingServiceObjectiveName() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.Database{ - Location: to.Ptr("southeastasia"), - SKU: &armsql.SKU{ - Name: to.Ptr("BC"), - Capacity: to.Ptr[int32](2), - Family: to.Ptr("Gen4"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Database = armsql.Database{ - // Name: to.Ptr("testdb"), - // Type: to.Ptr("Microsoft.Sql/servers/databases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"), - // Location: to.Ptr("southeastasia"), - // Kind: to.Ptr("v12.0,user"), - // Properties: &armsql.DatabaseProperties{ - // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // CurrentServiceObjectiveName: to.Ptr("BC_Gen4_2"), - // CurrentSKU: &armsql.SKU{ - // Name: to.Ptr("BC_Gen4"), - // Capacity: to.Ptr[int32](2), - // Tier: to.Ptr("BusinessCritical"), - // }, - // DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"), - // DefaultSecondaryLocation: to.Ptr("North Europe"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()), - // IsInfraEncryptionEnabled: to.Ptr(false), - // IsLedgerOn: to.Ptr(false), - // LicenseType: to.Ptr(armsql.DatabaseLicenseTypeLicenseIncluded), - // MaxLogSizeBytes: to.Ptr[int64](104857600), - // MaxSizeBytes: to.Ptr[int64](1073741824), - // ReadScale: to.Ptr(armsql.DatabaseReadScaleEnabled), - // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // Status: to.Ptr(armsql.DatabaseStatusOnline), - // ZoneRedundant: to.Ptr(false), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("BC_Gen4"), - // Capacity: to.Ptr[int32](2), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr("BusinessCritical"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CreateVCoreDatabaseBySkuNameCapacity.json -func ExampleDatabasesClient_BeginCreateOrUpdate_createsAVCoreDatabaseBySpecifyingSkuNameAndCapacity() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.Database{ - Location: to.Ptr("southeastasia"), - SKU: &armsql.SKU{ - Name: to.Ptr("BC_Gen4"), - Capacity: 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.Database = armsql.Database{ - // Name: to.Ptr("testdb"), - // Type: to.Ptr("Microsoft.Sql/servers/databases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"), - // Location: to.Ptr("southeastasia"), - // Kind: to.Ptr("v12.0,user"), - // Properties: &armsql.DatabaseProperties{ - // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // CurrentServiceObjectiveName: to.Ptr("BC_Gen4_2"), - // CurrentSKU: &armsql.SKU{ - // Name: to.Ptr("BC_Gen4"), - // Capacity: to.Ptr[int32](2), - // Tier: to.Ptr("BusinessCritical"), - // }, - // DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"), - // DefaultSecondaryLocation: to.Ptr("North Europe"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()), - // IsInfraEncryptionEnabled: to.Ptr(false), - // IsLedgerOn: to.Ptr(false), - // LicenseType: to.Ptr(armsql.DatabaseLicenseTypeLicenseIncluded), - // MaxLogSizeBytes: to.Ptr[int64](104857600), - // MaxSizeBytes: to.Ptr[int64](1073741824), - // ReadScale: to.Ptr(armsql.DatabaseReadScaleEnabled), - // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // Status: to.Ptr(armsql.DatabaseStatusOnline), - // ZoneRedundant: to.Ptr(false), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("BC_Gen4"), - // Capacity: to.Ptr[int32](2), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr("BusinessCritical"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CreateDwDatabaseCrossSubscriptionRestore.json -func ExampleDatabasesClient_BeginCreateOrUpdate_createsADataWarehouseDatabaseAsACrossSubscriptionRestoreFromABackupOfADroppedDatabase() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdw", armsql.Database{ - Location: to.Ptr("southeastasia"), - Properties: &armsql.DatabaseProperties{ - CreateMode: to.Ptr(armsql.CreateModeRestore), - SourceResourceID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/srcsvr/restorableDroppedDatabases/srcdw,131403269876900000"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Database = armsql.Database{ - // Name: to.Ptr("testdw"), - // Type: to.Ptr("Microsoft.Sql/servers/databases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdw"), - // Location: to.Ptr("southeastasia"), - // Kind: to.Ptr("v12.0,user,datawarehouse,gen2"), - // Properties: &armsql.DatabaseProperties{ - // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-24T06:46:14.99Z"); return t}()), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // CurrentServiceObjectiveName: to.Ptr("DW1000c"), - // CurrentSKU: &armsql.SKU{ - // Name: to.Ptr("DataWarehouse"), - // Capacity: to.Ptr[int32](9000), - // Tier: to.Ptr("DataWarehouse"), - // }, - // DatabaseID: to.Ptr("188784c9-d602-4684-86cf-e67b6f03551a"), - // DefaultSecondaryLocation: to.Ptr("eastus"), - // MaxSizeBytes: to.Ptr[int64](263882790666240), - // ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled), - // RequestedServiceObjectiveName: to.Ptr("DW1000c"), - // Status: to.Ptr(armsql.DatabaseStatusOnline), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("DataWarehouse"), - // Capacity: to.Ptr[int32](9000), - // Tier: to.Ptr("DataWarehouse"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CreateDwDatabaseCrossSubscriptionRecovery.json -func ExampleDatabasesClient_BeginCreateOrUpdate_createsADataWarehouseDatabaseAsACrossSubscriptionRestoreFromAGeoBackup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-WestUS", "testsvr", "testdw", armsql.Database{ - Location: to.Ptr("westus"), - Properties: &armsql.DatabaseProperties{ - CreateMode: to.Ptr(armsql.CreateModeRecovery), - SourceResourceID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-SQL-EastUS/providers/Microsoft.Sql/servers/srcsvr/recoverabledatabases/srcdw"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Database = armsql.Database{ - // Name: to.Ptr("testdw"), - // Type: to.Ptr("Microsoft.Sql/servers/databases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-WestUS/providers/Microsoft.Sql/servers/testsvr/databases/testdw"), - // Location: to.Ptr("westus"), - // Kind: to.Ptr("v12.0,user,datawarehouse,gen2"), - // Properties: &armsql.DatabaseProperties{ - // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-24T06:46:14.99Z"); return t}()), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // CurrentServiceObjectiveName: to.Ptr("DW1000c"), - // CurrentSKU: &armsql.SKU{ - // Name: to.Ptr("DataWarehouse"), - // Capacity: to.Ptr[int32](9000), - // Tier: to.Ptr("DataWarehouse"), - // }, - // DatabaseID: to.Ptr("188784c9-d602-4684-86cf-e67b6f03551a"), - // DefaultSecondaryLocation: to.Ptr("eastus"), - // MaxSizeBytes: to.Ptr[int64](263882790666240), - // ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled), - // RequestedServiceObjectiveName: to.Ptr("DW1000c"), - // Status: to.Ptr(armsql.DatabaseStatusOnline), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("DataWarehouse"), - // Capacity: to.Ptr[int32](9000), - // Tier: to.Ptr("DataWarehouse"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CreateDwDatabaseCrossSubscriptionPITR.json -func ExampleDatabasesClient_BeginCreateOrUpdate_createsADataWarehouseDatabaseAsACrossSubscriptionRestoreFromARestorePointOfAnExistingDatabase() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdw", armsql.Database{ - Location: to.Ptr("southeastasia"), - Properties: &armsql.DatabaseProperties{ - CreateMode: to.Ptr(armsql.CreateModePointInTimeRestore), - RestorePointInTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-22T05:35:31.503Z"); return t }()), - SourceResourceID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/srcsvr/databases/srcdw"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Database = armsql.Database{ - // Name: to.Ptr("testdw"), - // Type: to.Ptr("Microsoft.Sql/servers/databases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdw"), - // Location: to.Ptr("southeastasia"), - // Kind: to.Ptr("v12.0,user,datawarehouse,gen2"), - // Properties: &armsql.DatabaseProperties{ - // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-24T06:46:14.99Z"); return t}()), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // CurrentServiceObjectiveName: to.Ptr("DW1000c"), - // CurrentSKU: &armsql.SKU{ - // Name: to.Ptr("DataWarehouse"), - // Capacity: to.Ptr[int32](9000), - // Tier: to.Ptr("DataWarehouse"), - // }, - // DatabaseID: to.Ptr("188784c9-d602-4684-86cf-e67b6f03551a"), - // DefaultSecondaryLocation: to.Ptr("eastus"), - // MaxSizeBytes: to.Ptr[int64](263882790666240), - // ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled), - // RequestedServiceObjectiveName: to.Ptr("DW1000c"), - // Status: to.Ptr(armsql.DatabaseStatusOnline), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("DataWarehouse"), - // Capacity: to.Ptr[int32](9000), - // Tier: to.Ptr("DataWarehouse"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CreateDatabaseCopyMode.json -func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseAsACopy() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "dbcopy", armsql.Database{ - Location: to.Ptr("southeastasia"), - Properties: &armsql.DatabaseProperties{ - CreateMode: to.Ptr(armsql.CreateModeCopy), - SourceDatabaseID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"), - }, - SKU: &armsql.SKU{ - Name: to.Ptr("S0"), - Tier: to.Ptr("Standard"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Database = armsql.Database{ - // Name: to.Ptr("dbcopy"), - // Type: to.Ptr("Microsoft.Sql/servers/databases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/dbcopy"), - // Location: to.Ptr("southeastasia"), - // Kind: to.Ptr("v12.0,user"), - // Properties: &armsql.DatabaseProperties{ - // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // CurrentServiceObjectiveName: to.Ptr("S0"), - // CurrentSKU: &armsql.SKU{ - // Name: to.Ptr("Standard"), - // Capacity: to.Ptr[int32](10), - // Tier: to.Ptr("Standard"), - // }, - // DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"), - // DefaultSecondaryLocation: to.Ptr("North Europe"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()), - // IsInfraEncryptionEnabled: to.Ptr(false), - // IsLedgerOn: to.Ptr(false), - // MaxSizeBytes: to.Ptr[int64](268435456000), - // ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled), - // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // RequestedServiceObjectiveName: to.Ptr("S0"), - // Status: to.Ptr(armsql.DatabaseStatusOnline), - // ZoneRedundant: to.Ptr(false), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("Standard"), - // Capacity: to.Ptr[int32](10), - // Tier: to.Ptr("Standard"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CreateDatabaseStandbyMode.json -func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseAsAStandbySecondary() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.Database{ - Location: to.Ptr("southeastasia"), - Properties: &armsql.DatabaseProperties{ - CreateMode: to.Ptr(armsql.CreateModeSecondary), - SecondaryType: to.Ptr(armsql.SecondaryTypeStandby), - SourceDatabaseID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-NorthEurope/providers/Microsoft.Sql/servers/testsvr1/databases/testdb"), - }, - SKU: &armsql.SKU{ - Name: to.Ptr("S0"), - Tier: to.Ptr("Standard"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Database = armsql.Database{ - // Name: to.Ptr("testdb"), - // Type: to.Ptr("Microsoft.Sql/servers/databases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"), - // Location: to.Ptr("southeastasia"), - // Kind: to.Ptr("v12.0,user"), - // Properties: &armsql.DatabaseProperties{ - // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // CurrentServiceObjectiveName: to.Ptr("S0"), - // CurrentSKU: &armsql.SKU{ - // Name: to.Ptr("Standard"), - // Capacity: to.Ptr[int32](10), - // Tier: to.Ptr("Standard"), - // }, - // DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"), - // DefaultSecondaryLocation: to.Ptr("North Europe"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()), - // IsInfraEncryptionEnabled: to.Ptr(false), - // IsLedgerOn: to.Ptr(false), - // MaxSizeBytes: to.Ptr[int64](268435456000), - // ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled), - // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // RequestedServiceObjectiveName: to.Ptr("S0"), - // SecondaryType: to.Ptr(armsql.SecondaryTypeStandby), - // Status: to.Ptr(armsql.DatabaseStatusOnline), - // ZoneRedundant: to.Ptr(false), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("Standard"), - // Capacity: to.Ptr[int32](10), - // Tier: to.Ptr("Standard"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CreateDatabaseSecondaryMode.json -func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseAsAnOnLineSecondary() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.Database{ - Location: to.Ptr("southeastasia"), - Properties: &armsql.DatabaseProperties{ - CreateMode: to.Ptr(armsql.CreateModeSecondary), - SecondaryType: to.Ptr(armsql.SecondaryTypeGeo), - SourceDatabaseID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-NorthEurope/providers/Microsoft.Sql/servers/testsvr1/databases/testdb"), - }, - SKU: &armsql.SKU{ - Name: to.Ptr("S0"), - Tier: to.Ptr("Standard"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Database = armsql.Database{ - // Name: to.Ptr("testdb"), - // Type: to.Ptr("Microsoft.Sql/servers/databases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"), - // Location: to.Ptr("southeastasia"), - // Kind: to.Ptr("v12.0,user"), - // Properties: &armsql.DatabaseProperties{ - // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // CurrentServiceObjectiveName: to.Ptr("S0"), - // CurrentSKU: &armsql.SKU{ - // Name: to.Ptr("Standard"), - // Capacity: to.Ptr[int32](10), - // Tier: to.Ptr("Standard"), - // }, - // DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"), - // DefaultSecondaryLocation: to.Ptr("North Europe"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()), - // IsInfraEncryptionEnabled: to.Ptr(false), - // IsLedgerOn: to.Ptr(false), - // MaxSizeBytes: to.Ptr[int64](268435456000), - // ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled), - // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // RequestedServiceObjectiveName: to.Ptr("S0"), - // SecondaryType: to.Ptr(armsql.SecondaryTypeGeo), - // Status: to.Ptr(armsql.DatabaseStatusOnline), - // ZoneRedundant: to.Ptr(false), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("Standard"), - // Capacity: to.Ptr[int32](10), - // Tier: to.Ptr("Standard"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CreateDatabaseNamedReplica.json -func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseAsNamedReplicaSecondary() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.Database{ - Location: to.Ptr("southeastasia"), - Properties: &armsql.DatabaseProperties{ - CreateMode: to.Ptr(armsql.CreateModeSecondary), - SecondaryType: to.Ptr(armsql.SecondaryTypeNamed), - SourceDatabaseID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-NorthEurope/providers/Microsoft.Sql/servers/testsvr1/databases/primarydb"), - }, - SKU: &armsql.SKU{ - Name: to.Ptr("HS_Gen4"), - Capacity: to.Ptr[int32](2), - Tier: to.Ptr("Hyperscale"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Database = armsql.Database{ - // Name: to.Ptr("testdb"), - // Type: to.Ptr("Microsoft.Sql/servers/databases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"), - // Location: to.Ptr("southeastasia"), - // Kind: to.Ptr("v12.0,user,vcore,hyperscale"), - // Properties: &armsql.DatabaseProperties{ - // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // CurrentServiceObjectiveName: to.Ptr("HS_Gen4_2"), - // CurrentSKU: &armsql.SKU{ - // Name: to.Ptr("HS_Gen4"), - // Capacity: to.Ptr[int32](2), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr("Hyperscale"), - // }, - // DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"), - // DefaultSecondaryLocation: to.Ptr("North Europe"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()), - // HighAvailabilityReplicaCount: to.Ptr[int32](0), - // IsInfraEncryptionEnabled: to.Ptr(false), - // IsLedgerOn: to.Ptr(false), - // LicenseType: to.Ptr(armsql.DatabaseLicenseTypeLicenseIncluded), - // MaxSizeBytes: to.Ptr[int64](-1), - // ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled), - // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // RequestedServiceObjectiveName: to.Ptr("HS_Gen4_2"), - // SecondaryType: to.Ptr(armsql.SecondaryTypeNamed), - // Status: to.Ptr(armsql.DatabaseStatusOnline), - // ZoneRedundant: to.Ptr(false), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("HS_Gen4"), - // Capacity: to.Ptr[int32](2), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr("Hyperscale"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CreateDatabasePITRMode.json -func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseFromPointInTimeRestore() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "dbpitr", armsql.Database{ - Location: to.Ptr("southeastasia"), - Properties: &armsql.DatabaseProperties{ - CreateMode: to.Ptr(armsql.CreateModePointInTimeRestore), - RestorePointInTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-22T05:35:31.503Z"); return t }()), - SourceDatabaseID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SoutheastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Database = armsql.Database{ - // Name: to.Ptr("dbpitr"), - // Type: to.Ptr("Microsoft.Sql/servers/databases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SoutheastAsia/providers/Microsoft.Sql/servers/testsvr/databases/dbpitr"), - // Location: to.Ptr("SoutheastAsia"), - // Kind: to.Ptr("v12.0,user"), - // Properties: &armsql.DatabaseProperties{ - // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-23T20:31:35.807Z"); return t}()), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // CurrentServiceObjectiveName: to.Ptr("S0"), - // CurrentSKU: &armsql.SKU{ - // Name: to.Ptr("Standard"), - // Capacity: to.Ptr[int32](10), - // Tier: to.Ptr("Standard"), - // }, - // DatabaseID: to.Ptr("2463ef48-53e2-4c26-9781-2d7138080bfd"), - // DefaultSecondaryLocation: to.Ptr("SoutheastAsia"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-23T20:47:37Z"); return t}()), - // IsInfraEncryptionEnabled: to.Ptr(false), - // IsLedgerOn: to.Ptr(false), - // MaxSizeBytes: to.Ptr[int64](268435456000), - // ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled), - // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // RequestedServiceObjectiveName: to.Ptr("S0"), - // Status: to.Ptr(armsql.DatabaseStatusOnline), - // ZoneRedundant: to.Ptr(false), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("Standard"), - // Capacity: to.Ptr[int32](10), - // Tier: to.Ptr("Standard"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CreateDatabaseDefaultEnclave.json -func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseWithDefaultEnclaveType() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.Database{ - Location: to.Ptr("southeastasia"), - Properties: &armsql.DatabaseProperties{ - PreferredEnclaveType: to.Ptr(armsql.AlwaysEncryptedEnclaveTypeDefault), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Database = armsql.Database{ - // Name: to.Ptr("testdb"), - // Type: to.Ptr("Microsoft.Sql/servers/databases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"), - // Location: to.Ptr("southeastasia"), - // Kind: to.Ptr("v12.0,user"), - // Properties: &armsql.DatabaseProperties{ - // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // CurrentServiceObjectiveName: to.Ptr("S0"), - // CurrentSKU: &armsql.SKU{ - // Name: to.Ptr("Standard"), - // Capacity: to.Ptr[int32](10), - // Tier: to.Ptr("Standard"), - // }, - // DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"), - // DefaultSecondaryLocation: to.Ptr("North Europe"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()), - // MaxSizeBytes: to.Ptr[int64](268435456000), - // PreferredEnclaveType: to.Ptr(armsql.AlwaysEncryptedEnclaveTypeDefault), - // ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled), - // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // RequestedServiceObjectiveName: to.Ptr("S0"), - // Status: to.Ptr(armsql.DatabaseStatusOnline), - // ZoneRedundant: to.Ptr(false), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("Standard"), - // Capacity: to.Ptr[int32](10), - // Tier: to.Ptr("Standard"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CreateDatabaseVBSEnclave.json -func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseWithVbsEnclaveType() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.Database{ - Location: to.Ptr("southeastasia"), - Properties: &armsql.DatabaseProperties{ - PreferredEnclaveType: to.Ptr(armsql.AlwaysEncryptedEnclaveTypeVBS), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Database = armsql.Database{ - // Name: to.Ptr("testdb"), - // Type: to.Ptr("Microsoft.Sql/servers/databases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"), - // Location: to.Ptr("southeastasia"), - // Kind: to.Ptr("v12.0,user"), - // Properties: &armsql.DatabaseProperties{ - // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // CurrentServiceObjectiveName: to.Ptr("S0"), - // CurrentSKU: &armsql.SKU{ - // Name: to.Ptr("Standard"), - // Capacity: to.Ptr[int32](10), - // Tier: to.Ptr("Standard"), - // }, - // DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"), - // DefaultSecondaryLocation: to.Ptr("North Europe"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()), - // MaxSizeBytes: to.Ptr[int64](268435456000), - // PreferredEnclaveType: to.Ptr(armsql.AlwaysEncryptedEnclaveTypeVBS), - // ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled), - // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // RequestedServiceObjectiveName: to.Ptr("S0"), - // Status: to.Ptr(armsql.DatabaseStatusOnline), - // ZoneRedundant: to.Ptr(false), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("Standard"), - // Capacity: to.Ptr[int32](10), - // Tier: to.Ptr("Standard"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CreateDatabaseWithAvailabilityZone.json -func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseWithAvailabilityZoneSpecified() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.Database{ - Location: to.Ptr("southeastasia"), - Properties: &armsql.DatabaseProperties{ - AvailabilityZone: to.Ptr(armsql.AvailabilityZoneTypeOne), - Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - CreateMode: to.Ptr(armsql.CreateModeDefault), - MaxSizeBytes: to.Ptr[int64](1073741824), - }, - SKU: &armsql.SKU{ - Name: to.Ptr("S0"), - Tier: to.Ptr("Standard"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Database = armsql.Database{ - // Name: to.Ptr("testdb"), - // Type: to.Ptr("Microsoft.Sql/servers/databases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"), - // Location: to.Ptr("southeastasia"), - // Kind: to.Ptr("v12.0,user"), - // Properties: &armsql.DatabaseProperties{ - // AvailabilityZone: to.Ptr(armsql.AvailabilityZoneTypeOne), - // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // CurrentServiceObjectiveName: to.Ptr("S0"), - // CurrentSKU: &armsql.SKU{ - // Name: to.Ptr("Standard"), - // Capacity: to.Ptr[int32](10), - // Tier: to.Ptr("Standard"), - // }, - // DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"), - // DefaultSecondaryLocation: to.Ptr("North Europe"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()), - // IsInfraEncryptionEnabled: to.Ptr(false), - // IsLedgerOn: to.Ptr(false), - // MaxSizeBytes: to.Ptr[int64](1073741824), - // ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled), - // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // RequestedServiceObjectiveName: to.Ptr("S0"), - // Status: to.Ptr(armsql.DatabaseStatusOnline), - // ZoneRedundant: to.Ptr(false), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("S0"), - // Capacity: to.Ptr[int32](10), - // Tier: to.Ptr("Standard"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CreateDatabaseDefaultModeWithKeysAndEncryptionProtector.json -func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseWithDatabaseLevelCustomerManagedKeys() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.Database{ - Location: to.Ptr("southeastasia"), - Identity: &armsql.DatabaseIdentity{ - Type: to.Ptr(armsql.DatabaseIdentityTypeUserAssigned), - UserAssignedIdentities: map[string]*armsql.DatabaseUserIdentity{ - "/subscriptions/00000000-1111-2222-3333-444444444444/resourcegroups/Default-SQL-SouthEastAsia/providers/Microsoft.ManagedIdentity/userAssignedIdentities/umi": {}, - }, - }, - Properties: &armsql.DatabaseProperties{ - Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - CreateMode: to.Ptr(armsql.CreateModeDefault), - EncryptionProtector: to.Ptr("https://your-key-vault-name.vault.azure.net/yourKey/yourKeyVersion"), - Keys: map[string]*armsql.DatabaseKey{ - "https://your-key-vault-name.vault.azure.net/yourKey/yourKeyVersion": {}, - "https://your-key-vault-name.vault.azure.net/yourKey2/yourKey2Version": {}, - }, - MaxSizeBytes: to.Ptr[int64](1073741824), - }, - SKU: &armsql.SKU{ - Name: to.Ptr("S0"), - Tier: to.Ptr("Standard"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Database = armsql.Database{ - // Name: to.Ptr("testdb"), - // Type: to.Ptr("Microsoft.Sql/servers/databases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"), - // Location: to.Ptr("southeastasia"), - // Kind: to.Ptr("v12.0,user"), - // Properties: &armsql.DatabaseProperties{ - // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // CurrentServiceObjectiveName: to.Ptr("S0"), - // CurrentSKU: &armsql.SKU{ - // Name: to.Ptr("Standard"), - // Capacity: to.Ptr[int32](10), - // Tier: to.Ptr("Standard"), - // }, - // DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"), - // DefaultSecondaryLocation: to.Ptr("North Europe"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()), - // IsInfraEncryptionEnabled: to.Ptr(false), - // IsLedgerOn: to.Ptr(false), - // MaxSizeBytes: to.Ptr[int64](1073741824), - // ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled), - // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // RequestedServiceObjectiveName: to.Ptr("S0"), - // Status: to.Ptr(armsql.DatabaseStatusOnline), - // ZoneRedundant: to.Ptr(false), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("S0"), - // Capacity: to.Ptr[int32](10), - // Tier: to.Ptr("Standard"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CreateDatabaseDefaultMode.json -func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseWithDefaultMode() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.Database{ - Location: to.Ptr("southeastasia"), - Properties: &armsql.DatabaseProperties{ - Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - CreateMode: to.Ptr(armsql.CreateModeDefault), - MaxSizeBytes: to.Ptr[int64](1073741824), - }, - SKU: &armsql.SKU{ - Name: to.Ptr("S0"), - Tier: to.Ptr("Standard"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Database = armsql.Database{ - // Name: to.Ptr("testdb"), - // Type: to.Ptr("Microsoft.Sql/servers/databases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"), - // Location: to.Ptr("southeastasia"), - // Kind: to.Ptr("v12.0,user"), - // Properties: &armsql.DatabaseProperties{ - // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // CurrentServiceObjectiveName: to.Ptr("S0"), - // CurrentSKU: &armsql.SKU{ - // Name: to.Ptr("Standard"), - // Capacity: to.Ptr[int32](10), - // Tier: to.Ptr("Standard"), - // }, - // DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"), - // DefaultSecondaryLocation: to.Ptr("North Europe"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()), - // IsInfraEncryptionEnabled: to.Ptr(false), - // IsLedgerOn: to.Ptr(false), - // MaxSizeBytes: to.Ptr[int64](1073741824), - // ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled), - // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // RequestedServiceObjectiveName: to.Ptr("S0"), - // Status: to.Ptr(armsql.DatabaseStatusOnline), - // ZoneRedundant: to.Ptr(false), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("S0"), - // Capacity: to.Ptr[int32](10), - // Tier: to.Ptr("Standard"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CreateDatabaseLedger.json -func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseWithLedgerOn() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.Database{ - Location: to.Ptr("southeastasia"), - Properties: &armsql.DatabaseProperties{ - IsLedgerOn: 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.Database = armsql.Database{ - // Name: to.Ptr("testdb"), - // Type: to.Ptr("Microsoft.Sql/servers/databases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"), - // Location: to.Ptr("southeastasia"), - // Kind: to.Ptr("v12.0,user"), - // Properties: &armsql.DatabaseProperties{ - // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // CurrentServiceObjectiveName: to.Ptr("S0"), - // CurrentSKU: &armsql.SKU{ - // Name: to.Ptr("Standard"), - // Capacity: to.Ptr[int32](10), - // Tier: to.Ptr("Standard"), - // }, - // DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"), - // DefaultSecondaryLocation: to.Ptr("North Europe"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()), - // IsLedgerOn: to.Ptr(true), - // MaxSizeBytes: to.Ptr[int64](268435456000), - // ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled), - // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // RequestedServiceObjectiveName: to.Ptr("S0"), - // Status: to.Ptr(armsql.DatabaseStatusOnline), - // ZoneRedundant: to.Ptr(false), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("Standard"), - // Capacity: to.Ptr[int32](10), - // Tier: to.Ptr("Standard"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CreateDatabaseMin.json -func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseWithMinimumNumberOfParameters() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.Database{ - Location: to.Ptr("southeastasia"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Database = armsql.Database{ - // Name: to.Ptr("testdb"), - // Type: to.Ptr("Microsoft.Sql/servers/databases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"), - // Location: to.Ptr("southeastasia"), - // Kind: to.Ptr("v12.0,user"), - // Properties: &armsql.DatabaseProperties{ - // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // CurrentServiceObjectiveName: to.Ptr("S0"), - // CurrentSKU: &armsql.SKU{ - // Name: to.Ptr("Standard"), - // Capacity: to.Ptr[int32](10), - // Tier: to.Ptr("Standard"), - // }, - // DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"), - // DefaultSecondaryLocation: to.Ptr("North Europe"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()), - // IsInfraEncryptionEnabled: to.Ptr(false), - // IsLedgerOn: to.Ptr(false), - // MaxSizeBytes: to.Ptr[int64](268435456000), - // ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled), - // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // RequestedServiceObjectiveName: to.Ptr("S0"), - // Status: to.Ptr(armsql.DatabaseStatusOnline), - // ZoneRedundant: to.Ptr(false), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("Standard"), - // Capacity: to.Ptr[int32](10), - // Tier: to.Ptr("Standard"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CreateDatabaseMaintenanceConfiguration.json -func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseWithPreferredMaintenanceWindow() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.Database{ - Location: to.Ptr("southeastasia"), - Properties: &armsql.DatabaseProperties{ - Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - CreateMode: to.Ptr(armsql.CreateModeDefault), - MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_SouthEastAsia_1"), - MaxSizeBytes: to.Ptr[int64](1073741824), - }, - SKU: &armsql.SKU{ - Name: to.Ptr("S2"), - Tier: to.Ptr("Standard"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Database = armsql.Database{ - // Name: to.Ptr("testdb"), - // Type: to.Ptr("Microsoft.Sql/servers/databases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"), - // Location: to.Ptr("southeastasia"), - // Kind: to.Ptr("v12.0,user"), - // Properties: &armsql.DatabaseProperties{ - // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // CurrentServiceObjectiveName: to.Ptr("S2"), - // CurrentSKU: &armsql.SKU{ - // Name: to.Ptr("Standard"), - // Capacity: to.Ptr[int32](50), - // Tier: to.Ptr("Standard"), - // }, - // DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"), - // DefaultSecondaryLocation: to.Ptr("North Europe"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-08-29T06:41:18.283Z"); return t}()), - // IsInfraEncryptionEnabled: to.Ptr(false), - // IsLedgerOn: to.Ptr(false), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_SouthEastAsia_1"), - // MaxSizeBytes: to.Ptr[int64](1073741824), - // ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled), - // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // Status: to.Ptr(armsql.DatabaseStatusOnline), - // ZoneRedundant: to.Ptr(false), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("S2"), - // Tier: to.Ptr("Standard"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CreateDatabaseConfiguredBackupStorageRedundancy.json -func ExampleDatabasesClient_BeginCreateOrUpdate_createsADatabaseWithSpecifiedBackupStorageRedundancy() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.Database{ - Location: to.Ptr("southeastasia"), - Properties: &armsql.DatabaseProperties{ - RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyZone), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Database = armsql.Database{ - // Name: to.Ptr("testdb"), - // Type: to.Ptr("Microsoft.Sql/servers/databases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"), - // Location: to.Ptr("southeastasia"), - // Kind: to.Ptr("v12.0,user"), - // Properties: &armsql.DatabaseProperties{ - // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyZone), - // CurrentServiceObjectiveName: to.Ptr("S0"), - // CurrentSKU: &armsql.SKU{ - // Name: to.Ptr("Standard"), - // Capacity: to.Ptr[int32](10), - // Tier: to.Ptr("Standard"), - // }, - // DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"), - // DefaultSecondaryLocation: to.Ptr("North Europe"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()), - // IsInfraEncryptionEnabled: to.Ptr(false), - // IsLedgerOn: to.Ptr(false), - // MaxSizeBytes: to.Ptr[int64](268435456000), - // ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled), - // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyZone), - // RequestedServiceObjectiveName: to.Ptr("S0"), - // Status: to.Ptr(armsql.DatabaseStatusOnline), - // ZoneRedundant: to.Ptr(false), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("Standard"), - // Capacity: to.Ptr[int32](10), - // Tier: to.Ptr("Standard"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/UpdateDatabaseHyperscaleMigrationWithManualCutover.json -func ExampleDatabasesClient_BeginCreateOrUpdate_updatesADatabaseToHyperscaleSloWithManualCutover() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.Database{ - Location: to.Ptr("southeastasia"), - Identity: &armsql.DatabaseIdentity{ - Type: to.Ptr(armsql.DatabaseIdentityTypeUserAssigned), - UserAssignedIdentities: map[string]*armsql.DatabaseUserIdentity{ - "/subscriptions/00000000-1111-2222-3333-444444444444/resourcegroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/userAssignedIdentities/umi": {}, - "/subscriptions/00000000-1111-2222-3333-444444444444/resourcegroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/userAssignedIdentities/umiToDelete": nil, - }, - }, - Properties: &armsql.DatabaseProperties{ - ManualCutover: to.Ptr(true), - }, - SKU: &armsql.SKU{ - Name: to.Ptr("HS_Gen5_2"), - Tier: to.Ptr("Hyperscale"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Database = armsql.Database{ - // Name: to.Ptr("testdb"), - // Type: to.Ptr("Microsoft.Sql/servers/databases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"), - // Location: to.Ptr("southeastasia"), - // Kind: to.Ptr("v12.0,user,vcore"), - // Properties: &armsql.DatabaseProperties{ - // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-12-08T12:41:23.953Z"); return t}()), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // CurrentServiceObjectiveName: to.Ptr("GP_Gen5_2"), - // CurrentSKU: &armsql.SKU{ - // Name: to.Ptr("GP_Gen5"), - // Capacity: to.Ptr[int32](2), - // Family: to.Ptr("Gen5"), - // Tier: to.Ptr("GeneralPurpose"), - // }, - // DatabaseID: to.Ptr("dad50ee1-9fbb-4fb9-bd2b-5786d175ce3c"), - // DefaultSecondaryLocation: to.Ptr("North Europe"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-12-08T12:42:00Z"); return t}()), - // IsInfraEncryptionEnabled: to.Ptr(false), - // IsLedgerOn: to.Ptr(false), - // LicenseType: to.Ptr(armsql.DatabaseLicenseTypeLicenseIncluded), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default"), - // MaxLogSizeBytes: to.Ptr[int64](193273528320), - // MaxSizeBytes: to.Ptr[int64](34359738368), - // ReadScale: to.Ptr(armsql.DatabaseReadScaleEnabled), - // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // RequestedServiceObjectiveName: to.Ptr("HS_Gen5_2"), - // Status: to.Ptr(armsql.DatabaseStatusOnline), - // ZoneRedundant: to.Ptr(false), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("HS_Gen5"), - // Capacity: to.Ptr[int32](2), - // Family: to.Ptr("Gen5"), - // Tier: to.Ptr("Hyperscale"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/UpdateDatabaseHyperscaleMigrationPerformCutover.json -func ExampleDatabasesClient_BeginCreateOrUpdate_updatesADatabaseToHyperscaleTierByTriggeringManualCutoverDuringMigrationWorkflow() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.Database{ - Location: to.Ptr("southeastasia"), - Identity: &armsql.DatabaseIdentity{ - Type: to.Ptr(armsql.DatabaseIdentityTypeUserAssigned), - UserAssignedIdentities: map[string]*armsql.DatabaseUserIdentity{ - "/subscriptions/00000000-1111-2222-3333-444444444444/resourcegroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/userAssignedIdentities/umi": {}, - "/subscriptions/00000000-1111-2222-3333-444444444444/resourcegroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/userAssignedIdentities/umiToDelete": nil, - }, - }, - Properties: &armsql.DatabaseProperties{ - PerformCutover: 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.Database = armsql.Database{ - // Name: to.Ptr("testdb"), - // Type: to.Ptr("Microsoft.Sql/servers/databases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"), - // Location: to.Ptr("southeastasia"), - // Kind: to.Ptr("v12.0,user,vcore"), - // Properties: &armsql.DatabaseProperties{ - // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-12-08T12:41:23.953Z"); return t}()), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // CurrentServiceObjectiveName: to.Ptr("GP_Gen5_2"), - // CurrentSKU: &armsql.SKU{ - // Name: to.Ptr("GP_Gen5"), - // Capacity: to.Ptr[int32](2), - // Family: to.Ptr("Gen5"), - // Tier: to.Ptr("GeneralPurpose"), - // }, - // DatabaseID: to.Ptr("dad50ee1-9fbb-4fb9-bd2b-5786d175ce3c"), - // DefaultSecondaryLocation: to.Ptr("North Europe"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-12-08T12:42:00Z"); return t}()), - // IsInfraEncryptionEnabled: to.Ptr(false), - // IsLedgerOn: to.Ptr(false), - // LicenseType: to.Ptr(armsql.DatabaseLicenseTypeLicenseIncluded), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default"), - // MaxLogSizeBytes: to.Ptr[int64](193273528320), - // MaxSizeBytes: to.Ptr[int64](34359738368), - // ReadScale: to.Ptr(armsql.DatabaseReadScaleEnabled), - // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // RequestedServiceObjectiveName: to.Ptr("HS_Gen5_2"), - // Status: to.Ptr(armsql.DatabaseStatusOnline), - // ZoneRedundant: to.Ptr(false), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("HS_Gen5"), - // Capacity: to.Ptr[int32](2), - // Family: to.Ptr("Gen5"), - // Tier: to.Ptr("Hyperscale"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/DeleteDatabase.json -func ExampleDatabasesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatabasesClient().BeginDelete(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", 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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/PatchVCoreDatabaseAssignMaintenanceConfiguration.json -func ExampleDatabasesClient_BeginUpdate_assignsMaintenanceWindowToADatabase() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatabasesClient().BeginUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.DatabaseUpdate{ - Properties: &armsql.DatabaseUpdateProperties{ - MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_SouthEastAsia_1"), - }, - SKU: &armsql.SKU{ - Name: to.Ptr("BC_Gen5_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.Database = armsql.Database{ - // Name: to.Ptr("testdb"), - // Type: to.Ptr("Microsoft.Sql/servers/databases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"), - // Location: to.Ptr("southeastasia"), - // Kind: to.Ptr("v12.0,user,vcore"), - // Properties: &armsql.DatabaseProperties{ - // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // CurrentServiceObjectiveName: to.Ptr("BC_Gen5_2"), - // CurrentSKU: &armsql.SKU{ - // Name: to.Ptr("BC_Gen5"), - // Capacity: to.Ptr[int32](4), - // Tier: to.Ptr("BusinessCritical"), - // }, - // DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"), - // DefaultSecondaryLocation: to.Ptr("North Europe"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()), - // IsInfraEncryptionEnabled: to.Ptr(false), - // IsLedgerOn: to.Ptr(false), - // LicenseType: to.Ptr(armsql.DatabaseLicenseTypeLicenseIncluded), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_SouthEastAsia_1"), - // MaxLogSizeBytes: to.Ptr[int64](104857600), - // MaxSizeBytes: to.Ptr[int64](1073741824), - // ReadScale: to.Ptr(armsql.DatabaseReadScaleEnabled), - // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // RequestedServiceObjectiveName: to.Ptr("BC_Gen5_2"), - // Status: to.Ptr(armsql.DatabaseStatusOnline), - // ZoneRedundant: to.Ptr(false), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("BC_Gen5"), - // Capacity: to.Ptr[int32](4), - // Tier: to.Ptr("BusinessCritical"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/PatchDatabaseVBSEnclave.json -func ExampleDatabasesClient_BeginUpdate_createsADatabaseWithVbsEnclaveType() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatabasesClient().BeginUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.DatabaseUpdate{ - Properties: &armsql.DatabaseUpdateProperties{ - PreferredEnclaveType: to.Ptr(armsql.AlwaysEncryptedEnclaveTypeVBS), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Database = armsql.Database{ - // Name: to.Ptr("testdb"), - // Type: to.Ptr("Microsoft.Sql/servers/databases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"), - // Location: to.Ptr("southeastasia"), - // Kind: to.Ptr("v12.0,user"), - // Properties: &armsql.DatabaseProperties{ - // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // CurrentServiceObjectiveName: to.Ptr("S0"), - // CurrentSKU: &armsql.SKU{ - // Name: to.Ptr("Standard"), - // Capacity: to.Ptr[int32](10), - // Tier: to.Ptr("Standard"), - // }, - // DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"), - // DefaultSecondaryLocation: to.Ptr("North Europe"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()), - // MaxSizeBytes: to.Ptr[int64](268435456000), - // PreferredEnclaveType: to.Ptr(armsql.AlwaysEncryptedEnclaveTypeVBS), - // ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled), - // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // RequestedServiceObjectiveName: to.Ptr("S0"), - // Status: to.Ptr(armsql.DatabaseStatusOnline), - // ZoneRedundant: to.Ptr(false), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("Standard"), - // Capacity: to.Ptr[int32](10), - // Tier: to.Ptr("Standard"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/PatchVCoreDatabaseWithKeysAndEncryptionProtector.json -func ExampleDatabasesClient_BeginUpdate_patchADatabaseWithDatabaseLevelCustomerManagedKeys() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatabasesClient().BeginUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.DatabaseUpdate{ - Identity: &armsql.DatabaseIdentity{ - Type: to.Ptr(armsql.DatabaseIdentityTypeUserAssigned), - UserAssignedIdentities: map[string]*armsql.DatabaseUserIdentity{ - "/subscriptions/00000000-1111-2222-3333-444444444444/resourcegroups/Default-SQL-SouthEastAsia/providers/Microsoft.ManagedIdentity/userAssignedIdentities/umi": {}, - "/subscriptions/00000000-1111-2222-3333-444444444444/resourcegroups/Default-SQL-SouthEastAsia/providers/Microsoft.ManagedIdentity/userAssignedIdentities/umiToDelete": nil, - }, - }, - Properties: &armsql.DatabaseUpdateProperties{ - EncryptionProtector: to.Ptr("https://your-key-vault-name.vault.azure.net/yourKey/yourKeyVersion"), - Keys: map[string]*armsql.DatabaseKey{ - "https://your-key-vault-name.vault.azure.net/yourKey/yourKeyVersion": {}, - "https://your-key-vault-name.vault.azure.net/yourKey2/yourKey2VersionToDelete": nil, - }, - }, - SKU: &armsql.SKU{ - Name: to.Ptr("S0"), - Tier: to.Ptr("Standard"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Database = armsql.Database{ - // Name: to.Ptr("testdb"), - // Type: to.Ptr("Microsoft.Sql/servers/databases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"), - // Location: to.Ptr("southeastasia"), - // Kind: to.Ptr("v12.0,user,vcore"), - // Properties: &armsql.DatabaseProperties{ - // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // CurrentServiceObjectiveName: to.Ptr("BC_Gen4_2"), - // CurrentSKU: &armsql.SKU{ - // Name: to.Ptr("BC_Gen4"), - // Capacity: to.Ptr[int32](4), - // Tier: to.Ptr("BusinessCritical"), - // }, - // DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"), - // DefaultSecondaryLocation: to.Ptr("North Europe"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()), - // IsInfraEncryptionEnabled: to.Ptr(false), - // IsLedgerOn: to.Ptr(false), - // LicenseType: to.Ptr(armsql.DatabaseLicenseTypeLicenseIncluded), - // MaxLogSizeBytes: to.Ptr[int64](104857600), - // MaxSizeBytes: to.Ptr[int64](1073741824), - // ReadScale: to.Ptr(armsql.DatabaseReadScaleEnabled), - // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyLocal), - // RequestedServiceObjectiveName: to.Ptr("BC_Gen4_2"), - // Status: to.Ptr(armsql.DatabaseStatusOnline), - // ZoneRedundant: to.Ptr(false), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("BC_Gen4"), - // Capacity: to.Ptr[int32](4), - // Tier: to.Ptr("BusinessCritical"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/PatchVCoreDatabaseResetMaintenanceConfiguration.json -func ExampleDatabasesClient_BeginUpdate_resetsMaintenanceWindowOfADatabaseToDefault() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatabasesClient().BeginUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.DatabaseUpdate{ - Properties: &armsql.DatabaseUpdateProperties{ - MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default"), - }, - SKU: &armsql.SKU{ - Name: to.Ptr("BC_Gen5_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.Database = armsql.Database{ - // Name: to.Ptr("testdb"), - // Type: to.Ptr("Microsoft.Sql/servers/databases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"), - // Location: to.Ptr("southeastasia"), - // Kind: to.Ptr("v12.0,user,vcore"), - // Properties: &armsql.DatabaseProperties{ - // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // CurrentServiceObjectiveName: to.Ptr("BC_Gen5_4"), - // CurrentSKU: &armsql.SKU{ - // Name: to.Ptr("BC_Gen5"), - // Capacity: to.Ptr[int32](4), - // Tier: to.Ptr("BusinessCritical"), - // }, - // DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"), - // DefaultSecondaryLocation: to.Ptr("North Europe"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()), - // IsInfraEncryptionEnabled: to.Ptr(false), - // IsLedgerOn: to.Ptr(false), - // LicenseType: to.Ptr(armsql.DatabaseLicenseTypeLicenseIncluded), - // MaxLogSizeBytes: to.Ptr[int64](104857600), - // MaxSizeBytes: to.Ptr[int64](1073741824), - // ReadScale: to.Ptr(armsql.DatabaseReadScaleEnabled), - // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // RequestedServiceObjectiveName: to.Ptr("BC_Gen5_4"), - // Status: to.Ptr(armsql.DatabaseStatusOnline), - // ZoneRedundant: to.Ptr(false), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("BC_Gen5"), - // Capacity: to.Ptr[int32](4), - // Tier: to.Ptr("BusinessCritical"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/PatchDatabaseDefaultEnclave.json -func ExampleDatabasesClient_BeginUpdate_updatesADatabaseWithDefaultEnclaveType() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatabasesClient().BeginUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.DatabaseUpdate{ - Properties: &armsql.DatabaseUpdateProperties{ - PreferredEnclaveType: to.Ptr(armsql.AlwaysEncryptedEnclaveTypeDefault), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Database = armsql.Database{ - // Name: to.Ptr("testdb"), - // Type: to.Ptr("Microsoft.Sql/servers/databases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"), - // Location: to.Ptr("southeastasia"), - // Kind: to.Ptr("v12.0,user"), - // Properties: &armsql.DatabaseProperties{ - // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // CurrentServiceObjectiveName: to.Ptr("S0"), - // CurrentSKU: &armsql.SKU{ - // Name: to.Ptr("Standard"), - // Capacity: to.Ptr[int32](10), - // Tier: to.Ptr("Standard"), - // }, - // DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"), - // DefaultSecondaryLocation: to.Ptr("North Europe"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()), - // MaxSizeBytes: to.Ptr[int64](268435456000), - // PreferredEnclaveType: to.Ptr(armsql.AlwaysEncryptedEnclaveTypeDefault), - // ReadScale: to.Ptr(armsql.DatabaseReadScaleDisabled), - // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // RequestedServiceObjectiveName: to.Ptr("S0"), - // Status: to.Ptr(armsql.DatabaseStatusOnline), - // ZoneRedundant: to.Ptr(false), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("Standard"), - // Capacity: to.Ptr[int32](10), - // Tier: to.Ptr("Standard"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/PatchVCoreDatabase.json -func ExampleDatabasesClient_BeginUpdate_updatesADatabase() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatabasesClient().BeginUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.DatabaseUpdate{ - Properties: &armsql.DatabaseUpdateProperties{ - LicenseType: to.Ptr(armsql.DatabaseLicenseTypeLicenseIncluded), - MaxSizeBytes: to.Ptr[int64](1073741824), - }, - SKU: &armsql.SKU{ - Name: to.Ptr("BC_Gen4_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.Database = armsql.Database{ - // Name: to.Ptr("testdb"), - // Type: to.Ptr("Microsoft.Sql/servers/databases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"), - // Location: to.Ptr("southeastasia"), - // Kind: to.Ptr("v12.0,user,vcore"), - // Properties: &armsql.DatabaseProperties{ - // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // CurrentServiceObjectiveName: to.Ptr("BC_Gen4_2"), - // CurrentSKU: &armsql.SKU{ - // Name: to.Ptr("BC_Gen4"), - // Capacity: to.Ptr[int32](4), - // Tier: to.Ptr("BusinessCritical"), - // }, - // DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"), - // DefaultSecondaryLocation: to.Ptr("North Europe"), - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:51:33.937Z"); return t}()), - // IsInfraEncryptionEnabled: to.Ptr(false), - // IsLedgerOn: to.Ptr(false), - // LicenseType: to.Ptr(armsql.DatabaseLicenseTypeLicenseIncluded), - // MaxLogSizeBytes: to.Ptr[int64](104857600), - // MaxSizeBytes: to.Ptr[int64](1073741824), - // ReadScale: to.Ptr(armsql.DatabaseReadScaleEnabled), - // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyLocal), - // RequestedServiceObjectiveName: to.Ptr("BC_Gen4_2"), - // Status: to.Ptr(armsql.DatabaseStatusOnline), - // ZoneRedundant: to.Ptr(false), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("BC_Gen4"), - // Capacity: to.Ptr[int32](4), - // Tier: to.Ptr("BusinessCritical"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ExportDatabaseWithNetworkIsolation.json -func ExampleDatabasesClient_BeginExport_exportsADatabaseUsingPrivateLinkToCommunicateWithSqlServerAndStorageAccount() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatabasesClient().BeginExport(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.ExportDatabaseDefinition{ - AdministratorLogin: to.Ptr("login"), - AdministratorLoginPassword: to.Ptr("password"), - AuthenticationType: to.Ptr("Sql"), - NetworkIsolation: &armsql.NetworkIsolationSettings{ - SQLServerResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr"), - StorageAccountResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Storage/storageAccounts/test-privatelink"), - }, - StorageKey: to.Ptr("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=="), - StorageKeyType: to.Ptr(armsql.StorageKeyTypeStorageAccessKey), - StorageURI: to.Ptr("https://test.blob.core.windows.net/test.bacpac"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ImportExportOperationResult = armsql.ImportExportOperationResult{ - // Name: to.Ptr("9d9a794a-5cec-4f23-af70-d29511b522a4"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/importExportOperationResults"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb/importExportOperationResults/9d9a794a-5cec-4f23-af70-d29511b522a4"), - // Properties: &armsql.ImportExportOperationResultProperties{ - // BlobURI: to.Ptr("https://test.blob.core.windows.net/test.bacpac"), - // DatabaseName: to.Ptr("testdb"), - // LastModifiedTime: to.Ptr("2/2/2020 8:34:47 PM"), - // QueuedTime: to.Ptr("2/2/2020 8:33:27 PM"), - // RequestID: to.Ptr("9d9a794a-5cec-4f23-af70-d29511b522a4"), - // RequestType: to.Ptr("Export"), - // ServerName: to.Ptr("testsvr.database.windows.net"), - // Status: to.Ptr("Completed"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ExportDatabase.json -func ExampleDatabasesClient_BeginExport_exportsADatabase() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatabasesClient().BeginExport(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.ExportDatabaseDefinition{ - AdministratorLogin: to.Ptr("login"), - AdministratorLoginPassword: to.Ptr("password"), - AuthenticationType: to.Ptr("Sql"), - StorageKey: to.Ptr("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=="), - StorageKeyType: to.Ptr(armsql.StorageKeyTypeStorageAccessKey), - StorageURI: to.Ptr("https://test.blob.core.windows.net/test.bacpac"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ImportExportOperationResult = armsql.ImportExportOperationResult{ - // Name: to.Ptr("9d9a794a-5cec-4f23-af70-d29511b522a4"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/importExportOperationResults"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb/importExportOperationResults/9d9a794a-5cec-4f23-af70-d29511b522a4"), - // Properties: &armsql.ImportExportOperationResultProperties{ - // BlobURI: to.Ptr("https://test.blob.core.windows.net/test.bacpac"), - // DatabaseName: to.Ptr("testdb"), - // LastModifiedTime: to.Ptr("2/2/2020 8:34:47 PM"), - // QueuedTime: to.Ptr("2/2/2020 8:33:27 PM"), - // RequestID: to.Ptr("9d9a794a-5cec-4f23-af70-d29511b522a4"), - // RequestType: to.Ptr("Export"), - // ServerName: to.Ptr("testsvr.database.windows.net"), - // Status: to.Ptr("Completed"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/FailoverDatabase.json -func ExampleDatabasesClient_BeginFailover() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatabasesClient().BeginFailover(ctx, "group1", "testServer", "testDatabase", &armsql.DatabasesClientBeginFailoverOptions{ReplicaType: to.Ptr(armsql.ReplicaTypePrimary)}) - 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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ImportDatabaseWithNetworkIsolation.json -func ExampleDatabasesClient_BeginImport_importsToAnExistingEmptyDatabaseUsingPrivateLinkToCommunicateWithSqlServerAndStorageAccount() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatabasesClient().BeginImport(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.ImportExistingDatabaseDefinition{ - AdministratorLogin: to.Ptr("login"), - AdministratorLoginPassword: to.Ptr("password"), - AuthenticationType: to.Ptr("Sql"), - NetworkIsolation: &armsql.NetworkIsolationSettings{ - SQLServerResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr"), - StorageAccountResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Storage/storageAccounts/test-privatelink"), - }, - StorageKey: to.Ptr("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=="), - StorageKeyType: to.Ptr(armsql.StorageKeyTypeStorageAccessKey), - StorageURI: to.Ptr("https://test.blob.core.windows.net/test.bacpac"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ImportExportOperationResult = armsql.ImportExportOperationResult{ - // Name: to.Ptr("9d9a794a-5cec-4f23-af70-d29511b522a4"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/importExportOperationResults"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb/importExportOperationResults/9d9a794a-5cec-4f23-af70-d29511b522a4"), - // Properties: &armsql.ImportExportOperationResultProperties{ - // BlobURI: to.Ptr("https://test.blob.core.windows.net/test.bacpac"), - // DatabaseName: to.Ptr("testdb"), - // LastModifiedTime: to.Ptr("2/2/2020 8:34:47 PM"), - // QueuedTime: to.Ptr("2/2/2020 8:33:27 PM"), - // RequestID: to.Ptr("9d9a794a-5cec-4f23-af70-d29511b522a4"), - // RequestType: to.Ptr("Import"), - // ServerName: to.Ptr("testsvr.database.windows.net"), - // Status: to.Ptr("Completed"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ImportDatabase.json -func ExampleDatabasesClient_BeginImport_importsToAnExistingEmptyDatabase() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatabasesClient().BeginImport(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.ImportExistingDatabaseDefinition{ - AdministratorLogin: to.Ptr("login"), - AdministratorLoginPassword: to.Ptr("password"), - AuthenticationType: to.Ptr("Sql"), - StorageKey: to.Ptr("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=="), - StorageKeyType: to.Ptr(armsql.StorageKeyTypeStorageAccessKey), - StorageURI: to.Ptr("https://test.blob.core.windows.net/test.bacpac"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ImportExportOperationResult = armsql.ImportExportOperationResult{ - // Name: to.Ptr("9d9a794a-5cec-4f23-af70-d29511b522a4"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/importExportOperationResults"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb/importExportOperationResults/9d9a794a-5cec-4f23-af70-d29511b522a4"), - // Properties: &armsql.ImportExportOperationResultProperties{ - // BlobURI: to.Ptr("https://test.blob.core.windows.net/test.bacpac"), - // DatabaseName: to.Ptr("testdb"), - // LastModifiedTime: to.Ptr("2/2/2020 8:34:47 PM"), - // QueuedTime: to.Ptr("2/2/2020 8:33:27 PM"), - // RequestID: to.Ptr("9d9a794a-5cec-4f23-af70-d29511b522a4"), - // RequestType: to.Ptr("Import"), - // ServerName: to.Ptr("testsvr.database.windows.net"), - // Status: to.Ptr("Completed"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/RenameDatabase.json -func ExampleDatabasesClient_Rename() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewDatabasesClient().Rename(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.ResourceMoveDefinition{ - ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/newtestdb"), - }, 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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/PauseDatabase.json -func ExampleDatabasesClient_BeginPause() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatabasesClient().BeginPause(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdwdb", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Database = armsql.Database{ - // Name: to.Ptr("testdwdb"), - // Type: to.Ptr("Microsoft.Sql/servers/databases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdwdb"), - // Location: to.Ptr("southeastasia"), - // Kind: to.Ptr("v12.0,user,datawarehouse"), - // Properties: &armsql.DatabaseProperties{ - // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-07-13T02:04:26.187Z"); return t}()), - // CurrentServiceObjectiveName: to.Ptr("D1"), - // DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"), - // DefaultSecondaryLocation: to.Ptr("North Europe"), - // MaxSizeBytes: to.Ptr[int64](10995116277760), - // Status: to.Ptr(armsql.DatabaseStatusPaused), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("DataWarehouse"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ResumeDatabase.json -func ExampleDatabasesClient_BeginResume() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatabasesClient().BeginResume(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdwdb", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Database = armsql.Database{ - // Name: to.Ptr("testdwdb"), - // Type: to.Ptr("Microsoft.Sql/servers/databases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdwdb"), - // Location: to.Ptr("southeastasia"), - // Kind: to.Ptr("v12.0,user,datawarehouse"), - // Properties: &armsql.DatabaseProperties{ - // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-07-13T02:04:26.187Z"); return t}()), - // CurrentServiceObjectiveName: to.Ptr("D1"), - // DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"), - // DefaultSecondaryLocation: to.Ptr("North Europe"), - // MaxSizeBytes: to.Ptr[int64](10995116277760), - // Status: to.Ptr(armsql.DatabaseStatusOnline), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("DataWarehouse"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/UpgradeDataWarehouse.json -func ExampleDatabasesClient_BeginUpgradeDataWarehouse() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatabasesClient().BeginUpgradeDataWarehouse(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdwdb", 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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ListDatabasesByElasticPool.json -func ExampleDatabasesClient_NewListByElasticPoolPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDatabasesClient().NewListByElasticPoolPager("Default-SQL-SouthEastAsia", "testsvr", "pool1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DatabaseListResult = armsql.DatabaseListResult{ - // Value: []*armsql.Database{ - // { - // Name: to.Ptr("DB001"), - // Type: to.Ptr("Microsoft.Sql/servers/databases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/DB001"), - // Location: to.Ptr("southeastasia"), - // Kind: to.Ptr("v12.0,user"), - // Properties: &armsql.DatabaseProperties{ - // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-07-12T22:08:39.163Z"); return t}()), - // CurrentServiceObjectiveName: to.Ptr("ElasticPool"), - // DatabaseID: to.Ptr("bfe0735f-bc87-447f-b2c2-481f4b100614"), - // DefaultSecondaryLocation: to.Ptr("North Europe"), - // ElasticPoolID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/elasticPools/Pool1"), - // MaxSizeBytes: to.Ptr[int64](268435456000), - // Status: to.Ptr(armsql.DatabaseStatusOnline), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("ElasticPool"), - // Tier: to.Ptr("Standard"), - // }, - // }, - // { - // Name: to.Ptr("DB002"), - // Type: to.Ptr("Microsoft.Sql/servers/databases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/DB002"), - // Location: to.Ptr("southeastasia"), - // Kind: to.Ptr("v12.0,user"), - // Properties: &armsql.DatabaseProperties{ - // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-07-12T22:10:10.773Z"); return t}()), - // CurrentServiceObjectiveName: to.Ptr("ElasticPool"), - // DatabaseID: to.Ptr("82246152-3177-4357-b81c-a16d87ce3593"), - // DefaultSecondaryLocation: to.Ptr("North Europe"), - // ElasticPoolID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/elasticPools/Pool1"), - // MaxSizeBytes: to.Ptr[int64](268435456000), - // Status: to.Ptr(armsql.DatabaseStatusOnline), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("ElasticPool"), - // Tier: to.Ptr("Standard"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ListVCoreInaccessibleDatabasesByServer.json -func ExampleDatabasesClient_NewListInaccessibleByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDatabasesClient().NewListInaccessibleByServerPager("Default-SQL-SouthEastAsia", "testsvr", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DatabaseListResult = armsql.DatabaseListResult{ - // Value: []*armsql.Database{ - // { - // Name: to.Ptr("testdb"), - // Type: to.Ptr("Microsoft.Sql/servers/databases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"), - // Location: to.Ptr("southeastasia"), - // Kind: to.Ptr("v12.0,user,vcore"), - // Properties: &armsql.DatabaseProperties{ - // CatalogCollation: to.Ptr(armsql.CatalogCollationTypeSQLLatin1GeneralCP1CIAS), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), - // CurrentServiceObjectiveName: to.Ptr("BC_Gen4_2"), - // DatabaseID: to.Ptr("6c764297-577b-470f-9af4-96d3d41e2ba3"), - // DefaultSecondaryLocation: to.Ptr("North Europe"), - // LicenseType: to.Ptr(armsql.DatabaseLicenseTypeLicenseIncluded), - // MaxLogSizeBytes: to.Ptr[int64](104857600), - // MaxSizeBytes: to.Ptr[int64](268435456000), - // ReadScale: to.Ptr(armsql.DatabaseReadScaleEnabled), - // Status: to.Ptr(armsql.DatabaseStatusInaccessible), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("BC_Gen4"), - // Capacity: to.Ptr[int32](2), - // Tier: to.Ptr("BusinessCritical"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/sql/armsql/databaseschemas_client.go b/sdk/resourcemanager/sql/armsql/databaseschemas_client.go index 52e2cb4715bf..77519f88c9db 100644 --- a/sdk/resourcemanager/sql/armsql/databaseschemas_client.go +++ b/sdk/resourcemanager/sql/armsql/databaseschemas_client.go @@ -46,7 +46,7 @@ func NewDatabaseSchemasClient(subscriptionID string, credential azcore.TokenCred // Get - Get database schema // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -99,7 +99,7 @@ func (client *DatabaseSchemasClient) getCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -116,7 +116,7 @@ func (client *DatabaseSchemasClient) getHandleResponse(resp *http.Response) (Dat // NewListByDatabasePager - List database schemas // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -178,7 +178,7 @@ func (client *DatabaseSchemasClient) listByDatabaseCreateRequest(ctx context.Con if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/databaseschemas_client_example_test.go b/sdk/resourcemanager/sql/armsql/databaseschemas_client_example_test.go deleted file mode 100644 index f34b7bba7aa6..000000000000 --- a/sdk/resourcemanager/sql/armsql/databaseschemas_client_example_test.go +++ /dev/null @@ -1,81 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseSchemaListByDatabase.json -func ExampleDatabaseSchemasClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDatabaseSchemasClient().NewListByDatabasePager("myRG", "serverName", "myDatabase", &armsql.DatabaseSchemasClientListByDatabaseOptions{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.DatabaseSchemaListResult = armsql.DatabaseSchemaListResult{ - // Value: []*armsql.DatabaseSchema{ - // { - // Name: to.Ptr("dbo"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/schemas"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myRG/providers/Microsoft.Sql/servers/serverName/databases/myDatabase/schemas/dbo"), - // }, - // { - // Name: to.Ptr("schema2"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/schemas"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myRG/providers/Microsoft.Sql/servers/serverName/databases/myDatabase/schemas/schema2"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseSchemaGet.json -func ExampleDatabaseSchemasClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatabaseSchemasClient().Get(ctx, "myRG", "serverName", "myDatabase", "dbo", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DatabaseSchema = armsql.DatabaseSchema{ - // Name: to.Ptr("dbo"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/schemas"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myRG/providers/Microsoft.Sql/servers/serverName/databases/myDatabase/schemas/dbo"), - // } -} diff --git a/sdk/resourcemanager/sql/armsql/databasesecurityalertpolicies_client.go b/sdk/resourcemanager/sql/armsql/databasesecurityalertpolicies_client.go index 0f82a143a205..f6b3c5e56794 100644 --- a/sdk/resourcemanager/sql/armsql/databasesecurityalertpolicies_client.go +++ b/sdk/resourcemanager/sql/armsql/databasesecurityalertpolicies_client.go @@ -46,7 +46,7 @@ func NewDatabaseSecurityAlertPoliciesClient(subscriptionID string, credential az // CreateOrUpdate - Creates or updates a database's security alert policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -101,7 +101,7 @@ func (client *DatabaseSecurityAlertPoliciesClient) createOrUpdateCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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 *DatabaseSecurityAlertPoliciesClient) createOrUpdateHandleResponse( // Get - Gets a database's security alert policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -176,7 +176,7 @@ func (client *DatabaseSecurityAlertPoliciesClient) getCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -193,7 +193,7 @@ func (client *DatabaseSecurityAlertPoliciesClient) getHandleResponse(resp *http. // NewListByDatabasePager - Gets a list of database's security alert policies. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -252,7 +252,7 @@ func (client *DatabaseSecurityAlertPoliciesClient) listByDatabaseCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/databasesecurityalertpolicies_client_example_test.go b/sdk/resourcemanager/sql/armsql/databasesecurityalertpolicies_client_example_test.go deleted file mode 100644 index f722188eb92d..000000000000 --- a/sdk/resourcemanager/sql/armsql/databasesecurityalertpolicies_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 armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseSecurityAlertGet.json -func ExampleDatabaseSecurityAlertPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatabaseSecurityAlertPoliciesClient().Get(ctx, "securityalert-6852", "securityalert-2080", "testdb", armsql.SecurityAlertPolicyNameDefault, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DatabaseSecurityAlertPolicy = armsql.DatabaseSecurityAlertPolicy{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/securityAlertPolicies"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/securityalert-6852/providers/Microsoft.Sql/servers/securityalert-2080/databases/testdb"), - // Properties: &armsql.SecurityAlertsPolicyProperties{ - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-03T04:41:33.937Z"); return t}()), - // DisabledAlerts: []*string{ - // to.Ptr("Usage_Anomaly")}, - // EmailAccountAdmins: to.Ptr(true), - // EmailAddresses: []*string{ - // to.Ptr("test@consoto.com"), - // to.Ptr("user@consoto.com")}, - // RetentionDays: to.Ptr[int32](0), - // State: to.Ptr(armsql.SecurityAlertsPolicyStateEnabled), - // StorageAccountAccessKey: to.Ptr(""), - // }, - // SystemData: &armsql.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-03T04:41:33.937Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsql.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-03T04:41:33.937Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsql.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseSecurityAlertCreateMax.json -func ExampleDatabaseSecurityAlertPoliciesClient_CreateOrUpdate_updateADatabasesThreatDetectionPolicyWithAllParameters() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatabaseSecurityAlertPoliciesClient().CreateOrUpdate(ctx, "securityalert-4799", "securityalert-6440", "testdb", armsql.SecurityAlertPolicyNameDefault, armsql.DatabaseSecurityAlertPolicy{ - Properties: &armsql.SecurityAlertsPolicyProperties{ - DisabledAlerts: []*string{ - to.Ptr("Sql_Injection"), - to.Ptr("Usage_Anomaly")}, - EmailAccountAdmins: to.Ptr(true), - EmailAddresses: []*string{ - to.Ptr("test@microsoft.com"), - to.Ptr("user@microsoft.com")}, - RetentionDays: to.Ptr[int32](6), - State: to.Ptr(armsql.SecurityAlertsPolicyStateEnabled), - StorageAccountAccessKey: to.Ptr("sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD=="), - StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DatabaseSecurityAlertPolicy = armsql.DatabaseSecurityAlertPolicy{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/securityAlertPolicies"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/securityalert-4799/providers/Microsoft.Sql/servers/securityalert-6440/databases/testdb"), - // Properties: &armsql.SecurityAlertsPolicyProperties{ - // DisabledAlerts: []*string{ - // to.Ptr("Sql_Injection"), - // to.Ptr("Usage_Anomaly")}, - // EmailAccountAdmins: to.Ptr(true), - // EmailAddresses: []*string{ - // to.Ptr("test@microsoft.com"), - // to.Ptr("user@microsoft.com")}, - // RetentionDays: to.Ptr[int32](6), - // State: to.Ptr(armsql.SecurityAlertsPolicyStateEnabled), - // StorageAccountAccessKey: to.Ptr(""), - // StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - // }, - // SystemData: &armsql.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-03T04:41:33.937Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsql.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-03T04:41:33.937Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsql.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseSecurityAlertCreateMin.json -func ExampleDatabaseSecurityAlertPoliciesClient_CreateOrUpdate_updateADatabasesThreatDetectionPolicyWithMinimalParameters() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatabaseSecurityAlertPoliciesClient().CreateOrUpdate(ctx, "securityalert-4799", "securityalert-6440", "testdb", armsql.SecurityAlertPolicyNameDefault, armsql.DatabaseSecurityAlertPolicy{ - Properties: &armsql.SecurityAlertsPolicyProperties{ - State: to.Ptr(armsql.SecurityAlertsPolicyStateEnabled), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DatabaseSecurityAlertPolicy = armsql.DatabaseSecurityAlertPolicy{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/securityAlertPolicies"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/securityalert-4799/providers/Microsoft.Sql/servers/securityalert-6440/databases/testdb"), - // Properties: &armsql.SecurityAlertsPolicyProperties{ - // DisabledAlerts: []*string{ - // }, - // EmailAccountAdmins: to.Ptr(true), - // EmailAddresses: []*string{ - // }, - // RetentionDays: to.Ptr[int32](0), - // State: to.Ptr(armsql.SecurityAlertsPolicyStateEnabled), - // StorageAccountAccessKey: to.Ptr(""), - // StorageEndpoint: to.Ptr(""), - // }, - // SystemData: &armsql.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-03T04:41:33.937Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsql.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-03T04:41:33.937Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsql.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseSecurityAlertListByDatabase.json -func ExampleDatabaseSecurityAlertPoliciesClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDatabaseSecurityAlertPoliciesClient().NewListByDatabasePager("securityalert-6852", "securityalert-2080", "testdb", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DatabaseSecurityAlertListResult = armsql.DatabaseSecurityAlertListResult{ - // Value: []*armsql.DatabaseSecurityAlertPolicy{ - // { - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/securityAlertPolicies"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/securityalert-6852/providers/Microsoft.Sql/servers/securityalert-2080/databases/testdb"), - // Properties: &armsql.SecurityAlertsPolicyProperties{ - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-03T04:41:33.937Z"); return t}()), - // DisabledAlerts: []*string{ - // to.Ptr("Usage_Anomaly")}, - // EmailAccountAdmins: to.Ptr(true), - // EmailAddresses: []*string{ - // to.Ptr("test@consoto.com"), - // to.Ptr("user@consoto.com")}, - // RetentionDays: to.Ptr[int32](0), - // State: to.Ptr(armsql.SecurityAlertsPolicyStateEnabled), - // StorageAccountAccessKey: to.Ptr(""), - // StorageEndpoint: to.Ptr(""), - // }, - // SystemData: &armsql.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-03T04:41:33.937Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsql.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-03T04:41:33.937Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsql.CreatedByTypeUser), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentbaselines_client.go b/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentbaselines_client.go index 4c574f9a4714..21dacd08404c 100644 --- a/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentbaselines_client.go +++ b/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentbaselines_client.go @@ -46,7 +46,7 @@ func NewDatabaseSQLVulnerabilityAssessmentBaselinesClient(subscriptionID string, // CreateOrUpdate - Add a database's vulnerability assessment rule baseline list. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -105,7 +105,7 @@ func (client *DatabaseSQLVulnerabilityAssessmentBaselinesClient) createOrUpdateC return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -126,7 +126,7 @@ func (client *DatabaseSQLVulnerabilityAssessmentBaselinesClient) createOrUpdateH // Get - Gets a list of database's sql vulnerability assessment rule baselines. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -184,7 +184,7 @@ func (client *DatabaseSQLVulnerabilityAssessmentBaselinesClient) getCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -201,7 +201,7 @@ func (client *DatabaseSQLVulnerabilityAssessmentBaselinesClient) getHandleRespon // NewListBySQLVulnerabilityAssessmentPager - Gets a list of database's sql vulnerability assessment rule baselines. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -265,7 +265,7 @@ func (client *DatabaseSQLVulnerabilityAssessmentBaselinesClient) listBySQLVulner return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentbaselines_client_example_test.go b/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentbaselines_client_example_test.go deleted file mode 100644 index c0b53590884b..000000000000 --- a/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentbaselines_client_example_test.go +++ /dev/null @@ -1,324 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/DatabaseSqlVulnerabilityAssessmentBaselineListBySqlVulnerabilityAssessment.json -func ExampleDatabaseSQLVulnerabilityAssessmentBaselinesClient_NewListBySQLVulnerabilityAssessmentPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDatabaseSQLVulnerabilityAssessmentBaselinesClient().NewListBySQLVulnerabilityAssessmentPager("vulnerabilityaseessmenttest-4711", "vulnerabilityaseessmenttest-6411", "testdb", armsql.VulnerabilityAssessmentNameDefault, nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DatabaseSQLVulnerabilityAssessmentBaselineSetListResult = armsql.DatabaseSQLVulnerabilityAssessmentBaselineSetListResult{ - // Value: []*armsql.DatabaseSQLVulnerabilityAssessmentBaselineSet{ - // { - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/sqlVulnerabilityAssessments/baselines"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/servers/vulnerabilityaseessmenttest-6440/databases/testdb/sqlVulnerabilityAssessments/Default/baselines/Default"), - // Properties: &armsql.DatabaseSQLVulnerabilityAssessmentBaselineSetProperties{ - // Results: map[string][][]*string{ - // "VA1020": [][]*string{ - // }, - // "VA1054": [][]*string{ - // }, - // "VA1095": [][]*string{ - // }, - // "VA1096": [][]*string{ - // }, - // "VA1097": [][]*string{ - // }, - // "VA1099": [][]*string{ - // }, - // "VA1143": [][]*string{ - // []*string{ - // to.Ptr("True")}}, - // "VA1219": [][]*string{ - // []*string{ - // to.Ptr("False")}}, - // "VA1221": [][]*string{ - // }, - // "VA1223": [][]*string{ - // }, - // "VA1224": [][]*string{ - // }, - // "VA1246": [][]*string{ - // }, - // "VA1248": [][]*string{ - // }, - // "VA1258": [][]*string{ - // }, - // "VA1281": [][]*string{ - // }, - // "VA1282": [][]*string{ - // }, - // "VA2020": [][]*string{ - // }, - // "VA2033": [][]*string{ - // }, - // "VA2062": [][]*string{ - // }, - // "VA2064": [][]*string{ - // }, - // "VA2108": [][]*string{ - // }, - // "VA2109": [][]*string{ - // }, - // "VA2129": [][]*string{ - // }, - // "VA2130": [][]*string{ - // }, - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/DatabaseSqlVulnerabilityAssessmentBaselineGet.json -func ExampleDatabaseSQLVulnerabilityAssessmentBaselinesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatabaseSQLVulnerabilityAssessmentBaselinesClient().Get(ctx, "vulnerabilityaseessmenttest-4711", "vulnerabilityaseessmenttest-6411", "testdb", armsql.VulnerabilityAssessmentNameDefault, armsql.BaselineNameDefault, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DatabaseSQLVulnerabilityAssessmentBaselineSet = armsql.DatabaseSQLVulnerabilityAssessmentBaselineSet{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/sqlVulnerabilityAssessments/baselines"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/servers/vulnerabilityaseessmenttest-6440/databases/testdb/sqlVulnerabilityAssessments/Default/baselines/Default"), - // Properties: &armsql.DatabaseSQLVulnerabilityAssessmentBaselineSetProperties{ - // Results: map[string][][]*string{ - // "VA1020": [][]*string{ - // }, - // "VA1054": [][]*string{ - // }, - // "VA1095": [][]*string{ - // }, - // "VA1096": [][]*string{ - // }, - // "VA1097": [][]*string{ - // }, - // "VA1099": [][]*string{ - // }, - // "VA1143": [][]*string{ - // []*string{ - // to.Ptr("True")}}, - // "VA1219": [][]*string{ - // []*string{ - // to.Ptr("False")}}, - // "VA1221": [][]*string{ - // }, - // "VA1223": [][]*string{ - // }, - // "VA1224": [][]*string{ - // }, - // "VA1246": [][]*string{ - // }, - // "VA1248": [][]*string{ - // }, - // "VA1258": [][]*string{ - // }, - // "VA1281": [][]*string{ - // }, - // "VA1282": [][]*string{ - // }, - // "VA2020": [][]*string{ - // }, - // "VA2033": [][]*string{ - // }, - // "VA2062": [][]*string{ - // }, - // "VA2064": [][]*string{ - // }, - // "VA2108": [][]*string{ - // }, - // "VA2109": [][]*string{ - // }, - // "VA2129": [][]*string{ - // }, - // "VA2130": [][]*string{ - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/DatabaseSqlVulnerabilityAssessmentBaselineAddLatest.json -func ExampleDatabaseSQLVulnerabilityAssessmentBaselinesClient_CreateOrUpdate_addADatabasesVulnerabilityAssessmentRuleBaselineFromTheLatestScanResult() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatabaseSQLVulnerabilityAssessmentBaselinesClient().CreateOrUpdate(ctx, "vulnerabilityaseessmenttest-4799", "vulnerabilityaseessmenttest-6440", "testdb", armsql.VulnerabilityAssessmentNameDefault, armsql.BaselineNameDefault, armsql.DatabaseSQLVulnerabilityAssessmentRuleBaselineListInput{ - Properties: &armsql.DatabaseSQLVulnerabilityAssessmentRuleBaselineListInputProperties{ - LatestScan: to.Ptr(true), - Results: map[string][][]*string{}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DatabaseSQLVulnerabilityAssessmentBaselineSet = armsql.DatabaseSQLVulnerabilityAssessmentBaselineSet{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/sqlVulnerabilityAssessments/baselines"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/servers/vulnerabilityaseessmenttest-6440/databases/testdb/sqlVulnerabilityAssessments/Default/baselines/Default"), - // Properties: &armsql.DatabaseSQLVulnerabilityAssessmentBaselineSetProperties{ - // Results: map[string][][]*string{ - // "VA1020": [][]*string{ - // }, - // "VA1054": [][]*string{ - // }, - // "VA1095": [][]*string{ - // }, - // "VA1096": [][]*string{ - // }, - // "VA1097": [][]*string{ - // }, - // "VA1099": [][]*string{ - // }, - // "VA1143": [][]*string{ - // []*string{ - // to.Ptr("True")}}, - // "VA1219": [][]*string{ - // []*string{ - // to.Ptr("False")}}, - // "VA1221": [][]*string{ - // }, - // "VA1223": [][]*string{ - // }, - // "VA1224": [][]*string{ - // }, - // "VA1246": [][]*string{ - // }, - // "VA1248": [][]*string{ - // }, - // "VA1258": [][]*string{ - // }, - // "VA1281": [][]*string{ - // }, - // "VA1282": [][]*string{ - // }, - // "VA2020": [][]*string{ - // }, - // "VA2033": [][]*string{ - // }, - // "VA2062": [][]*string{ - // }, - // "VA2064": [][]*string{ - // }, - // "VA2108": [][]*string{ - // }, - // "VA2109": [][]*string{ - // }, - // "VA2129": [][]*string{ - // }, - // "VA2130": [][]*string{ - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/DatabaseSqlVulnerabilityAssessmentBaselineAdd.json -func ExampleDatabaseSQLVulnerabilityAssessmentBaselinesClient_CreateOrUpdate_addADatabasesVulnerabilityAssessmentRuleBaselineList() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatabaseSQLVulnerabilityAssessmentBaselinesClient().CreateOrUpdate(ctx, "vulnerabilityaseessmenttest-4799", "vulnerabilityaseessmenttest-6440", "testdb", armsql.VulnerabilityAssessmentNameDefault, armsql.BaselineNameDefault, armsql.DatabaseSQLVulnerabilityAssessmentRuleBaselineListInput{ - Properties: &armsql.DatabaseSQLVulnerabilityAssessmentRuleBaselineListInputProperties{ - LatestScan: to.Ptr(false), - Results: map[string][][]*string{ - "VA2063": { - { - to.Ptr("AllowAll"), - to.Ptr("0.0.0.0"), - to.Ptr("255.255.255.255")}}, - "VA2065": { - { - to.Ptr("AllowAll"), - to.Ptr("0.0.0.0"), - to.Ptr("255.255.255.255")}}, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DatabaseSQLVulnerabilityAssessmentBaselineSet = armsql.DatabaseSQLVulnerabilityAssessmentBaselineSet{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.Sql/servers/sqlVulnerabilityAssessments/baselines"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/servers/vulnerabilityaseessmenttest-6440/databases/testdb/sqlVulnerabilityAssessments/Default/baselines/Default"), - // Properties: &armsql.DatabaseSQLVulnerabilityAssessmentBaselineSetProperties{ - // Results: map[string][][]*string{ - // "VA2063": [][]*string{ - // []*string{ - // to.Ptr("AllowAll"), - // to.Ptr("0.0.0.0"), - // to.Ptr("255.255.255.255")}}, - // "VA2065": [][]*string{ - // []*string{ - // to.Ptr("AllowAll"), - // to.Ptr("0.0.0.0"), - // to.Ptr("255.255.255.255")}}, - // }, - // }, - // } -} diff --git a/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentexecutescan_client.go b/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentexecutescan_client.go index ae489769ccfb..d9c586db48e6 100644 --- a/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentexecutescan_client.go +++ b/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentexecutescan_client.go @@ -46,7 +46,7 @@ func NewDatabaseSQLVulnerabilityAssessmentExecuteScanClient(subscriptionID strin // BeginExecute - Executes a Vulnerability Assessment database scan. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -70,7 +70,7 @@ func (client *DatabaseSQLVulnerabilityAssessmentExecuteScanClient) BeginExecute( // Execute - Executes a Vulnerability Assessment database scan. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-05-01-preview func (client *DatabaseSQLVulnerabilityAssessmentExecuteScanClient) execute(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, options *DatabaseSQLVulnerabilityAssessmentExecuteScanClientBeginExecuteOptions) (*http.Response, error) { var err error req, err := client.executeCreateRequest(ctx, resourceGroupName, serverName, databaseName, vulnerabilityAssessmentName, options) @@ -116,7 +116,7 @@ func (client *DatabaseSQLVulnerabilityAssessmentExecuteScanClient) executeCreate return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } diff --git a/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentexecutescan_client_example_test.go b/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentexecutescan_client_example_test.go deleted file mode 100644 index 5a0448e96d80..000000000000 --- a/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentexecutescan_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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/DatabaseSqlVulnerabilityAssessmentScansExecute.json -func ExampleDatabaseSQLVulnerabilityAssessmentExecuteScanClient_BeginExecute() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatabaseSQLVulnerabilityAssessmentExecuteScanClient().BeginExecute(ctx, "vulnerabilityassessmenttest-4711", "vulnerabilityassessmenttest-6411", "testdb", armsql.VulnerabilityAssessmentNameDefault, 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/sql/armsql/databasesqlvulnerabilityassessmentrulebaselines_client.go b/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentrulebaselines_client.go index f49c8efcb321..dfa21cab24e2 100644 --- a/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentrulebaselines_client.go +++ b/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentrulebaselines_client.go @@ -46,7 +46,7 @@ func NewDatabaseSQLVulnerabilityAssessmentRuleBaselinesClient(subscriptionID str // CreateOrUpdate - Creates or updates a database's vulnerability assessment rule baseline. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -110,7 +110,7 @@ func (client *DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient) createOrUpd return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -131,7 +131,7 @@ func (client *DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient) createOrUpd // Delete - Removes the database's vulnerability assessment rule baseline. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -193,7 +193,7 @@ func (client *DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient) deleteCreat return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -201,7 +201,7 @@ func (client *DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient) deleteCreat // Get - Gets a database's sql vulnerability assessment rule baseline. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -264,7 +264,7 @@ func (client *DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient) getCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -281,7 +281,7 @@ func (client *DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient) getHandleRe // NewListByBaselinePager - Gets a list of database's sql vulnerability assessment rule baselines. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -349,7 +349,7 @@ func (client *DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient) listByBasel return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentrulebaselines_client_example_test.go b/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentrulebaselines_client_example_test.go deleted file mode 100644 index a3fa31c347b8..000000000000 --- a/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentrulebaselines_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 armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/DatabaseSqlVulnerabilityAssessmentRuleBaselineListByBaseline.json -func ExampleDatabaseSQLVulnerabilityAssessmentRuleBaselinesClient_NewListByBaselinePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDatabaseSQLVulnerabilityAssessmentRuleBaselinesClient().NewListByBaselinePager("vulnerabilityaseessmenttest-4711", "vulnerabilityaseessmenttest-6411", "testdb", armsql.VulnerabilityAssessmentNameDefault, armsql.BaselineNameDefault, nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DatabaseSQLVulnerabilityAssessmentRuleBaselineListResult = armsql.DatabaseSQLVulnerabilityAssessmentRuleBaselineListResult{ - // Value: []*armsql.DatabaseSQLVulnerabilityAssessmentRuleBaseline{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/sqlVulnerabilityAssessments/baselines"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/servers/vulnerabilityaseessmenttest-6440/databases/testdb/sqlVulnerabilityAssessments/default/baselines/default/rules/VA1001"), - // Properties: &armsql.DatabaseSQLVulnerabilityAssessmentRuleBaselineProperties{ - // Results: [][]*string{ - // []*string{ - // to.Ptr("userA"), - // to.Ptr("SELECT")}, - // []*string{ - // to.Ptr("userB"), - // to.Ptr("SELECT")}, - // []*string{ - // to.Ptr("userC"), - // to.Ptr("SELECT")}}, - // }, - // }, - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/sqlVulnerabilityAssessments/baselines"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/servers/vulnerabilityaseessmenttest-6440/databases/testdb/sqlVulnerabilityAssessments/default/baselines/default/rules/VA1002"), - // Properties: &armsql.DatabaseSQLVulnerabilityAssessmentRuleBaselineProperties{ - // Results: [][]*string{ - // []*string{ - // to.Ptr("userA"), - // to.Ptr("SELECT")}, - // []*string{ - // to.Ptr("userB"), - // to.Ptr("SELECT")}, - // []*string{ - // to.Ptr("userC"), - // to.Ptr("SELECT")}}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/DatabaseSqlVulnerabilityAssessmentRuleBaselineGet.json -func ExampleDatabaseSQLVulnerabilityAssessmentRuleBaselinesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatabaseSQLVulnerabilityAssessmentRuleBaselinesClient().Get(ctx, "vulnerabilityaseessmenttest-4711", "vulnerabilityaseessmenttest-6411", "testdb", armsql.VulnerabilityAssessmentNameDefault, armsql.BaselineNameDefault, "VA1001", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DatabaseSQLVulnerabilityAssessmentRuleBaseline = armsql.DatabaseSQLVulnerabilityAssessmentRuleBaseline{ - // Name: to.Ptr("VA1001"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/sqlVulnerabilityAssessments/baselineRules"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/servers/vulnerabilityaseessmenttest-6440/databases/testdb/sqlVulnerabilityAssessments/default/baselines/default/rules/VA1001"), - // Properties: &armsql.DatabaseSQLVulnerabilityAssessmentRuleBaselineProperties{ - // Results: [][]*string{ - // []*string{ - // to.Ptr("userA"), - // to.Ptr("SELECT")}, - // []*string{ - // to.Ptr("userB"), - // to.Ptr("SELECT")}, - // []*string{ - // to.Ptr("userC"), - // to.Ptr("SELECT")}}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/DatabaseSqlVulnerabilityAssessmentRuleBaselineCreate.json -func ExampleDatabaseSQLVulnerabilityAssessmentRuleBaselinesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatabaseSQLVulnerabilityAssessmentRuleBaselinesClient().CreateOrUpdate(ctx, "vulnerabilityaseessmenttest-4799", "vulnerabilityaseessmenttest-6440", "testdb", armsql.VulnerabilityAssessmentNameDefault, armsql.BaselineNameDefault, "VA1001", armsql.DatabaseSQLVulnerabilityAssessmentRuleBaselineInput{ - Properties: &armsql.DatabaseSQLVulnerabilityAssessmentRuleBaselineInputProperties{ - LatestScan: to.Ptr(false), - Results: [][]*string{ - { - to.Ptr("userA"), - to.Ptr("SELECT")}, - { - to.Ptr("userB"), - to.Ptr("SELECT")}, - { - to.Ptr("userC"), - to.Ptr("SELECT")}}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DatabaseSQLVulnerabilityAssessmentRuleBaseline = armsql.DatabaseSQLVulnerabilityAssessmentRuleBaseline{ - // Name: to.Ptr("Scan123"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/vulnerabilityAssessments/rules/baselines"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/servers/vulnerabilityaseessmenttest-6440/databases/testdb/sqlVulnerabilityAssessments/default/baselines/default/rules/VA1001"), - // Properties: &armsql.DatabaseSQLVulnerabilityAssessmentRuleBaselineProperties{ - // Results: [][]*string{ - // []*string{ - // to.Ptr("userA"), - // to.Ptr("SELECT")}, - // []*string{ - // to.Ptr("userB"), - // to.Ptr("SELECT")}, - // []*string{ - // to.Ptr("userC"), - // to.Ptr("SELECT")}}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/DatabaseSqlVulnerabilityAssessmentRuleBaselineDelete.json -func ExampleDatabaseSQLVulnerabilityAssessmentRuleBaselinesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewDatabaseSQLVulnerabilityAssessmentRuleBaselinesClient().Delete(ctx, "vulnerabilityaseessmenttest-4711", "vulnerabilityaseessmenttest-6411", "testdb", armsql.VulnerabilityAssessmentNameDefault, armsql.BaselineNameDefault, "VA1001", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentscanresult_client.go b/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentscanresult_client.go index 3918cddf2389..75fd477c9a1c 100644 --- a/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentscanresult_client.go +++ b/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentscanresult_client.go @@ -46,7 +46,7 @@ func NewDatabaseSQLVulnerabilityAssessmentScanResultClient(subscriptionID string // Get - Gets a vulnerability assessment scan record of a database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -110,7 +110,7 @@ func (client *DatabaseSQLVulnerabilityAssessmentScanResultClient) getCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -127,7 +127,7 @@ func (client *DatabaseSQLVulnerabilityAssessmentScanResultClient) getHandleRespo // NewListByScanPager - Gets a vulnerability assessment scan record of a database. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -196,7 +196,7 @@ func (client *DatabaseSQLVulnerabilityAssessmentScanResultClient) listByScanCrea return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentscanresult_client_example_test.go b/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentscanresult_client_example_test.go deleted file mode 100644 index 8de664ab2680..000000000000 --- a/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentscanresult_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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/DatabaseSqlVulnerabilityAssessmentListScansResults.json -func ExampleDatabaseSQLVulnerabilityAssessmentScanResultClient_NewListByScanPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDatabaseSQLVulnerabilityAssessmentScanResultClient().NewListByScanPager("vulnerabilityassessmenttest-4711", "testsvr", "master", armsql.SQLVulnerabilityAssessmentNameDefault, "scanId1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VulnerabilityAssessmentScanListResult = armsql.VulnerabilityAssessmentScanListResult{ - // Value: []*armsql.VulnerabilityAssessmentScanResults{ - // { - // Name: to.Ptr("VA1234"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/sqlVulnerabilityAssessments/scans/scanResults"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityassessmenttest-4711/providers/Microsoft.Sql/servers/testsvr/databases/master/sqlVulnerabilityAssessments/Default/scans/scanId1/scanResults/VA1234"), - // Properties: &armsql.VulnerabilityAssessmentScanResultProperties{ - // IsTrimmed: to.Ptr(false), - // QueryResults: [][]*string{ - // []*string{ - // to.Ptr("a1"), - // to.Ptr("a2"), - // to.Ptr("a3")}, - // []*string{ - // to.Ptr("b1"), - // to.Ptr("b2"), - // to.Ptr("b3")}}, - // Remediation: &armsql.Remediation{ - // Description: to.Ptr("Remove users"), - // Automated: to.Ptr(false), - // Scripts: []*string{ - // to.Ptr("drop user a"), - // to.Ptr("drop user b")}, - // }, - // RuleID: to.Ptr("VA1234"), - // RuleMetadata: &armsql.VaRule{ - // Description: to.Ptr("This is an example check"), - // BenchmarkReferences: []*armsql.BenchmarkReference{ - // { - // Benchmark: to.Ptr("fedramp"), - // Reference: to.Ptr("v1"), - // }}, - // Category: to.Ptr("information"), - // QueryCheck: &armsql.QueryCheck{ - // ColumnNames: []*string{ - // to.Ptr("col1"), - // to.Ptr("col2"), - // to.Ptr("col3")}, - // ExpectedResult: [][]*string{ - // }, - // Query: to.Ptr("Select a1,a2, a3"), - // }, - // Rationale: to.Ptr("This is important"), - // RuleID: to.Ptr("VA1234"), - // RuleType: to.Ptr(armsql.RuleTypeNegativeList), - // Severity: to.Ptr(armsql.RuleSeverityInformational), - // Title: to.Ptr("This is the title"), - // }, - // Status: to.Ptr(armsql.RuleStatusNonFinding), - // }, - // }, - // { - // Name: to.Ptr("VA2341"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/sqlVulnerabilityAssessments/scans/scanResults"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-Onebox/providers/Microsoft.Sql/servers/testsvr/databases/master/sqlVulnerabilityAssessments/Default/scans/scanId1/scanResults/VA2341"), - // Properties: &armsql.VulnerabilityAssessmentScanResultProperties{ - // IsTrimmed: to.Ptr(false), - // QueryResults: [][]*string{ - // []*string{ - // to.Ptr("a1"), - // to.Ptr("a2"), - // to.Ptr("a3")}, - // []*string{ - // to.Ptr("b1"), - // to.Ptr("b2"), - // to.Ptr("b3")}}, - // Remediation: &armsql.Remediation{ - // Description: to.Ptr("Remove users"), - // Automated: to.Ptr(false), - // Scripts: []*string{ - // to.Ptr("drop user a"), - // to.Ptr("drop user b")}, - // }, - // RuleID: to.Ptr("VA2341"), - // RuleMetadata: &armsql.VaRule{ - // Description: to.Ptr("This is an example check"), - // BenchmarkReferences: []*armsql.BenchmarkReference{ - // { - // Benchmark: to.Ptr("fedramp"), - // Reference: to.Ptr("v1"), - // }}, - // Category: to.Ptr("information"), - // QueryCheck: &armsql.QueryCheck{ - // ColumnNames: []*string{ - // to.Ptr("col1"), - // to.Ptr("col2"), - // to.Ptr("col3")}, - // ExpectedResult: [][]*string{ - // }, - // Query: to.Ptr("Select a1,a2, a3"), - // }, - // Rationale: to.Ptr("This is important"), - // RuleID: to.Ptr("VA1234"), - // RuleType: to.Ptr(armsql.RuleTypeNegativeList), - // Severity: to.Ptr(armsql.RuleSeverityInformational), - // Title: to.Ptr("This is the title"), - // }, - // Status: to.Ptr(armsql.RuleStatusNonFinding), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/DatabaseSqlVulnerabilityAssessmentScansResults.json -func ExampleDatabaseSQLVulnerabilityAssessmentScanResultClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatabaseSQLVulnerabilityAssessmentScanResultClient().Get(ctx, "vulnerabilityassessmenttest-4711", "vulnerabilityassessmenttest-6411", "master", armsql.SQLVulnerabilityAssessmentNameDefault, "scanId1", "VA1234", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VulnerabilityAssessmentScanResults = armsql.VulnerabilityAssessmentScanResults{ - // Name: to.Ptr("VA1234"), - // Type: to.Ptr("Microsoft.Sql/servers/sqlVulnerabilityAssessments/scans/scanResults"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityassessmenttest-4711/providers/Microsoft.Sql/servers/vulnerabilityassessmenttest-6411/sqlVulnerabilityAssessments/Default/scans/scanId1/scanResults/VA1234"), - // Properties: &armsql.VulnerabilityAssessmentScanResultProperties{ - // IsTrimmed: to.Ptr(false), - // QueryResults: [][]*string{ - // []*string{ - // to.Ptr("a1"), - // to.Ptr("a2"), - // to.Ptr("a3")}, - // []*string{ - // to.Ptr("b1"), - // to.Ptr("b2"), - // to.Ptr("b3")}}, - // Remediation: &armsql.Remediation{ - // Description: to.Ptr("Remove users"), - // Automated: to.Ptr(false), - // Scripts: []*string{ - // to.Ptr("drop user a"), - // to.Ptr("drop user b")}, - // }, - // RuleID: to.Ptr("VA1234"), - // RuleMetadata: &armsql.VaRule{ - // Description: to.Ptr("This is an example check"), - // BenchmarkReferences: []*armsql.BenchmarkReference{ - // { - // Benchmark: to.Ptr("fedramp"), - // Reference: to.Ptr("v1"), - // }}, - // Category: to.Ptr("information"), - // QueryCheck: &armsql.QueryCheck{ - // ColumnNames: []*string{ - // to.Ptr("col1"), - // to.Ptr("col2"), - // to.Ptr("col3")}, - // ExpectedResult: [][]*string{ - // }, - // Query: to.Ptr("Select a1,a2, a3"), - // }, - // Rationale: to.Ptr("This is important"), - // RuleID: to.Ptr("VA1234"), - // RuleType: to.Ptr(armsql.RuleTypeNegativeList), - // Severity: to.Ptr(armsql.RuleSeverityInformational), - // Title: to.Ptr("This is the title"), - // }, - // Status: to.Ptr(armsql.RuleStatusNonFinding), - // }, - // } -} diff --git a/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentscans_client.go b/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentscans_client.go index e2ba3f484684..9bd40fa0ef4d 100644 --- a/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentscans_client.go +++ b/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentscans_client.go @@ -46,7 +46,7 @@ func NewDatabaseSQLVulnerabilityAssessmentScansClient(subscriptionID string, cre // Get - Get a database vulnerability assessment scan result. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -105,7 +105,7 @@ func (client *DatabaseSQLVulnerabilityAssessmentScansClient) getCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -122,7 +122,7 @@ func (client *DatabaseSQLVulnerabilityAssessmentScansClient) getHandleResponse(r // NewListBySQLVulnerabilityAssessmentsPager - Lists the vulnerability assessment scans of a database. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -186,7 +186,7 @@ func (client *DatabaseSQLVulnerabilityAssessmentScansClient) listBySQLVulnerabil return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentscans_client_example_test.go b/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentscans_client_example_test.go deleted file mode 100644 index 24480217a622..000000000000 --- a/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentscans_client_example_test.go +++ /dev/null @@ -1,158 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/DatabaseSqlVulnerabilityAssessmentScanRecordsListByDatabase.json -func ExampleDatabaseSQLVulnerabilityAssessmentScansClient_NewListBySQLVulnerabilityAssessmentsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDatabaseSQLVulnerabilityAssessmentScansClient().NewListBySQLVulnerabilityAssessmentsPager("vulnerabilityassessmenttest-4711", "vulnerabilityassessmenttest-6411", "testdb", armsql.VulnerabilityAssessmentNameDefault, nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VulnerabilityAssessmentScanRecordForSQLListResult = armsql.VulnerabilityAssessmentScanRecordForSQLListResult{ - // Value: []*armsql.VulnerabilityAssessmentScanRecordForSQL{ - // { - // Name: to.Ptr("scan001"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/sqlVulnerabilityAssessments/scans"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityassessmenttest-4711/providers/Microsoft.Sql/servers/vulnerabilityassessmenttest-6411/databases/testdb/sqlVulnerabilityAssessments/default/scans/scan001"), - // Properties: &armsql.VulnerabilityAssessmentScanRecordForSQLProperties{ - // Database: to.Ptr("testdb"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-23T06:49:00.7236217Z"); return t}()), - // HighSeverityFailedRulesCount: to.Ptr[int32](3), - // IsBaselineApplied: to.Ptr(false), - // LastScanTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-22T23:49:00.6455136-07:00"); return t}()), - // LowSeverityFailedRulesCount: to.Ptr[int32](1), - // MediumSeverityFailedRulesCount: to.Ptr[int32](2), - // ScanID: to.Ptr("scan001"), - // Server: to.Ptr("vulnerabilityassessmenttest-6411"), - // SQLVersion: to.Ptr("15.0.2000"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-22T23:49:00.6455136-07:00"); return t}()), - // State: to.Ptr(armsql.VulnerabilityAssessmentScanStateFailed), - // TotalFailedRulesCount: to.Ptr[int32](6), - // TotalPassedRulesCount: to.Ptr[int32](20), - // TotalRulesCount: to.Ptr[int32](26), - // TriggerType: to.Ptr(armsql.VulnerabilityAssessmentScanTriggerTypeRecurring), - // }, - // }, - // { - // Name: to.Ptr("scan001"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/sqlVulnerabilityAssessments/scans"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityassessmenttest-4711/providers/Microsoft.Sql/servers/vulnerabilityassessmenttest-6411/databases/testdb/sqlVulnerabilityAssessments/default/scans/scan002"), - // Properties: &armsql.VulnerabilityAssessmentScanRecordForSQLProperties{ - // Database: to.Ptr("testdb"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-23T06:49:00.7236217Z"); return t}()), - // HighSeverityFailedRulesCount: to.Ptr[int32](3), - // IsBaselineApplied: to.Ptr(false), - // LastScanTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-22T23:49:00.6455136-07:00"); return t}()), - // LowSeverityFailedRulesCount: to.Ptr[int32](1), - // MediumSeverityFailedRulesCount: to.Ptr[int32](2), - // ScanID: to.Ptr("scan002"), - // Server: to.Ptr("vulnerabilityassessmenttest-6411"), - // SQLVersion: to.Ptr("15.0.2000"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-22T23:49:00.6455136-07:00"); return t}()), - // State: to.Ptr(armsql.VulnerabilityAssessmentScanStateFailed), - // TotalFailedRulesCount: to.Ptr[int32](6), - // TotalPassedRulesCount: to.Ptr[int32](20), - // TotalRulesCount: to.Ptr[int32](26), - // TriggerType: to.Ptr(armsql.VulnerabilityAssessmentScanTriggerTypeRecurring), - // }, - // }, - // { - // Name: to.Ptr("scan001"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/sqlVulnerabilityAssessments/scans"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityassessmenttest-4711/providers/Microsoft.Sql/servers/vulnerabilityassessmenttest-6411/databases/testdb/sqlVulnerabilityAssessments/default/scans/scan003"), - // Properties: &armsql.VulnerabilityAssessmentScanRecordForSQLProperties{ - // Database: to.Ptr("testdb"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-23T06:49:00.7236217Z"); return t}()), - // HighSeverityFailedRulesCount: to.Ptr[int32](3), - // IsBaselineApplied: to.Ptr(false), - // LastScanTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-22T23:49:00.6455136-07:00"); return t}()), - // LowSeverityFailedRulesCount: to.Ptr[int32](1), - // MediumSeverityFailedRulesCount: to.Ptr[int32](2), - // ScanID: to.Ptr("scan003"), - // Server: to.Ptr("vulnerabilityassessmenttest-6411"), - // SQLVersion: to.Ptr("15.0.2000"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-22T23:49:00.6455136-07:00"); return t}()), - // State: to.Ptr(armsql.VulnerabilityAssessmentScanStateFailed), - // TotalFailedRulesCount: to.Ptr[int32](6), - // TotalPassedRulesCount: to.Ptr[int32](20), - // TotalRulesCount: to.Ptr[int32](26), - // TriggerType: to.Ptr(armsql.VulnerabilityAssessmentScanTriggerTypeRecurring), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/DatabaseSqlVulnerabilityAssessmentScan.json -func ExampleDatabaseSQLVulnerabilityAssessmentScansClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatabaseSQLVulnerabilityAssessmentScansClient().Get(ctx, "vulnerabilityassessmenttest-4711", "vulnerabilityassessmenttest-6411", "testdb", armsql.VulnerabilityAssessmentNameDefault, "scan001", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VulnerabilityAssessmentScanRecordForSQL = armsql.VulnerabilityAssessmentScanRecordForSQL{ - // Name: to.Ptr("scan001"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/sqlVulnerabilityAssessments/scans"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityassessmenttest-4711/providers/Microsoft.Sql/servers/vulnerabilityassessmenttest-6411/databases/testdb/sqlVulnerabilityAssessments/default/scans/scan001"), - // Properties: &armsql.VulnerabilityAssessmentScanRecordForSQLProperties{ - // Database: to.Ptr("testdb"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-23T06:49:00.7236217Z"); return t}()), - // HighSeverityFailedRulesCount: to.Ptr[int32](3), - // IsBaselineApplied: to.Ptr(false), - // LastScanTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-22T23:49:00.6455136-07:00"); return t}()), - // LowSeverityFailedRulesCount: to.Ptr[int32](1), - // MediumSeverityFailedRulesCount: to.Ptr[int32](2), - // ScanID: to.Ptr("scan001"), - // Server: to.Ptr("vulnerabilityassessmenttest-6411"), - // SQLVersion: to.Ptr("15.0.2000"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-22T23:49:00.6455136-07:00"); return t}()), - // State: to.Ptr(armsql.VulnerabilityAssessmentScanStateFailed), - // TotalFailedRulesCount: to.Ptr[int32](6), - // TotalPassedRulesCount: to.Ptr[int32](20), - // TotalRulesCount: to.Ptr[int32](26), - // TriggerType: to.Ptr(armsql.VulnerabilityAssessmentScanTriggerTypeRecurring), - // }, - // } -} diff --git a/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentssettings_client.go b/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentssettings_client.go index 437aa17d02dc..c4d71c34ab3f 100644 --- a/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentssettings_client.go +++ b/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentssettings_client.go @@ -46,7 +46,7 @@ func NewDatabaseSQLVulnerabilityAssessmentsSettingsClient(subscriptionID string, // Get - Gets SQL Vulnerability Assessment policy for database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -100,7 +100,7 @@ func (client *DatabaseSQLVulnerabilityAssessmentsSettingsClient) getCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -117,7 +117,7 @@ func (client *DatabaseSQLVulnerabilityAssessmentsSettingsClient) getHandleRespon // NewListByDatabasePager - Lists SQL Vulnerability Assessment policies associated with a database. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -176,7 +176,7 @@ func (client *DatabaseSQLVulnerabilityAssessmentsSettingsClient) listByDatabaseC return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentssettings_client_example_test.go b/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentssettings_client_example_test.go deleted file mode 100644 index 28afa967c8d8..000000000000 --- a/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentssettings_client_example_test.go +++ /dev/null @@ -1,82 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/DatabaseSqlVulnerabilityAssessmentListByDatabase.json -func ExampleDatabaseSQLVulnerabilityAssessmentsSettingsClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDatabaseSQLVulnerabilityAssessmentsSettingsClient().NewListByDatabasePager("vulnerabilityaseessmenttest-4799", "vulnerabilityaseessmenttest-6440", "testdb", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VulnerabilityAssessmentListResult = armsql.VulnerabilityAssessmentListResult{ - // Value: []*armsql.VulnerabilityAssessment{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/sqlVulnerabilityAssessments"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/servers/vulnerabilityaseessmenttest-6440/databases/testdb/sqlVulnerabilityAssessments/default"), - // Properties: &armsql.VulnerabilityAssessmentPolicyProperties{ - // State: to.Ptr(armsql.SQLVulnerabilityAssessmentStateEnabled), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/DatabaseSqlVulnerabilityAssessmentGet.json -func ExampleDatabaseSQLVulnerabilityAssessmentsSettingsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatabaseSQLVulnerabilityAssessmentsSettingsClient().Get(ctx, "vulnerabilityaseessmenttest-4799", "vulnerabilityaseessmenttest-6440", "testdb", armsql.SQLVulnerabilityAssessmentNameDefault, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VulnerabilityAssessment = armsql.VulnerabilityAssessment{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/sqlVulnerabilityAssessments"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/servers/vulnerabilityaseessmenttest-6440/databases/testdb/sqlVulnerabilityAssessments/default"), - // Properties: &armsql.VulnerabilityAssessmentPolicyProperties{ - // State: to.Ptr(armsql.SQLVulnerabilityAssessmentStateEnabled), - // }, - // } -} diff --git a/sdk/resourcemanager/sql/armsql/databasetables_client.go b/sdk/resourcemanager/sql/armsql/databasetables_client.go index dfb40fcc1c92..4951d216c778 100644 --- a/sdk/resourcemanager/sql/armsql/databasetables_client.go +++ b/sdk/resourcemanager/sql/armsql/databasetables_client.go @@ -46,7 +46,7 @@ func NewDatabaseTablesClient(subscriptionID string, credential azcore.TokenCrede // Get - Get database table // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -104,7 +104,7 @@ func (client *DatabaseTablesClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -121,7 +121,7 @@ func (client *DatabaseTablesClient) getHandleResponse(resp *http.Response) (Data // NewListBySchemaPager - List database tables // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -188,7 +188,7 @@ func (client *DatabaseTablesClient) listBySchemaCreateRequest(ctx context.Contex if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/databasetables_client_example_test.go b/sdk/resourcemanager/sql/armsql/databasetables_client_example_test.go deleted file mode 100644 index 3c40e4dac248..000000000000 --- a/sdk/resourcemanager/sql/armsql/databasetables_client_example_test.go +++ /dev/null @@ -1,81 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseTableListBySchema.json -func ExampleDatabaseTablesClient_NewListBySchemaPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDatabaseTablesClient().NewListBySchemaPager("myRG", "serverName", "myDatabase", "dbo", &armsql.DatabaseTablesClientListBySchemaOptions{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.DatabaseTableListResult = armsql.DatabaseTableListResult{ - // Value: []*armsql.DatabaseTable{ - // { - // Name: to.Ptr("table1"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/schemas/tables"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myRG/providers/Microsoft.Sql/servers/serverName/databases/myDatabase/schemas/dbo/tables/table1"), - // }, - // { - // Name: to.Ptr("table2"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/schemas/tables"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myRG/providers/Microsoft.Sql/servers/serverName/databases/myDatabase/schemas/dbo/tables/table2"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseTableGet.json -func ExampleDatabaseTablesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatabaseTablesClient().Get(ctx, "myRG", "serverName", "myDatabase", "dbo", "table1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DatabaseTable = armsql.DatabaseTable{ - // Name: to.Ptr("table1"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/schemas/tables"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myRG/providers/Microsoft.Sql/servers/serverName/databases/myDatabase/schemas/dbo/tables/table1"), - // } -} diff --git a/sdk/resourcemanager/sql/armsql/databaseusages_client.go b/sdk/resourcemanager/sql/armsql/databaseusages_client.go index 2804f2441aa8..9d662e698ef1 100644 --- a/sdk/resourcemanager/sql/armsql/databaseusages_client.go +++ b/sdk/resourcemanager/sql/armsql/databaseusages_client.go @@ -45,7 +45,7 @@ func NewDatabaseUsagesClient(subscriptionID string, credential azcore.TokenCrede // NewListByDatabasePager - Gets database usages. // -// Generated from API version 2021-02-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -104,7 +104,7 @@ func (client *DatabaseUsagesClient) listByDatabaseCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-02-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/databaseusages_client_example_test.go b/sdk/resourcemanager/sql/armsql/databaseusages_client_example_test.go deleted file mode 100644 index 173f2794e1eb..000000000000 --- a/sdk/resourcemanager/sql/armsql/databaseusages_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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/GetDatabaseUsages.json -func ExampleDatabaseUsagesClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDatabaseUsagesClient().NewListByDatabasePager("Default-SQL-SouthEastAsia", "testsvr", "testdb", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DatabaseUsageListResult = armsql.DatabaseUsageListResult{ - // Value: []*armsql.DatabaseUsage{ - // { - // Name: to.Ptr("database_size"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/usages"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb/usages/database_size"), - // Properties: &armsql.DatabaseUsageProperties{ - // CurrentValue: to.Ptr[float64](4194304), - // DisplayName: to.Ptr("Database Size"), - // Limit: to.Ptr[float64](268435456000), - // Unit: to.Ptr("Bytes"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/sql/armsql/databasevulnerabilityassessmentrulebaselines_client.go b/sdk/resourcemanager/sql/armsql/databasevulnerabilityassessmentrulebaselines_client.go index 3746fd7c88d8..beb291c8f880 100644 --- a/sdk/resourcemanager/sql/armsql/databasevulnerabilityassessmentrulebaselines_client.go +++ b/sdk/resourcemanager/sql/armsql/databasevulnerabilityassessmentrulebaselines_client.go @@ -46,7 +46,7 @@ func NewDatabaseVulnerabilityAssessmentRuleBaselinesClient(subscriptionID string // CreateOrUpdate - Creates or updates a database's vulnerability assessment rule baseline. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -112,7 +112,7 @@ func (client *DatabaseVulnerabilityAssessmentRuleBaselinesClient) createOrUpdate return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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 *DatabaseVulnerabilityAssessmentRuleBaselinesClient) createOrUpdate // Delete - Removes the database's vulnerability assessment rule baseline. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -197,7 +197,7 @@ func (client *DatabaseVulnerabilityAssessmentRuleBaselinesClient) deleteCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -205,7 +205,7 @@ func (client *DatabaseVulnerabilityAssessmentRuleBaselinesClient) deleteCreateRe // Get - Gets a database's vulnerability assessment rule baseline. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -270,7 +270,7 @@ func (client *DatabaseVulnerabilityAssessmentRuleBaselinesClient) getCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/databasevulnerabilityassessmentrulebaselines_client_example_test.go b/sdk/resourcemanager/sql/armsql/databasevulnerabilityassessmentrulebaselines_client_example_test.go deleted file mode 100644 index 9accc2ac5b41..000000000000 --- a/sdk/resourcemanager/sql/armsql/databasevulnerabilityassessmentrulebaselines_client_example_test.go +++ /dev/null @@ -1,144 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentRuleBaselineGet.json -func ExampleDatabaseVulnerabilityAssessmentRuleBaselinesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatabaseVulnerabilityAssessmentRuleBaselinesClient().Get(ctx, "vulnerabilityaseessmenttest-4711", "vulnerabilityaseessmenttest-6411", "testdb", armsql.VulnerabilityAssessmentNameDefault, "VA1001", armsql.VulnerabilityAssessmentPolicyBaselineNameMaster, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DatabaseVulnerabilityAssessmentRuleBaseline = armsql.DatabaseVulnerabilityAssessmentRuleBaseline{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/vulnerabilityAssessments/rules/baselines"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/servers/vulnerabilityaseessmenttest-6440/databases/testdb/vulnerabilityAssessments/default/rules/VA1001/baselines/default"), - // Properties: &armsql.DatabaseVulnerabilityAssessmentRuleBaselineProperties{ - // BaselineResults: []*armsql.DatabaseVulnerabilityAssessmentRuleBaselineItem{ - // { - // Result: []*string{ - // to.Ptr("userA"), - // to.Ptr("SELECT")}, - // }, - // { - // Result: []*string{ - // to.Ptr("userB"), - // to.Ptr("SELECT")}, - // }, - // { - // Result: []*string{ - // to.Ptr("userC"), - // to.Ptr("SELECT"), - // to.Ptr("tableId_4")}, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentRuleBaselineCreate.json -func ExampleDatabaseVulnerabilityAssessmentRuleBaselinesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatabaseVulnerabilityAssessmentRuleBaselinesClient().CreateOrUpdate(ctx, "vulnerabilityaseessmenttest-4799", "vulnerabilityaseessmenttest-6440", "testdb", armsql.VulnerabilityAssessmentNameDefault, "VA1001", armsql.VulnerabilityAssessmentPolicyBaselineNameDefault, armsql.DatabaseVulnerabilityAssessmentRuleBaseline{ - Properties: &armsql.DatabaseVulnerabilityAssessmentRuleBaselineProperties{ - BaselineResults: []*armsql.DatabaseVulnerabilityAssessmentRuleBaselineItem{ - { - Result: []*string{ - to.Ptr("userA"), - to.Ptr("SELECT")}, - }, - { - Result: []*string{ - to.Ptr("userB"), - to.Ptr("SELECT")}, - }, - { - Result: []*string{ - to.Ptr("userC"), - to.Ptr("SELECT"), - to.Ptr("tableId_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.DatabaseVulnerabilityAssessmentRuleBaseline = armsql.DatabaseVulnerabilityAssessmentRuleBaseline{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/vulnerabilityAssessments/rules/baselines"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/servers/vulnerabilityaseessmenttest-6440/databases/testdb/vulnerabilityAssessments/default/rules/VA1001/baselines/default"), - // Properties: &armsql.DatabaseVulnerabilityAssessmentRuleBaselineProperties{ - // BaselineResults: []*armsql.DatabaseVulnerabilityAssessmentRuleBaselineItem{ - // { - // Result: []*string{ - // to.Ptr("userA"), - // to.Ptr("SELECT")}, - // }, - // { - // Result: []*string{ - // to.Ptr("userB"), - // to.Ptr("SELECT")}, - // }, - // { - // Result: []*string{ - // to.Ptr("userC"), - // to.Ptr("SELECT"), - // to.Ptr("tableId_4")}, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentRuleBaselineDelete.json -func ExampleDatabaseVulnerabilityAssessmentRuleBaselinesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewDatabaseVulnerabilityAssessmentRuleBaselinesClient().Delete(ctx, "vulnerabilityaseessmenttest-4799", "vulnerabilityaseessmenttest-6440", "testdb", armsql.VulnerabilityAssessmentNameDefault, "VA1001", armsql.VulnerabilityAssessmentPolicyBaselineNameDefault, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/sql/armsql/databasevulnerabilityassessments_client.go b/sdk/resourcemanager/sql/armsql/databasevulnerabilityassessments_client.go index 1a58243174d0..5f43d8765679 100644 --- a/sdk/resourcemanager/sql/armsql/databasevulnerabilityassessments_client.go +++ b/sdk/resourcemanager/sql/armsql/databasevulnerabilityassessments_client.go @@ -46,7 +46,7 @@ func NewDatabaseVulnerabilityAssessmentsClient(subscriptionID string, credential // CreateOrUpdate - Creates or updates the database's vulnerability assessment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -101,7 +101,7 @@ func (client *DatabaseVulnerabilityAssessmentsClient) createOrUpdateCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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 *DatabaseVulnerabilityAssessmentsClient) createOrUpdateHandleRespon // Delete - Removes the database's vulnerability assessment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -175,7 +175,7 @@ func (client *DatabaseVulnerabilityAssessmentsClient) deleteCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -183,7 +183,7 @@ func (client *DatabaseVulnerabilityAssessmentsClient) deleteCreateRequest(ctx co // Get - Gets the database's vulnerability assessment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -237,7 +237,7 @@ func (client *DatabaseVulnerabilityAssessmentsClient) getCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -254,7 +254,7 @@ func (client *DatabaseVulnerabilityAssessmentsClient) getHandleResponse(resp *ht // NewListByDatabasePager - Lists the vulnerability assessment policies associated with a database. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -313,7 +313,7 @@ func (client *DatabaseVulnerabilityAssessmentsClient) listByDatabaseCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/databasevulnerabilityassessments_client_example_test.go b/sdk/resourcemanager/sql/armsql/databasevulnerabilityassessments_client_example_test.go deleted file mode 100644 index 86bd7953f6db..000000000000 --- a/sdk/resourcemanager/sql/armsql/databasevulnerabilityassessments_client_example_test.go +++ /dev/null @@ -1,235 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentGet.json -func ExampleDatabaseVulnerabilityAssessmentsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatabaseVulnerabilityAssessmentsClient().Get(ctx, "vulnerabilityaseessmenttest-4799", "vulnerabilityaseessmenttest-6440", "testdb", armsql.VulnerabilityAssessmentNameDefault, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DatabaseVulnerabilityAssessment = armsql.DatabaseVulnerabilityAssessment{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/vulnerabilityAssessments"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/servers/vulnerabilityaseessmenttest-6440/databases/testdb/vulnerabilityAssessments/default"), - // Properties: &armsql.DatabaseVulnerabilityAssessmentProperties{ - // RecurringScans: &armsql.VulnerabilityAssessmentRecurringScansProperties{ - // EmailSubscriptionAdmins: to.Ptr(true), - // Emails: []*string{ - // to.Ptr("email1@mail.com"), - // to.Ptr("email2@mail.com")}, - // IsEnabled: to.Ptr(true), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentCreateMax.json -func ExampleDatabaseVulnerabilityAssessmentsClient_CreateOrUpdate_createADatabasesVulnerabilityAssessmentWithAllParameters() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatabaseVulnerabilityAssessmentsClient().CreateOrUpdate(ctx, "vulnerabilityaseessmenttest-4799", "vulnerabilityaseessmenttest-6440", "testdb", armsql.VulnerabilityAssessmentNameDefault, armsql.DatabaseVulnerabilityAssessment{ - Properties: &armsql.DatabaseVulnerabilityAssessmentProperties{ - RecurringScans: &armsql.VulnerabilityAssessmentRecurringScansProperties{ - EmailSubscriptionAdmins: to.Ptr(true), - Emails: []*string{ - to.Ptr("email1@mail.com"), - to.Ptr("email2@mail.com")}, - IsEnabled: to.Ptr(true), - }, - StorageAccountAccessKey: to.Ptr("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"), - StorageContainerPath: to.Ptr("https://myStorage.blob.core.windows.net/vulnerability-assessment/"), - StorageContainerSasKey: to.Ptr("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DatabaseVulnerabilityAssessment = armsql.DatabaseVulnerabilityAssessment{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/vulnerabilityAssessments"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/servers/vulnerabilityaseessmenttest-6440/databases/testdb/vulnerabilityAssessments/default"), - // Properties: &armsql.DatabaseVulnerabilityAssessmentProperties{ - // RecurringScans: &armsql.VulnerabilityAssessmentRecurringScansProperties{ - // EmailSubscriptionAdmins: to.Ptr(true), - // Emails: []*string{ - // to.Ptr("email1@mail.com"), - // to.Ptr("email2@mail.com")}, - // IsEnabled: to.Ptr(true), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentCreateStorageAccessKeyMin.json -func ExampleDatabaseVulnerabilityAssessmentsClient_CreateOrUpdate_createADatabasesVulnerabilityAssessmentWithMinimalParametersWhenStorageAccountAccessKeyIsSpecified() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatabaseVulnerabilityAssessmentsClient().CreateOrUpdate(ctx, "vulnerabilityaseessmenttest-4799", "vulnerabilityaseessmenttest-6440", "testdb", armsql.VulnerabilityAssessmentNameDefault, armsql.DatabaseVulnerabilityAssessment{ - Properties: &armsql.DatabaseVulnerabilityAssessmentProperties{ - StorageAccountAccessKey: to.Ptr("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"), - StorageContainerPath: to.Ptr("https://myStorage.blob.core.windows.net/vulnerability-assessment/"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DatabaseVulnerabilityAssessment = armsql.DatabaseVulnerabilityAssessment{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/vulnerabilityAssessments"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/servers/vulnerabilityaseessmenttest-6440/databases/testdb/vulnerabilityAssessments/default"), - // Properties: &armsql.DatabaseVulnerabilityAssessmentProperties{ - // RecurringScans: &armsql.VulnerabilityAssessmentRecurringScansProperties{ - // EmailSubscriptionAdmins: to.Ptr(false), - // Emails: []*string{ - // }, - // IsEnabled: to.Ptr(true), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentCreateContainerSasKeyMin.json -func ExampleDatabaseVulnerabilityAssessmentsClient_CreateOrUpdate_createADatabasesVulnerabilityAssessmentWithMinimalParametersWhenStorageContainerSasKeyIsSpecified() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatabaseVulnerabilityAssessmentsClient().CreateOrUpdate(ctx, "vulnerabilityaseessmenttest-4799", "vulnerabilityaseessmenttest-6440", "testdb", armsql.VulnerabilityAssessmentNameDefault, armsql.DatabaseVulnerabilityAssessment{ - Properties: &armsql.DatabaseVulnerabilityAssessmentProperties{ - StorageContainerPath: to.Ptr("https://myStorage.blob.core.windows.net/vulnerability-assessment/"), - StorageContainerSasKey: to.Ptr("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DatabaseVulnerabilityAssessment = armsql.DatabaseVulnerabilityAssessment{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/vulnerabilityAssessments"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/servers/vulnerabilityaseessmenttest-6440/databases/testdb/vulnerabilityAssessments/default"), - // Properties: &armsql.DatabaseVulnerabilityAssessmentProperties{ - // RecurringScans: &armsql.VulnerabilityAssessmentRecurringScansProperties{ - // EmailSubscriptionAdmins: to.Ptr(false), - // Emails: []*string{ - // }, - // IsEnabled: to.Ptr(true), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentDelete.json -func ExampleDatabaseVulnerabilityAssessmentsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewDatabaseVulnerabilityAssessmentsClient().Delete(ctx, "vulnerabilityaseessmenttest-4799", "vulnerabilityaseessmenttest-6440", "testdb", armsql.VulnerabilityAssessmentNameDefault, 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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentListByDatabase.json -func ExampleDatabaseVulnerabilityAssessmentsClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDatabaseVulnerabilityAssessmentsClient().NewListByDatabasePager("vulnerabilityaseessmenttest-4799", "vulnerabilityaseessmenttest-6440", "testdb", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DatabaseVulnerabilityAssessmentListResult = armsql.DatabaseVulnerabilityAssessmentListResult{ - // Value: []*armsql.DatabaseVulnerabilityAssessment{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/vulnerabilityAssessments"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/servers/vulnerabilityaseessmenttest-6440/databases/testdb/vulnerabilityAssessments/default"), - // Properties: &armsql.DatabaseVulnerabilityAssessmentProperties{ - // RecurringScans: &armsql.VulnerabilityAssessmentRecurringScansProperties{ - // EmailSubscriptionAdmins: to.Ptr(true), - // Emails: []*string{ - // to.Ptr("email1@mail.com"), - // to.Ptr("email2@mail.com")}, - // IsEnabled: to.Ptr(true), - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/sql/armsql/databasevulnerabilityassessmentscans_client.go b/sdk/resourcemanager/sql/armsql/databasevulnerabilityassessmentscans_client.go index 3f6e910fc324..c20f0c3935c5 100644 --- a/sdk/resourcemanager/sql/armsql/databasevulnerabilityassessmentscans_client.go +++ b/sdk/resourcemanager/sql/armsql/databasevulnerabilityassessmentscans_client.go @@ -46,7 +46,7 @@ func NewDatabaseVulnerabilityAssessmentScansClient(subscriptionID string, creden // Export - Convert an existing scan result to a human readable format. If already exists nothing happens // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -105,7 +105,7 @@ func (client *DatabaseVulnerabilityAssessmentScansClient) exportCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -123,7 +123,7 @@ func (client *DatabaseVulnerabilityAssessmentScansClient) exportHandleResponse(r // Get - Gets a vulnerability assessment scan record of a database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -182,7 +182,7 @@ func (client *DatabaseVulnerabilityAssessmentScansClient) getCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -200,7 +200,7 @@ func (client *DatabaseVulnerabilityAssessmentScansClient) getHandleResponse(resp // BeginInitiateScan - Executes a Vulnerability Assessment database scan. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -225,7 +225,7 @@ func (client *DatabaseVulnerabilityAssessmentScansClient) BeginInitiateScan(ctx // InitiateScan - Executes a Vulnerability Assessment database scan. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview func (client *DatabaseVulnerabilityAssessmentScansClient) initiateScan(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, scanID string, options *DatabaseVulnerabilityAssessmentScansClientBeginInitiateScanOptions) (*http.Response, error) { var err error req, err := client.initiateScanCreateRequest(ctx, resourceGroupName, serverName, databaseName, vulnerabilityAssessmentName, scanID, options) @@ -275,14 +275,14 @@ func (client *DatabaseVulnerabilityAssessmentScansClient) initiateScanCreateRequ return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // NewListByDatabasePager - Lists the vulnerability assessment scans of a database. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -346,7 +346,7 @@ func (client *DatabaseVulnerabilityAssessmentScansClient) listByDatabaseCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/databasevulnerabilityassessmentscans_client_example_test.go b/sdk/resourcemanager/sql/armsql/databasevulnerabilityassessmentscans_client_example_test.go deleted file mode 100644 index 537138bd5211..000000000000 --- a/sdk/resourcemanager/sql/armsql/databasevulnerabilityassessmentscans_client_example_test.go +++ /dev/null @@ -1,182 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentScansExecute.json -func ExampleDatabaseVulnerabilityAssessmentScansClient_BeginInitiateScan() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatabaseVulnerabilityAssessmentScansClient().BeginInitiateScan(ctx, "vulnerabilityassessmenttest-4711", "vulnerabilityassessmenttest-6411", "testdb", armsql.VulnerabilityAssessmentNameDefault, "scan01", 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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentScanRecordsListByDatabase.json -func ExampleDatabaseVulnerabilityAssessmentScansClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDatabaseVulnerabilityAssessmentScansClient().NewListByDatabasePager("vulnerabilityassessmenttest-4711", "vulnerabilityassessmenttest-6411", "testdb", armsql.VulnerabilityAssessmentNameDefault, nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VulnerabilityAssessmentScanRecordListResult = armsql.VulnerabilityAssessmentScanRecordListResult{ - // Value: []*armsql.VulnerabilityAssessmentScanRecord{ - // { - // Name: to.Ptr("scan001"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/vulnerabilityAssessments/scans"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityassessmenttest-4799/providers/Microsoft.Sql/servers/vulnerabilityassessmenttest-6440/databases/testdb/vulnerabilityAssessments/default/scans/scan001"), - // Properties: &armsql.VulnerabilityAssessmentScanRecordProperties{ - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-12T17:47:06Z"); return t}()), - // Errors: []*armsql.VulnerabilityAssessmentScanError{ - // }, - // NumberOfFailedSecurityChecks: to.Ptr[int32](9), - // ScanID: to.Ptr("scan001"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-12T17:45:06Z"); return t}()), - // State: to.Ptr(armsql.VulnerabilityAssessmentScanStatePassed), - // StorageContainerPath: to.Ptr("https://myaccount.blob.core.windows.net/vulnerability-assessment"), - // TriggerType: to.Ptr(armsql.VulnerabilityAssessmentScanTriggerTypeOnDemand), - // }, - // }, - // { - // Name: to.Ptr("scan002"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/vulnerabilityAssessments/scans"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityassessmenttest-4799/providers/Microsoft.Sql/servers/vulnerabilityassessmenttest-6440/databases/testdb/vulnerabilityAssessments/default/scans/scan002"), - // Properties: &armsql.VulnerabilityAssessmentScanRecordProperties{ - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-12T17:47:06Z"); return t}()), - // Errors: []*armsql.VulnerabilityAssessmentScanError{ - // }, - // NumberOfFailedSecurityChecks: to.Ptr[int32](9), - // ScanID: to.Ptr("scan002"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-12T17:45:06Z"); return t}()), - // State: to.Ptr(armsql.VulnerabilityAssessmentScanStateFailed), - // StorageContainerPath: to.Ptr("https://myaccount.blob.core.windows.net/vulnerability-assessment"), - // TriggerType: to.Ptr(armsql.VulnerabilityAssessmentScanTriggerTypeRecurring), - // }, - // }, - // { - // Name: to.Ptr("scan003"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/vulnerabilityAssessments/scans"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityassessmenttest-4799/providers/Microsoft.Sql/servers/vulnerabilityassessmenttest-6440/databases/testdb/vulnerabilityAssessments/default/scans/scan003"), - // Properties: &armsql.VulnerabilityAssessmentScanRecordProperties{ - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-12T17:47:06Z"); return t}()), - // Errors: []*armsql.VulnerabilityAssessmentScanError{ - // { - // Code: to.Ptr("StorageNotFound"), - // Message: to.Ptr("Storage not found"), - // }}, - // NumberOfFailedSecurityChecks: to.Ptr[int32](0), - // ScanID: to.Ptr("scan003"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-12T17:45:06Z"); return t}()), - // State: to.Ptr(armsql.VulnerabilityAssessmentScanStateFailedToRun), - // StorageContainerPath: to.Ptr("https://myaccount.blob.core.windows.net/vulnerability-assessment"), - // TriggerType: to.Ptr(armsql.VulnerabilityAssessmentScanTriggerTypeRecurring), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentScanRecordsGet.json -func ExampleDatabaseVulnerabilityAssessmentScansClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatabaseVulnerabilityAssessmentScansClient().Get(ctx, "vulnerabilityassessmenttest-4711", "vulnerabilityassessmenttest-6411", "testdb", armsql.VulnerabilityAssessmentNameDefault, "scan001", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VulnerabilityAssessmentScanRecord = armsql.VulnerabilityAssessmentScanRecord{ - // Name: to.Ptr("scan001"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/vulnerabilityAssessments/scans"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityassessmenttest-4799/providers/Microsoft.Sql/servers/vulnerabilityassessmenttest-6440/databases/testdb/vulnerabilityAssessments/default/scans/scan001"), - // Properties: &armsql.VulnerabilityAssessmentScanRecordProperties{ - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-12T17:47:06Z"); return t}()), - // Errors: []*armsql.VulnerabilityAssessmentScanError{ - // }, - // NumberOfFailedSecurityChecks: to.Ptr[int32](9), - // ScanID: to.Ptr("scan001"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-12T17:45:06Z"); return t}()), - // State: to.Ptr(armsql.VulnerabilityAssessmentScanStatePassed), - // StorageContainerPath: to.Ptr("https://myaccount.blob.core.windows.net/vulnerability-assessment"), - // TriggerType: to.Ptr(armsql.VulnerabilityAssessmentScanTriggerTypeOnDemand), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentScanExport.json -func ExampleDatabaseVulnerabilityAssessmentScansClient_Export() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatabaseVulnerabilityAssessmentScansClient().Export(ctx, "vulnerabilityassessmenttest-4799", "vulnerabilityassessmenttest-6440", "testdb", armsql.VulnerabilityAssessmentNameDefault, "scan001", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DatabaseVulnerabilityAssessmentScansExport = armsql.DatabaseVulnerabilityAssessmentScansExport{ - // Name: to.Ptr("scan001"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/vulnerabilityAssessments/scans/export"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityassessmenttest-4799/providers/Microsoft.Sql/servers/vulnerabilityassessmenttest-6440/databases/testdb/vulnerabilityAssessments/default/scans/scan001/export"), - // Properties: &armsql.DatabaseVulnerabilityAssessmentScanExportProperties{ - // ExportedReportLocation: to.Ptr("https://myaccount.blob.core.windows.net/vulnerabilityAssessment/vulnerabilityassessmenttest-6440/testdb/scan001.xlsx"), - // }, - // } -} diff --git a/sdk/resourcemanager/sql/armsql/datamaskingpolicies_client.go b/sdk/resourcemanager/sql/armsql/datamaskingpolicies_client.go index 5de5c533779c..8ea78c7e9304 100644 --- a/sdk/resourcemanager/sql/armsql/datamaskingpolicies_client.go +++ b/sdk/resourcemanager/sql/armsql/datamaskingpolicies_client.go @@ -43,20 +43,21 @@ func NewDataMaskingPoliciesClient(subscriptionID string, credential azcore.Token return client, nil } -// CreateOrUpdate - Creates or updates a database data masking policy +// CreateOrUpdate - Creates or updates a database data masking policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2014-04-01 +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. // - databaseName - The name of the database. +// - dataMaskingPolicyName - The name of the database for which the data masking policy applies. // - parameters - Parameters for creating or updating a data masking policy. // - options - DataMaskingPoliciesClientCreateOrUpdateOptions contains the optional parameters for the DataMaskingPoliciesClient.CreateOrUpdate // method. -func (client *DataMaskingPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters DataMaskingPolicy, options *DataMaskingPoliciesClientCreateOrUpdateOptions) (DataMaskingPoliciesClientCreateOrUpdateResponse, error) { +func (client *DataMaskingPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, dataMaskingPolicyName DataMaskingPolicyName, parameters DataMaskingPolicy, options *DataMaskingPoliciesClientCreateOrUpdateOptions) (DataMaskingPoliciesClientCreateOrUpdateResponse, error) { var err error - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, parameters, options) + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, dataMaskingPolicyName, parameters, options) if err != nil { return DataMaskingPoliciesClientCreateOrUpdateResponse{}, err } @@ -64,7 +65,7 @@ func (client *DataMaskingPoliciesClient) CreateOrUpdate(ctx context.Context, res if err != nil { return DataMaskingPoliciesClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { err = runtime.NewResponseError(httpResp) return DataMaskingPoliciesClientCreateOrUpdateResponse{}, err } @@ -73,12 +74,8 @@ func (client *DataMaskingPoliciesClient) CreateOrUpdate(ctx context.Context, res } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *DataMaskingPoliciesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters DataMaskingPolicy, options *DataMaskingPoliciesClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *DataMaskingPoliciesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, dataMaskingPolicyName DataMaskingPolicyName, parameters DataMaskingPolicy, options *DataMaskingPoliciesClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataMaskingPolicies/{dataMaskingPolicyName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -91,13 +88,20 @@ func (client *DataMaskingPoliciesClient) createOrUpdateCreateRequest(ctx context return nil, errors.New("parameter databaseName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) - urlPath = strings.ReplaceAll(urlPath, "{dataMaskingPolicyName}", url.PathEscape("Default")) + if dataMaskingPolicyName == "" { + return nil, errors.New("parameter dataMaskingPolicyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{dataMaskingPolicyName}", url.PathEscape(string(dataMaskingPolicyName))) + 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.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2014-04-01") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -115,18 +119,19 @@ func (client *DataMaskingPoliciesClient) createOrUpdateHandleResponse(resp *http return result, nil } -// Get - Gets a database data masking policy. +// Get - Gets the database data masking policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2014-04-01 +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. // - databaseName - The name of the database. +// - dataMaskingPolicyName - The name of the database for which the data masking policy applies. // - options - DataMaskingPoliciesClientGetOptions contains the optional parameters for the DataMaskingPoliciesClient.Get method. -func (client *DataMaskingPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DataMaskingPoliciesClientGetOptions) (DataMaskingPoliciesClientGetResponse, error) { +func (client *DataMaskingPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, dataMaskingPolicyName DataMaskingPolicyName, options *DataMaskingPoliciesClientGetOptions) (DataMaskingPoliciesClientGetResponse, error) { var err error - req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, options) + req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, dataMaskingPolicyName, options) if err != nil { return DataMaskingPoliciesClientGetResponse{}, err } @@ -143,12 +148,8 @@ func (client *DataMaskingPoliciesClient) Get(ctx context.Context, resourceGroupN } // getCreateRequest creates the Get request. -func (client *DataMaskingPoliciesClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DataMaskingPoliciesClientGetOptions) (*policy.Request, error) { +func (client *DataMaskingPoliciesClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, dataMaskingPolicyName DataMaskingPolicyName, options *DataMaskingPoliciesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataMaskingPolicies/{dataMaskingPolicyName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -161,13 +162,20 @@ func (client *DataMaskingPoliciesClient) getCreateRequest(ctx context.Context, r return nil, errors.New("parameter databaseName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) - urlPath = strings.ReplaceAll(urlPath, "{dataMaskingPolicyName}", url.PathEscape("Default")) + if dataMaskingPolicyName == "" { + return nil, errors.New("parameter dataMaskingPolicyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{dataMaskingPolicyName}", url.PathEscape(string(dataMaskingPolicyName))) + 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.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2014-04-01") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/datamaskingpolicies_client_example_test.go b/sdk/resourcemanager/sql/armsql/datamaskingpolicies_client_example_test.go deleted file mode 100644 index 6dd09499c510..000000000000 --- a/sdk/resourcemanager/sql/armsql/datamaskingpolicies_client_example_test.go +++ /dev/null @@ -1,124 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DataMaskingPolicyCreateOrUpdateMax.json -func ExampleDataMaskingPoliciesClient_CreateOrUpdate_createOrUpdateDataMaskingPolicyMax() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDataMaskingPoliciesClient().CreateOrUpdate(ctx, "sqlcrudtest-6852", "sqlcrudtest-2080", "sqlcrudtest-331", armsql.DataMaskingPolicy{ - Properties: &armsql.DataMaskingPolicyProperties{ - DataMaskingState: to.Ptr(armsql.DataMaskingStateEnabled), - ExemptPrincipals: to.Ptr("testuser;"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DataMaskingPolicy = armsql.DataMaskingPolicy{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/dataMaskingPolicies"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-6852/providers/Microsoft.Sql/servers/sqlcrudtest-2080/databases/sqlcrudtest-331/dataMaskingPolicies/Default"), - // Location: to.Ptr("Central US"), - // Properties: &armsql.DataMaskingPolicyProperties{ - // ApplicationPrincipals: to.Ptr(""), - // DataMaskingState: to.Ptr(armsql.DataMaskingStateEnabled), - // ExemptPrincipals: to.Ptr("testuser;"), - // MaskingLevel: to.Ptr(""), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DataMaskingPolicyCreateOrUpdateMin.json -func ExampleDataMaskingPoliciesClient_CreateOrUpdate_createOrUpdateDataMaskingPolicyMin() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDataMaskingPoliciesClient().CreateOrUpdate(ctx, "sqlcrudtest-6852", "sqlcrudtest-2080", "sqlcrudtest-331", armsql.DataMaskingPolicy{ - Properties: &armsql.DataMaskingPolicyProperties{ - DataMaskingState: to.Ptr(armsql.DataMaskingStateEnabled), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DataMaskingPolicy = armsql.DataMaskingPolicy{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/dataMaskingPolicies"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-6852/providers/Microsoft.Sql/servers/sqlcrudtest-2080/databases/sqlcrudtest-331/dataMaskingPolicies/Default"), - // Location: to.Ptr("Central US"), - // Properties: &armsql.DataMaskingPolicyProperties{ - // ApplicationPrincipals: to.Ptr(""), - // DataMaskingState: to.Ptr(armsql.DataMaskingStateEnabled), - // ExemptPrincipals: to.Ptr(""), - // MaskingLevel: to.Ptr(""), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DataMaskingPolicyGet.json -func ExampleDataMaskingPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDataMaskingPoliciesClient().Get(ctx, "sqlcrudtest-6852", "sqlcrudtest-2080", "sqlcrudtest-331", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DataMaskingPolicy = armsql.DataMaskingPolicy{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/dataMaskingPolicies"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-6852/providers/Microsoft.Sql/servers/sqlcrudtest-2080/databases/sqlcrudtest-331/dataMaskingPolicies/Default"), - // Location: to.Ptr("Central US"), - // Properties: &armsql.DataMaskingPolicyProperties{ - // ApplicationPrincipals: to.Ptr(""), - // DataMaskingState: to.Ptr(armsql.DataMaskingStateEnabled), - // ExemptPrincipals: to.Ptr(""), - // MaskingLevel: to.Ptr(""), - // }, - // } -} diff --git a/sdk/resourcemanager/sql/armsql/datamaskingrules_client.go b/sdk/resourcemanager/sql/armsql/datamaskingrules_client.go index 619e7f8b59fb..9519e71877cd 100644 --- a/sdk/resourcemanager/sql/armsql/datamaskingrules_client.go +++ b/sdk/resourcemanager/sql/armsql/datamaskingrules_client.go @@ -46,18 +46,19 @@ func NewDataMaskingRulesClient(subscriptionID string, credential azcore.TokenCre // CreateOrUpdate - Creates or updates a database data masking rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2014-04-01 +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. // - databaseName - The name of the database. +// - dataMaskingPolicyName - The name of the database for which the data masking policy applies. // - dataMaskingRuleName - The name of the data masking rule. // - parameters - The required parameters for creating or updating a data masking rule. // - options - DataMaskingRulesClientCreateOrUpdateOptions contains the optional parameters for the DataMaskingRulesClient.CreateOrUpdate // method. -func (client *DataMaskingRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, dataMaskingRuleName string, parameters DataMaskingRule, options *DataMaskingRulesClientCreateOrUpdateOptions) (DataMaskingRulesClientCreateOrUpdateResponse, error) { +func (client *DataMaskingRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, dataMaskingPolicyName DataMaskingPolicyName, dataMaskingRuleName string, parameters DataMaskingRule, options *DataMaskingRulesClientCreateOrUpdateOptions) (DataMaskingRulesClientCreateOrUpdateResponse, error) { var err error - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, dataMaskingRuleName, parameters, options) + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, dataMaskingPolicyName, dataMaskingRuleName, parameters, options) if err != nil { return DataMaskingRulesClientCreateOrUpdateResponse{}, err } @@ -74,12 +75,8 @@ func (client *DataMaskingRulesClient) CreateOrUpdate(ctx context.Context, resour } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *DataMaskingRulesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, dataMaskingRuleName string, parameters DataMaskingRule, options *DataMaskingRulesClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *DataMaskingRulesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, dataMaskingPolicyName DataMaskingPolicyName, dataMaskingRuleName string, parameters DataMaskingRule, options *DataMaskingRulesClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataMaskingPolicies/{dataMaskingPolicyName}/rules/{dataMaskingRuleName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -92,17 +89,24 @@ func (client *DataMaskingRulesClient) createOrUpdateCreateRequest(ctx context.Co return nil, errors.New("parameter databaseName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) - urlPath = strings.ReplaceAll(urlPath, "{dataMaskingPolicyName}", url.PathEscape("Default")) + if dataMaskingPolicyName == "" { + return nil, errors.New("parameter dataMaskingPolicyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{dataMaskingPolicyName}", url.PathEscape(string(dataMaskingPolicyName))) if dataMaskingRuleName == "" { return nil, errors.New("parameter dataMaskingRuleName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{dataMaskingRuleName}", url.PathEscape(dataMaskingRuleName)) + 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.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2014-04-01") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -122,20 +126,27 @@ func (client *DataMaskingRulesClient) createOrUpdateHandleResponse(resp *http.Re // NewListByDatabasePager - Gets a list of database data masking rules. // -// Generated from API version 2014-04-01 +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. // - databaseName - The name of the database. +// - dataMaskingPolicyName - The name of the database for which the data masking rule applies. // - options - DataMaskingRulesClientListByDatabaseOptions contains the optional parameters for the DataMaskingRulesClient.NewListByDatabasePager // method. -func (client *DataMaskingRulesClient) NewListByDatabasePager(resourceGroupName string, serverName string, databaseName string, options *DataMaskingRulesClientListByDatabaseOptions) *runtime.Pager[DataMaskingRulesClientListByDatabaseResponse] { +func (client *DataMaskingRulesClient) NewListByDatabasePager(resourceGroupName string, serverName string, databaseName string, dataMaskingPolicyName DataMaskingPolicyName, options *DataMaskingRulesClientListByDatabaseOptions) *runtime.Pager[DataMaskingRulesClientListByDatabaseResponse] { return runtime.NewPager(runtime.PagingHandler[DataMaskingRulesClientListByDatabaseResponse]{ More: func(page DataMaskingRulesClientListByDatabaseResponse) bool { - return false + return page.NextLink != nil && len(*page.NextLink) > 0 }, Fetcher: func(ctx context.Context, page *DataMaskingRulesClientListByDatabaseResponse) (DataMaskingRulesClientListByDatabaseResponse, error) { - req, err := client.listByDatabaseCreateRequest(ctx, resourceGroupName, serverName, databaseName, options) + var req *policy.Request + var err error + if page == nil { + req, err = client.listByDatabaseCreateRequest(ctx, resourceGroupName, serverName, databaseName, dataMaskingPolicyName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } if err != nil { return DataMaskingRulesClientListByDatabaseResponse{}, err } @@ -152,12 +163,8 @@ func (client *DataMaskingRulesClient) NewListByDatabasePager(resourceGroupName s } // listByDatabaseCreateRequest creates the ListByDatabase request. -func (client *DataMaskingRulesClient) listByDatabaseCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DataMaskingRulesClientListByDatabaseOptions) (*policy.Request, error) { +func (client *DataMaskingRulesClient) listByDatabaseCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, dataMaskingPolicyName DataMaskingPolicyName, options *DataMaskingRulesClientListByDatabaseOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataMaskingPolicies/{dataMaskingPolicyName}/rules" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -170,13 +177,20 @@ func (client *DataMaskingRulesClient) listByDatabaseCreateRequest(ctx context.Co return nil, errors.New("parameter databaseName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) - urlPath = strings.ReplaceAll(urlPath, "{dataMaskingPolicyName}", url.PathEscape("Default")) + if dataMaskingPolicyName == "" { + return nil, errors.New("parameter dataMaskingPolicyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{dataMaskingPolicyName}", url.PathEscape(string(dataMaskingPolicyName))) + 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.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2014-04-01") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/datamaskingrules_client_example_test.go b/sdk/resourcemanager/sql/armsql/datamaskingrules_client_example_test.go deleted file mode 100644 index cd0e4413d9c0..000000000000 --- a/sdk/resourcemanager/sql/armsql/datamaskingrules_client_example_test.go +++ /dev/null @@ -1,251 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DataMaskingRuleCreateOrUpdateDefaultMax.json -func ExampleDataMaskingRulesClient_CreateOrUpdate_createUpdateDataMaskingRuleForDefaultMax() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDataMaskingRulesClient().CreateOrUpdate(ctx, "sqlcrudtest-6852", "sqlcrudtest-2080", "sqlcrudtest-331", "rule1", armsql.DataMaskingRule{ - Properties: &armsql.DataMaskingRuleProperties{ - AliasName: to.Ptr("nickname"), - ColumnName: to.Ptr("test1"), - MaskingFunction: to.Ptr(armsql.DataMaskingFunctionDefault), - RuleState: to.Ptr(armsql.DataMaskingRuleStateEnabled), - SchemaName: to.Ptr("dbo"), - TableName: to.Ptr("Table_1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DataMaskingRule = armsql.DataMaskingRule{ - // Type: to.Ptr("Microsoft.Sql/servers/databases/dataMaskingPolicies/rules"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-6852/providers/Microsoft.Sql/servers/sqlcrudtest-6852/databases/sqlcrudtest-331/dataMaskingPolicies/Default/rules/"), - // Location: to.Ptr("Central US"), - // Properties: &armsql.DataMaskingRuleProperties{ - // AliasName: to.Ptr("nickname"), - // ColumnName: to.Ptr("test1"), - // ID: to.Ptr("dbo_Table_1_test1"), - // MaskingFunction: to.Ptr(armsql.DataMaskingFunctionDefault), - // RuleState: to.Ptr(armsql.DataMaskingRuleStateEnabled), - // SchemaName: to.Ptr("dbo"), - // TableName: to.Ptr("Table_1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DataMaskingRuleCreateOrUpdateDefaultMin.json -func ExampleDataMaskingRulesClient_CreateOrUpdate_createUpdateDataMaskingRuleForDefaultMin() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDataMaskingRulesClient().CreateOrUpdate(ctx, "sqlcrudtest-6852", "sqlcrudtest-2080", "sqlcrudtest-331", "rule1", armsql.DataMaskingRule{ - Properties: &armsql.DataMaskingRuleProperties{ - ColumnName: to.Ptr("test1"), - MaskingFunction: to.Ptr(armsql.DataMaskingFunctionDefault), - SchemaName: to.Ptr("dbo"), - TableName: to.Ptr("Table_1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DataMaskingRule = armsql.DataMaskingRule{ - // Type: to.Ptr("Microsoft.Sql/servers/databases/dataMaskingPolicies/rules"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-6852/providers/Microsoft.Sql/servers/sqlcrudtest-6852/databases/sqlcrudtest-331/dataMaskingPolicies/Default/rules/"), - // Location: to.Ptr("Central US"), - // Properties: &armsql.DataMaskingRuleProperties{ - // ColumnName: to.Ptr("test1"), - // ID: to.Ptr("dbo_Table_1_test1"), - // MaskingFunction: to.Ptr(armsql.DataMaskingFunctionDefault), - // RuleState: to.Ptr(armsql.DataMaskingRuleStateEnabled), - // SchemaName: to.Ptr("dbo"), - // TableName: to.Ptr("Table_1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DataMaskingRuleCreateOrUpdateNumber.json -func ExampleDataMaskingRulesClient_CreateOrUpdate_createUpdateDataMaskingRuleForNumbers() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDataMaskingRulesClient().CreateOrUpdate(ctx, "sqlcrudtest-6852", "sqlcrudtest-2080", "sqlcrudtest-331", "rule1", armsql.DataMaskingRule{ - Properties: &armsql.DataMaskingRuleProperties{ - ColumnName: to.Ptr("test1"), - MaskingFunction: to.Ptr(armsql.DataMaskingFunctionNumber), - NumberFrom: to.Ptr("0"), - NumberTo: to.Ptr("2"), - SchemaName: to.Ptr("dbo"), - TableName: to.Ptr("Table_1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DataMaskingRule = armsql.DataMaskingRule{ - // Type: to.Ptr("Microsoft.Sql/servers/databases/dataMaskingPolicies/rules"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-6852/providers/Microsoft.Sql/servers/sqlcrudtest-6852/databases/sqlcrudtest-331/dataMaskingPolicies/Default/rules/"), - // Location: to.Ptr("Central US"), - // Properties: &armsql.DataMaskingRuleProperties{ - // ColumnName: to.Ptr("test1"), - // ID: to.Ptr("dbo_Table_1_test1"), - // MaskingFunction: to.Ptr(armsql.DataMaskingFunctionNumber), - // NumberFrom: to.Ptr("0"), - // NumberTo: to.Ptr("2"), - // RuleState: to.Ptr(armsql.DataMaskingRuleStateEnabled), - // SchemaName: to.Ptr("dbo"), - // TableName: to.Ptr("Table_1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DataMaskingRuleCreateOrUpdateText.json -func ExampleDataMaskingRulesClient_CreateOrUpdate_createUpdateDataMaskingRuleForText() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDataMaskingRulesClient().CreateOrUpdate(ctx, "sqlcrudtest-6852", "sqlcrudtest-2080", "sqlcrudtest-331", "rule1", armsql.DataMaskingRule{ - Properties: &armsql.DataMaskingRuleProperties{ - ColumnName: to.Ptr("test1"), - MaskingFunction: to.Ptr(armsql.DataMaskingFunctionText), - PrefixSize: to.Ptr("1"), - ReplacementString: to.Ptr("asdf"), - SchemaName: to.Ptr("dbo"), - SuffixSize: to.Ptr("0"), - TableName: to.Ptr("Table_1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DataMaskingRule = armsql.DataMaskingRule{ - // Type: to.Ptr("Microsoft.Sql/servers/databases/dataMaskingPolicies/rules"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-6852/providers/Microsoft.Sql/servers/sqlcrudtest-6852/databases/sqlcrudtest-331/dataMaskingPolicies/Default/rules/"), - // Location: to.Ptr("Central US"), - // Properties: &armsql.DataMaskingRuleProperties{ - // ColumnName: to.Ptr("test1"), - // ID: to.Ptr("dbo_Table_1_test1"), - // MaskingFunction: to.Ptr(armsql.DataMaskingFunctionText), - // PrefixSize: to.Ptr("1"), - // ReplacementString: to.Ptr("asdf"), - // RuleState: to.Ptr(armsql.DataMaskingRuleStateEnabled), - // SchemaName: to.Ptr("dbo"), - // SuffixSize: to.Ptr("0"), - // TableName: to.Ptr("Table_1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DataMaskingRuleList.json -func ExampleDataMaskingRulesClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDataMaskingRulesClient().NewListByDatabasePager("sqlcrudtest-6852", "sqlcrudtest-2080", "sqlcrudtest-331", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DataMaskingRuleListResult = armsql.DataMaskingRuleListResult{ - // Value: []*armsql.DataMaskingRule{ - // { - // Type: to.Ptr("Microsoft.Sql/servers/databases/dataMaskingPolicies/rules"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-6852/providers/Microsoft.Sql/servers/sqlcrudtest-6852/databases/sqlcrudtest-331/dataMaskingPolicies/Default/rules/"), - // Location: to.Ptr("Central US"), - // Properties: &armsql.DataMaskingRuleProperties{ - // ColumnName: to.Ptr("test1"), - // ID: to.Ptr("dbo_Table_1_test1"), - // MaskingFunction: to.Ptr(armsql.DataMaskingFunctionText), - // PrefixSize: to.Ptr("1"), - // ReplacementString: to.Ptr("asdf"), - // RuleState: to.Ptr(armsql.DataMaskingRuleStateEnabled), - // SchemaName: to.Ptr("dbo"), - // SuffixSize: to.Ptr("0"), - // TableName: to.Ptr("Table_1"), - // }, - // }, - // { - // Type: to.Ptr("Microsoft.Sql/servers/databases/dataMaskingPolicies/rules"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-6852/providers/Microsoft.Sql/servers/sqlcrudtest-6852/databases/sqlcrudtest-331/dataMaskingPolicies/Default/rules/"), - // Location: to.Ptr("Central US"), - // Properties: &armsql.DataMaskingRuleProperties{ - // ColumnName: to.Ptr("test1"), - // ID: to.Ptr("dbo_Table_1_test1"), - // MaskingFunction: to.Ptr(armsql.DataMaskingFunctionNumber), - // NumberFrom: to.Ptr("0"), - // NumberTo: to.Ptr("2"), - // RuleState: to.Ptr(armsql.DataMaskingRuleStateEnabled), - // SchemaName: to.Ptr("dbo"), - // TableName: to.Ptr("Table_1"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/sql/armsql/datawarehouseuseractivities_client.go b/sdk/resourcemanager/sql/armsql/datawarehouseuseractivities_client.go index 036c6cfaf055..b3d44ebb44c8 100644 --- a/sdk/resourcemanager/sql/armsql/datawarehouseuseractivities_client.go +++ b/sdk/resourcemanager/sql/armsql/datawarehouseuseractivities_client.go @@ -46,7 +46,7 @@ func NewDataWarehouseUserActivitiesClient(subscriptionID string, credential azco // Get - Gets the user activities of a data warehouse which includes running and suspended queries // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -100,7 +100,7 @@ func (client *DataWarehouseUserActivitiesClient) getCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -117,7 +117,7 @@ func (client *DataWarehouseUserActivitiesClient) getHandleResponse(resp *http.Re // NewListByDatabasePager - List the user activities of a data warehouse which includes running and suspended queries // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -176,7 +176,7 @@ func (client *DataWarehouseUserActivitiesClient) listByDatabaseCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/datawarehouseuseractivities_client_example_test.go b/sdk/resourcemanager/sql/armsql/datawarehouseuseractivities_client_example_test.go deleted file mode 100644 index 6cc0ebbbcf22..000000000000 --- a/sdk/resourcemanager/sql/armsql/datawarehouseuseractivities_client_example_test.go +++ /dev/null @@ -1,81 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetDataWarehouseUserActivities.json -func ExampleDataWarehouseUserActivitiesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDataWarehouseUserActivitiesClient().Get(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.DataWarehouseUserActivityNameCurrent, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DataWarehouseUserActivities = armsql.DataWarehouseUserActivities{ - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/dataWarehouseUserActivities"), - // ID: to.Ptr("subscriptions/326affc3-21f4-4471-a545-e37430b70113/resourceGroups/Default-SQL-Onebox/providers/Microsoft.Sql/servers/testsvr/databases/dwdb01/dataWarehouseUserActivities/current"), - // Properties: &armsql.DataWarehouseUserActivitiesProperties{ - // ActiveQueriesCount: to.Ptr[int32](0), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListDataWarehouseUserActivities.json -func ExampleDataWarehouseUserActivitiesClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDataWarehouseUserActivitiesClient().NewListByDatabasePager("Default-SQL-SouthEastAsia", "testsvr", "testdb", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DataWarehouseUserActivitiesListResult = armsql.DataWarehouseUserActivitiesListResult{ - // Value: []*armsql.DataWarehouseUserActivities{ - // { - // Type: to.Ptr("Microsoft.Sql/servers/databases/dataWarehouseUserActivities"), - // ID: to.Ptr("subscriptions/326affc3-21f4-4471-a545-e37430b70113/resourceGroups/Default-SQL-Onebox/providers/Microsoft.Sql/servers/testsvr/databases/dwdb01/dataWarehouseUserActivities/current"), - // Properties: &armsql.DataWarehouseUserActivitiesProperties{ - // ActiveQueriesCount: to.Ptr[int32](0), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/sql/armsql/deletedservers_client.go b/sdk/resourcemanager/sql/armsql/deletedservers_client.go index 31247df5b587..f08b7a1c583c 100644 --- a/sdk/resourcemanager/sql/armsql/deletedservers_client.go +++ b/sdk/resourcemanager/sql/armsql/deletedservers_client.go @@ -46,7 +46,7 @@ func NewDeletedServersClient(subscriptionID string, credential azcore.TokenCrede // Get - Gets a deleted server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - locationName - The name of the region where the resource is located. // - deletedServerName - The name of the deleted server. // - options - DeletedServersClientGetOptions contains the optional parameters for the DeletedServersClient.Get method. @@ -88,7 +88,7 @@ func (client *DeletedServersClient) getCreateRequest(ctx context.Context, locati return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -105,7 +105,7 @@ func (client *DeletedServersClient) getHandleResponse(resp *http.Response) (Dele // NewListPager - Gets a list of all deleted servers in a subscription. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - options - DeletedServersClientListOptions contains the optional parameters for the DeletedServersClient.NewListPager method. func (client *DeletedServersClient) NewListPager(options *DeletedServersClientListOptions) *runtime.Pager[DeletedServersClientListResponse] { return runtime.NewPager(runtime.PagingHandler[DeletedServersClientListResponse]{ @@ -147,7 +147,7 @@ func (client *DeletedServersClient) listCreateRequest(ctx context.Context, optio return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -164,7 +164,7 @@ func (client *DeletedServersClient) listHandleResponse(resp *http.Response) (Del // NewListByLocationPager - Gets a list of deleted servers for a location. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - locationName - The name of the region where the resource is located. // - options - DeletedServersClientListByLocationOptions contains the optional parameters for the DeletedServersClient.NewListByLocationPager // method. @@ -212,7 +212,7 @@ func (client *DeletedServersClient) listByLocationCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -230,7 +230,7 @@ func (client *DeletedServersClient) listByLocationHandleResponse(resp *http.Resp // BeginRecover - Recovers a deleted server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - locationName - The name of the region where the resource is located. // - deletedServerName - The name of the deleted server. // - options - DeletedServersClientBeginRecoverOptions contains the optional parameters for the DeletedServersClient.BeginRecover @@ -251,7 +251,7 @@ func (client *DeletedServersClient) BeginRecover(ctx context.Context, locationNa // Recover - Recovers a deleted server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview func (client *DeletedServersClient) recoverOperation(ctx context.Context, locationName string, deletedServerName string, options *DeletedServersClientBeginRecoverOptions) (*http.Response, error) { var err error req, err := client.recoverCreateRequest(ctx, locationName, deletedServerName, options) @@ -289,7 +289,7 @@ func (client *DeletedServersClient) recoverCreateRequest(ctx context.Context, lo return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/deletedservers_client_example_test.go b/sdk/resourcemanager/sql/armsql/deletedservers_client_example_test.go deleted file mode 100644 index dbbfb2883f5f..000000000000 --- a/sdk/resourcemanager/sql/armsql/deletedservers_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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeletedServerListBySubscription.json -func ExampleDeletedServersClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDeletedServersClient().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.DeletedServerListResult = armsql.DeletedServerListResult{ - // Value: []*armsql.DeletedServer{ - // { - // Name: to.Ptr("sqlcrudtest-d-1414"), - // Type: to.Ptr("Microsoft.Sql/deletedServers"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/deletedServers/sqlcrudtest-d-1414"), - // Properties: &armsql.DeletedServerProperties{ - // DeletionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-15T20:20:00.345Z"); return t}()), - // FullyQualifiedDomainName: to.Ptr("sqlcrudtest-d-1414.database.windows.net"), - // OriginalID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/sqlcrudtest-d-1414"), - // Version: to.Ptr("12.0"), - // }, - // }, - // { - // Name: to.Ptr("sqlcrudtest-d-2424"), - // Type: to.Ptr("Microsoft.Sql/deletedServers"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/deletedServers/sqlcrudtest-d-2424"), - // Properties: &armsql.DeletedServerProperties{ - // DeletionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-13T10:10:00.678Z"); return t}()), - // FullyQualifiedDomainName: to.Ptr("sqlcrudtest-d-2424.database.windows.net"), - // OriginalID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/sqlcrudtest-d-2424"), - // Version: to.Ptr("12.0"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeletedServerGet.json -func ExampleDeletedServersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDeletedServersClient().Get(ctx, "japaneast", "sqlcrudtest-d-1414", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DeletedServer = armsql.DeletedServer{ - // Name: to.Ptr("sqlcrudtest-d-1414"), - // Type: to.Ptr("Microsoft.Sql/deletedServers"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/deletedServers/sqlcrudtest-d-1414"), - // Properties: &armsql.DeletedServerProperties{ - // DeletionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-15T11:20:00.345Z"); return t}()), - // FullyQualifiedDomainName: to.Ptr("sqlcrudtest-d-1414.database.windows.net"), - // OriginalID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/sqlcrudtest-d-1414"), - // Version: to.Ptr("12.0"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeletedServerList.json -func ExampleDeletedServersClient_NewListByLocationPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDeletedServersClient().NewListByLocationPager("japaneast", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DeletedServerListResult = armsql.DeletedServerListResult{ - // Value: []*armsql.DeletedServer{ - // { - // Name: to.Ptr("sqlcrudtest-d-1414"), - // Type: to.Ptr("Microsoft.Sql/deletedServers"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/deletedServers/sqlcrudtest-d-1414"), - // Properties: &armsql.DeletedServerProperties{ - // DeletionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-15T20:20:00.345Z"); return t}()), - // FullyQualifiedDomainName: to.Ptr("sqlcrudtest-d-1414.database.windows.net"), - // OriginalID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/sqlcrudtest-d-1414"), - // Version: to.Ptr("12.0"), - // }, - // }, - // { - // Name: to.Ptr("sqlcrudtest-d-2424"), - // Type: to.Ptr("Microsoft.Sql/deletedServers"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/deletedServers/sqlcrudtest-d-2424"), - // Properties: &armsql.DeletedServerProperties{ - // DeletionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-13T10:10:00.678Z"); return t}()), - // FullyQualifiedDomainName: to.Ptr("sqlcrudtest-d-2424.database.windows.net"), - // OriginalID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/sqlcrudtest-d-2424"), - // Version: to.Ptr("12.0"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeletedServerRecover.json -func ExampleDeletedServersClient_BeginRecover() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDeletedServersClient().BeginRecover(ctx, "japaneast", "sqlcrudtest-d-1414", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DeletedServer = armsql.DeletedServer{ - // Name: to.Ptr("sqlcrudtest-d-1414"), - // Type: to.Ptr("Microsoft.Sql/deletedServers"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/deletedServers/sqlcrudtest-d-1414"), - // Properties: &armsql.DeletedServerProperties{ - // DeletionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-15T11:20:00.345Z"); return t}()), - // FullyQualifiedDomainName: to.Ptr("sqlcrudtest-d-1414.database.windows.net"), - // OriginalID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/sqlcrudtest-d-1414"), - // Version: to.Ptr("12.0"), - // }, - // } -} diff --git a/sdk/resourcemanager/sql/armsql/distributedavailabilitygroups_client.go b/sdk/resourcemanager/sql/armsql/distributedavailabilitygroups_client.go index d0749baa4908..19e5a2b9aa7e 100644 --- a/sdk/resourcemanager/sql/armsql/distributedavailabilitygroups_client.go +++ b/sdk/resourcemanager/sql/armsql/distributedavailabilitygroups_client.go @@ -46,7 +46,7 @@ func NewDistributedAvailabilityGroupsClient(subscriptionID string, credential az // BeginCreateOrUpdate - Creates a distributed availability group between Sql On-Prem and Sql Managed Instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -54,7 +54,7 @@ func NewDistributedAvailabilityGroupsClient(subscriptionID string, credential az // - parameters - The distributed availability group info. // - options - DistributedAvailabilityGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the DistributedAvailabilityGroupsClient.BeginCreateOrUpdate // method. -func (client *DistributedAvailabilityGroupsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, distributedAvailabilityGroupName string, parameters DistributedAvailabilityGroup, options *DistributedAvailabilityGroupsClientBeginCreateOrUpdateOptions) (*runtime.Poller[DistributedAvailabilityGroupsClientCreateOrUpdateResponse], error) { +func (client *DistributedAvailabilityGroupsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, distributedAvailabilityGroupName string, parameters DistributedAvailabilityGroupsCreateOrUpdateRequestBody, options *DistributedAvailabilityGroupsClientBeginCreateOrUpdateOptions) (*runtime.Poller[DistributedAvailabilityGroupsClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, managedInstanceName, distributedAvailabilityGroupName, parameters, options) if err != nil { @@ -70,8 +70,8 @@ func (client *DistributedAvailabilityGroupsClient) BeginCreateOrUpdate(ctx conte // CreateOrUpdate - Creates a distributed availability group between Sql On-Prem and Sql Managed Instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01-preview -func (client *DistributedAvailabilityGroupsClient) createOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, distributedAvailabilityGroupName string, parameters DistributedAvailabilityGroup, options *DistributedAvailabilityGroupsClientBeginCreateOrUpdateOptions) (*http.Response, error) { +// Generated from API version 2023-05-01-preview +func (client *DistributedAvailabilityGroupsClient) createOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, distributedAvailabilityGroupName string, parameters DistributedAvailabilityGroupsCreateOrUpdateRequestBody, options *DistributedAvailabilityGroupsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, distributedAvailabilityGroupName, parameters, options) if err != nil { @@ -89,7 +89,7 @@ func (client *DistributedAvailabilityGroupsClient) createOrUpdate(ctx context.Co } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *DistributedAvailabilityGroupsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, distributedAvailabilityGroupName string, parameters DistributedAvailabilityGroup, options *DistributedAvailabilityGroupsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *DistributedAvailabilityGroupsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, distributedAvailabilityGroupName string, parameters DistributedAvailabilityGroupsCreateOrUpdateRequestBody, options *DistributedAvailabilityGroupsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -112,7 +112,7 @@ func (client *DistributedAvailabilityGroupsClient) createOrUpdateCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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 *DistributedAvailabilityGroupsClient) createOrUpdateCreateRequest(c // BeginDelete - Drops a distributed availability group between Sql On-Prem and Sql Managed Instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -147,7 +147,7 @@ func (client *DistributedAvailabilityGroupsClient) BeginDelete(ctx context.Conte // Delete - Drops a distributed availability group between Sql On-Prem and Sql Managed Instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01-preview +// Generated from API version 2023-05-01-preview func (client *DistributedAvailabilityGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, managedInstanceName string, distributedAvailabilityGroupName string, options *DistributedAvailabilityGroupsClientBeginDeleteOptions) (*http.Response, error) { var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, managedInstanceName, distributedAvailabilityGroupName, options) @@ -189,7 +189,7 @@ func (client *DistributedAvailabilityGroupsClient) deleteCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -197,7 +197,7 @@ func (client *DistributedAvailabilityGroupsClient) deleteCreateRequest(ctx conte // Get - Gets a distributed availability group info. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -246,7 +246,7 @@ func (client *DistributedAvailabilityGroupsClient) getCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -263,7 +263,7 @@ func (client *DistributedAvailabilityGroupsClient) getHandleResponse(resp *http. // NewListByInstancePager - Gets a list of a distributed availability groups in instance. // -// Generated from API version 2021-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -317,7 +317,7 @@ func (client *DistributedAvailabilityGroupsClient) listByInstanceCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -332,10 +332,90 @@ func (client *DistributedAvailabilityGroupsClient) listByInstanceHandleResponse( return result, nil } +// BeginSetRole - Sets the role for managed instance in a distributed availability group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - distributedAvailabilityGroupName - The distributed availability group name. +// - parameters - The distributed availability group set role request parameters. +// - options - DistributedAvailabilityGroupsClientBeginSetRoleOptions contains the optional parameters for the DistributedAvailabilityGroupsClient.BeginSetRole +// method. +func (client *DistributedAvailabilityGroupsClient) BeginSetRole(ctx context.Context, resourceGroupName string, managedInstanceName string, distributedAvailabilityGroupName string, parameters DistributedAvailabilityGroupSetRole, options *DistributedAvailabilityGroupsClientBeginSetRoleOptions) (*runtime.Poller[DistributedAvailabilityGroupsClientSetRoleResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.setRole(ctx, resourceGroupName, managedInstanceName, distributedAvailabilityGroupName, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DistributedAvailabilityGroupsClientSetRoleResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[DistributedAvailabilityGroupsClientSetRoleResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// SetRole - Sets the role for managed instance in a distributed availability group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01-preview +func (client *DistributedAvailabilityGroupsClient) setRole(ctx context.Context, resourceGroupName string, managedInstanceName string, distributedAvailabilityGroupName string, parameters DistributedAvailabilityGroupSetRole, options *DistributedAvailabilityGroupsClientBeginSetRoleOptions) (*http.Response, error) { + var err error + req, err := client.setRoleCreateRequest(ctx, resourceGroupName, managedInstanceName, distributedAvailabilityGroupName, parameters, 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 +} + +// setRoleCreateRequest creates the SetRole request. +func (client *DistributedAvailabilityGroupsClient) setRoleCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, distributedAvailabilityGroupName string, parameters DistributedAvailabilityGroupSetRole, options *DistributedAvailabilityGroupsClientBeginSetRoleOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}/setRole" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if managedInstanceName == "" { + return nil, errors.New("parameter managedInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedInstanceName}", url.PathEscape(managedInstanceName)) + if distributedAvailabilityGroupName == "" { + return nil, errors.New("parameter distributedAvailabilityGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{distributedAvailabilityGroupName}", url.PathEscape(distributedAvailabilityGroupName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + // BeginUpdate - Updates a distributed availability group replication mode. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -359,7 +439,7 @@ func (client *DistributedAvailabilityGroupsClient) BeginUpdate(ctx context.Conte // Update - Updates a distributed availability group replication mode. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01-preview +// Generated from API version 2023-05-01-preview func (client *DistributedAvailabilityGroupsClient) update(ctx context.Context, resourceGroupName string, managedInstanceName string, distributedAvailabilityGroupName string, parameters DistributedAvailabilityGroup, options *DistributedAvailabilityGroupsClientBeginUpdateOptions) (*http.Response, error) { var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, managedInstanceName, distributedAvailabilityGroupName, parameters, options) @@ -401,7 +481,7 @@ func (client *DistributedAvailabilityGroupsClient) updateCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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/sql/armsql/distributedavailabilitygroups_client_example_test.go b/sdk/resourcemanager/sql/armsql/distributedavailabilitygroups_client_example_test.go deleted file mode 100644 index a73b8f5c16fa..000000000000 --- a/sdk/resourcemanager/sql/armsql/distributedavailabilitygroups_client_example_test.go +++ /dev/null @@ -1,211 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DistributedAvailabilityGroupsListByInstance.json -func ExampleDistributedAvailabilityGroupsClient_NewListByInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDistributedAvailabilityGroupsClient().NewListByInstancePager("testrg", "testcl", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DistributedAvailabilityGroupsListResult = armsql.DistributedAvailabilityGroupsListResult{ - // Value: []*armsql.DistributedAvailabilityGroup{ - // { - // Name: to.Ptr("dag"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/distributedAvailabilityGroups"), - // ID: to.Ptr("/subscriptions/f2669dff-5f08-45dd-b857-b2a60b72cdc9/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testcl/distributedAvailabilityGroups/dag"), - // Properties: &armsql.DistributedAvailabilityGroupProperties{ - // DistributedAvailabilityGroupID: to.Ptr("6bc05a51-aa36-a196-09bd-481d7a0973c0"), - // LastHardenedLsn: to.Ptr("39000000030400001"), - // LinkState: to.Ptr("Catchup"), - // ReplicationMode: to.Ptr(armsql.ReplicationModeAsync), - // SourceEndpoint: to.Ptr("TCP://SERVER:7022"), - // SourceReplicaID: to.Ptr("543dd519-7585-faff-6ad2-11fb826d4f4d"), - // TargetDatabase: to.Ptr("testdb"), - // TargetReplicaID: to.Ptr("7e218aba-0a53-6231-be09-895d99f96bf2"), - // }, - // }, - // { - // Name: to.Ptr("dag2"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/distributedAvailabilityGroups"), - // ID: to.Ptr("/subscriptions/f2669dff-5f08-45dd-b857-b2a60b72cdc9/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testcl/distributedAvailabilityGroups/dag2"), - // Properties: &armsql.DistributedAvailabilityGroupProperties{ - // DistributedAvailabilityGroupID: to.Ptr("7ec05a51-aa36-a196-09bd-481d7a0973c0"), - // LastHardenedLsn: to.Ptr("39000000030400001"), - // LinkState: to.Ptr("Catchup"), - // ReplicationMode: to.Ptr(armsql.ReplicationModeAsync), - // SourceEndpoint: to.Ptr("TCP://SERVER:7022"), - // SourceReplicaID: to.Ptr("d423d519-7585-faff-6ad2-11fb826d4f4d"), - // TargetDatabase: to.Ptr("testdb2"), - // TargetReplicaID: to.Ptr("32578aba-0a53-6231-be09-895d99f96bf2"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DistributedAvailabilityGroupsGet.json -func ExampleDistributedAvailabilityGroupsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDistributedAvailabilityGroupsClient().Get(ctx, "testrg", "testcl", "dag", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DistributedAvailabilityGroup = armsql.DistributedAvailabilityGroup{ - // Name: to.Ptr("dag"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/distributedAvailabilityGroups"), - // ID: to.Ptr("/subscriptions/f2669dff-5f08-45dd-b857-b2a60b72cdc9/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testcl/distributedAvailabilityGroups/dag"), - // Properties: &armsql.DistributedAvailabilityGroupProperties{ - // DistributedAvailabilityGroupID: to.Ptr("6bc05a51-aa36-a196-09bd-481d7a0973c0"), - // LastHardenedLsn: to.Ptr("39000000030400001"), - // LinkState: to.Ptr("Catchup"), - // ReplicationMode: to.Ptr(armsql.ReplicationModeAsync), - // SourceEndpoint: to.Ptr("TCP://SERVER:7022"), - // SourceReplicaID: to.Ptr("543dd519-7585-faff-6ad2-11fb826d4f4d"), - // TargetDatabase: to.Ptr("testdb"), - // TargetReplicaID: to.Ptr("7e218aba-0a53-6231-be09-895d99f96bf2"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DistributedAvailabilityGroupsCreate.json -func ExampleDistributedAvailabilityGroupsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDistributedAvailabilityGroupsClient().BeginCreateOrUpdate(ctx, "testrg", "testcl", "dag", armsql.DistributedAvailabilityGroup{ - Properties: &armsql.DistributedAvailabilityGroupProperties{ - PrimaryAvailabilityGroupName: to.Ptr("BoxLocalAg1"), - SecondaryAvailabilityGroupName: to.Ptr("testcl"), - SourceEndpoint: to.Ptr("TCP://SERVER:7022"), - TargetDatabase: to.Ptr("testdb"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DistributedAvailabilityGroup = armsql.DistributedAvailabilityGroup{ - // Name: to.Ptr("dag"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/distributedAvailabilityGroups"), - // ID: to.Ptr("/subscriptions/f2669dff-5f08-45dd-b857-b2a60b72cdc9/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testcl/distributedAvailabilityGroups/dag"), - // Properties: &armsql.DistributedAvailabilityGroupProperties{ - // PrimaryAvailabilityGroupName: to.Ptr("BoxLocalAg1"), - // SecondaryAvailabilityGroupName: to.Ptr("testcl"), - // SourceEndpoint: to.Ptr("TCP://SERVER:7022"), - // TargetDatabase: to.Ptr("testdb"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DistributedAvailabilityGroupsDelete.json -func ExampleDistributedAvailabilityGroupsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDistributedAvailabilityGroupsClient().BeginDelete(ctx, "testrg", "testcl", "dag", 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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DistributedAvailabilityGroupsUpdate.json -func ExampleDistributedAvailabilityGroupsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDistributedAvailabilityGroupsClient().BeginUpdate(ctx, "testrg", "testcl", "dag", armsql.DistributedAvailabilityGroup{ - Properties: &armsql.DistributedAvailabilityGroupProperties{ - ReplicationMode: to.Ptr(armsql.ReplicationModeSync), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DistributedAvailabilityGroup = armsql.DistributedAvailabilityGroup{ - // Name: to.Ptr("dag"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/distributedAvailabilityGroups"), - // ID: to.Ptr("/subscriptions/f2669dff-5f08-45dd-b857-b2a60b72cdc9/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testcl/distributedAvailabilityGroups/dag"), - // Properties: &armsql.DistributedAvailabilityGroupProperties{ - // ReplicationMode: to.Ptr(armsql.ReplicationModeSync), - // }, - // } -} diff --git a/sdk/resourcemanager/sql/armsql/elasticpoolactivities_client.go b/sdk/resourcemanager/sql/armsql/elasticpoolactivities_client.go deleted file mode 100644 index 341e51f0a4ae..000000000000 --- a/sdk/resourcemanager/sql/armsql/elasticpoolactivities_client.go +++ /dev/null @@ -1,114 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsql - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// ElasticPoolActivitiesClient contains the methods for the ElasticPoolActivities group. -// Don't use this type directly, use NewElasticPoolActivitiesClient() instead. -type ElasticPoolActivitiesClient struct { - internal *arm.Client - subscriptionID string -} - -// NewElasticPoolActivitiesClient creates a new instance of ElasticPoolActivitiesClient with the specified values. -// - subscriptionID - The subscription ID that identifies an Azure subscription. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewElasticPoolActivitiesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ElasticPoolActivitiesClient, error) { - cl, err := arm.NewClient(moduleName+".ElasticPoolActivitiesClient", moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &ElasticPoolActivitiesClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// NewListByElasticPoolPager - Returns elastic pool activities. -// -// Generated from API version 2014-04-01 -// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// - serverName - The name of the server. -// - elasticPoolName - The name of the elastic pool for which to get the current activity. -// - options - ElasticPoolActivitiesClientListByElasticPoolOptions contains the optional parameters for the ElasticPoolActivitiesClient.NewListByElasticPoolPager -// method. -func (client *ElasticPoolActivitiesClient) NewListByElasticPoolPager(resourceGroupName string, serverName string, elasticPoolName string, options *ElasticPoolActivitiesClientListByElasticPoolOptions) *runtime.Pager[ElasticPoolActivitiesClientListByElasticPoolResponse] { - return runtime.NewPager(runtime.PagingHandler[ElasticPoolActivitiesClientListByElasticPoolResponse]{ - More: func(page ElasticPoolActivitiesClientListByElasticPoolResponse) bool { - return false - }, - Fetcher: func(ctx context.Context, page *ElasticPoolActivitiesClientListByElasticPoolResponse) (ElasticPoolActivitiesClientListByElasticPoolResponse, error) { - req, err := client.listByElasticPoolCreateRequest(ctx, resourceGroupName, serverName, elasticPoolName, options) - if err != nil { - return ElasticPoolActivitiesClientListByElasticPoolResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return ElasticPoolActivitiesClientListByElasticPoolResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ElasticPoolActivitiesClientListByElasticPoolResponse{}, runtime.NewResponseError(resp) - } - return client.listByElasticPoolHandleResponse(resp) - }, - }) -} - -// listByElasticPoolCreateRequest creates the ListByElasticPool request. -func (client *ElasticPoolActivitiesClient) listByElasticPoolCreateRequest(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string, options *ElasticPoolActivitiesClientListByElasticPoolOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/elasticPoolActivity" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if serverName == "" { - return nil, errors.New("parameter serverName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) - if elasticPoolName == "" { - return nil, errors.New("parameter elasticPoolName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{elasticPoolName}", url.PathEscape(elasticPoolName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2014-04-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByElasticPoolHandleResponse handles the ListByElasticPool response. -func (client *ElasticPoolActivitiesClient) listByElasticPoolHandleResponse(resp *http.Response) (ElasticPoolActivitiesClientListByElasticPoolResponse, error) { - result := ElasticPoolActivitiesClientListByElasticPoolResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ElasticPoolActivityListResult); err != nil { - return ElasticPoolActivitiesClientListByElasticPoolResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/sql/armsql/elasticpoolactivities_client_example_test.go b/sdk/resourcemanager/sql/armsql/elasticpoolactivities_client_example_test.go deleted file mode 100644 index ff335c00231f..000000000000 --- a/sdk/resourcemanager/sql/armsql/elasticpoolactivities_client_example_test.go +++ /dev/null @@ -1,67 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01-legacy/examples/ElasticPoolActivityList.json -func ExampleElasticPoolActivitiesClient_NewListByElasticPoolPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewElasticPoolActivitiesClient().NewListByElasticPoolPager("sqlcrudtest-4291", "sqlcrudtest-6574", "8749", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ElasticPoolActivityListResult = armsql.ElasticPoolActivityListResult{ - // Value: []*armsql.ElasticPoolActivity{ - // { - // Name: to.Ptr("851f1672-f7f0-46f6-a262-ee9b51e18e97"), - // Type: to.Ptr("Microsoft.Sql/servers/elasticPools/elasticPoolActivity"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-4291/providers/Microsoft.Sql/servers/sqlcrudtest-6574/elasticPools/8749/elasticPoolActivity/851f1672-f7f0-46f6-a262-ee9b51e18e97"), - // Location: to.Ptr("Japan East"), - // Properties: &armsql.ElasticPoolActivityProperties{ - // OperationID: to.Ptr("851f1672-f7f0-46f6-a262-ee9b51e18e97"), - // ElasticPoolName: to.Ptr("8749"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-10T02:03:23.263Z"); return t}()), - // Operation: to.Ptr("CREATE"), - // PercentComplete: to.Ptr[int32](100), - // RequestedDatabaseDtuCap: to.Ptr[int32](5), - // RequestedDatabaseDtuGuarantee: to.Ptr[int32](0), - // RequestedDtuGuarantee: to.Ptr[int32](100), - // RequestedStorageLimitInGB: to.Ptr[int64](9), - // RequestedStorageLimitInMB: to.Ptr[int32](10000), - // ServerName: to.Ptr("sqlcrudtest-6574"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-10T02:03:06.16Z"); return t}()), - // State: to.Ptr("COMPLETED"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/sql/armsql/elasticpooldatabaseactivities_client.go b/sdk/resourcemanager/sql/armsql/elasticpooldatabaseactivities_client.go deleted file mode 100644 index 0f2be039b392..000000000000 --- a/sdk/resourcemanager/sql/armsql/elasticpooldatabaseactivities_client.go +++ /dev/null @@ -1,114 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsql - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// ElasticPoolDatabaseActivitiesClient contains the methods for the ElasticPoolDatabaseActivities group. -// Don't use this type directly, use NewElasticPoolDatabaseActivitiesClient() instead. -type ElasticPoolDatabaseActivitiesClient struct { - internal *arm.Client - subscriptionID string -} - -// NewElasticPoolDatabaseActivitiesClient creates a new instance of ElasticPoolDatabaseActivitiesClient with the specified values. -// - subscriptionID - The subscription ID that identifies an Azure subscription. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewElasticPoolDatabaseActivitiesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ElasticPoolDatabaseActivitiesClient, error) { - cl, err := arm.NewClient(moduleName+".ElasticPoolDatabaseActivitiesClient", moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &ElasticPoolDatabaseActivitiesClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// NewListByElasticPoolPager - Returns activity on databases inside of an elastic pool. -// -// Generated from API version 2014-04-01 -// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// - serverName - The name of the server. -// - elasticPoolName - The name of the elastic pool. -// - options - ElasticPoolDatabaseActivitiesClientListByElasticPoolOptions contains the optional parameters for the ElasticPoolDatabaseActivitiesClient.NewListByElasticPoolPager -// method. -func (client *ElasticPoolDatabaseActivitiesClient) NewListByElasticPoolPager(resourceGroupName string, serverName string, elasticPoolName string, options *ElasticPoolDatabaseActivitiesClientListByElasticPoolOptions) *runtime.Pager[ElasticPoolDatabaseActivitiesClientListByElasticPoolResponse] { - return runtime.NewPager(runtime.PagingHandler[ElasticPoolDatabaseActivitiesClientListByElasticPoolResponse]{ - More: func(page ElasticPoolDatabaseActivitiesClientListByElasticPoolResponse) bool { - return false - }, - Fetcher: func(ctx context.Context, page *ElasticPoolDatabaseActivitiesClientListByElasticPoolResponse) (ElasticPoolDatabaseActivitiesClientListByElasticPoolResponse, error) { - req, err := client.listByElasticPoolCreateRequest(ctx, resourceGroupName, serverName, elasticPoolName, options) - if err != nil { - return ElasticPoolDatabaseActivitiesClientListByElasticPoolResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return ElasticPoolDatabaseActivitiesClientListByElasticPoolResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ElasticPoolDatabaseActivitiesClientListByElasticPoolResponse{}, runtime.NewResponseError(resp) - } - return client.listByElasticPoolHandleResponse(resp) - }, - }) -} - -// listByElasticPoolCreateRequest creates the ListByElasticPool request. -func (client *ElasticPoolDatabaseActivitiesClient) listByElasticPoolCreateRequest(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string, options *ElasticPoolDatabaseActivitiesClientListByElasticPoolOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/elasticPoolDatabaseActivity" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if serverName == "" { - return nil, errors.New("parameter serverName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) - if elasticPoolName == "" { - return nil, errors.New("parameter elasticPoolName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{elasticPoolName}", url.PathEscape(elasticPoolName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2014-04-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByElasticPoolHandleResponse handles the ListByElasticPool response. -func (client *ElasticPoolDatabaseActivitiesClient) listByElasticPoolHandleResponse(resp *http.Response) (ElasticPoolDatabaseActivitiesClientListByElasticPoolResponse, error) { - result := ElasticPoolDatabaseActivitiesClientListByElasticPoolResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ElasticPoolDatabaseActivityListResult); err != nil { - return ElasticPoolDatabaseActivitiesClientListByElasticPoolResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/sql/armsql/elasticpooldatabaseactivities_client_example_test.go b/sdk/resourcemanager/sql/armsql/elasticpooldatabaseactivities_client_example_test.go deleted file mode 100644 index b93f00d411c7..000000000000 --- a/sdk/resourcemanager/sql/armsql/elasticpooldatabaseactivities_client_example_test.go +++ /dev/null @@ -1,82 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01-legacy/examples/ElasticPoolDatabaseActivityList.json -func ExampleElasticPoolDatabaseActivitiesClient_NewListByElasticPoolPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewElasticPoolDatabaseActivitiesClient().NewListByElasticPoolPager("sqlcrudtest-4673", "sqlcrudtest-603", "7537", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ElasticPoolDatabaseActivityListResult = armsql.ElasticPoolDatabaseActivityListResult{ - // Value: []*armsql.ElasticPoolDatabaseActivity{ - // { - // Name: to.Ptr("3a3272b3-f1fe-423c-9feb-7b843157eda5"), - // Type: to.Ptr("Microsoft.Sql/servers/elasticPools/elasticPoolDatabaseActivity"), - // ID: to.Ptr("/subscriptions/9d4e2ad0-e20b-4464-9219-353bded52513/resourceGroups/sqlcrudtest-4673/providers/Microsoft.Sql/servers/sqlcrudtest-603/elasticPools/7537/elasticPoolDatabaseActivity/3a3272b3-f1fe-423c-9feb-7b843157eda5"), - // Location: to.Ptr("Japan East"), - // Properties: &armsql.ElasticPoolDatabaseActivityProperties{ - // OperationID: to.Ptr("3a3272b3-f1fe-423c-9feb-7b843157eda5"), - // CurrentElasticPoolName: to.Ptr("7537"), - // CurrentServiceObjective: to.Ptr("ElasticPool"), - // DatabaseName: to.Ptr("2396"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-10-23T03:08:02.95Z"); return t}()), - // Operation: to.Ptr("UPDATE"), - // PercentComplete: to.Ptr[int32](100), - // ServerName: to.Ptr("sqlcrudtest-603"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-10-23T03:07:12.57Z"); return t}()), - // State: to.Ptr("COMPLETED"), - // }, - // }, - // { - // Name: to.Ptr("95108a78-384e-48d3-b4de-7bf23b93a26d"), - // Type: to.Ptr("Microsoft.Sql/servers/elasticPools/elasticPoolDatabaseActivity"), - // ID: to.Ptr("/subscriptions/9d4e2ad0-e20b-4464-9219-353bded52513/resourceGroups/sqlcrudtest-4673/providers/Microsoft.Sql/servers/sqlcrudtest-603/elasticPools/7537/elasticPoolDatabaseActivity/95108a78-384e-48d3-b4de-7bf23b93a26d"), - // Location: to.Ptr("Japan East"), - // Properties: &armsql.ElasticPoolDatabaseActivityProperties{ - // OperationID: to.Ptr("95108a78-384e-48d3-b4de-7bf23b93a26d"), - // CurrentElasticPoolName: to.Ptr("7537"), - // CurrentServiceObjective: to.Ptr("ElasticPool"), - // DatabaseName: to.Ptr("2396"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-10-23T03:06:49.19Z"); return t}()), - // Operation: to.Ptr("CREATE"), - // PercentComplete: to.Ptr[int32](100), - // ServerName: to.Ptr("sqlcrudtest-603"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-10-23T03:06:11.19Z"); return t}()), - // State: to.Ptr("COMPLETED"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/sql/armsql/elasticpooloperations_client.go b/sdk/resourcemanager/sql/armsql/elasticpooloperations_client.go index b442b231d6af..af89e2c29834 100644 --- a/sdk/resourcemanager/sql/armsql/elasticpooloperations_client.go +++ b/sdk/resourcemanager/sql/armsql/elasticpooloperations_client.go @@ -46,7 +46,7 @@ func NewElasticPoolOperationsClient(subscriptionID string, credential azcore.Tok // Cancel - Cancels the asynchronous operation on the elastic pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -95,14 +95,14 @@ func (client *ElasticPoolOperationsClient) cancelCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // NewListByElasticPoolPager - Gets a list of operations performed on the elastic pool. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -160,7 +160,7 @@ func (client *ElasticPoolOperationsClient) listByElasticPoolCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/elasticpooloperations_client_example_test.go b/sdk/resourcemanager/sql/armsql/elasticpooloperations_client_example_test.go deleted file mode 100644 index a6c0d1b01e4a..000000000000 --- a/sdk/resourcemanager/sql/armsql/elasticpooloperations_client_example_test.go +++ /dev/null @@ -1,91 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CancelElasticPoolOperation.json -func ExampleElasticPoolOperationsClient_Cancel() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewElasticPoolOperationsClient().Cancel(ctx, "sqlcrudtest-7398", "sqlcrudtest-6661", "testpool", "f779414b-e748-4925-8cfe-c8598f7660ae", 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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListElasticPoolOperations.json -func ExampleElasticPoolOperationsClient_NewListByElasticPoolPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewElasticPoolOperationsClient().NewListByElasticPoolPager("sqlcrudtestgroup", "sqlcrudtestserver", "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.ElasticPoolOperationListResult = armsql.ElasticPoolOperationListResult{ - // Value: []*armsql.ElasticPoolOperation{ - // { - // Name: to.Ptr("11111111-1111-1111-1111-111111111111"), - // Type: to.Ptr("Microsoft.Sql/servers/elasticPools/operations"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtestgroup/providers/Microsoft.Sql/servers/sqlcrudtestserver/elasticPools/testpool/operations/11111111-1111-1111-1111-111111111111"), - // Properties: &armsql.ElasticPoolOperationProperties{ - // ElasticPoolName: to.Ptr("testpool"), - // Operation: to.Ptr("UPDATE"), - // OperationFriendlyName: to.Ptr("UPDATE"), - // PercentComplete: to.Ptr[int32](100), - // ServerName: to.Ptr("sqlcrudtestserver"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-10-30T09:10:08.1Z"); return t}()), - // State: to.Ptr("COMPLETED"), - // }, - // }, - // { - // Name: to.Ptr("55555555-5555-5555-5555-555555555555"), - // Type: to.Ptr("Microsoft.Sql/servers/elasticPools/operations"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtestgroup/providers/Microsoft.Sql/servers/sqlcrudtestserver/elasticPools/testpool/operations/55555555-5555-5555-5555-555555555555"), - // Properties: &armsql.ElasticPoolOperationProperties{ - // ElasticPoolName: to.Ptr("testpool"), - // Operation: to.Ptr("UPDATE"), - // OperationFriendlyName: to.Ptr("UPDATE"), - // PercentComplete: to.Ptr[int32](0), - // ServerName: to.Ptr("sqlcrudtestserver"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-10-30T10:10:08.1Z"); return t}()), - // State: to.Ptr("IN_PROGRESS"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/sql/armsql/elasticpools_client.go b/sdk/resourcemanager/sql/armsql/elasticpools_client.go index 8a4df3ccab7c..f703fff9a0b2 100644 --- a/sdk/resourcemanager/sql/armsql/elasticpools_client.go +++ b/sdk/resourcemanager/sql/armsql/elasticpools_client.go @@ -47,7 +47,7 @@ func NewElasticPoolsClient(subscriptionID string, credential azcore.TokenCredent // BeginCreateOrUpdate - Creates or updates an elastic pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -73,7 +73,7 @@ func (client *ElasticPoolsClient) BeginCreateOrUpdate(ctx context.Context, resou // CreateOrUpdate - Creates or updates an elastic pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview func (client *ElasticPoolsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string, parameters ElasticPool, options *ElasticPoolsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, elasticPoolName, parameters, options) @@ -115,7 +115,7 @@ func (client *ElasticPoolsClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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 *ElasticPoolsClient) createOrUpdateCreateRequest(ctx context.Contex // BeginDelete - Deletes an elastic pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -152,7 +152,7 @@ func (client *ElasticPoolsClient) BeginDelete(ctx context.Context, resourceGroup // Delete - Deletes an elastic pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview func (client *ElasticPoolsClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string, options *ElasticPoolsClientBeginDeleteOptions) (*http.Response, error) { var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, elasticPoolName, options) @@ -194,7 +194,7 @@ func (client *ElasticPoolsClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -202,7 +202,7 @@ func (client *ElasticPoolsClient) deleteCreateRequest(ctx context.Context, resou // BeginFailover - Failovers an elastic pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -225,7 +225,7 @@ func (client *ElasticPoolsClient) BeginFailover(ctx context.Context, resourceGro // Failover - Failovers an elastic pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview func (client *ElasticPoolsClient) failover(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string, options *ElasticPoolsClientBeginFailoverOptions) (*http.Response, error) { var err error req, err := client.failoverCreateRequest(ctx, resourceGroupName, serverName, elasticPoolName, options) @@ -267,7 +267,7 @@ func (client *ElasticPoolsClient) failoverCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -275,7 +275,7 @@ func (client *ElasticPoolsClient) failoverCreateRequest(ctx context.Context, res // Get - Gets an elastic pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -323,7 +323,7 @@ func (client *ElasticPoolsClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -340,7 +340,7 @@ func (client *ElasticPoolsClient) getHandleResponse(resp *http.Response) (Elasti // NewListByServerPager - Gets all elastic pools in a server. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -397,7 +397,7 @@ func (client *ElasticPoolsClient) listByServerCreateRequest(ctx context.Context, if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(*options.Skip, 10)) } - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -412,152 +412,10 @@ func (client *ElasticPoolsClient) listByServerHandleResponse(resp *http.Response return result, nil } -// NewListMetricDefinitionsPager - Returns elastic pool metric definitions. -// -// Generated from API version 2014-04-01 -// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// - serverName - The name of the server. -// - elasticPoolName - The name of the elastic pool. -// - options - ElasticPoolsClientListMetricDefinitionsOptions contains the optional parameters for the ElasticPoolsClient.NewListMetricDefinitionsPager -// method. -func (client *ElasticPoolsClient) NewListMetricDefinitionsPager(resourceGroupName string, serverName string, elasticPoolName string, options *ElasticPoolsClientListMetricDefinitionsOptions) *runtime.Pager[ElasticPoolsClientListMetricDefinitionsResponse] { - return runtime.NewPager(runtime.PagingHandler[ElasticPoolsClientListMetricDefinitionsResponse]{ - More: func(page ElasticPoolsClientListMetricDefinitionsResponse) bool { - return false - }, - Fetcher: func(ctx context.Context, page *ElasticPoolsClientListMetricDefinitionsResponse) (ElasticPoolsClientListMetricDefinitionsResponse, error) { - req, err := client.listMetricDefinitionsCreateRequest(ctx, resourceGroupName, serverName, elasticPoolName, options) - if err != nil { - return ElasticPoolsClientListMetricDefinitionsResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return ElasticPoolsClientListMetricDefinitionsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ElasticPoolsClientListMetricDefinitionsResponse{}, runtime.NewResponseError(resp) - } - return client.listMetricDefinitionsHandleResponse(resp) - }, - }) -} - -// listMetricDefinitionsCreateRequest creates the ListMetricDefinitions request. -func (client *ElasticPoolsClient) listMetricDefinitionsCreateRequest(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string, options *ElasticPoolsClientListMetricDefinitionsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/metricDefinitions" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if serverName == "" { - return nil, errors.New("parameter serverName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) - if elasticPoolName == "" { - return nil, errors.New("parameter elasticPoolName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{elasticPoolName}", url.PathEscape(elasticPoolName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2014-04-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listMetricDefinitionsHandleResponse handles the ListMetricDefinitions response. -func (client *ElasticPoolsClient) listMetricDefinitionsHandleResponse(resp *http.Response) (ElasticPoolsClientListMetricDefinitionsResponse, error) { - result := ElasticPoolsClientListMetricDefinitionsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.MetricDefinitionListResult); err != nil { - return ElasticPoolsClientListMetricDefinitionsResponse{}, err - } - return result, nil -} - -// NewListMetricsPager - Returns elastic pool metrics. -// -// Generated from API version 2014-04-01 -// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// - serverName - The name of the server. -// - elasticPoolName - The name of the elastic pool. -// - filter - An OData filter expression that describes a subset of metrics to return. -// - options - ElasticPoolsClientListMetricsOptions contains the optional parameters for the ElasticPoolsClient.NewListMetricsPager -// method. -func (client *ElasticPoolsClient) NewListMetricsPager(resourceGroupName string, serverName string, elasticPoolName string, filter string, options *ElasticPoolsClientListMetricsOptions) *runtime.Pager[ElasticPoolsClientListMetricsResponse] { - return runtime.NewPager(runtime.PagingHandler[ElasticPoolsClientListMetricsResponse]{ - More: func(page ElasticPoolsClientListMetricsResponse) bool { - return false - }, - Fetcher: func(ctx context.Context, page *ElasticPoolsClientListMetricsResponse) (ElasticPoolsClientListMetricsResponse, error) { - req, err := client.listMetricsCreateRequest(ctx, resourceGroupName, serverName, elasticPoolName, filter, options) - if err != nil { - return ElasticPoolsClientListMetricsResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return ElasticPoolsClientListMetricsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ElasticPoolsClientListMetricsResponse{}, runtime.NewResponseError(resp) - } - return client.listMetricsHandleResponse(resp) - }, - }) -} - -// listMetricsCreateRequest creates the ListMetrics request. -func (client *ElasticPoolsClient) listMetricsCreateRequest(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string, filter string, options *ElasticPoolsClientListMetricsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/metrics" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if serverName == "" { - return nil, errors.New("parameter serverName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) - if elasticPoolName == "" { - return nil, errors.New("parameter elasticPoolName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{elasticPoolName}", url.PathEscape(elasticPoolName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2014-04-01") - reqQP.Set("$filter", filter) - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listMetricsHandleResponse handles the ListMetrics response. -func (client *ElasticPoolsClient) listMetricsHandleResponse(resp *http.Response) (ElasticPoolsClientListMetricsResponse, error) { - result := ElasticPoolsClientListMetricsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.MetricListResult); err != nil { - return ElasticPoolsClientListMetricsResponse{}, err - } - return result, nil -} - // BeginUpdate - Updates an elastic pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -583,7 +441,7 @@ func (client *ElasticPoolsClient) BeginUpdate(ctx context.Context, resourceGroup // Update - Updates an elastic pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview func (client *ElasticPoolsClient) update(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string, parameters ElasticPoolUpdate, options *ElasticPoolsClientBeginUpdateOptions) (*http.Response, error) { var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, serverName, elasticPoolName, parameters, options) @@ -625,7 +483,7 @@ func (client *ElasticPoolsClient) updateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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/sql/armsql/elasticpools_client_example_test.go b/sdk/resourcemanager/sql/armsql/elasticpools_client_example_test.go deleted file mode 100644 index 705eec2eb8eb..000000000000 --- a/sdk/resourcemanager/sql/armsql/elasticpools_client_example_test.go +++ /dev/null @@ -1,1547 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ElasticPoolMetricsListWithFilter.json -func ExampleElasticPoolsClient_NewListMetricsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewElasticPoolsClient().NewListMetricsPager("sqlcrudtest-6730", "sqlcrudtest-9007", "3481", "name/value eq 'cpu_percent' and timeGrain eq '00:10:00' and startTime eq '2017-06-02T18:35:00Z' and endTime eq '2017-06-02T18:55:00Z'", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.MetricListResult = armsql.MetricListResult{ - // Value: []*armsql.Metric{ - // { - // Name: &armsql.MetricName{ - // LocalizedValue: to.Ptr("CPU percentage"), - // Value: to.Ptr("cpu_percent"), - // }, - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-02T18:55:00Z"); return t}()), - // MetricValues: []*armsql.MetricValue{ - // { - // Average: to.Ptr[float64](0), - // Count: to.Ptr[int32](1), - // Maximum: to.Ptr[float64](0), - // Minimum: to.Ptr[float64](0), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-02T18:30:01Z"); return t}()), - // Total: to.Ptr[float64](0), - // }, - // { - // Average: to.Ptr[float64](0), - // Count: to.Ptr[int32](1), - // Maximum: to.Ptr[float64](0), - // Minimum: to.Ptr[float64](0), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-02T18:40:01Z"); return t}()), - // Total: to.Ptr[float64](0), - // }, - // { - // Average: to.Ptr[float64](0), - // Count: to.Ptr[int32](1), - // Maximum: to.Ptr[float64](0), - // Minimum: to.Ptr[float64](0), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-02T18:50:01Z"); return t}()), - // Total: to.Ptr[float64](0), - // }}, - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-02T18:35:00Z"); return t}()), - // TimeGrain: to.Ptr("00:10:00"), - // Unit: to.Ptr(armsql.UnitTypePercent), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ElasticPoolMetricsDefinitionsList.json -func ExampleElasticPoolsClient_NewListMetricDefinitionsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewElasticPoolsClient().NewListMetricDefinitionsPager("sqlcrudtest-6730", "sqlcrudtest-9007", "3481", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.MetricDefinitionListResult = armsql.MetricDefinitionListResult{ - // Value: []*armsql.MetricDefinition{ - // { - // Name: &armsql.MetricName{ - // LocalizedValue: to.Ptr("CPU percentage"), - // Value: to.Ptr("cpu_percent"), - // }, - // MetricAvailabilities: []*armsql.MetricAvailability{ - // { - // Retention: to.Ptr("PT1H"), - // TimeGrain: to.Ptr("PT15S"), - // }, - // { - // Retention: to.Ptr("PT1H"), - // TimeGrain: to.Ptr("PT60S"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("PT5M"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("PT1H"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("P1D"), - // }}, - // PrimaryAggregationType: to.Ptr(armsql.PrimaryAggregationTypeAverage), - // ResourceURI: to.Ptr("/subscriptions/b6a6e0c5-e79c-4c6d-a878-72eafbca4cf2/resourceGroups/QA/providers/Microsoft.Sql/servers/nafantest/databases/db1"), - // Unit: to.Ptr(armsql.UnitDefinitionTypePercent), - // }, - // { - // Name: &armsql.MetricName{ - // LocalizedValue: to.Ptr("Data IO percentage"), - // Value: to.Ptr("physical_data_read_percent"), - // }, - // MetricAvailabilities: []*armsql.MetricAvailability{ - // { - // Retention: to.Ptr("PT1H"), - // TimeGrain: to.Ptr("PT15S"), - // }, - // { - // Retention: to.Ptr("PT1H"), - // TimeGrain: to.Ptr("PT60S"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("PT5M"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("PT1H"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("P1D"), - // }}, - // PrimaryAggregationType: to.Ptr(armsql.PrimaryAggregationTypeAverage), - // ResourceURI: to.Ptr("/subscriptions/b6a6e0c5-e79c-4c6d-a878-72eafbca4cf2/resourceGroups/QA/providers/Microsoft.Sql/servers/nafantest/databases/db1"), - // Unit: to.Ptr(armsql.UnitDefinitionTypePercent), - // }, - // { - // Name: &armsql.MetricName{ - // LocalizedValue: to.Ptr("Log IO percentage"), - // Value: to.Ptr("log_write_percent"), - // }, - // MetricAvailabilities: []*armsql.MetricAvailability{ - // { - // Retention: to.Ptr("PT1H"), - // TimeGrain: to.Ptr("PT15S"), - // }, - // { - // Retention: to.Ptr("PT1H"), - // TimeGrain: to.Ptr("PT60S"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("PT5M"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("PT1H"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("P1D"), - // }}, - // PrimaryAggregationType: to.Ptr(armsql.PrimaryAggregationTypeAverage), - // ResourceURI: to.Ptr("/subscriptions/b6a6e0c5-e79c-4c6d-a878-72eafbca4cf2/resourceGroups/QA/providers/Microsoft.Sql/servers/nafantest/databases/db1"), - // Unit: to.Ptr(armsql.UnitDefinitionTypePercent), - // }, - // { - // Name: &armsql.MetricName{ - // LocalizedValue: to.Ptr("DTU percentage"), - // Value: to.Ptr("dtu_consumption_percent"), - // }, - // MetricAvailabilities: []*armsql.MetricAvailability{ - // { - // Retention: to.Ptr("PT1H"), - // TimeGrain: to.Ptr("PT15S"), - // }, - // { - // Retention: to.Ptr("PT1H"), - // TimeGrain: to.Ptr("PT60S"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("PT5M"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("PT1H"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("P1D"), - // }}, - // PrimaryAggregationType: to.Ptr(armsql.PrimaryAggregationTypeAverage), - // ResourceURI: to.Ptr("/subscriptions/b6a6e0c5-e79c-4c6d-a878-72eafbca4cf2/resourceGroups/QA/providers/Microsoft.Sql/servers/nafantest/databases/db1"), - // Unit: to.Ptr(armsql.UnitDefinitionTypePercent), - // }, - // { - // Name: &armsql.MetricName{ - // LocalizedValue: to.Ptr("Total database size"), - // Value: to.Ptr("storage"), - // }, - // MetricAvailabilities: []*armsql.MetricAvailability{ - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("PT5M"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("PT1H"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("P1D"), - // }}, - // PrimaryAggregationType: to.Ptr(armsql.PrimaryAggregationTypeMaximum), - // ResourceURI: to.Ptr("/subscriptions/b6a6e0c5-e79c-4c6d-a878-72eafbca4cf2/resourceGroups/QA/providers/Microsoft.Sql/servers/nafantest/databases/db1"), - // Unit: to.Ptr(armsql.UnitDefinitionTypeBytes), - // }, - // { - // Name: &armsql.MetricName{ - // LocalizedValue: to.Ptr("In-Memory OLTP storage percent"), - // Value: to.Ptr("xtp_storage_percent"), - // }, - // MetricAvailabilities: []*armsql.MetricAvailability{ - // { - // Retention: to.Ptr("PT1H"), - // TimeGrain: to.Ptr("PT15S"), - // }, - // { - // Retention: to.Ptr("PT1H"), - // TimeGrain: to.Ptr("PT60S"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("PT5M"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("PT1H"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("P1D"), - // }}, - // PrimaryAggregationType: to.Ptr(armsql.PrimaryAggregationTypeAverage), - // ResourceURI: to.Ptr("/subscriptions/b6a6e0c5-e79c-4c6d-a878-72eafbca4cf2/resourceGroups/QA/providers/Microsoft.Sql/servers/nafantest/databases/db1"), - // Unit: to.Ptr(armsql.UnitDefinitionTypePercent), - // }, - // { - // Name: &armsql.MetricName{ - // LocalizedValue: to.Ptr("Workers percentage"), - // Value: to.Ptr("workers_percent"), - // }, - // MetricAvailabilities: []*armsql.MetricAvailability{ - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("PT5M"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("PT1H"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("P1D"), - // }}, - // PrimaryAggregationType: to.Ptr(armsql.PrimaryAggregationTypeAverage), - // ResourceURI: to.Ptr("/subscriptions/b6a6e0c5-e79c-4c6d-a878-72eafbca4cf2/resourceGroups/QA/providers/Microsoft.Sql/servers/nafantest/databases/db1"), - // Unit: to.Ptr(armsql.UnitDefinitionTypePercent), - // }, - // { - // Name: &armsql.MetricName{ - // LocalizedValue: to.Ptr("Sessions percentage"), - // Value: to.Ptr("sessions_percent"), - // }, - // MetricAvailabilities: []*armsql.MetricAvailability{ - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("PT5M"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("PT1H"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("P1D"), - // }}, - // PrimaryAggregationType: to.Ptr(armsql.PrimaryAggregationTypeAverage), - // ResourceURI: to.Ptr("/subscriptions/b6a6e0c5-e79c-4c6d-a878-72eafbca4cf2/resourceGroups/QA/providers/Microsoft.Sql/servers/nafantest/databases/db1"), - // Unit: to.Ptr(armsql.UnitDefinitionTypePercent), - // }, - // { - // Name: &armsql.MetricName{ - // LocalizedValue: to.Ptr("DTU limit"), - // Value: to.Ptr("dtu_limit"), - // }, - // MetricAvailabilities: []*armsql.MetricAvailability{ - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("PT5M"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("PT1H"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("P1D"), - // }}, - // PrimaryAggregationType: to.Ptr(armsql.PrimaryAggregationTypeAverage), - // ResourceURI: to.Ptr("/subscriptions/b6a6e0c5-e79c-4c6d-a878-72eafbca4cf2/resourceGroups/QA/providers/Microsoft.Sql/servers/nafantest/databases/db1"), - // Unit: to.Ptr(armsql.UnitDefinitionTypeCount), - // }, - // { - // Name: &armsql.MetricName{ - // LocalizedValue: to.Ptr("DTU used"), - // Value: to.Ptr("dtu_used"), - // }, - // MetricAvailabilities: []*armsql.MetricAvailability{ - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("PT5M"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("PT1H"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("P1D"), - // }}, - // PrimaryAggregationType: to.Ptr(armsql.PrimaryAggregationTypeAverage), - // ResourceURI: to.Ptr("/subscriptions/b6a6e0c5-e79c-4c6d-a878-72eafbca4cf2/resourceGroups/QA/providers/Microsoft.Sql/servers/nafantest/databases/db1"), - // Unit: to.Ptr(armsql.UnitDefinitionTypeCount), - // }, - // { - // Name: &armsql.MetricName{ - // LocalizedValue: to.Ptr("Successful Connections"), - // Value: to.Ptr("connection_successful"), - // }, - // MetricAvailabilities: []*armsql.MetricAvailability{ - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("PT5M"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("PT1H"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("P1D"), - // }}, - // PrimaryAggregationType: to.Ptr(armsql.PrimaryAggregationTypeTotal), - // ResourceURI: to.Ptr("/subscriptions/b6a6e0c5-e79c-4c6d-a878-72eafbca4cf2/resourceGroups/QA/providers/Microsoft.Sql/servers/nafantest/databases/db1"), - // Unit: to.Ptr(armsql.UnitDefinitionTypeCount), - // }, - // { - // Name: &armsql.MetricName{ - // LocalizedValue: to.Ptr("Failed Connections"), - // Value: to.Ptr("connection_failed"), - // }, - // MetricAvailabilities: []*armsql.MetricAvailability{ - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("PT5M"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("PT1H"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("P1D"), - // }}, - // PrimaryAggregationType: to.Ptr(armsql.PrimaryAggregationTypeTotal), - // ResourceURI: to.Ptr("/subscriptions/b6a6e0c5-e79c-4c6d-a878-72eafbca4cf2/resourceGroups/QA/providers/Microsoft.Sql/servers/nafantest/databases/db1"), - // Unit: to.Ptr(armsql.UnitDefinitionTypeCount), - // }, - // { - // Name: &armsql.MetricName{ - // LocalizedValue: to.Ptr("Blocked by Firewall"), - // Value: to.Ptr("blocked_by_firewall"), - // }, - // MetricAvailabilities: []*armsql.MetricAvailability{ - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("PT5M"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("PT1H"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("P1D"), - // }}, - // PrimaryAggregationType: to.Ptr(armsql.PrimaryAggregationTypeTotal), - // ResourceURI: to.Ptr("/subscriptions/b6a6e0c5-e79c-4c6d-a878-72eafbca4cf2/resourceGroups/QA/providers/Microsoft.Sql/servers/nafantest/databases/db1"), - // Unit: to.Ptr(armsql.UnitDefinitionTypeCount), - // }, - // { - // Name: &armsql.MetricName{ - // LocalizedValue: to.Ptr("Deadlocks"), - // Value: to.Ptr("deadlock"), - // }, - // MetricAvailabilities: []*armsql.MetricAvailability{ - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("PT5M"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("PT1H"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("P1D"), - // }}, - // PrimaryAggregationType: to.Ptr(armsql.PrimaryAggregationTypeTotal), - // ResourceURI: to.Ptr("/subscriptions/b6a6e0c5-e79c-4c6d-a878-72eafbca4cf2/resourceGroups/QA/providers/Microsoft.Sql/servers/nafantest/databases/db1"), - // Unit: to.Ptr(armsql.UnitDefinitionTypeCount), - // }, - // { - // Name: &armsql.MetricName{ - // LocalizedValue: to.Ptr("Database size percentage"), - // Value: to.Ptr("storage_percent"), - // }, - // MetricAvailabilities: []*armsql.MetricAvailability{ - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("PT5M"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("PT1H"), - // }, - // { - // Retention: to.Ptr("P14D"), - // TimeGrain: to.Ptr("P1D"), - // }}, - // PrimaryAggregationType: to.Ptr(armsql.PrimaryAggregationTypeMaximum), - // ResourceURI: to.Ptr("/subscriptions/b6a6e0c5-e79c-4c6d-a878-72eafbca4cf2/resourceGroups/QA/providers/Microsoft.Sql/servers/nafantest/databases/db1"), - // Unit: to.Ptr(armsql.UnitDefinitionTypePercent), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ElasticPoolListByServer.json -func ExampleElasticPoolsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewElasticPoolsClient().NewListByServerPager("sqlcrudtest-2369", "sqlcrudtest-8069", &armsql.ElasticPoolsClientListByServerOptions{Skip: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ElasticPoolListResult = armsql.ElasticPoolListResult{ - // Value: []*armsql.ElasticPool{ - // { - // Name: to.Ptr("sqlcrudtest-2729"), - // Type: to.Ptr("Microsoft.Sql/servers/elasticPools"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-2729"), - // Location: to.Ptr("Japan East"), - // Properties: &armsql.ElasticPoolProperties{ - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-10T01:27:21.32Z"); return t}()), - // LicenseType: to.Ptr(armsql.ElasticPoolLicenseTypeLicenseIncluded), - // MaxSizeBytes: to.Ptr[int64](5242880000), - // PerDatabaseSettings: &armsql.ElasticPoolPerDatabaseSettings{ - // MaxCapacity: to.Ptr[float64](1), - // MinCapacity: to.Ptr[float64](0.25), - // }, - // State: to.Ptr(armsql.ElasticPoolStateReady), - // ZoneRedundant: to.Ptr(true), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("GP_Gen4_2"), - // Capacity: to.Ptr[int32](2), - // Tier: to.Ptr("GeneralPurpose"), - // }, - // }, - // { - // Name: to.Ptr("sqlcrudtest-3191"), - // Type: to.Ptr("Microsoft.Sql/servers/elasticPools"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-3191"), - // Location: to.Ptr("Japan East"), - // Properties: &armsql.ElasticPoolProperties{ - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-10T01:26:26.45Z"); return t}()), - // MaxSizeBytes: to.Ptr[int64](5242880000), - // PerDatabaseSettings: &armsql.ElasticPoolPerDatabaseSettings{ - // MaxCapacity: to.Ptr[float64](5), - // MinCapacity: to.Ptr[float64](0), - // }, - // State: to.Ptr(armsql.ElasticPoolStateReady), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("BasicPool"), - // Capacity: to.Ptr[int32](50), - // Tier: to.Ptr("Basic"), - // }, - // }, - // { - // Name: to.Ptr("sqlcrudtest-8102"), - // Type: to.Ptr("Microsoft.Sql/servers/elasticPools"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-8102"), - // Location: to.Ptr("Japan East"), - // Properties: &armsql.ElasticPoolProperties{ - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-10T01:25:25.033Z"); return t}()), - // MaxSizeBytes: to.Ptr[int64](5242880000), - // PerDatabaseSettings: &armsql.ElasticPoolPerDatabaseSettings{ - // MaxCapacity: to.Ptr[float64](5), - // MinCapacity: to.Ptr[float64](0), - // }, - // State: to.Ptr(armsql.ElasticPoolStateReady), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("BasicPool"), - // Capacity: to.Ptr[int32](50), - // Tier: to.Ptr("Basic"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/HyperscaleElasticPoolGet.json -func ExampleElasticPoolsClient_Get_getAHyperscaleElasticPool() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewElasticPoolsClient().Get(ctx, "sqlcrudtest-2369", "sqlcrudtest-8069", "sqlcrudtest-8102", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ElasticPool = armsql.ElasticPool{ - // Name: to.Ptr("sqlcrudtest-8102"), - // Type: to.Ptr("Microsoft.Sql/servers/elasticPools"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-8102"), - // Location: to.Ptr("Japan East"), - // Kind: to.Ptr("vcore,pool"), - // Properties: &armsql.ElasticPoolProperties{ - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-26T03:46:20.57Z"); return t}()), - // HighAvailabilityReplicaCount: to.Ptr[int32](2), - // LicenseType: to.Ptr(armsql.ElasticPoolLicenseTypeLicenseIncluded), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default"), - // MaxSizeBytes: to.Ptr[int64](0), - // PerDatabaseSettings: &armsql.ElasticPoolPerDatabaseSettings{ - // MaxCapacity: to.Ptr[float64](4), - // MinCapacity: to.Ptr[float64](0), - // }, - // State: to.Ptr(armsql.ElasticPoolStateReady), - // ZoneRedundant: to.Ptr(false), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("HS_Gen5"), - // Capacity: to.Ptr[int32](4), - // Family: to.Ptr("Gen5"), - // Tier: to.Ptr("Hyperscale"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ElasticPoolGet.json -func ExampleElasticPoolsClient_Get_getAnElasticPool() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewElasticPoolsClient().Get(ctx, "sqlcrudtest-2369", "sqlcrudtest-8069", "sqlcrudtest-8102", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ElasticPool = armsql.ElasticPool{ - // Name: to.Ptr("sqlcrudtest-8102"), - // Type: to.Ptr("Microsoft.Sql/servers/elasticPools"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-8102"), - // Location: to.Ptr("Japan East"), - // Properties: &armsql.ElasticPoolProperties{ - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-10-10T01:25:25.033Z"); return t}()), - // LicenseType: to.Ptr(armsql.ElasticPoolLicenseTypeLicenseIncluded), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_1"), - // MaxSizeBytes: to.Ptr[int64](5242880000), - // PerDatabaseSettings: &armsql.ElasticPoolPerDatabaseSettings{ - // MaxCapacity: to.Ptr[float64](1), - // MinCapacity: to.Ptr[float64](0.25), - // }, - // State: to.Ptr(armsql.ElasticPoolStateReady), - // ZoneRedundant: to.Ptr(true), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("GP_Gen5_2"), - // Capacity: to.Ptr[int32](2), - // Tier: to.Ptr("GeneralPurpose"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/GetElasticPoolWithAvailabilityZone.json -func ExampleElasticPoolsClient_Get_getAnElasticPoolWithAvailabilityZone() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewElasticPoolsClient().Get(ctx, "sqlcrudtest-2369", "sqlcrudtest-8069", "sqlcrudtest-8102", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ElasticPool = armsql.ElasticPool{ - // Name: to.Ptr("sqlcrudtest-8102"), - // Type: to.Ptr("Microsoft.Sql/servers/elasticPools"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-8102"), - // Location: to.Ptr("Japan East"), - // Properties: &armsql.ElasticPoolProperties{ - // AvailabilityZone: to.Ptr(armsql.AvailabilityZoneTypeOne), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-10-10T01:25:25.033Z"); return t}()), - // LicenseType: to.Ptr(armsql.ElasticPoolLicenseTypeLicenseIncluded), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_1"), - // MaxSizeBytes: to.Ptr[int64](5242880000), - // PerDatabaseSettings: &armsql.ElasticPoolPerDatabaseSettings{ - // MaxCapacity: to.Ptr[float64](1), - // MinCapacity: to.Ptr[float64](0.25), - // }, - // State: to.Ptr(armsql.ElasticPoolStateReady), - // ZoneRedundant: to.Ptr(true), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("GP_Gen5_2"), - // Capacity: to.Ptr[int32](2), - // Tier: to.Ptr("GeneralPurpose"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ElasticPoolGetWithPreferredEnclaveType.json -func ExampleElasticPoolsClient_Get_getAnElasticPoolWithPreferredEnclaveTypeParameter() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewElasticPoolsClient().Get(ctx, "sqlcrudtest-2369", "sqlcrudtest-8069", "sqlcrudtest-8102", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ElasticPool = armsql.ElasticPool{ - // Name: to.Ptr("sqlcrudtest-8102"), - // Type: to.Ptr("Microsoft.Sql/servers/elasticPools"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-8102"), - // Location: to.Ptr("Japan East"), - // Kind: to.Ptr("vcore,pool"), - // Properties: &armsql.ElasticPoolProperties{ - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-08-26T03:46:20.57Z"); return t}()), - // HighAvailabilityReplicaCount: to.Ptr[int32](2), - // LicenseType: to.Ptr(armsql.ElasticPoolLicenseTypeLicenseIncluded), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default"), - // MaxSizeBytes: to.Ptr[int64](0), - // PerDatabaseSettings: &armsql.ElasticPoolPerDatabaseSettings{ - // MaxCapacity: to.Ptr[float64](4), - // MinCapacity: to.Ptr[float64](0), - // }, - // PreferredEnclaveType: to.Ptr(armsql.AlwaysEncryptedEnclaveTypeVBS), - // State: to.Ptr(armsql.ElasticPoolStateReady), - // ZoneRedundant: to.Ptr(false), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("GP_Gen5"), - // Capacity: to.Ptr[int32](4), - // Family: to.Ptr("Gen5"), - // Tier: to.Ptr("GeneralPurpose"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CreateElasticPoolWithAvailabilityZone.json -func ExampleElasticPoolsClient_BeginCreateOrUpdate_createOrUpdateAnElasticPoolWithAvailabilityZone() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewElasticPoolsClient().BeginCreateOrUpdate(ctx, "sqlcrudtest-2369", "sqlcrudtest-8069", "sqlcrudtest-8102", armsql.ElasticPool{ - Location: to.Ptr("Japan East"), - Properties: &armsql.ElasticPoolProperties{ - AvailabilityZone: to.Ptr(armsql.AvailabilityZoneTypeOne), - PerDatabaseSettings: &armsql.ElasticPoolPerDatabaseSettings{ - MaxCapacity: to.Ptr[float64](2), - MinCapacity: to.Ptr[float64](0.25), - }, - ZoneRedundant: to.Ptr(true), - }, - SKU: &armsql.SKU{ - Name: to.Ptr("HS_Gen5_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.ElasticPool = armsql.ElasticPool{ - // Name: to.Ptr("sqlcrudtest-8102"), - // Type: to.Ptr("Microsoft.Sql/servers/elasticPools"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-8102"), - // Location: to.Ptr("Japan East"), - // Properties: &armsql.ElasticPoolProperties{ - // AvailabilityZone: to.Ptr(armsql.AvailabilityZoneTypeOne), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-10T01:25:25.033Z"); return t}()), - // MaxSizeBytes: to.Ptr[int64](102400), - // PerDatabaseSettings: &armsql.ElasticPoolPerDatabaseSettings{ - // MaxCapacity: to.Ptr[float64](2), - // MinCapacity: to.Ptr[float64](0.25), - // }, - // State: to.Ptr(armsql.ElasticPoolStateReady), - // ZoneRedundant: to.Ptr(true), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("StandardPool"), - // Capacity: to.Ptr[int32](100), - // Tier: to.Ptr("Standard"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/HyperscaleElasticPoolCreateOrUpdateSetHighAvailabilityReplicaCount.json -func ExampleElasticPoolsClient_BeginCreateOrUpdate_createOrUpdateHyperscaleElasticPoolWithHighAvailabilityReplicaCountParameter() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewElasticPoolsClient().BeginCreateOrUpdate(ctx, "sqlcrudtest-2369", "sqlcrudtest-8069", "sqlcrudtest-8102", armsql.ElasticPool{ - Location: to.Ptr("Japan East"), - Properties: &armsql.ElasticPoolProperties{ - HighAvailabilityReplicaCount: to.Ptr[int32](2), - }, - SKU: &armsql.SKU{ - Name: to.Ptr("HS_Gen5_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.ElasticPool = armsql.ElasticPool{ - // Name: to.Ptr("sqlcrudtest-8102"), - // Type: to.Ptr("Microsoft.Sql/servers/elasticPools"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-8102"), - // Location: to.Ptr("Japan East"), - // Kind: to.Ptr("vcore,pool"), - // Properties: &armsql.ElasticPoolProperties{ - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-26T03:46:20.57Z"); return t}()), - // HighAvailabilityReplicaCount: to.Ptr[int32](2), - // LicenseType: to.Ptr(armsql.ElasticPoolLicenseTypeLicenseIncluded), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default"), - // MaxSizeBytes: to.Ptr[int64](0), - // PerDatabaseSettings: &armsql.ElasticPoolPerDatabaseSettings{ - // MaxCapacity: to.Ptr[float64](4), - // MinCapacity: to.Ptr[float64](0), - // }, - // State: to.Ptr(armsql.ElasticPoolStateReady), - // ZoneRedundant: to.Ptr(false), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("HS_Gen5"), - // Capacity: to.Ptr[int32](4), - // Family: to.Ptr("Gen5"), - // Tier: to.Ptr("Hyperscale"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ElasticPoolCreateOrUpdateMax.json -func ExampleElasticPoolsClient_BeginCreateOrUpdate_createOrUpdateElasticPoolWithAllParameter() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewElasticPoolsClient().BeginCreateOrUpdate(ctx, "sqlcrudtest-2369", "sqlcrudtest-8069", "sqlcrudtest-8102", armsql.ElasticPool{ - Location: to.Ptr("Japan East"), - Properties: &armsql.ElasticPoolProperties{ - PerDatabaseSettings: &armsql.ElasticPoolPerDatabaseSettings{ - MaxCapacity: to.Ptr[float64](2), - MinCapacity: to.Ptr[float64](0.25), - }, - }, - SKU: &armsql.SKU{ - Name: to.Ptr("GP_Gen4_2"), - Capacity: to.Ptr[int32](2), - Tier: to.Ptr("GeneralPurpose"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ElasticPool = armsql.ElasticPool{ - // Name: to.Ptr("sqlcrudtest-8102"), - // Type: to.Ptr("Microsoft.Sql/servers/elasticPools"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-8102"), - // Location: to.Ptr("Japan East"), - // Properties: &armsql.ElasticPoolProperties{ - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-10T01:25:25.033Z"); return t}()), - // MaxSizeBytes: to.Ptr[int64](5242880000), - // PerDatabaseSettings: &armsql.ElasticPoolPerDatabaseSettings{ - // MaxCapacity: to.Ptr[float64](2), - // MinCapacity: to.Ptr[float64](0.25), - // }, - // State: to.Ptr(armsql.ElasticPoolStateReady), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("GP_Gen4_2"), - // Capacity: to.Ptr[int32](2), - // Tier: to.Ptr("GeneralPurpose"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ElasticPoolCreateOrUpdateSetMaintenanceConfiguration.json -func ExampleElasticPoolsClient_BeginCreateOrUpdate_createOrUpdateElasticPoolWithMaintenanceConfigurationParameter() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewElasticPoolsClient().BeginCreateOrUpdate(ctx, "sqlcrudtest-2369", "sqlcrudtest-8069", "sqlcrudtest-8102", armsql.ElasticPool{ - Location: to.Ptr("Japan East"), - Properties: &armsql.ElasticPoolProperties{ - MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ElasticPool = armsql.ElasticPool{ - // Name: to.Ptr("sqlcrudtest-8102"), - // Type: to.Ptr("Microsoft.Sql/servers/elasticPools"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-8102"), - // Location: to.Ptr("Japan East"), - // Properties: &armsql.ElasticPoolProperties{ - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-10T01:25:25.033Z"); return t}()), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_1"), - // MaxSizeBytes: to.Ptr[int64](102400), - // PerDatabaseSettings: &armsql.ElasticPoolPerDatabaseSettings{ - // MaxCapacity: to.Ptr[float64](100), - // MinCapacity: to.Ptr[float64](0), - // }, - // State: to.Ptr(armsql.ElasticPoolStateReady), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("StandardPool"), - // Capacity: to.Ptr[int32](100), - // Tier: to.Ptr("Standard"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ElasticPoolCreateOrUpdateMin.json -func ExampleElasticPoolsClient_BeginCreateOrUpdate_createOrUpdateElasticPoolWithMinimumParameters() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewElasticPoolsClient().BeginCreateOrUpdate(ctx, "sqlcrudtest-2369", "sqlcrudtest-8069", "sqlcrudtest-8102", armsql.ElasticPool{ - Location: to.Ptr("Japan East"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ElasticPool = armsql.ElasticPool{ - // Name: to.Ptr("sqlcrudtest-8102"), - // Type: to.Ptr("Microsoft.Sql/servers/elasticPools"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-8102"), - // Location: to.Ptr("Japan East"), - // Properties: &armsql.ElasticPoolProperties{ - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-10T01:25:25.033Z"); return t}()), - // MaxSizeBytes: to.Ptr[int64](102400), - // PerDatabaseSettings: &armsql.ElasticPoolPerDatabaseSettings{ - // MaxCapacity: to.Ptr[float64](100), - // MinCapacity: to.Ptr[float64](0), - // }, - // State: to.Ptr(armsql.ElasticPoolStateReady), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("StandardPool"), - // Capacity: to.Ptr[int32](100), - // Tier: to.Ptr("Standard"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ElasticPoolCreateWithDefaultPreferredEnclaveType.json -func ExampleElasticPoolsClient_BeginCreateOrUpdate_createOrUpdateElasticPoolWithPreferredEnclaveTypeParameterAsDefault() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewElasticPoolsClient().BeginCreateOrUpdate(ctx, "sqlcrudtest-2369", "sqlcrudtest-8069", "sqlcrudtest-8102", armsql.ElasticPool{ - Location: to.Ptr("Japan East"), - Properties: &armsql.ElasticPoolProperties{ - PreferredEnclaveType: to.Ptr(armsql.AlwaysEncryptedEnclaveTypeDefault), - }, - SKU: &armsql.SKU{ - Name: to.Ptr("GP_Gen5_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.ElasticPool = armsql.ElasticPool{ - // Name: to.Ptr("sqlcrudtest-8102"), - // Type: to.Ptr("Microsoft.Sql/servers/elasticPools"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-8102"), - // Location: to.Ptr("Japan East"), - // Kind: to.Ptr("vcore,pool"), - // Properties: &armsql.ElasticPoolProperties{ - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-08-26T03:46:20.57Z"); return t}()), - // LicenseType: to.Ptr(armsql.ElasticPoolLicenseTypeLicenseIncluded), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default"), - // MaxSizeBytes: to.Ptr[int64](0), - // PerDatabaseSettings: &armsql.ElasticPoolPerDatabaseSettings{ - // MaxCapacity: to.Ptr[float64](4), - // MinCapacity: to.Ptr[float64](0), - // }, - // PreferredEnclaveType: to.Ptr(armsql.AlwaysEncryptedEnclaveTypeDefault), - // State: to.Ptr(armsql.ElasticPoolStateReady), - // ZoneRedundant: to.Ptr(false), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("GP_Gen5"), - // Capacity: to.Ptr[int32](4), - // Family: to.Ptr("Gen5"), - // Tier: to.Ptr("GeneralPurpose"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ElasticPoolCreateWithVBSPreferredEnclaveType.json -func ExampleElasticPoolsClient_BeginCreateOrUpdate_createOrUpdateElasticPoolWithPreferredEnclaveTypeParameterAsVbs() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewElasticPoolsClient().BeginCreateOrUpdate(ctx, "sqlcrudtest-2369", "sqlcrudtest-8069", "sqlcrudtest-8102", armsql.ElasticPool{ - Location: to.Ptr("Japan East"), - Properties: &armsql.ElasticPoolProperties{ - PreferredEnclaveType: to.Ptr(armsql.AlwaysEncryptedEnclaveTypeVBS), - }, - SKU: &armsql.SKU{ - Name: to.Ptr("GP_Gen5_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.ElasticPool = armsql.ElasticPool{ - // Name: to.Ptr("sqlcrudtest-8102"), - // Type: to.Ptr("Microsoft.Sql/servers/elasticPools"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-8102"), - // Location: to.Ptr("Japan East"), - // Kind: to.Ptr("vcore,pool"), - // Properties: &armsql.ElasticPoolProperties{ - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-08-26T03:46:20.57Z"); return t}()), - // LicenseType: to.Ptr(armsql.ElasticPoolLicenseTypeLicenseIncluded), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default"), - // MaxSizeBytes: to.Ptr[int64](0), - // PerDatabaseSettings: &armsql.ElasticPoolPerDatabaseSettings{ - // MaxCapacity: to.Ptr[float64](4), - // MinCapacity: to.Ptr[float64](0), - // }, - // PreferredEnclaveType: to.Ptr(armsql.AlwaysEncryptedEnclaveTypeVBS), - // State: to.Ptr(armsql.ElasticPoolStateReady), - // ZoneRedundant: to.Ptr(false), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("GP_Gen5"), - // Capacity: to.Ptr[int32](4), - // Family: to.Ptr("Gen5"), - // Tier: to.Ptr("GeneralPurpose"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ElasticPoolDelete.json -func ExampleElasticPoolsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewElasticPoolsClient().BeginDelete(ctx, "sqlcrudtest-3129", "sqlcrudtest-228", "sqlcrudtest-3851", 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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ElasticPoolUpdateAssignMaintenanceConfiguration.json -func ExampleElasticPoolsClient_BeginUpdate_assignsMaintenanceConfigurationToAnElasticPool() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewElasticPoolsClient().BeginUpdate(ctx, "sqlcrudtest-2369", "sqlcrudtest-8069", "sqlcrudtest-8102", armsql.ElasticPoolUpdate{ - Properties: &armsql.ElasticPoolUpdateProperties{ - MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ElasticPool = armsql.ElasticPool{ - // Name: to.Ptr("sqlcrudtest-8102"), - // Type: to.Ptr("Microsoft.Sql/servers/elasticPools"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-8102"), - // Location: to.Ptr("Japan East"), - // Properties: &armsql.ElasticPoolProperties{ - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-10T01:25:25.033Z"); return t}()), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_1"), - // MaxSizeBytes: to.Ptr[int64](5242880000), - // PerDatabaseSettings: &armsql.ElasticPoolPerDatabaseSettings{ - // MaxCapacity: to.Ptr[float64](5), - // MinCapacity: to.Ptr[float64](0), - // }, - // State: to.Ptr(armsql.ElasticPoolStateReady), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("BasicPool"), - // Capacity: to.Ptr[int32](50), - // Tier: to.Ptr("Basic"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ElasticPoolUpdateWithDefaultPreferredEnclaveType.json -func ExampleElasticPoolsClient_BeginUpdate_createOrUpdateElasticPoolWithPreferredEnclaveTypeParameterAsDefault() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewElasticPoolsClient().BeginUpdate(ctx, "sqlcrudtest-2369", "sqlcrudtest-8069", "sqlcrudtest-8102", armsql.ElasticPoolUpdate{ - Properties: &armsql.ElasticPoolUpdateProperties{ - PreferredEnclaveType: to.Ptr(armsql.AlwaysEncryptedEnclaveTypeDefault), - }, - SKU: &armsql.SKU{ - Name: to.Ptr("GP_Gen5_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.ElasticPool = armsql.ElasticPool{ - // Name: to.Ptr("sqlcrudtest-8102"), - // Type: to.Ptr("Microsoft.Sql/servers/elasticPools"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-8102"), - // Location: to.Ptr("Japan East"), - // Kind: to.Ptr("vcore,pool"), - // Properties: &armsql.ElasticPoolProperties{ - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-08-26T03:46:20.57Z"); return t}()), - // LicenseType: to.Ptr(armsql.ElasticPoolLicenseTypeLicenseIncluded), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default"), - // MaxSizeBytes: to.Ptr[int64](0), - // PerDatabaseSettings: &armsql.ElasticPoolPerDatabaseSettings{ - // MaxCapacity: to.Ptr[float64](4), - // MinCapacity: to.Ptr[float64](0), - // }, - // PreferredEnclaveType: to.Ptr(armsql.AlwaysEncryptedEnclaveTypeDefault), - // State: to.Ptr(armsql.ElasticPoolStateReady), - // ZoneRedundant: to.Ptr(false), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("GP_Gen5"), - // Capacity: to.Ptr[int32](4), - // Family: to.Ptr("Gen5"), - // Tier: to.Ptr("GeneralPurpose"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ElasticPoolUpdateWithVBSPreferredEnclaveType.json -func ExampleElasticPoolsClient_BeginUpdate_createOrUpdateElasticPoolWithPreferredEnclaveTypeParameterAsVbs() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewElasticPoolsClient().BeginUpdate(ctx, "sqlcrudtest-2369", "sqlcrudtest-8069", "sqlcrudtest-8102", armsql.ElasticPoolUpdate{ - Properties: &armsql.ElasticPoolUpdateProperties{ - PreferredEnclaveType: to.Ptr(armsql.AlwaysEncryptedEnclaveTypeVBS), - }, - SKU: &armsql.SKU{ - Name: to.Ptr("GP_Gen5_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.ElasticPool = armsql.ElasticPool{ - // Name: to.Ptr("sqlcrudtest-8102"), - // Type: to.Ptr("Microsoft.Sql/servers/elasticPools"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-8102"), - // Location: to.Ptr("Japan East"), - // Kind: to.Ptr("vcore,pool"), - // Properties: &armsql.ElasticPoolProperties{ - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-08-26T03:46:20.57Z"); return t}()), - // LicenseType: to.Ptr(armsql.ElasticPoolLicenseTypeLicenseIncluded), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default"), - // MaxSizeBytes: to.Ptr[int64](0), - // PerDatabaseSettings: &armsql.ElasticPoolPerDatabaseSettings{ - // MaxCapacity: to.Ptr[float64](4), - // MinCapacity: to.Ptr[float64](0), - // }, - // PreferredEnclaveType: to.Ptr(armsql.AlwaysEncryptedEnclaveTypeVBS), - // State: to.Ptr(armsql.ElasticPoolStateReady), - // ZoneRedundant: to.Ptr(false), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("GP_Gen5"), - // Capacity: to.Ptr[int32](4), - // Family: to.Ptr("Gen5"), - // Tier: to.Ptr("GeneralPurpose"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ElasticPoolUpdateResetMaintenanceConfiguration.json -func ExampleElasticPoolsClient_BeginUpdate_resetsMaintenanceConfigurationOfAnElasticPoolToDefault() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewElasticPoolsClient().BeginUpdate(ctx, "sqlcrudtest-2369", "sqlcrudtest-8069", "sqlcrudtest-8102", armsql.ElasticPoolUpdate{ - Properties: &armsql.ElasticPoolUpdateProperties{ - MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_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.ElasticPool = armsql.ElasticPool{ - // Name: to.Ptr("sqlcrudtest-8102"), - // Type: to.Ptr("Microsoft.Sql/servers/elasticPools"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-8102"), - // Location: to.Ptr("Japan East"), - // Properties: &armsql.ElasticPoolProperties{ - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-10T01:25:25.033Z"); return t}()), - // MaxSizeBytes: to.Ptr[int64](5242880000), - // PerDatabaseSettings: &armsql.ElasticPoolPerDatabaseSettings{ - // MaxCapacity: to.Ptr[float64](5), - // MinCapacity: to.Ptr[float64](0), - // }, - // State: to.Ptr(armsql.ElasticPoolStateReady), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("BasicPool"), - // Capacity: to.Ptr[int32](50), - // Tier: to.Ptr("Basic"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ElasticPoolUpdateMax.json -func ExampleElasticPoolsClient_BeginUpdate_updateAnElasticPoolWithAllParameter() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewElasticPoolsClient().BeginUpdate(ctx, "sqlcrudtest-2369", "sqlcrudtest-8069", "sqlcrudtest-8102", armsql.ElasticPoolUpdate{ - Properties: &armsql.ElasticPoolUpdateProperties{ - LicenseType: to.Ptr(armsql.ElasticPoolLicenseTypeLicenseIncluded), - PerDatabaseSettings: &armsql.ElasticPoolPerDatabaseSettings{ - MaxCapacity: to.Ptr[float64](1), - MinCapacity: to.Ptr[float64](0.25), - }, - ZoneRedundant: to.Ptr(true), - }, - SKU: &armsql.SKU{ - Name: to.Ptr("BC_Gen4"), - Capacity: to.Ptr[int32](2), - Tier: to.Ptr("BusinessCritical"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ElasticPool = armsql.ElasticPool{ - // Name: to.Ptr("sqlcrudtest-8102"), - // Type: to.Ptr("Microsoft.Sql/servers/elasticPools"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-8102"), - // Location: to.Ptr("Japan East"), - // Properties: &armsql.ElasticPoolProperties{ - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-10T01:27:21.32Z"); return t}()), - // LicenseType: to.Ptr(armsql.ElasticPoolLicenseTypeLicenseIncluded), - // MaxSizeBytes: to.Ptr[int64](5242880000), - // PerDatabaseSettings: &armsql.ElasticPoolPerDatabaseSettings{ - // MaxCapacity: to.Ptr[float64](1), - // MinCapacity: to.Ptr[float64](0.25), - // }, - // State: to.Ptr(armsql.ElasticPoolStateReady), - // ZoneRedundant: to.Ptr(true), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("BC_Gen4"), - // Capacity: to.Ptr[int32](2), - // Tier: to.Ptr("BusinessCritical"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ElasticPoolUpdateMin.json -func ExampleElasticPoolsClient_BeginUpdate_updateAnElasticPoolWithMinimumParameters() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewElasticPoolsClient().BeginUpdate(ctx, "sqlcrudtest-2369", "sqlcrudtest-8069", "sqlcrudtest-8102", armsql.ElasticPoolUpdate{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ElasticPool = armsql.ElasticPool{ - // Name: to.Ptr("sqlcrudtest-8102"), - // Type: to.Ptr("Microsoft.Sql/servers/elasticPools"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-8102"), - // Location: to.Ptr("Japan East"), - // Properties: &armsql.ElasticPoolProperties{ - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-10T01:25:25.033Z"); return t}()), - // MaxSizeBytes: to.Ptr[int64](5242880000), - // PerDatabaseSettings: &armsql.ElasticPoolPerDatabaseSettings{ - // MaxCapacity: to.Ptr[float64](5), - // MinCapacity: to.Ptr[float64](0), - // }, - // State: to.Ptr(armsql.ElasticPoolStateReady), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("BasicPool"), - // Capacity: to.Ptr[int32](50), - // Tier: to.Ptr("Basic"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/HyperscaleElasticPoolUpdateSetHighAvailabilityReplicaCount.json -func ExampleElasticPoolsClient_BeginUpdate_updateHighAvailabilityReplicaCountOfAHyperscaleElasticPool() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewElasticPoolsClient().BeginUpdate(ctx, "sqlcrudtest-2369", "sqlcrudtest-8069", "sqlcrudtest-8102", armsql.ElasticPoolUpdate{ - Properties: &armsql.ElasticPoolUpdateProperties{ - HighAvailabilityReplicaCount: 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.ElasticPool = armsql.ElasticPool{ - // Name: to.Ptr("sqlcrudtest-8102"), - // Type: to.Ptr("Microsoft.Sql/servers/elasticPools"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-2369/providers/Microsoft.Sql/servers/sqlcrudtest-8069/elasticPools/sqlcrudtest-8102"), - // Location: to.Ptr("Japan East"), - // Kind: to.Ptr("vcore,pool"), - // Properties: &armsql.ElasticPoolProperties{ - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-26T03:46:20.57Z"); return t}()), - // HighAvailabilityReplicaCount: to.Ptr[int32](2), - // LicenseType: to.Ptr(armsql.ElasticPoolLicenseTypeLicenseIncluded), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default"), - // MaxSizeBytes: to.Ptr[int64](0), - // PerDatabaseSettings: &armsql.ElasticPoolPerDatabaseSettings{ - // MaxCapacity: to.Ptr[float64](4), - // MinCapacity: to.Ptr[float64](0), - // }, - // State: to.Ptr(armsql.ElasticPoolStateReady), - // ZoneRedundant: to.Ptr(false), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("HS_Gen5"), - // Capacity: to.Ptr[int32](4), - // Family: to.Ptr("Gen5"), - // Tier: to.Ptr("Hyperscale"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/FailoverElasticPool.json -func ExampleElasticPoolsClient_BeginFailover() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewElasticPoolsClient().BeginFailover(ctx, "group1", "testServer", "testElasticPool", 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/sql/armsql/encryptionprotectors_client.go b/sdk/resourcemanager/sql/armsql/encryptionprotectors_client.go index 9927cf732e63..212aa29db65b 100644 --- a/sdk/resourcemanager/sql/armsql/encryptionprotectors_client.go +++ b/sdk/resourcemanager/sql/armsql/encryptionprotectors_client.go @@ -46,7 +46,7 @@ func NewEncryptionProtectorsClient(subscriptionID string, credential azcore.Toke // BeginCreateOrUpdate - Updates an existing encryption protector. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -70,7 +70,7 @@ func (client *EncryptionProtectorsClient) BeginCreateOrUpdate(ctx context.Contex // CreateOrUpdate - Updates an existing encryption protector. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview func (client *EncryptionProtectorsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, encryptionProtectorName EncryptionProtectorName, parameters EncryptionProtector, options *EncryptionProtectorsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, encryptionProtectorName, parameters, options) @@ -112,7 +112,7 @@ func (client *EncryptionProtectorsClient) createOrUpdateCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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 *EncryptionProtectorsClient) createOrUpdateCreateRequest(ctx contex // Get - Gets a server encryption protector. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -173,7 +173,7 @@ func (client *EncryptionProtectorsClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -190,7 +190,7 @@ func (client *EncryptionProtectorsClient) getHandleResponse(resp *http.Response) // NewListByServerPager - Gets a list of server encryption protectors // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -244,7 +244,7 @@ func (client *EncryptionProtectorsClient) listByServerCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -262,7 +262,7 @@ func (client *EncryptionProtectorsClient) listByServerHandleResponse(resp *http. // BeginRevalidate - Revalidates an existing encryption protector. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -285,7 +285,7 @@ func (client *EncryptionProtectorsClient) BeginRevalidate(ctx context.Context, r // Revalidate - Revalidates an existing encryption protector. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview func (client *EncryptionProtectorsClient) revalidate(ctx context.Context, resourceGroupName string, serverName string, encryptionProtectorName EncryptionProtectorName, options *EncryptionProtectorsClientBeginRevalidateOptions) (*http.Response, error) { var err error req, err := client.revalidateCreateRequest(ctx, resourceGroupName, serverName, encryptionProtectorName, options) @@ -327,7 +327,7 @@ func (client *EncryptionProtectorsClient) revalidateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } diff --git a/sdk/resourcemanager/sql/armsql/encryptionprotectors_client_example_test.go b/sdk/resourcemanager/sql/armsql/encryptionprotectors_client_example_test.go deleted file mode 100644 index 41f7a13dbd9a..000000000000 --- a/sdk/resourcemanager/sql/armsql/encryptionprotectors_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 armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/EncryptionProtectorList.json -func ExampleEncryptionProtectorsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewEncryptionProtectorsClient().NewListByServerPager("sqlcrudtest-7398", "sqlcrudtest-4645", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.EncryptionProtectorListResult = armsql.EncryptionProtectorListResult{ - // Value: []*armsql.EncryptionProtector{ - // { - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.Sql/servers/encryptionProtector"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645/encryptionProtector/current"), - // Kind: to.Ptr("azurekeyvault"), - // Location: to.Ptr("Japan East"), - // Properties: &armsql.EncryptionProtectorProperties{ - // ServerKeyName: to.Ptr("someVault_someKey_01234567890123456789012345678901"), - // ServerKeyType: to.Ptr(armsql.ServerKeyTypeAzureKeyVault), - // URI: to.Ptr("https://someVault.vault.azure.net/keys/someKey/01234567890123456789012345678901"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/EncryptionProtectorGet.json -func ExampleEncryptionProtectorsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewEncryptionProtectorsClient().Get(ctx, "sqlcrudtest-7398", "sqlcrudtest-4645", armsql.EncryptionProtectorNameCurrent, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.EncryptionProtector = armsql.EncryptionProtector{ - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.Sql/servers/encryptionProtector"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645/encryptionProtector/current"), - // Kind: to.Ptr("azurekeyvault"), - // Location: to.Ptr("Japan East"), - // Properties: &armsql.EncryptionProtectorProperties{ - // AutoRotationEnabled: to.Ptr(false), - // ServerKeyName: to.Ptr("someVault_someKey_01234567890123456789012345678901"), - // ServerKeyType: to.Ptr(armsql.ServerKeyTypeAzureKeyVault), - // URI: to.Ptr("https://someVault.vault.azure.net/keys/someKey/01234567890123456789012345678901"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/EncryptionProtectorCreateOrUpdateKeyVault.json -func ExampleEncryptionProtectorsClient_BeginCreateOrUpdate_updateTheEncryptionProtectorToKeyVault() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewEncryptionProtectorsClient().BeginCreateOrUpdate(ctx, "sqlcrudtest-7398", "sqlcrudtest-4645", armsql.EncryptionProtectorNameCurrent, armsql.EncryptionProtector{ - Properties: &armsql.EncryptionProtectorProperties{ - AutoRotationEnabled: to.Ptr(false), - ServerKeyName: to.Ptr("someVault_someKey_01234567890123456789012345678901"), - ServerKeyType: to.Ptr(armsql.ServerKeyTypeAzureKeyVault), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.EncryptionProtector = armsql.EncryptionProtector{ - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.Sql/servers/encryptionProtector"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645/encryptionProtector/current"), - // Kind: to.Ptr("azurekeyvault"), - // Location: to.Ptr("West US"), - // Properties: &armsql.EncryptionProtectorProperties{ - // AutoRotationEnabled: to.Ptr(false), - // ServerKeyName: to.Ptr("someVault_someKey_01234567890123456789012345678901"), - // ServerKeyType: to.Ptr(armsql.ServerKeyTypeAzureKeyVault), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/EncryptionProtectorCreateOrUpdateServiceManaged.json -func ExampleEncryptionProtectorsClient_BeginCreateOrUpdate_updateTheEncryptionProtectorToServiceManaged() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewEncryptionProtectorsClient().BeginCreateOrUpdate(ctx, "sqlcrudtest-7398", "sqlcrudtest-4645", armsql.EncryptionProtectorNameCurrent, armsql.EncryptionProtector{ - Properties: &armsql.EncryptionProtectorProperties{ - ServerKeyName: to.Ptr("ServiceManaged"), - ServerKeyType: to.Ptr(armsql.ServerKeyTypeServiceManaged), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.EncryptionProtector = armsql.EncryptionProtector{ - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.Sql/servers/encryptionProtector"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645/encryptionProtector/current"), - // Kind: to.Ptr("servicemanaged"), - // Location: to.Ptr("West US"), - // Properties: &armsql.EncryptionProtectorProperties{ - // ServerKeyName: to.Ptr("ServiceManaged"), - // ServerKeyType: to.Ptr(armsql.ServerKeyTypeServiceManaged), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/EncryptionProtectorRevalidate.json -func ExampleEncryptionProtectorsClient_BeginRevalidate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewEncryptionProtectorsClient().BeginRevalidate(ctx, "sqlcrudtest-7398", "sqlcrudtest-4645", armsql.EncryptionProtectorNameCurrent, 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/sql/armsql/endpointcertificates_client.go b/sdk/resourcemanager/sql/armsql/endpointcertificates_client.go index fc0008f7fcb7..d12c9c8bc212 100644 --- a/sdk/resourcemanager/sql/armsql/endpointcertificates_client.go +++ b/sdk/resourcemanager/sql/armsql/endpointcertificates_client.go @@ -46,7 +46,7 @@ func NewEndpointCertificatesClient(subscriptionID string, credential azcore.Toke // Get - Gets a certificate used on the endpoint with the given id. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -95,7 +95,7 @@ func (client *EndpointCertificatesClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -112,7 +112,7 @@ func (client *EndpointCertificatesClient) getHandleResponse(resp *http.Response) // NewListByInstancePager - List certificates used on endpoints on the target instance. // -// Generated from API version 2021-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -166,7 +166,7 @@ func (client *EndpointCertificatesClient) listByInstanceCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/endpointcertificates_client_example_test.go b/sdk/resourcemanager/sql/armsql/endpointcertificates_client_example_test.go deleted file mode 100644 index 31d43d5cb158..000000000000 --- a/sdk/resourcemanager/sql/armsql/endpointcertificates_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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/EndpointCertificatesListByInstance.json -func ExampleEndpointCertificatesClient_NewListByInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewEndpointCertificatesClient().NewListByInstancePager("testrg", "testcl", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.EndpointCertificateListResult = armsql.EndpointCertificateListResult{ - // Value: []*armsql.EndpointCertificate{ - // { - // Name: to.Ptr("SERVICE_BROKER"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/endpointCertificates"), - // ID: to.Ptr("/subscriptions/38e0dc56-907f-45ba-a97c-74233baad471/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testcl/endpointCertificates/SERVICE_BROKER"), - // Properties: &armsql.EndpointCertificateProperties{ - // PublicBlob: to.Ptr("0x308203B23082021AA003020102021034C597BA"), - // }, - // }, - // { - // Name: to.Ptr("DATABASE_MIRRORING"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/endpointCertificates"), - // ID: to.Ptr("/subscriptions/38e0dc56-907f-45ba-a97c-74233baad471/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testcl/endpointCertificates/DATABASE_MIRRORING"), - // Properties: &armsql.EndpointCertificateProperties{ - // PublicBlob: to.Ptr("0x308203B23082021AA003020102021034C597BA"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/EndpointCertificatesGet.json -func ExampleEndpointCertificatesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewEndpointCertificatesClient().Get(ctx, "testrg", "testcl", "DATABASE_MIRRORING", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.EndpointCertificate = armsql.EndpointCertificate{ - // Name: to.Ptr("DATABASE_MIRRORING"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/endpointCertificates"), - // ID: to.Ptr("/subscriptions/38e0dc56-907f-45ba-a97c-74233baad471/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testcl/endpointCertificates/DATABASE_MIRRORING"), - // Properties: &armsql.EndpointCertificateProperties{ - // PublicBlob: to.Ptr("0x308203B23082021AA003020102021034C597BA"), - // }, - // } -} diff --git a/sdk/resourcemanager/sql/armsql/extendeddatabaseblobauditingpolicies_client.go b/sdk/resourcemanager/sql/armsql/extendeddatabaseblobauditingpolicies_client.go index 390e2d019084..1ad53df7a0d4 100644 --- a/sdk/resourcemanager/sql/armsql/extendeddatabaseblobauditingpolicies_client.go +++ b/sdk/resourcemanager/sql/armsql/extendeddatabaseblobauditingpolicies_client.go @@ -46,7 +46,7 @@ func NewExtendedDatabaseBlobAuditingPoliciesClient(subscriptionID string, creden // CreateOrUpdate - Creates or updates an extended database's blob auditing policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -97,7 +97,7 @@ func (client *ExtendedDatabaseBlobAuditingPoliciesClient) createOrUpdateCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -118,7 +118,7 @@ func (client *ExtendedDatabaseBlobAuditingPoliciesClient) createOrUpdateHandleRe // Get - Gets an extended database's blob auditing policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -168,7 +168,7 @@ func (client *ExtendedDatabaseBlobAuditingPoliciesClient) getCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -185,7 +185,7 @@ func (client *ExtendedDatabaseBlobAuditingPoliciesClient) getHandleResponse(resp // NewListByDatabasePager - Lists extended auditing settings of a database. // -// Generated from API version 2021-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -244,7 +244,7 @@ func (client *ExtendedDatabaseBlobAuditingPoliciesClient) listByDatabaseCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/extendeddatabaseblobauditingpolicies_client_example_test.go b/sdk/resourcemanager/sql/armsql/extendeddatabaseblobauditingpolicies_client_example_test.go deleted file mode 100644 index 262856d7c91b..000000000000 --- a/sdk/resourcemanager/sql/armsql/extendeddatabaseblobauditingpolicies_client_example_test.go +++ /dev/null @@ -1,239 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseExtendedAuditingSettingsList.json -func ExampleExtendedDatabaseBlobAuditingPoliciesClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewExtendedDatabaseBlobAuditingPoliciesClient().NewListByDatabasePager("blobauditingtest-6852", "blobauditingtest-2080", "testdb", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ExtendedDatabaseBlobAuditingPolicyListResult = armsql.ExtendedDatabaseBlobAuditingPolicyListResult{ - // Value: []*armsql.ExtendedDatabaseBlobAuditingPolicy{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/extendedAuditingSettings"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/blobauditingtest-6852/providers/Microsoft.Sql/servers/blobauditingtest-2080/databases/testdb/extendedAuditingSettings/default"), - // Properties: &armsql.ExtendedDatabaseBlobAuditingPolicyProperties{ - // AuditActionsAndGroups: []*string{ - // }, - // IsAzureMonitorTargetEnabled: to.Ptr(false), - // IsManagedIdentityInUse: to.Ptr(false), - // IsStorageSecondaryKeyInUse: to.Ptr(false), - // PredicateExpression: to.Ptr("statement = 'select 1'"), - // RetentionDays: to.Ptr[int32](0), - // State: to.Ptr(armsql.BlobAuditingPolicyStateDisabled), - // StorageAccountSubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // StorageEndpoint: to.Ptr(""), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ExtendedDatabaseBlobAuditingGet.json -func ExampleExtendedDatabaseBlobAuditingPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewExtendedDatabaseBlobAuditingPoliciesClient().Get(ctx, "blobauditingtest-6852", "blobauditingtest-2080", "testdb", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ExtendedDatabaseBlobAuditingPolicy = armsql.ExtendedDatabaseBlobAuditingPolicy{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/extendedAuditingSettings"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/blobauditingtest-6852/providers/Microsoft.Sql/servers/blobauditingtest-2080/databases/testdb"), - // Properties: &armsql.ExtendedDatabaseBlobAuditingPolicyProperties{ - // AuditActionsAndGroups: []*string{ - // }, - // IsAzureMonitorTargetEnabled: to.Ptr(false), - // IsManagedIdentityInUse: to.Ptr(false), - // IsStorageSecondaryKeyInUse: to.Ptr(false), - // PredicateExpression: to.Ptr("statement = 'select 1'"), - // RetentionDays: to.Ptr[int32](0), - // State: to.Ptr(armsql.BlobAuditingPolicyStateDisabled), - // StorageAccountSubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // StorageEndpoint: to.Ptr(""), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ExtendedDatabaseAzureMonitorAuditingCreateMin.json -func ExampleExtendedDatabaseBlobAuditingPoliciesClient_CreateOrUpdate_createOrUpdateAnExtendedDatabasesAzureMonitorAuditingPolicyWithMinimalParameters() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewExtendedDatabaseBlobAuditingPoliciesClient().CreateOrUpdate(ctx, "blobauditingtest-4799", "blobauditingtest-6440", "testdb", armsql.ExtendedDatabaseBlobAuditingPolicy{ - Properties: &armsql.ExtendedDatabaseBlobAuditingPolicyProperties{ - IsAzureMonitorTargetEnabled: to.Ptr(true), - State: to.Ptr(armsql.BlobAuditingPolicyStateEnabled), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ExtendedDatabaseBlobAuditingPolicy = armsql.ExtendedDatabaseBlobAuditingPolicy{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/extendedAuditingSettings"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/blobauditingtest-4799/providers/Microsoft.Sql/servers/blobauditingtest-6440/databases/testdb"), - // Properties: &armsql.ExtendedDatabaseBlobAuditingPolicyProperties{ - // AuditActionsAndGroups: []*string{ - // to.Ptr("SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP"), - // to.Ptr("FAILED_DATABASE_AUTHENTICATION_GROUP"), - // to.Ptr("BATCH_COMPLETED_GROUP")}, - // IsAzureMonitorTargetEnabled: to.Ptr(true), - // RetentionDays: to.Ptr[int32](0), - // State: to.Ptr(armsql.BlobAuditingPolicyStateEnabled), - // StorageAccountSubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ExtendedDatabaseBlobAuditingCreateMax.json -func ExampleExtendedDatabaseBlobAuditingPoliciesClient_CreateOrUpdate_createOrUpdateAnExtendedDatabasesBlobAuditingPolicyWithAllParameters() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewExtendedDatabaseBlobAuditingPoliciesClient().CreateOrUpdate(ctx, "blobauditingtest-4799", "blobauditingtest-6440", "testdb", armsql.ExtendedDatabaseBlobAuditingPolicy{ - Properties: &armsql.ExtendedDatabaseBlobAuditingPolicyProperties{ - AuditActionsAndGroups: []*string{ - to.Ptr("DATABASE_LOGOUT_GROUP"), - to.Ptr("DATABASE_ROLE_MEMBER_CHANGE_GROUP"), - to.Ptr("UPDATE on database::TestDatabaseName by public")}, - IsAzureMonitorTargetEnabled: to.Ptr(true), - IsStorageSecondaryKeyInUse: to.Ptr(false), - PredicateExpression: to.Ptr("statement = 'select 1'"), - QueueDelayMs: to.Ptr[int32](4000), - RetentionDays: to.Ptr[int32](6), - State: to.Ptr(armsql.BlobAuditingPolicyStateEnabled), - StorageAccountAccessKey: to.Ptr("sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD=="), - StorageAccountSubscriptionID: to.Ptr("00000000-1234-0000-5678-000000000000"), - StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ExtendedDatabaseBlobAuditingPolicy = armsql.ExtendedDatabaseBlobAuditingPolicy{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/extendedAuditingSettings"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/blobauditingtest-4799/providers/Microsoft.Sql/servers/blobauditingtest-6440/databases/testdb"), - // Properties: &armsql.ExtendedDatabaseBlobAuditingPolicyProperties{ - // AuditActionsAndGroups: []*string{ - // to.Ptr("DATABASE_LOGOUT_GROUP"), - // to.Ptr("DATABASE_ROLE_MEMBER_CHANGE_GROUP"), - // to.Ptr("UPDATE on database::TestDatabaseName by public")}, - // IsAzureMonitorTargetEnabled: to.Ptr(true), - // IsStorageSecondaryKeyInUse: to.Ptr(false), - // PredicateExpression: to.Ptr("statement = 'select 1'"), - // QueueDelayMs: to.Ptr[int32](4000), - // RetentionDays: to.Ptr[int32](0), - // State: to.Ptr(armsql.BlobAuditingPolicyStateEnabled), - // StorageAccountSubscriptionID: to.Ptr("00000000-1234-0000-5678-000000000000"), - // StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ExtendedDatabaseBlobAuditingCreateMin.json -func ExampleExtendedDatabaseBlobAuditingPoliciesClient_CreateOrUpdate_createOrUpdateAnExtendedDatabasesBlobAuditingPolicyWithMinimalParameters() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewExtendedDatabaseBlobAuditingPoliciesClient().CreateOrUpdate(ctx, "blobauditingtest-4799", "blobauditingtest-6440", "testdb", armsql.ExtendedDatabaseBlobAuditingPolicy{ - Properties: &armsql.ExtendedDatabaseBlobAuditingPolicyProperties{ - State: to.Ptr(armsql.BlobAuditingPolicyStateEnabled), - StorageAccountAccessKey: to.Ptr("sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD=="), - StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ExtendedDatabaseBlobAuditingPolicy = armsql.ExtendedDatabaseBlobAuditingPolicy{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/extendedAuditingSettings"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/blobauditingtest-4799/providers/Microsoft.Sql/servers/blobauditingtest-6440/databases/testdb"), - // Properties: &armsql.ExtendedDatabaseBlobAuditingPolicyProperties{ - // AuditActionsAndGroups: []*string{ - // to.Ptr("SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP"), - // to.Ptr("FAILED_DATABASE_AUTHENTICATION_GROUP"), - // to.Ptr("BATCH_COMPLETED_GROUP")}, - // IsAzureMonitorTargetEnabled: to.Ptr(false), - // IsStorageSecondaryKeyInUse: to.Ptr(false), - // RetentionDays: to.Ptr[int32](0), - // State: to.Ptr(armsql.BlobAuditingPolicyStateEnabled), - // StorageAccountSubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - // }, - // } -} diff --git a/sdk/resourcemanager/sql/armsql/extendedserverblobauditingpolicies_client.go b/sdk/resourcemanager/sql/armsql/extendedserverblobauditingpolicies_client.go index f782367cafc0..545ed7b3cdc8 100644 --- a/sdk/resourcemanager/sql/armsql/extendedserverblobauditingpolicies_client.go +++ b/sdk/resourcemanager/sql/armsql/extendedserverblobauditingpolicies_client.go @@ -46,7 +46,7 @@ func NewExtendedServerBlobAuditingPoliciesClient(subscriptionID string, credenti // BeginCreateOrUpdate - Creates or updates an extended server's blob auditing policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -69,7 +69,7 @@ func (client *ExtendedServerBlobAuditingPoliciesClient) BeginCreateOrUpdate(ctx // CreateOrUpdate - Creates or updates an extended server's blob auditing policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01-preview +// Generated from API version 2023-05-01-preview func (client *ExtendedServerBlobAuditingPoliciesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters ExtendedServerBlobAuditingPolicy, options *ExtendedServerBlobAuditingPoliciesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, parameters, options) @@ -108,7 +108,7 @@ func (client *ExtendedServerBlobAuditingPoliciesClient) createOrUpdateCreateRequ return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -120,7 +120,7 @@ func (client *ExtendedServerBlobAuditingPoliciesClient) createOrUpdateCreateRequ // Get - Gets an extended server's blob auditing policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -165,7 +165,7 @@ func (client *ExtendedServerBlobAuditingPoliciesClient) getCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -182,7 +182,7 @@ func (client *ExtendedServerBlobAuditingPoliciesClient) getHandleResponse(resp * // NewListByServerPager - Lists extended auditing settings of a server. // -// Generated from API version 2021-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -236,7 +236,7 @@ func (client *ExtendedServerBlobAuditingPoliciesClient) listByServerCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/extendedserverblobauditingpolicies_client_example_test.go b/sdk/resourcemanager/sql/armsql/extendedserverblobauditingpolicies_client_example_test.go deleted file mode 100644 index 668cff92e489..000000000000 --- a/sdk/resourcemanager/sql/armsql/extendedserverblobauditingpolicies_client_example_test.go +++ /dev/null @@ -1,207 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerExtendedAuditingSettingsList.json -func ExampleExtendedServerBlobAuditingPoliciesClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewExtendedServerBlobAuditingPoliciesClient().NewListByServerPager("blobauditingtest-4799", "blobauditingtest-6440", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ExtendedServerBlobAuditingPolicyListResult = armsql.ExtendedServerBlobAuditingPolicyListResult{ - // Value: []*armsql.ExtendedServerBlobAuditingPolicy{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/servers/extendedAuditingSettings"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/blobauditingtest-6852/providers/Microsoft.Sql/servers/blobauditingtest-2080/extendedAuditingSettings/default"), - // Properties: &armsql.ExtendedServerBlobAuditingPolicyProperties{ - // AuditActionsAndGroups: []*string{ - // }, - // IsAzureMonitorTargetEnabled: to.Ptr(false), - // IsManagedIdentityInUse: to.Ptr(false), - // IsStorageSecondaryKeyInUse: to.Ptr(false), - // PredicateExpression: to.Ptr("object_name = 'SensitiveData'"), - // RetentionDays: to.Ptr[int32](0), - // State: to.Ptr(armsql.BlobAuditingPolicyStateDisabled), - // StorageAccountSubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // StorageEndpoint: to.Ptr(""), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ExtendedServerBlobAuditingGet.json -func ExampleExtendedServerBlobAuditingPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewExtendedServerBlobAuditingPoliciesClient().Get(ctx, "blobauditingtest-4799", "blobauditingtest-6440", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ExtendedServerBlobAuditingPolicy = armsql.ExtendedServerBlobAuditingPolicy{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/servers/extendedAuditingSettings"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/blobauditingtest-6852/providers/Microsoft.Sql/servers/blobauditingtest-2080/extendedAuditingSettings/default"), - // Properties: &armsql.ExtendedServerBlobAuditingPolicyProperties{ - // AuditActionsAndGroups: []*string{ - // }, - // IsAzureMonitorTargetEnabled: to.Ptr(false), - // IsManagedIdentityInUse: to.Ptr(false), - // IsStorageSecondaryKeyInUse: to.Ptr(false), - // PredicateExpression: to.Ptr("object_name = 'SensitiveData'"), - // RetentionDays: to.Ptr[int32](0), - // State: to.Ptr(armsql.BlobAuditingPolicyStateDisabled), - // StorageAccountSubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // StorageEndpoint: to.Ptr(""), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ExtendedServerBlobAuditingCreateMax.json -func ExampleExtendedServerBlobAuditingPoliciesClient_BeginCreateOrUpdate_updateAServersExtendedBlobAuditingPolicyWithAllParameters() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewExtendedServerBlobAuditingPoliciesClient().BeginCreateOrUpdate(ctx, "blobauditingtest-4799", "blobauditingtest-6440", armsql.ExtendedServerBlobAuditingPolicy{ - Properties: &armsql.ExtendedServerBlobAuditingPolicyProperties{ - AuditActionsAndGroups: []*string{ - to.Ptr("SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP"), - to.Ptr("FAILED_DATABASE_AUTHENTICATION_GROUP"), - to.Ptr("BATCH_COMPLETED_GROUP")}, - IsAzureMonitorTargetEnabled: to.Ptr(true), - IsStorageSecondaryKeyInUse: to.Ptr(false), - PredicateExpression: to.Ptr("object_name = 'SensitiveData'"), - QueueDelayMs: to.Ptr[int32](4000), - RetentionDays: to.Ptr[int32](6), - State: to.Ptr(armsql.BlobAuditingPolicyStateEnabled), - StorageAccountAccessKey: to.Ptr("sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD=="), - StorageAccountSubscriptionID: to.Ptr("00000000-1234-0000-5678-000000000000"), - StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ExtendedServerBlobAuditingPolicy = armsql.ExtendedServerBlobAuditingPolicy{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/servers/extendedAuditingSettings"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/blobauditingtest-4799/providers/Microsoft.Sql/servers/blobauditingtest-6440/extendedAuditingSettings/default"), - // Properties: &armsql.ExtendedServerBlobAuditingPolicyProperties{ - // AuditActionsAndGroups: []*string{ - // to.Ptr("SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP"), - // to.Ptr("FAILED_DATABASE_AUTHENTICATION_GROUP"), - // to.Ptr("BATCH_COMPLETED_GROUP")}, - // IsAzureMonitorTargetEnabled: to.Ptr(true), - // IsStorageSecondaryKeyInUse: to.Ptr(false), - // PredicateExpression: to.Ptr("object_name = 'SensitiveData'"), - // QueueDelayMs: to.Ptr[int32](4000), - // RetentionDays: to.Ptr[int32](6), - // State: to.Ptr(armsql.BlobAuditingPolicyStateEnabled), - // StorageAccountSubscriptionID: to.Ptr("00000000-1234-0000-5678-000000000000"), - // StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ExtendedServerBlobAuditingCreateMin.json -func ExampleExtendedServerBlobAuditingPoliciesClient_BeginCreateOrUpdate_updateAServersExtendedBlobAuditingPolicyWithMinimalParameters() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewExtendedServerBlobAuditingPoliciesClient().BeginCreateOrUpdate(ctx, "blobauditingtest-4799", "blobauditingtest-6440", armsql.ExtendedServerBlobAuditingPolicy{ - Properties: &armsql.ExtendedServerBlobAuditingPolicyProperties{ - State: to.Ptr(armsql.BlobAuditingPolicyStateEnabled), - StorageAccountAccessKey: to.Ptr("sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD=="), - StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ExtendedServerBlobAuditingPolicy = armsql.ExtendedServerBlobAuditingPolicy{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/servers/extendedAuditingSettings"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/blobauditingtest-4799/providers/Microsoft.Sql/servers/blobauditingtest-6440/extendedAuditingSettings/default"), - // Properties: &armsql.ExtendedServerBlobAuditingPolicyProperties{ - // AuditActionsAndGroups: []*string{ - // to.Ptr("SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP"), - // to.Ptr("FAILED_DATABASE_AUTHENTICATION_GROUP"), - // to.Ptr("BATCH_COMPLETED_GROUP")}, - // IsAzureMonitorTargetEnabled: to.Ptr(false), - // IsStorageSecondaryKeyInUse: to.Ptr(false), - // RetentionDays: to.Ptr[int32](6), - // State: to.Ptr(armsql.BlobAuditingPolicyStateEnabled), - // StorageAccountSubscriptionID: to.Ptr("00000000-1234-0000-5678-000000000000"), - // StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - // }, - // } -} diff --git a/sdk/resourcemanager/sql/armsql/failovergroups_client.go b/sdk/resourcemanager/sql/armsql/failovergroups_client.go index 849286db4558..b3c0f661a8de 100644 --- a/sdk/resourcemanager/sql/armsql/failovergroups_client.go +++ b/sdk/resourcemanager/sql/armsql/failovergroups_client.go @@ -46,7 +46,7 @@ func NewFailoverGroupsClient(subscriptionID string, credential azcore.TokenCrede // BeginCreateOrUpdate - Creates or updates a failover group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server containing the failover group. @@ -70,7 +70,7 @@ func (client *FailoverGroupsClient) BeginCreateOrUpdate(ctx context.Context, res // CreateOrUpdate - Creates or updates a failover group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-05-01-preview func (client *FailoverGroupsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, failoverGroupName string, parameters FailoverGroup, options *FailoverGroupsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, failoverGroupName, parameters, options) @@ -112,7 +112,7 @@ func (client *FailoverGroupsClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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 *FailoverGroupsClient) createOrUpdateCreateRequest(ctx context.Cont // BeginDelete - Deletes a failover group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server containing the failover group. @@ -147,7 +147,7 @@ func (client *FailoverGroupsClient) BeginDelete(ctx context.Context, resourceGro // Delete - Deletes a failover group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-05-01-preview func (client *FailoverGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, failoverGroupName string, options *FailoverGroupsClientBeginDeleteOptions) (*http.Response, error) { var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, failoverGroupName, options) @@ -189,7 +189,7 @@ func (client *FailoverGroupsClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -197,7 +197,7 @@ func (client *FailoverGroupsClient) deleteCreateRequest(ctx context.Context, res // BeginFailover - Fails over from the current primary server to this server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server containing the failover group. @@ -220,7 +220,7 @@ func (client *FailoverGroupsClient) BeginFailover(ctx context.Context, resourceG // Failover - Fails over from the current primary server to this server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-05-01-preview func (client *FailoverGroupsClient) failover(ctx context.Context, resourceGroupName string, serverName string, failoverGroupName string, options *FailoverGroupsClientBeginFailoverOptions) (*http.Response, error) { var err error req, err := client.failoverCreateRequest(ctx, resourceGroupName, serverName, failoverGroupName, options) @@ -262,7 +262,7 @@ func (client *FailoverGroupsClient) failoverCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -272,7 +272,7 @@ func (client *FailoverGroupsClient) failoverCreateRequest(ctx context.Context, r // in data loss. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server containing the failover group. @@ -296,7 +296,7 @@ func (client *FailoverGroupsClient) BeginForceFailoverAllowDataLoss(ctx context. // data loss. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-05-01-preview func (client *FailoverGroupsClient) forceFailoverAllowDataLoss(ctx context.Context, resourceGroupName string, serverName string, failoverGroupName string, options *FailoverGroupsClientBeginForceFailoverAllowDataLossOptions) (*http.Response, error) { var err error req, err := client.forceFailoverAllowDataLossCreateRequest(ctx, resourceGroupName, serverName, failoverGroupName, options) @@ -338,7 +338,7 @@ func (client *FailoverGroupsClient) forceFailoverAllowDataLossCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -347,7 +347,7 @@ func (client *FailoverGroupsClient) forceFailoverAllowDataLossCreateRequest(ctx // Get - Gets a failover group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server containing the failover group. @@ -395,7 +395,7 @@ func (client *FailoverGroupsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -412,7 +412,7 @@ func (client *FailoverGroupsClient) getHandleResponse(resp *http.Response) (Fail // NewListByServerPager - Lists the failover groups in a server. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server containing the failover group. @@ -466,7 +466,7 @@ func (client *FailoverGroupsClient) listByServerCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -485,7 +485,7 @@ func (client *FailoverGroupsClient) listByServerHandleResponse(resp *http.Respon // before forced failover but might still result in data loss. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -511,7 +511,7 @@ func (client *FailoverGroupsClient) BeginTryPlannedBeforeForcedFailover(ctx cont // before forced failover but might still result in data loss. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-05-01-preview func (client *FailoverGroupsClient) tryPlannedBeforeForcedFailover(ctx context.Context, resourceGroupName string, serverName string, failoverGroupName string, options *FailoverGroupsClientBeginTryPlannedBeforeForcedFailoverOptions) (*http.Response, error) { var err error req, err := client.tryPlannedBeforeForcedFailoverCreateRequest(ctx, resourceGroupName, serverName, failoverGroupName, options) @@ -553,7 +553,7 @@ func (client *FailoverGroupsClient) tryPlannedBeforeForcedFailoverCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -562,7 +562,7 @@ func (client *FailoverGroupsClient) tryPlannedBeforeForcedFailoverCreateRequest( // BeginUpdate - Updates a failover group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server containing the failover group. @@ -586,7 +586,7 @@ func (client *FailoverGroupsClient) BeginUpdate(ctx context.Context, resourceGro // Update - Updates a failover group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-05-01-preview func (client *FailoverGroupsClient) update(ctx context.Context, resourceGroupName string, serverName string, failoverGroupName string, parameters FailoverGroupUpdate, options *FailoverGroupsClientBeginUpdateOptions) (*http.Response, error) { var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, serverName, failoverGroupName, parameters, options) @@ -628,7 +628,7 @@ func (client *FailoverGroupsClient) updateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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/sql/armsql/failovergroups_client_example_test.go b/sdk/resourcemanager/sql/armsql/failovergroups_client_example_test.go deleted file mode 100644 index 65c0ba82e8a2..000000000000 --- a/sdk/resourcemanager/sql/armsql/failovergroups_client_example_test.go +++ /dev/null @@ -1,438 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/FailoverGroupList.json -func ExampleFailoverGroupsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewFailoverGroupsClient().NewListByServerPager("Default", "failover-group-primary-server", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.FailoverGroupListResult = armsql.FailoverGroupListResult{ - // Value: []*armsql.FailoverGroup{ - // { - // Name: to.Ptr("failover-group-test"), - // Type: to.Ptr("Microsoft.Sql/servers/failoverGroups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-primary-server/failoverGroups/failover-group-test"), - // Location: to.Ptr("Japan East"), - // Properties: &armsql.FailoverGroupProperties{ - // Databases: []*string{ - // }, - // PartnerServers: []*armsql.PartnerInfo{ - // { - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-secondary-server"), - // Location: to.Ptr("Japan West"), - // ReplicationRole: to.Ptr(armsql.FailoverGroupReplicationRoleSecondary), - // }}, - // ReadOnlyEndpoint: &armsql.FailoverGroupReadOnlyEndpoint{ - // FailoverPolicy: to.Ptr(armsql.ReadOnlyEndpointFailoverPolicyDisabled), - // }, - // ReadWriteEndpoint: &armsql.FailoverGroupReadWriteEndpoint{ - // FailoverPolicy: to.Ptr(armsql.ReadWriteEndpointFailoverPolicyAutomatic), - // FailoverWithDataLossGracePeriodMinutes: to.Ptr[int32](480), - // }, - // ReplicationRole: to.Ptr(armsql.FailoverGroupReplicationRolePrimary), - // ReplicationState: to.Ptr("CATCH_UP"), - // }, - // }, - // { - // Name: to.Ptr("failover-group-test-2"), - // Type: to.Ptr("Microsoft.Sql/servers/failoverGroups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-primary-server/failoverGroups/failover-group-test-2"), - // Location: to.Ptr("Japan East"), - // Properties: &armsql.FailoverGroupProperties{ - // Databases: []*string{ - // }, - // PartnerServers: []*armsql.PartnerInfo{ - // { - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-secondary-server"), - // Location: to.Ptr("Japan West"), - // ReplicationRole: to.Ptr(armsql.FailoverGroupReplicationRoleSecondary), - // }}, - // ReadOnlyEndpoint: &armsql.FailoverGroupReadOnlyEndpoint{ - // FailoverPolicy: to.Ptr(armsql.ReadOnlyEndpointFailoverPolicyDisabled), - // }, - // ReadWriteEndpoint: &armsql.FailoverGroupReadWriteEndpoint{ - // FailoverPolicy: to.Ptr(armsql.ReadWriteEndpointFailoverPolicyAutomatic), - // FailoverWithDataLossGracePeriodMinutes: to.Ptr[int32](480), - // }, - // ReplicationRole: to.Ptr(armsql.FailoverGroupReplicationRolePrimary), - // ReplicationState: to.Ptr("CATCH_UP"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/FailoverGroupGet.json -func ExampleFailoverGroupsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFailoverGroupsClient().Get(ctx, "Default", "failover-group-primary-server", "failover-group-test", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.FailoverGroup = armsql.FailoverGroup{ - // Name: to.Ptr("failover-group-test"), - // Type: to.Ptr("Microsoft.Sql/servers/failoverGroups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-primary-server/failoverGroups/failover-group-test"), - // Location: to.Ptr("Japan East"), - // Properties: &armsql.FailoverGroupProperties{ - // Databases: []*string{ - // }, - // PartnerServers: []*armsql.PartnerInfo{ - // { - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-secondary-server"), - // Location: to.Ptr("Japan West"), - // ReplicationRole: to.Ptr(armsql.FailoverGroupReplicationRoleSecondary), - // }}, - // ReadOnlyEndpoint: &armsql.FailoverGroupReadOnlyEndpoint{ - // FailoverPolicy: to.Ptr(armsql.ReadOnlyEndpointFailoverPolicyDisabled), - // }, - // ReadWriteEndpoint: &armsql.FailoverGroupReadWriteEndpoint{ - // FailoverPolicy: to.Ptr(armsql.ReadWriteEndpointFailoverPolicyAutomatic), - // FailoverWithDataLossGracePeriodMinutes: to.Ptr[int32](480), - // }, - // ReplicationRole: to.Ptr(armsql.FailoverGroupReplicationRolePrimary), - // ReplicationState: to.Ptr("CATCH_UP"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/FailoverGroupCreateOrUpdate.json -func ExampleFailoverGroupsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFailoverGroupsClient().BeginCreateOrUpdate(ctx, "Default", "failover-group-primary-server", "failover-group-test-3", armsql.FailoverGroup{ - Properties: &armsql.FailoverGroupProperties{ - Databases: []*string{ - to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-primary-server/databases/testdb-1"), - to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-primary-server/databases/testdb-2")}, - PartnerServers: []*armsql.PartnerInfo{ - { - ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-secondary-server"), - }}, - ReadOnlyEndpoint: &armsql.FailoverGroupReadOnlyEndpoint{ - FailoverPolicy: to.Ptr(armsql.ReadOnlyEndpointFailoverPolicyDisabled), - }, - ReadWriteEndpoint: &armsql.FailoverGroupReadWriteEndpoint{ - FailoverPolicy: to.Ptr(armsql.ReadWriteEndpointFailoverPolicyAutomatic), - FailoverWithDataLossGracePeriodMinutes: to.Ptr[int32](480), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.FailoverGroup = armsql.FailoverGroup{ - // Name: to.Ptr("failover-group-test-3"), - // Type: to.Ptr("Microsoft.Sql/servers/failoverGroups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-primary-server/failoverGroups/failover-group-test-3"), - // Location: to.Ptr("Japan East"), - // Properties: &armsql.FailoverGroupProperties{ - // Databases: []*string{ - // to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-primary-server/databases/testdb-1"), - // to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-primary-server/databases/testdb-2")}, - // PartnerServers: []*armsql.PartnerInfo{ - // { - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-secondary-server"), - // Location: to.Ptr("Japan West"), - // ReplicationRole: to.Ptr(armsql.FailoverGroupReplicationRoleSecondary), - // }}, - // ReadOnlyEndpoint: &armsql.FailoverGroupReadOnlyEndpoint{ - // FailoverPolicy: to.Ptr(armsql.ReadOnlyEndpointFailoverPolicyDisabled), - // }, - // ReadWriteEndpoint: &armsql.FailoverGroupReadWriteEndpoint{ - // FailoverPolicy: to.Ptr(armsql.ReadWriteEndpointFailoverPolicyAutomatic), - // FailoverWithDataLossGracePeriodMinutes: to.Ptr[int32](480), - // }, - // ReplicationRole: to.Ptr(armsql.FailoverGroupReplicationRolePrimary), - // ReplicationState: to.Ptr("CATCH_UP"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/FailoverGroupDelete.json -func ExampleFailoverGroupsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFailoverGroupsClient().BeginDelete(ctx, "Default", "failover-group-primary-server", "failover-group-test-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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/FailoverGroupUpdate.json -func ExampleFailoverGroupsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFailoverGroupsClient().BeginUpdate(ctx, "Default", "failover-group-primary-server", "failover-group-test-1", armsql.FailoverGroupUpdate{ - Properties: &armsql.FailoverGroupUpdateProperties{ - Databases: []*string{ - to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-primary-server/databases/testdb-1")}, - ReadWriteEndpoint: &armsql.FailoverGroupReadWriteEndpoint{ - FailoverPolicy: to.Ptr(armsql.ReadWriteEndpointFailoverPolicyAutomatic), - FailoverWithDataLossGracePeriodMinutes: to.Ptr[int32](120), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.FailoverGroup = armsql.FailoverGroup{ - // Name: to.Ptr("failover-group-test-3"), - // Type: to.Ptr("Microsoft.Sql/servers/failoverGroups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-primary-server/failoverGroups/failover-group-test-3"), - // Location: to.Ptr("Japan East"), - // Properties: &armsql.FailoverGroupProperties{ - // Databases: []*string{ - // to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-primary-server/databases/testdb-1")}, - // PartnerServers: []*armsql.PartnerInfo{ - // { - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-secondary-server"), - // Location: to.Ptr("Japan West"), - // ReplicationRole: to.Ptr(armsql.FailoverGroupReplicationRoleSecondary), - // }}, - // ReadOnlyEndpoint: &armsql.FailoverGroupReadOnlyEndpoint{ - // FailoverPolicy: to.Ptr(armsql.ReadOnlyEndpointFailoverPolicyDisabled), - // }, - // ReadWriteEndpoint: &armsql.FailoverGroupReadWriteEndpoint{ - // FailoverPolicy: to.Ptr(armsql.ReadWriteEndpointFailoverPolicyAutomatic), - // FailoverWithDataLossGracePeriodMinutes: to.Ptr[int32](120), - // }, - // ReplicationRole: to.Ptr(armsql.FailoverGroupReplicationRolePrimary), - // ReplicationState: to.Ptr("CATCH_UP"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/FailoverGroupFailover.json -func ExampleFailoverGroupsClient_BeginFailover() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFailoverGroupsClient().BeginFailover(ctx, "Default", "failover-group-secondary-server", "failover-group-test-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.FailoverGroup = armsql.FailoverGroup{ - // Name: to.Ptr("failover-group-test-3"), - // Type: to.Ptr("Microsoft.Sql/servers/failoverGroups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-secondary-server/failoverGroups/failover-group-test-3"), - // Location: to.Ptr("Japan West"), - // Properties: &armsql.FailoverGroupProperties{ - // Databases: []*string{ - // to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-secondary-server/databases/testdb-1"), - // to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-secondary-server/databases/testdb-2")}, - // PartnerServers: []*armsql.PartnerInfo{ - // { - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-primary-server"), - // Location: to.Ptr("Japan East"), - // ReplicationRole: to.Ptr(armsql.FailoverGroupReplicationRoleSecondary), - // }}, - // ReadOnlyEndpoint: &armsql.FailoverGroupReadOnlyEndpoint{ - // FailoverPolicy: to.Ptr(armsql.ReadOnlyEndpointFailoverPolicyDisabled), - // }, - // ReadWriteEndpoint: &armsql.FailoverGroupReadWriteEndpoint{ - // FailoverPolicy: to.Ptr(armsql.ReadWriteEndpointFailoverPolicyAutomatic), - // FailoverWithDataLossGracePeriodMinutes: to.Ptr[int32](120), - // }, - // ReplicationRole: to.Ptr(armsql.FailoverGroupReplicationRolePrimary), - // ReplicationState: to.Ptr("CATCH_UP"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/FailoverGroupForceFailoverAllowDataLoss.json -func ExampleFailoverGroupsClient_BeginForceFailoverAllowDataLoss() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFailoverGroupsClient().BeginForceFailoverAllowDataLoss(ctx, "Default", "failover-group-secondary-server", "failover-group-test-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.FailoverGroup = armsql.FailoverGroup{ - // Name: to.Ptr("failover-group-test-3"), - // Type: to.Ptr("Microsoft.Sql/servers/failoverGroups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-secondary-server/failoverGroups/failover-group-test-3"), - // Location: to.Ptr("Japan West"), - // Properties: &armsql.FailoverGroupProperties{ - // Databases: []*string{ - // to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-secondary-server/databases/testdb-1"), - // to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-secondary-server/databases/testdb-2")}, - // PartnerServers: []*armsql.PartnerInfo{ - // { - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-primary-server"), - // Location: to.Ptr("Japan East"), - // ReplicationRole: to.Ptr(armsql.FailoverGroupReplicationRoleSecondary), - // }}, - // ReadOnlyEndpoint: &armsql.FailoverGroupReadOnlyEndpoint{ - // FailoverPolicy: to.Ptr(armsql.ReadOnlyEndpointFailoverPolicyDisabled), - // }, - // ReadWriteEndpoint: &armsql.FailoverGroupReadWriteEndpoint{ - // FailoverPolicy: to.Ptr(armsql.ReadWriteEndpointFailoverPolicyAutomatic), - // FailoverWithDataLossGracePeriodMinutes: to.Ptr[int32](120), - // }, - // ReplicationRole: to.Ptr(armsql.FailoverGroupReplicationRolePrimary), - // ReplicationState: to.Ptr("CATCH_UP"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/FailoverGroupTryPlannedBeforeForcedFailover.json -func ExampleFailoverGroupsClient_BeginTryPlannedBeforeForcedFailover() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFailoverGroupsClient().BeginTryPlannedBeforeForcedFailover(ctx, "Default", "failovergroupsecondaryserver", "failovergrouptest3", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.FailoverGroup = armsql.FailoverGroup{ - // Name: to.Ptr("failovergrouptest3"), - // Type: to.Ptr("Microsoft.Sql/servers/failoverGroups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failovergroupsecondaryserver/failoverGroups/failovergrouptest3"), - // Location: to.Ptr("Japan West"), - // Properties: &armsql.FailoverGroupProperties{ - // Databases: []*string{ - // to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failovergroupsecondaryserver/databases/testdb1"), - // to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failovergroupsecondaryserver/databases/testdb2")}, - // PartnerServers: []*armsql.PartnerInfo{ - // { - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failovergroupprimaryserver"), - // Location: to.Ptr("Japan East"), - // ReplicationRole: to.Ptr(armsql.FailoverGroupReplicationRoleSecondary), - // }}, - // ReadOnlyEndpoint: &armsql.FailoverGroupReadOnlyEndpoint{ - // FailoverPolicy: to.Ptr(armsql.ReadOnlyEndpointFailoverPolicyDisabled), - // }, - // ReadWriteEndpoint: &armsql.FailoverGroupReadWriteEndpoint{ - // FailoverPolicy: to.Ptr(armsql.ReadWriteEndpointFailoverPolicyAutomatic), - // FailoverWithDataLossGracePeriodMinutes: to.Ptr[int32](120), - // }, - // ReplicationRole: to.Ptr(armsql.FailoverGroupReplicationRolePrimary), - // ReplicationState: to.Ptr("CATCH_UP"), - // }, - // } -} diff --git a/sdk/resourcemanager/sql/armsql/firewallrules_client.go b/sdk/resourcemanager/sql/armsql/firewallrules_client.go index 5bf47a1a4a3b..e72bc73abae8 100644 --- a/sdk/resourcemanager/sql/armsql/firewallrules_client.go +++ b/sdk/resourcemanager/sql/armsql/firewallrules_client.go @@ -46,7 +46,7 @@ func NewFirewallRulesClient(subscriptionID string, credential azcore.TokenCreden // CreateOrUpdate - Creates or updates a firewall rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -96,7 +96,7 @@ func (client *FirewallRulesClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -117,7 +117,7 @@ func (client *FirewallRulesClient) createOrUpdateHandleResponse(resp *http.Respo // Delete - Deletes a firewall rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -164,7 +164,7 @@ func (client *FirewallRulesClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -172,7 +172,7 @@ func (client *FirewallRulesClient) deleteCreateRequest(ctx context.Context, reso // Get - Gets a firewall rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -220,7 +220,7 @@ func (client *FirewallRulesClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -237,7 +237,7 @@ func (client *FirewallRulesClient) getHandleResponse(resp *http.Response) (Firew // NewListByServerPager - Gets a list of firewall rules. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -291,7 +291,7 @@ func (client *FirewallRulesClient) listByServerCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -309,7 +309,7 @@ func (client *FirewallRulesClient) listByServerHandleResponse(resp *http.Respons // Replace - Replaces all firewall rules on the server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -352,7 +352,7 @@ func (client *FirewallRulesClient) replaceCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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/sql/armsql/firewallrules_client_example_test.go b/sdk/resourcemanager/sql/armsql/firewallrules_client_example_test.go deleted file mode 100644 index 24e73f6cde2a..000000000000 --- a/sdk/resourcemanager/sql/armsql/firewallrules_client_example_test.go +++ /dev/null @@ -1,235 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FirewallRuleGet.json -func ExampleFirewallRulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFirewallRulesClient().Get(ctx, "firewallrulecrudtest-12", "firewallrulecrudtest-6285", "firewallrulecrudtest-2304", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.FirewallRule = armsql.FirewallRule{ - // Name: to.Ptr("firewallrulecrudtest-2304"), - // Type: to.Ptr("Microsoft.Sql/servers/firewallRules"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/firewallrulecrudtest-12/providers/Microsoft.Sql/servers/firewallrulecrudtest-6285/firewallRules/firewallrulecrudtest-2304"), - // Properties: &armsql.ServerFirewallRuleProperties{ - // EndIPAddress: to.Ptr("0.0.0.0"), - // StartIPAddress: to.Ptr("0.0.0.0"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FirewallRuleCreate.json -func ExampleFirewallRulesClient_CreateOrUpdate_createAFirewallRuleMaxMin() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFirewallRulesClient().CreateOrUpdate(ctx, "firewallrulecrudtest-12", "firewallrulecrudtest-6285", "firewallrulecrudtest-5370", armsql.FirewallRule{ - Properties: &armsql.ServerFirewallRuleProperties{ - EndIPAddress: to.Ptr("0.0.0.3"), - StartIPAddress: to.Ptr("0.0.0.3"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.FirewallRule = armsql.FirewallRule{ - // Name: to.Ptr("firewallrulecrudtest-5370"), - // Type: to.Ptr("Microsoft.Sql/servers/firewallRules"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/firewallrulecrudtest-12/providers/Microsoft.Sql/servers/firewallrulecrudtest-6285/firewallRules/firewallrulecrudtest-5370"), - // Properties: &armsql.ServerFirewallRuleProperties{ - // EndIPAddress: to.Ptr("0.0.0.3"), - // StartIPAddress: to.Ptr("0.0.0.3"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FirewallRuleUpdate.json -func ExampleFirewallRulesClient_CreateOrUpdate_updateAFirewallRuleMaxMin() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFirewallRulesClient().CreateOrUpdate(ctx, "firewallrulecrudtest-12", "firewallrulecrudtest-6285", "firewallrulecrudtest-3927", armsql.FirewallRule{ - Properties: &armsql.ServerFirewallRuleProperties{ - EndIPAddress: to.Ptr("0.0.0.1"), - StartIPAddress: to.Ptr("0.0.0.1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.FirewallRule = armsql.FirewallRule{ - // Name: to.Ptr("firewallrulecrudtest-3927"), - // Type: to.Ptr("Microsoft.Sql/servers/firewallRules"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/firewallrulecrudtest-12/providers/Microsoft.Sql/servers/firewallrulecrudtest-6285/firewallRules/firewallrulecrudtest-3927"), - // Properties: &armsql.ServerFirewallRuleProperties{ - // EndIPAddress: to.Ptr("0.0.0.1"), - // StartIPAddress: to.Ptr("0.0.0.1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FirewallRuleDelete.json -func ExampleFirewallRulesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewFirewallRulesClient().Delete(ctx, "firewallrulecrudtest-9886", "firewallrulecrudtest-2368", "firewallrulecrudtest-7011", 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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FirewallRuleList.json -func ExampleFirewallRulesClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewFirewallRulesClient().NewListByServerPager("firewallrulecrudtest-12", "firewallrulecrudtest-6285", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.FirewallRuleListResult = armsql.FirewallRuleListResult{ - // Value: []*armsql.FirewallRule{ - // { - // Name: to.Ptr("firewallrulecrudtest-2304"), - // Type: to.Ptr("Microsoft.Sql/servers/firewallRules"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/firewallrulecrudtest-12/providers/Microsoft.Sql/servers/firewallrulecrudtest-6285/firewallRules/firewallrulecrudtest-2304"), - // Properties: &armsql.ServerFirewallRuleProperties{ - // EndIPAddress: to.Ptr("0.0.0.0"), - // StartIPAddress: to.Ptr("0.0.0.0"), - // }, - // }, - // { - // Name: to.Ptr("firewallrulecrudtest-3927"), - // Type: to.Ptr("Microsoft.Sql/servers/firewallRules"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/firewallrulecrudtest-12/providers/Microsoft.Sql/servers/firewallrulecrudtest-6285/firewallRules/firewallrulecrudtest-3927"), - // Properties: &armsql.ServerFirewallRuleProperties{ - // EndIPAddress: to.Ptr("0.0.0.1"), - // StartIPAddress: to.Ptr("0.0.0.1"), - // }, - // }, - // { - // Name: to.Ptr("firewallrulecrudtest-5370"), - // Type: to.Ptr("Microsoft.Sql/servers/firewallRules"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/firewallrulecrudtest-12/providers/Microsoft.Sql/servers/firewallrulecrudtest-6285/firewallRules/firewallrulecrudtest-5370"), - // Properties: &armsql.ServerFirewallRuleProperties{ - // EndIPAddress: to.Ptr("0.0.0.3"), - // StartIPAddress: to.Ptr("0.0.0.3"), - // }, - // }, - // { - // Name: to.Ptr("firewallrulecrudtest-5767"), - // Type: to.Ptr("Microsoft.Sql/servers/firewallRules"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/firewallrulecrudtest-12/providers/Microsoft.Sql/servers/firewallrulecrudtest-6285/firewallRules/firewallrulecrudtest-5767"), - // Properties: &armsql.ServerFirewallRuleProperties{ - // EndIPAddress: to.Ptr("0.0.0.2"), - // StartIPAddress: to.Ptr("0.0.0.2"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FirewallRuleReplace.json -func ExampleFirewallRulesClient_Replace() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFirewallRulesClient().Replace(ctx, "firewallrulecrudtest-12", "firewallrulecrudtest-6285", armsql.FirewallRuleList{ - Values: []*armsql.FirewallRule{ - { - Name: to.Ptr("firewallrulecrudtest-5370 "), - Properties: &armsql.ServerFirewallRuleProperties{ - EndIPAddress: to.Ptr("100.0.0.0"), - StartIPAddress: to.Ptr("0.0.0.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.FirewallRule = armsql.FirewallRule{ - // Name: to.Ptr("firewallrulecrudtest-5370"), - // Type: to.Ptr("Microsoft.Sql/servers/firewallRules"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/firewallrulecrudtest-12/providers/Microsoft.Sql/servers/firewallrulecrudtest-6285/firewallRules/firewallrulecrudtest-5370"), - // Properties: &armsql.ServerFirewallRuleProperties{ - // EndIPAddress: to.Ptr("0.0.0.3"), - // StartIPAddress: to.Ptr("0.0.0.3"), - // }, - // } -} diff --git a/sdk/resourcemanager/sql/armsql/geobackuppolicies_client.go b/sdk/resourcemanager/sql/armsql/geobackuppolicies_client.go index 92ca7a599530..73969fc927d3 100644 --- a/sdk/resourcemanager/sql/armsql/geobackuppolicies_client.go +++ b/sdk/resourcemanager/sql/armsql/geobackuppolicies_client.go @@ -43,15 +43,15 @@ func NewGeoBackupPoliciesClient(subscriptionID string, credential azcore.TokenCr return client, nil } -// CreateOrUpdate - Updates a database geo backup policy. +// CreateOrUpdate - Create or update a database default Geo backup policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2014-04-01 +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. // - databaseName - The name of the database. -// - geoBackupPolicyName - The name of the geo backup policy. +// - geoBackupPolicyName - The name of the Geo backup policy. This should always be 'Default'. // - parameters - The required parameters for creating or updating the geo backup policy. // - options - GeoBackupPoliciesClientCreateOrUpdateOptions contains the optional parameters for the GeoBackupPoliciesClient.CreateOrUpdate // method. @@ -76,10 +76,6 @@ func (client *GeoBackupPoliciesClient) CreateOrUpdate(ctx context.Context, resou // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *GeoBackupPoliciesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, geoBackupPolicyName GeoBackupPolicyName, parameters GeoBackupPolicy, options *GeoBackupPoliciesClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/geoBackupPolicies/{geoBackupPolicyName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -96,12 +92,16 @@ func (client *GeoBackupPoliciesClient) createOrUpdateCreateRequest(ctx context.C return nil, errors.New("parameter geoBackupPolicyName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{geoBackupPolicyName}", url.PathEscape(string(geoBackupPolicyName))) + 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.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2014-04-01") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -119,15 +119,15 @@ func (client *GeoBackupPoliciesClient) createOrUpdateHandleResponse(resp *http.R return result, nil } -// Get - Gets a geo backup policy. +// Get - Gets a Geo backup policy for the given database resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2014-04-01 +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. // - databaseName - The name of the database. -// - geoBackupPolicyName - The name of the geo backup policy. +// - geoBackupPolicyName - The name of the Geo backup policy. This should always be 'Default'. // - options - GeoBackupPoliciesClientGetOptions contains the optional parameters for the GeoBackupPoliciesClient.Get method. func (client *GeoBackupPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, geoBackupPolicyName GeoBackupPolicyName, options *GeoBackupPoliciesClientGetOptions) (GeoBackupPoliciesClientGetResponse, error) { var err error @@ -150,10 +150,6 @@ func (client *GeoBackupPoliciesClient) Get(ctx context.Context, resourceGroupNam // getCreateRequest creates the Get request. func (client *GeoBackupPoliciesClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, geoBackupPolicyName GeoBackupPolicyName, options *GeoBackupPoliciesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/geoBackupPolicies/{geoBackupPolicyName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -170,12 +166,16 @@ func (client *GeoBackupPoliciesClient) getCreateRequest(ctx context.Context, res return nil, errors.New("parameter geoBackupPolicyName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{geoBackupPolicyName}", url.PathEscape(string(geoBackupPolicyName))) + 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.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2014-04-01") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -190,44 +190,46 @@ func (client *GeoBackupPoliciesClient) getHandleResponse(resp *http.Response) (G return result, nil } -// NewListByDatabasePager - Returns a list of geo backup policies. +// NewListPager - Gets a list of Geo backup policies for the given database resource. // -// Generated from API version 2014-04-01 +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. // - databaseName - The name of the database. -// - options - GeoBackupPoliciesClientListByDatabaseOptions contains the optional parameters for the GeoBackupPoliciesClient.NewListByDatabasePager +// - options - GeoBackupPoliciesClientListOptions contains the optional parameters for the GeoBackupPoliciesClient.NewListPager // method. -func (client *GeoBackupPoliciesClient) NewListByDatabasePager(resourceGroupName string, serverName string, databaseName string, options *GeoBackupPoliciesClientListByDatabaseOptions) *runtime.Pager[GeoBackupPoliciesClientListByDatabaseResponse] { - return runtime.NewPager(runtime.PagingHandler[GeoBackupPoliciesClientListByDatabaseResponse]{ - More: func(page GeoBackupPoliciesClientListByDatabaseResponse) bool { - return false +func (client *GeoBackupPoliciesClient) NewListPager(resourceGroupName string, serverName string, databaseName string, options *GeoBackupPoliciesClientListOptions) *runtime.Pager[GeoBackupPoliciesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[GeoBackupPoliciesClientListResponse]{ + More: func(page GeoBackupPoliciesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - Fetcher: func(ctx context.Context, page *GeoBackupPoliciesClientListByDatabaseResponse) (GeoBackupPoliciesClientListByDatabaseResponse, error) { - req, err := client.listByDatabaseCreateRequest(ctx, resourceGroupName, serverName, databaseName, options) + Fetcher: func(ctx context.Context, page *GeoBackupPoliciesClientListResponse) (GeoBackupPoliciesClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, serverName, databaseName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } if err != nil { - return GeoBackupPoliciesClientListByDatabaseResponse{}, err + return GeoBackupPoliciesClientListResponse{}, err } resp, err := client.internal.Pipeline().Do(req) if err != nil { - return GeoBackupPoliciesClientListByDatabaseResponse{}, err + return GeoBackupPoliciesClientListResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return GeoBackupPoliciesClientListByDatabaseResponse{}, runtime.NewResponseError(resp) + return GeoBackupPoliciesClientListResponse{}, runtime.NewResponseError(resp) } - return client.listByDatabaseHandleResponse(resp) + return client.listHandleResponse(resp) }, }) } -// listByDatabaseCreateRequest creates the ListByDatabase request. -func (client *GeoBackupPoliciesClient) listByDatabaseCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *GeoBackupPoliciesClientListByDatabaseOptions) (*policy.Request, error) { +// listCreateRequest creates the List request. +func (client *GeoBackupPoliciesClient) listCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *GeoBackupPoliciesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/geoBackupPolicies" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -240,22 +242,26 @@ func (client *GeoBackupPoliciesClient) listByDatabaseCreateRequest(ctx context.C return nil, errors.New("parameter databaseName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + 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.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2014-04-01") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// listByDatabaseHandleResponse handles the ListByDatabase response. -func (client *GeoBackupPoliciesClient) listByDatabaseHandleResponse(resp *http.Response) (GeoBackupPoliciesClientListByDatabaseResponse, error) { - result := GeoBackupPoliciesClientListByDatabaseResponse{} +// listHandleResponse handles the List response. +func (client *GeoBackupPoliciesClient) listHandleResponse(resp *http.Response) (GeoBackupPoliciesClientListResponse, error) { + result := GeoBackupPoliciesClientListResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.GeoBackupPolicyListResult); err != nil { - return GeoBackupPoliciesClientListByDatabaseResponse{}, err + return GeoBackupPoliciesClientListResponse{}, err } return result, nil } diff --git a/sdk/resourcemanager/sql/armsql/geobackuppolicies_client_example_test.go b/sdk/resourcemanager/sql/armsql/geobackuppolicies_client_example_test.go deleted file mode 100644 index fcbb7f3a20fd..000000000000 --- a/sdk/resourcemanager/sql/armsql/geobackuppolicies_client_example_test.go +++ /dev/null @@ -1,119 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/GeoBackupPoliciesCreateOrUpdate.json -func ExampleGeoBackupPoliciesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGeoBackupPoliciesClient().CreateOrUpdate(ctx, "sqlcrudtest-4799", "sqlcrudtest-5961", "testdw", armsql.GeoBackupPolicyNameDefault, armsql.GeoBackupPolicy{ - Properties: &armsql.GeoBackupPolicyProperties{ - State: to.Ptr(armsql.GeoBackupPolicyStateEnabled), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GeoBackupPolicy = armsql.GeoBackupPolicy{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/geoBackupPolicies"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-4799/providers/Microsoft.Sql/servers/sqlcrudtest-5961/databases/testdw/geoBackupPolicies/Default"), - // Properties: &armsql.GeoBackupPolicyProperties{ - // State: to.Ptr(armsql.GeoBackupPolicyStateEnabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/GeoBackupPoliciesGet.json -func ExampleGeoBackupPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGeoBackupPoliciesClient().Get(ctx, "sqlcrudtest-4799", "sqlcrudtest-5961", "testdw", armsql.GeoBackupPolicyNameDefault, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GeoBackupPolicy = armsql.GeoBackupPolicy{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/geoBackupPolicies"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-4799/providers/Microsoft.Sql/servers/sqlcrudtest-5961/databases/testdw/geoBackupPolicies/Default"), - // Location: to.Ptr("Central US"), - // Properties: &armsql.GeoBackupPolicyProperties{ - // State: to.Ptr(armsql.GeoBackupPolicyStateEnabled), - // StorageType: to.Ptr("Premium"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/GeoBackupPoliciesList.json -func ExampleGeoBackupPoliciesClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewGeoBackupPoliciesClient().NewListByDatabasePager("sqlcrudtest-4799", "sqlcrudtest-5961", "testdw", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.GeoBackupPolicyListResult = armsql.GeoBackupPolicyListResult{ - // Value: []*armsql.GeoBackupPolicy{ - // { - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/geoBackupPolicies"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-4799/providers/Microsoft.Sql/servers/sqlcrudtest-5961/databases/testdw/geoBackupPolicies/Default"), - // Location: to.Ptr("Central US"), - // Properties: &armsql.GeoBackupPolicyProperties{ - // State: to.Ptr(armsql.GeoBackupPolicyStateEnabled), - // StorageType: to.Ptr("Premium"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/sql/armsql/go.mod b/sdk/resourcemanager/sql/armsql/go.mod index 1476e76053c9..b89448136f94 100644 --- a/sdk/resourcemanager/sql/armsql/go.mod +++ b/sdk/resourcemanager/sql/armsql/go.mod @@ -2,20 +2,12 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2 go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v1.0.0 // indirect - github.com/golang-jwt/jwt/v4 v4.5.0 // indirect - github.com/google/uuid v1.3.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect - golang.org/x/crypto v0.7.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect golang.org/x/net v0.8.0 // indirect - golang.org/x/sys v0.6.0 // indirect golang.org/x/text v0.8.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/sdk/resourcemanager/sql/armsql/go.sum b/sdk/resourcemanager/sql/armsql/go.sum index ee2bc4389c66..727ce838bdc8 100644 --- a/sdk/resourcemanager/sql/armsql/go.sum +++ b/sdk/resourcemanager/sql/armsql/go.sum @@ -1,31 +1,15 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1 h1:SEy2xmstIphdPwNBUi7uhvjyjhVKISfwjfOJmuy7kg4= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1/go.mod h1:bjGvMhVMb+EEm3VRNQawDMUyMMjo+S5ewNjflkep/0Q= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.0 h1:vcYCAze6p19qBW7MhZybIsqD8sMV8js0NyQM8JDnVtg= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.0/go.mod h1:OQeznEEkTZ9OrhHJoDD8ZDq51FHgXjqtP9z6bEwBq9U= github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 h1:sXr+ck84g/ZlZUOZiNELInmMgOsuGwdjjVkEIde0OtY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0/go.mod h1:okt5dMMTOFjX/aovMlrjvvXoPMBVSPzk9185BT0+eZM= -github.com/AzureAD/microsoft-authentication-library-for-go v1.0.0 h1:OBhqkivkhkMqLPymWEppkm7vgPQY2XsHoEkaMQ0AdZY= -github.com/AzureAD/microsoft-authentication-library-for-go v1.0.0/go.mod h1:kgDmCTgBzIEPFElEF+FK0SdjAor06dRq2Go927dnQ6o= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI= -github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= -github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A= -golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/sql/armsql/instancefailovergroups_client.go b/sdk/resourcemanager/sql/armsql/instancefailovergroups_client.go index 716ed367bead..76b4d0f98bce 100644 --- a/sdk/resourcemanager/sql/armsql/instancefailovergroups_client.go +++ b/sdk/resourcemanager/sql/armsql/instancefailovergroups_client.go @@ -46,7 +46,7 @@ func NewInstanceFailoverGroupsClient(subscriptionID string, credential azcore.To // BeginCreateOrUpdate - Creates or updates a failover group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - locationName - The name of the region where the resource is located. @@ -70,7 +70,7 @@ func (client *InstanceFailoverGroupsClient) BeginCreateOrUpdate(ctx context.Cont // CreateOrUpdate - Creates or updates a failover group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01-preview +// Generated from API version 2023-05-01-preview func (client *InstanceFailoverGroupsClient) createOrUpdate(ctx context.Context, resourceGroupName string, locationName string, failoverGroupName string, parameters InstanceFailoverGroup, options *InstanceFailoverGroupsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, locationName, failoverGroupName, parameters, options) @@ -112,7 +112,7 @@ func (client *InstanceFailoverGroupsClient) createOrUpdateCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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 *InstanceFailoverGroupsClient) createOrUpdateCreateRequest(ctx cont // BeginDelete - Deletes a failover group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - locationName - The name of the region where the resource is located. @@ -147,7 +147,7 @@ func (client *InstanceFailoverGroupsClient) BeginDelete(ctx context.Context, res // Delete - Deletes a failover group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01-preview +// Generated from API version 2023-05-01-preview func (client *InstanceFailoverGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, locationName string, failoverGroupName string, options *InstanceFailoverGroupsClientBeginDeleteOptions) (*http.Response, error) { var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, locationName, failoverGroupName, options) @@ -189,7 +189,7 @@ func (client *InstanceFailoverGroupsClient) deleteCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -197,7 +197,7 @@ func (client *InstanceFailoverGroupsClient) deleteCreateRequest(ctx context.Cont // BeginFailover - Fails over from the current primary managed instance to this managed instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - locationName - The name of the region where the resource is located. @@ -220,7 +220,7 @@ func (client *InstanceFailoverGroupsClient) BeginFailover(ctx context.Context, r // Failover - Fails over from the current primary managed instance to this managed instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01-preview +// Generated from API version 2023-05-01-preview func (client *InstanceFailoverGroupsClient) failover(ctx context.Context, resourceGroupName string, locationName string, failoverGroupName string, options *InstanceFailoverGroupsClientBeginFailoverOptions) (*http.Response, error) { var err error req, err := client.failoverCreateRequest(ctx, resourceGroupName, locationName, failoverGroupName, options) @@ -262,7 +262,7 @@ func (client *InstanceFailoverGroupsClient) failoverCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -272,7 +272,7 @@ func (client *InstanceFailoverGroupsClient) failoverCreateRequest(ctx context.Co // might result in data loss. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - locationName - The name of the region where the resource is located. @@ -296,7 +296,7 @@ func (client *InstanceFailoverGroupsClient) BeginForceFailoverAllowDataLoss(ctx // might result in data loss. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01-preview +// Generated from API version 2023-05-01-preview func (client *InstanceFailoverGroupsClient) forceFailoverAllowDataLoss(ctx context.Context, resourceGroupName string, locationName string, failoverGroupName string, options *InstanceFailoverGroupsClientBeginForceFailoverAllowDataLossOptions) (*http.Response, error) { var err error req, err := client.forceFailoverAllowDataLossCreateRequest(ctx, resourceGroupName, locationName, failoverGroupName, options) @@ -338,7 +338,7 @@ func (client *InstanceFailoverGroupsClient) forceFailoverAllowDataLossCreateRequ return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -347,7 +347,7 @@ func (client *InstanceFailoverGroupsClient) forceFailoverAllowDataLossCreateRequ // Get - Gets a failover group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - locationName - The name of the region where the resource is located. @@ -396,7 +396,7 @@ func (client *InstanceFailoverGroupsClient) getCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -413,7 +413,7 @@ func (client *InstanceFailoverGroupsClient) getHandleResponse(resp *http.Respons // NewListByLocationPager - Lists the failover groups in a location. // -// Generated from API version 2022-05-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - locationName - The name of the region where the resource is located. @@ -467,7 +467,7 @@ func (client *InstanceFailoverGroupsClient) listByLocationCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/instancefailovergroups_client_example_test.go b/sdk/resourcemanager/sql/armsql/instancefailovergroups_client_example_test.go deleted file mode 100644 index 6f296ed0e04d..000000000000 --- a/sdk/resourcemanager/sql/armsql/instancefailovergroups_client_example_test.go +++ /dev/null @@ -1,342 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/InstanceFailoverGroupList.json -func ExampleInstanceFailoverGroupsClient_NewListByLocationPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewInstanceFailoverGroupsClient().NewListByLocationPager("Default", "Japan East", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.InstanceFailoverGroupListResult = armsql.InstanceFailoverGroupListResult{ - // Value: []*armsql.InstanceFailoverGroup{ - // { - // Name: to.Ptr("failover-group-test"), - // Type: to.Ptr("Microsoft.Sql/locations/instanceFailoverGroups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/locations/JapanEast/instanceFailoverGroups/failover-group-test"), - // Properties: &armsql.InstanceFailoverGroupProperties{ - // ManagedInstancePairs: []*armsql.ManagedInstancePairInfo{ - // { - // PartnerManagedInstanceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/failover-group-secondary-mngdInstance"), - // PrimaryManagedInstanceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/failover-group-primary-mngdInstance"), - // }}, - // PartnerRegions: []*armsql.PartnerRegionInfo{ - // { - // Location: to.Ptr("Japan West"), - // ReplicationRole: to.Ptr(armsql.InstanceFailoverGroupReplicationRoleSecondary), - // }}, - // ReadOnlyEndpoint: &armsql.InstanceFailoverGroupReadOnlyEndpoint{ - // FailoverPolicy: to.Ptr(armsql.ReadOnlyEndpointFailoverPolicyDisabled), - // }, - // ReadWriteEndpoint: &armsql.InstanceFailoverGroupReadWriteEndpoint{ - // FailoverPolicy: to.Ptr(armsql.ReadWriteEndpointFailoverPolicyAutomatic), - // FailoverWithDataLossGracePeriodMinutes: to.Ptr[int32](480), - // }, - // ReplicationRole: to.Ptr(armsql.InstanceFailoverGroupReplicationRolePrimary), - // ReplicationState: to.Ptr("CATCH_UP"), - // SecondaryType: to.Ptr(armsql.SecondaryInstanceTypeGeo), - // }, - // }, - // { - // Name: to.Ptr("failover-group-test-1"), - // Type: to.Ptr("Microsoft.Sql/locations/instanceFailoverGroups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/locations/JapanEast/instanceFailoverGroups/failover-group-test-1"), - // Properties: &armsql.InstanceFailoverGroupProperties{ - // ManagedInstancePairs: []*armsql.ManagedInstancePairInfo{ - // { - // PartnerManagedInstanceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/failover-group-secondary-mngdInstance-1"), - // PrimaryManagedInstanceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/failover-group-primary-mngdInstance-1"), - // }}, - // PartnerRegions: []*armsql.PartnerRegionInfo{ - // { - // Location: to.Ptr("Japan West"), - // ReplicationRole: to.Ptr(armsql.InstanceFailoverGroupReplicationRoleSecondary), - // }}, - // ReadOnlyEndpoint: &armsql.InstanceFailoverGroupReadOnlyEndpoint{ - // FailoverPolicy: to.Ptr(armsql.ReadOnlyEndpointFailoverPolicyDisabled), - // }, - // ReadWriteEndpoint: &armsql.InstanceFailoverGroupReadWriteEndpoint{ - // FailoverPolicy: to.Ptr(armsql.ReadWriteEndpointFailoverPolicyAutomatic), - // FailoverWithDataLossGracePeriodMinutes: to.Ptr[int32](480), - // }, - // ReplicationRole: to.Ptr(armsql.InstanceFailoverGroupReplicationRolePrimary), - // ReplicationState: to.Ptr("CATCH_UP"), - // SecondaryType: to.Ptr(armsql.SecondaryInstanceTypeGeo), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/InstanceFailoverGroupGet.json -func ExampleInstanceFailoverGroupsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewInstanceFailoverGroupsClient().Get(ctx, "Default", "Japan East", "failover-group-test", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.InstanceFailoverGroup = armsql.InstanceFailoverGroup{ - // Name: to.Ptr("failover-group-test-3"), - // Type: to.Ptr("Microsoft.Sql/locations/instanceFailoverGroups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/locations/JapanEast/instanceFailoverGroups/failover-group-test-3"), - // Properties: &armsql.InstanceFailoverGroupProperties{ - // ManagedInstancePairs: []*armsql.ManagedInstancePairInfo{ - // { - // PartnerManagedInstanceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/failover-group-secondary-mngdInstance"), - // PrimaryManagedInstanceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/failover-group-primary-mngdInstance"), - // }}, - // PartnerRegions: []*armsql.PartnerRegionInfo{ - // { - // Location: to.Ptr("Japan West"), - // ReplicationRole: to.Ptr(armsql.InstanceFailoverGroupReplicationRoleSecondary), - // }}, - // ReadOnlyEndpoint: &armsql.InstanceFailoverGroupReadOnlyEndpoint{ - // FailoverPolicy: to.Ptr(armsql.ReadOnlyEndpointFailoverPolicyDisabled), - // }, - // ReadWriteEndpoint: &armsql.InstanceFailoverGroupReadWriteEndpoint{ - // FailoverPolicy: to.Ptr(armsql.ReadWriteEndpointFailoverPolicyAutomatic), - // FailoverWithDataLossGracePeriodMinutes: to.Ptr[int32](480), - // }, - // ReplicationRole: to.Ptr(armsql.InstanceFailoverGroupReplicationRolePrimary), - // ReplicationState: to.Ptr("CATCH_UP"), - // SecondaryType: to.Ptr(armsql.SecondaryInstanceTypeGeo), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/InstanceFailoverGroupCreateOrUpdate.json -func ExampleInstanceFailoverGroupsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewInstanceFailoverGroupsClient().BeginCreateOrUpdate(ctx, "Default", "Japan East", "failover-group-test-3", armsql.InstanceFailoverGroup{ - Properties: &armsql.InstanceFailoverGroupProperties{ - ManagedInstancePairs: []*armsql.ManagedInstancePairInfo{ - { - PartnerManagedInstanceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/failover-group-secondary-mngdInstance"), - PrimaryManagedInstanceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/failover-group-primary-mngdInstance"), - }}, - PartnerRegions: []*armsql.PartnerRegionInfo{ - { - Location: to.Ptr("Japan West"), - }}, - ReadOnlyEndpoint: &armsql.InstanceFailoverGroupReadOnlyEndpoint{ - FailoverPolicy: to.Ptr(armsql.ReadOnlyEndpointFailoverPolicyDisabled), - }, - ReadWriteEndpoint: &armsql.InstanceFailoverGroupReadWriteEndpoint{ - FailoverPolicy: to.Ptr(armsql.ReadWriteEndpointFailoverPolicyAutomatic), - FailoverWithDataLossGracePeriodMinutes: to.Ptr[int32](480), - }, - SecondaryType: to.Ptr(armsql.SecondaryInstanceTypeGeo), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.InstanceFailoverGroup = armsql.InstanceFailoverGroup{ - // Name: to.Ptr("failover-group-test-3"), - // Type: to.Ptr("Microsoft.Sql/locations/instanceFailoverGroups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/locations/JapanEast/instanceFailoverGroups/failover-group-test-3"), - // Properties: &armsql.InstanceFailoverGroupProperties{ - // ManagedInstancePairs: []*armsql.ManagedInstancePairInfo{ - // { - // PartnerManagedInstanceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/failover-group-secondary-mngdInstance"), - // PrimaryManagedInstanceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/failover-group-primary-mngdInstance"), - // }}, - // PartnerRegions: []*armsql.PartnerRegionInfo{ - // { - // Location: to.Ptr("Japan West"), - // ReplicationRole: to.Ptr(armsql.InstanceFailoverGroupReplicationRoleSecondary), - // }}, - // ReadOnlyEndpoint: &armsql.InstanceFailoverGroupReadOnlyEndpoint{ - // FailoverPolicy: to.Ptr(armsql.ReadOnlyEndpointFailoverPolicyDisabled), - // }, - // ReadWriteEndpoint: &armsql.InstanceFailoverGroupReadWriteEndpoint{ - // FailoverPolicy: to.Ptr(armsql.ReadWriteEndpointFailoverPolicyAutomatic), - // FailoverWithDataLossGracePeriodMinutes: to.Ptr[int32](480), - // }, - // ReplicationRole: to.Ptr(armsql.InstanceFailoverGroupReplicationRolePrimary), - // ReplicationState: to.Ptr("CATCH_UP"), - // SecondaryType: to.Ptr(armsql.SecondaryInstanceTypeGeo), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/InstanceFailoverGroupDelete.json -func ExampleInstanceFailoverGroupsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewInstanceFailoverGroupsClient().BeginDelete(ctx, "Default", "Japan East", "failover-group-test-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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/InstanceFailoverGroupFailover.json -func ExampleInstanceFailoverGroupsClient_BeginFailover() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewInstanceFailoverGroupsClient().BeginFailover(ctx, "Default", "Japan West", "failover-group-test-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.InstanceFailoverGroup = armsql.InstanceFailoverGroup{ - // Name: to.Ptr("failover-group-test-3"), - // Type: to.Ptr("Microsoft.Sql/locations/instanceFailoverGroups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/locations/JapanWest/instanceFailoverGroups/failover-group-test-3"), - // Properties: &armsql.InstanceFailoverGroupProperties{ - // ManagedInstancePairs: []*armsql.ManagedInstancePairInfo{ - // { - // PartnerManagedInstanceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/failover-group-primary-mngdInstance"), - // PrimaryManagedInstanceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/failover-group-secondary-mngdInstance"), - // }}, - // PartnerRegions: []*armsql.PartnerRegionInfo{ - // { - // Location: to.Ptr("Japan East"), - // ReplicationRole: to.Ptr(armsql.InstanceFailoverGroupReplicationRoleSecondary), - // }}, - // ReadOnlyEndpoint: &armsql.InstanceFailoverGroupReadOnlyEndpoint{ - // FailoverPolicy: to.Ptr(armsql.ReadOnlyEndpointFailoverPolicyDisabled), - // }, - // ReadWriteEndpoint: &armsql.InstanceFailoverGroupReadWriteEndpoint{ - // FailoverPolicy: to.Ptr(armsql.ReadWriteEndpointFailoverPolicyAutomatic), - // FailoverWithDataLossGracePeriodMinutes: to.Ptr[int32](480), - // }, - // ReplicationRole: to.Ptr(armsql.InstanceFailoverGroupReplicationRolePrimary), - // ReplicationState: to.Ptr("CATCH_UP"), - // SecondaryType: to.Ptr(armsql.SecondaryInstanceTypeGeo), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/InstanceFailoverGroupForceFailoverAllowDataLoss.json -func ExampleInstanceFailoverGroupsClient_BeginForceFailoverAllowDataLoss() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewInstanceFailoverGroupsClient().BeginForceFailoverAllowDataLoss(ctx, "Default", "Japan West", "failover-group-test-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.InstanceFailoverGroup = armsql.InstanceFailoverGroup{ - // Name: to.Ptr("failover-group-test-3"), - // Type: to.Ptr("Microsoft.Sql/locations/instanceFailoverGroups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/locations/JapanWest/instanceFailoverGroups/failover-group-test-3"), - // Properties: &armsql.InstanceFailoverGroupProperties{ - // ManagedInstancePairs: []*armsql.ManagedInstancePairInfo{ - // { - // PartnerManagedInstanceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/failover-group-primary-mngdInstance"), - // PrimaryManagedInstanceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/failover-group-secondary-mngdInstance"), - // }}, - // PartnerRegions: []*armsql.PartnerRegionInfo{ - // { - // Location: to.Ptr("Japan East"), - // ReplicationRole: to.Ptr(armsql.InstanceFailoverGroupReplicationRoleSecondary), - // }}, - // ReadOnlyEndpoint: &armsql.InstanceFailoverGroupReadOnlyEndpoint{ - // FailoverPolicy: to.Ptr(armsql.ReadOnlyEndpointFailoverPolicyDisabled), - // }, - // ReadWriteEndpoint: &armsql.InstanceFailoverGroupReadWriteEndpoint{ - // FailoverPolicy: to.Ptr(armsql.ReadWriteEndpointFailoverPolicyAutomatic), - // FailoverWithDataLossGracePeriodMinutes: to.Ptr[int32](480), - // }, - // ReplicationRole: to.Ptr(armsql.InstanceFailoverGroupReplicationRolePrimary), - // ReplicationState: to.Ptr("CATCH_UP"), - // SecondaryType: to.Ptr(armsql.SecondaryInstanceTypeGeo), - // }, - // } -} diff --git a/sdk/resourcemanager/sql/armsql/instancepools_client.go b/sdk/resourcemanager/sql/armsql/instancepools_client.go index e5499b46152e..67f99acab59a 100644 --- a/sdk/resourcemanager/sql/armsql/instancepools_client.go +++ b/sdk/resourcemanager/sql/armsql/instancepools_client.go @@ -46,7 +46,7 @@ func NewInstancePoolsClient(subscriptionID string, credential azcore.TokenCreden // BeginCreateOrUpdate - Creates or updates an instance pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - instancePoolName - The name of the instance pool to be created or updated. @@ -69,7 +69,7 @@ func (client *InstancePoolsClient) BeginCreateOrUpdate(ctx context.Context, reso // CreateOrUpdate - Creates or updates an instance pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview func (client *InstancePoolsClient) createOrUpdate(ctx context.Context, resourceGroupName string, instancePoolName string, parameters InstancePool, options *InstancePoolsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, instancePoolName, parameters, options) @@ -107,7 +107,7 @@ func (client *InstancePoolsClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -119,7 +119,7 @@ func (client *InstancePoolsClient) createOrUpdateCreateRequest(ctx context.Conte // BeginDelete - Deletes an instance pool // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - instancePoolName - The name of the instance pool to be deleted @@ -141,7 +141,7 @@ func (client *InstancePoolsClient) BeginDelete(ctx context.Context, resourceGrou // Delete - Deletes an instance pool // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview func (client *InstancePoolsClient) deleteOperation(ctx context.Context, resourceGroupName string, instancePoolName string, options *InstancePoolsClientBeginDeleteOptions) (*http.Response, error) { var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, instancePoolName, options) @@ -179,7 +179,7 @@ func (client *InstancePoolsClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -187,7 +187,7 @@ func (client *InstancePoolsClient) deleteCreateRequest(ctx context.Context, reso // Get - Gets an instance pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - instancePoolName - The name of the instance pool to be retrieved. @@ -230,7 +230,7 @@ func (client *InstancePoolsClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -247,7 +247,7 @@ func (client *InstancePoolsClient) getHandleResponse(resp *http.Response) (Insta // NewListPager - Gets a list of all instance pools in the subscription. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - options - InstancePoolsClientListOptions contains the optional parameters for the InstancePoolsClient.NewListPager method. func (client *InstancePoolsClient) NewListPager(options *InstancePoolsClientListOptions) *runtime.Pager[InstancePoolsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[InstancePoolsClientListResponse]{ @@ -289,7 +289,7 @@ func (client *InstancePoolsClient) listCreateRequest(ctx context.Context, option return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -306,7 +306,7 @@ func (client *InstancePoolsClient) listHandleResponse(resp *http.Response) (Inst // NewListByResourceGroupPager - Gets a list of instance pools in the resource group // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - options - InstancePoolsClientListByResourceGroupOptions contains the optional parameters for the InstancePoolsClient.NewListByResourceGroupPager @@ -355,7 +355,7 @@ func (client *InstancePoolsClient) listByResourceGroupCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -373,7 +373,7 @@ func (client *InstancePoolsClient) listByResourceGroupHandleResponse(resp *http. // BeginUpdate - Updates an instance pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - instancePoolName - The name of the instance pool to be updated. @@ -396,7 +396,7 @@ func (client *InstancePoolsClient) BeginUpdate(ctx context.Context, resourceGrou // Update - Updates an instance pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview func (client *InstancePoolsClient) update(ctx context.Context, resourceGroupName string, instancePoolName string, parameters InstancePoolUpdate, options *InstancePoolsClientBeginUpdateOptions) (*http.Response, error) { var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, instancePoolName, parameters, options) @@ -434,7 +434,7 @@ func (client *InstancePoolsClient) updateCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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/sql/armsql/instancepools_client_example_test.go b/sdk/resourcemanager/sql/armsql/instancepools_client_example_test.go deleted file mode 100644 index 2b1351b292ae..000000000000 --- a/sdk/resourcemanager/sql/armsql/instancepools_client_example_test.go +++ /dev/null @@ -1,370 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetInstancePool.json -func ExampleInstancePoolsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewInstancePoolsClient().Get(ctx, "group1", "testIP", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.InstancePool = armsql.InstancePool{ - // Name: to.Ptr("testIP"), - // Type: to.Ptr("Microsoft.Sql/instancePools"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/instancePools/testIP"), - // Location: to.Ptr("japaneast"), - // Tags: map[string]*string{ - // "a": to.Ptr("b"), - // }, - // Properties: &armsql.InstancePoolProperties{ - // LicenseType: to.Ptr(armsql.InstancePoolLicenseTypeLicenseIncluded), - // SubnetID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Network/virtualNetwork/myvnet/subnets/mysubnet1"), - // VCores: to.Ptr[int32](8), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("GP_Gen5"), - // Family: to.Ptr("Gen5"), - // Tier: to.Ptr("GeneralPurpose"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateInstancePoolMax.json -func ExampleInstancePoolsClient_BeginCreateOrUpdate_createAnInstancePoolWithAllProperties() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewInstancePoolsClient().BeginCreateOrUpdate(ctx, "group1", "testIP", armsql.InstancePool{ - Location: to.Ptr("japaneast"), - Tags: map[string]*string{ - "a": to.Ptr("b"), - }, - Properties: &armsql.InstancePoolProperties{ - LicenseType: to.Ptr(armsql.InstancePoolLicenseTypeLicenseIncluded), - SubnetID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Network/virtualNetworks/myvnet/subnets/mysubnet1"), - VCores: to.Ptr[int32](8), - }, - SKU: &armsql.SKU{ - Name: to.Ptr("GP_Gen5"), - Family: to.Ptr("Gen5"), - Tier: to.Ptr("GeneralPurpose"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.InstancePool = armsql.InstancePool{ - // Name: to.Ptr("testIP"), - // Type: to.Ptr("Microsoft.Sql/instancePools"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/instancePools/testIP"), - // Location: to.Ptr("japaneast"), - // Tags: map[string]*string{ - // "a": to.Ptr("b"), - // }, - // Properties: &armsql.InstancePoolProperties{ - // LicenseType: to.Ptr(armsql.InstancePoolLicenseTypeLicenseIncluded), - // SubnetID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Network/virtualNetworks/myvnet/subnets/mysubnet1"), - // VCores: to.Ptr[int32](8), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("GP_Gen5"), - // Family: to.Ptr("Gen5"), - // Tier: to.Ptr("GeneralPurpose"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateInstancePoolMin.json -func ExampleInstancePoolsClient_BeginCreateOrUpdate_createAnInstancePoolWithMinProperties() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewInstancePoolsClient().BeginCreateOrUpdate(ctx, "group1", "testIP", armsql.InstancePool{ - Location: to.Ptr("japaneast"), - Properties: &armsql.InstancePoolProperties{ - LicenseType: to.Ptr(armsql.InstancePoolLicenseTypeLicenseIncluded), - SubnetID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Network/virtualNetworks/myvnet/subnets/mysubnet1"), - VCores: to.Ptr[int32](8), - }, - SKU: &armsql.SKU{ - Name: to.Ptr("GP_Gen5"), - Family: to.Ptr("Gen5"), - Tier: to.Ptr("GeneralPurpose"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.InstancePool = armsql.InstancePool{ - // Name: to.Ptr("testIP"), - // Type: to.Ptr("Microsoft.Sql/instancePools"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/instancePools/testIP"), - // Location: to.Ptr("japaneast"), - // Tags: map[string]*string{ - // }, - // Properties: &armsql.InstancePoolProperties{ - // LicenseType: to.Ptr(armsql.InstancePoolLicenseTypeLicenseIncluded), - // SubnetID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Network/virtualNetworks/myvnet/subnets/mysubnet1"), - // VCores: to.Ptr[int32](8), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("GP_Gen5"), - // Family: to.Ptr("Gen5"), - // Tier: to.Ptr("GeneralPurpose"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteInstancePool.json -func ExampleInstancePoolsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewInstancePoolsClient().BeginDelete(ctx, "group1", "testIP", 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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/PatchInstancePool.json -func ExampleInstancePoolsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewInstancePoolsClient().BeginUpdate(ctx, "group1", "testIP", armsql.InstancePoolUpdate{ - Tags: map[string]*string{ - "x": to.Ptr("y"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.InstancePool = armsql.InstancePool{ - // Name: to.Ptr("testIP"), - // Type: to.Ptr("Microsoft.Sql/instancePools"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/instancePools/testIP"), - // Location: to.Ptr("japaneast"), - // Tags: map[string]*string{ - // "x": to.Ptr("y"), - // }, - // Properties: &armsql.InstancePoolProperties{ - // LicenseType: to.Ptr(armsql.InstancePoolLicenseTypeLicenseIncluded), - // SubnetID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Network/virtualNetwork/myvnet/subnets/mysubnet1"), - // VCores: to.Ptr[int32](8), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("GP_Gen5"), - // Family: to.Ptr("Gen5"), - // Tier: to.Ptr("GeneralPurpose"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListInstancePoolsByResourceGroup.json -func ExampleInstancePoolsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewInstancePoolsClient().NewListByResourceGroupPager("group1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.InstancePoolListResult = armsql.InstancePoolListResult{ - // Value: []*armsql.InstancePool{ - // { - // Name: to.Ptr("testIP"), - // Type: to.Ptr("Microsoft.Sql/instancePools"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/instancePools/testIP"), - // Location: to.Ptr("japaneast"), - // Tags: map[string]*string{ - // "a": to.Ptr("b"), - // }, - // Properties: &armsql.InstancePoolProperties{ - // LicenseType: to.Ptr(armsql.InstancePoolLicenseTypeLicenseIncluded), - // SubnetID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Network/virtualNetwork/myvnet/subnets/mysubnet1"), - // VCores: to.Ptr[int32](8), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("GP_Gen5"), - // Family: to.Ptr("Gen5"), - // Tier: to.Ptr("GeneralPurpose"), - // }, - // }, - // { - // Name: to.Ptr("testIP2"), - // Type: to.Ptr("Microsoft.Sql/instancePools"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/instancePools/testIP2"), - // Location: to.Ptr("japaneast"), - // Tags: map[string]*string{ - // "a": to.Ptr("b"), - // }, - // Properties: &armsql.InstancePoolProperties{ - // LicenseType: to.Ptr(armsql.InstancePoolLicenseTypeLicenseIncluded), - // SubnetID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Network/virtualNetwork/myvnet/subnets/mysubnet1"), - // VCores: to.Ptr[int32](8), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("GP_Gen5"), - // Family: to.Ptr("Gen5"), - // Tier: to.Ptr("GeneralPurpose"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListInstancePoolsBySubscriptionId.json -func ExampleInstancePoolsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewInstancePoolsClient().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.InstancePoolListResult = armsql.InstancePoolListResult{ - // Value: []*armsql.InstancePool{ - // { - // Name: to.Ptr("testIP"), - // Type: to.Ptr("Microsoft.Sql/instancePools"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/instancePools/testIP"), - // Location: to.Ptr("japaneast"), - // Tags: map[string]*string{ - // "a": to.Ptr("b"), - // }, - // Properties: &armsql.InstancePoolProperties{ - // LicenseType: to.Ptr(armsql.InstancePoolLicenseTypeLicenseIncluded), - // SubnetID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Network/virtualNetwork/myvnet/subnets/mysubnet1"), - // VCores: to.Ptr[int32](8), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("GP_Gen5"), - // Family: to.Ptr("Gen5"), - // Tier: to.Ptr("GeneralPurpose"), - // }, - // }, - // { - // Name: to.Ptr("testIP2"), - // Type: to.Ptr("Microsoft.Sql/instancePools"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group2/providers/Microsoft.Sql/instancePools/testIP2"), - // Location: to.Ptr("japaneast"), - // Tags: map[string]*string{ - // "a": to.Ptr("b"), - // }, - // Properties: &armsql.InstancePoolProperties{ - // LicenseType: to.Ptr(armsql.InstancePoolLicenseTypeLicenseIncluded), - // SubnetID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group2/providers/Microsoft.Network/virtualNetwork/myvnet/subnets/mysubnet1"), - // VCores: to.Ptr[int32](8), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("GP_Gen5"), - // Family: to.Ptr("Gen5"), - // Tier: to.Ptr("GeneralPurpose"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ipv6firewallrules_client.go b/sdk/resourcemanager/sql/armsql/ipv6firewallrules_client.go index c0d474157f8f..1c6b1f09718b 100644 --- a/sdk/resourcemanager/sql/armsql/ipv6firewallrules_client.go +++ b/sdk/resourcemanager/sql/armsql/ipv6firewallrules_client.go @@ -46,7 +46,7 @@ func NewIPv6FirewallRulesClient(subscriptionID string, credential azcore.TokenCr // CreateOrUpdate - Creates or updates an IPv6 firewall rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -96,7 +96,7 @@ func (client *IPv6FirewallRulesClient) createOrUpdateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -117,7 +117,7 @@ func (client *IPv6FirewallRulesClient) createOrUpdateHandleResponse(resp *http.R // Delete - Deletes an IPv6 firewall rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -165,7 +165,7 @@ func (client *IPv6FirewallRulesClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -173,7 +173,7 @@ func (client *IPv6FirewallRulesClient) deleteCreateRequest(ctx context.Context, // Get - Gets an IPv6 firewall rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -221,7 +221,7 @@ func (client *IPv6FirewallRulesClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -238,7 +238,7 @@ func (client *IPv6FirewallRulesClient) getHandleResponse(resp *http.Response) (I // NewListByServerPager - Gets a list of IPv6 firewall rules. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -292,7 +292,7 @@ func (client *IPv6FirewallRulesClient) listByServerCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/ipv6firewallrules_client_example_test.go b/sdk/resourcemanager/sql/armsql/ipv6firewallrules_client_example_test.go deleted file mode 100644 index 1513f07f4f36..000000000000 --- a/sdk/resourcemanager/sql/armsql/ipv6firewallrules_client_example_test.go +++ /dev/null @@ -1,197 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/IPv6FirewallRuleList.json -func ExampleIPv6FirewallRulesClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewIPv6FirewallRulesClient().NewListByServerPager("firewallrulecrudtest-12", "firewallrulecrudtest-6285", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.IPv6FirewallRuleListResult = armsql.IPv6FirewallRuleListResult{ - // Value: []*armsql.IPv6FirewallRule{ - // { - // Name: to.Ptr("firewallrulecrudtest-2304"), - // Type: to.Ptr("Microsoft.Sql/servers/ipv6FirewallRules"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/firewallrulecrudtest-12/providers/Microsoft.Sql/servers/firewallrulecrudtest-6285/ipv6FirewallRules/firewallrulecrudtest-2304"), - // Properties: &armsql.IPv6ServerFirewallRuleProperties{ - // EndIPv6Address: to.Ptr("0000:0000:0000:0000:0000:ffff:0000:0000"), - // StartIPv6Address: to.Ptr("0000:0000:0000:0000:0000:ffff:0000:0000"), - // }, - // }, - // { - // Name: to.Ptr("firewallrulecrudtest-3927"), - // Type: to.Ptr("Microsoft.Sql/servers/ipv6FirewallRules"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/firewallrulecrudtest-12/providers/Microsoft.Sql/servers/firewallrulecrudtest-6285/ipv6FirewallRules/firewallrulecrudtest-3927"), - // Properties: &armsql.IPv6ServerFirewallRuleProperties{ - // EndIPv6Address: to.Ptr("0000:0000:0000:0000:0000:ffff:0000:0001"), - // StartIPv6Address: to.Ptr("0000:0000:0000:0000:0000:ffff:0000:0001"), - // }, - // }, - // { - // Name: to.Ptr("firewallrulecrudtest-5370"), - // Type: to.Ptr("Microsoft.Sql/servers/ipv6FirewallRules"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/firewallrulecrudtest-12/providers/Microsoft.Sql/servers/firewallrulecrudtest-6285/ipv6FirewallRules/firewallrulecrudtest-5370"), - // Properties: &armsql.IPv6ServerFirewallRuleProperties{ - // EndIPv6Address: to.Ptr("0000:0000:0000:0000:0000:ffff:0000:0003"), - // StartIPv6Address: to.Ptr("0000:0000:0000:0000:0000:ffff:0000:0003"), - // }, - // }, - // { - // Name: to.Ptr("firewallrulecrudtest-5767"), - // Type: to.Ptr("Microsoft.Sql/servers/ipv6FirewallRules"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/firewallrulecrudtest-12/providers/Microsoft.Sql/servers/firewallrulecrudtest-6285/ipv6FirewallRules/firewallrulecrudtest-5767"), - // Properties: &armsql.IPv6ServerFirewallRuleProperties{ - // EndIPv6Address: to.Ptr("0000:0000:0000:0000:0000:ffff:0000:0002"), - // StartIPv6Address: to.Ptr("0000:0000:0000:0000:0000:ffff:0000:0002"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/IPv6FirewallRuleGet.json -func ExampleIPv6FirewallRulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewIPv6FirewallRulesClient().Get(ctx, "firewallrulecrudtest-12", "firewallrulecrudtest-6285", "firewallrulecrudtest-2304", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.IPv6FirewallRule = armsql.IPv6FirewallRule{ - // Name: to.Ptr("firewallrulecrudtest-2304"), - // Type: to.Ptr("Microsoft.Sql/servers/ipv6FirewallRules"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/firewallrulecrudtest-12/providers/Microsoft.Sql/servers/firewallrulecrudtest-6285/ipv6FirewallRules/firewallrulecrudtest-2304"), - // Properties: &armsql.IPv6ServerFirewallRuleProperties{ - // EndIPv6Address: to.Ptr("0000:0000:0000:0000:0000:ffff:0000:0000"), - // StartIPv6Address: to.Ptr("0000:0000:0000:0000:0000:ffff:0000:0000"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/IPv6FirewallRuleCreate.json -func ExampleIPv6FirewallRulesClient_CreateOrUpdate_createAnIPv6FirewallRuleMaxMin() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewIPv6FirewallRulesClient().CreateOrUpdate(ctx, "firewallrulecrudtest-12", "firewallrulecrudtest-6285", "firewallrulecrudtest-5370", armsql.IPv6FirewallRule{ - Properties: &armsql.IPv6ServerFirewallRuleProperties{ - EndIPv6Address: to.Ptr("0000:0000:0000:0000:0000:ffff:0000:0003"), - StartIPv6Address: to.Ptr("0000:0000:0000:0000:0000:ffff:0000:0003"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.IPv6FirewallRule = armsql.IPv6FirewallRule{ - // Name: to.Ptr("firewallrulecrudtest-5370"), - // Type: to.Ptr("Microsoft.Sql/servers/ipv6FirewallRules"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/firewallrulecrudtest-12/providers/Microsoft.Sql/servers/firewallrulecrudtest-6285/ipv6FirewallRules/firewallrulecrudtest-5370"), - // Properties: &armsql.IPv6ServerFirewallRuleProperties{ - // EndIPv6Address: to.Ptr("0000:0000:0000:0000:0000:ffff:0000:0003"), - // StartIPv6Address: to.Ptr("0000:0000:0000:0000:0000:ffff:0000:0003"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/IPv6FirewallRuleUpdate.json -func ExampleIPv6FirewallRulesClient_CreateOrUpdate_updateAnIPv6FirewallRuleMaxMin() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewIPv6FirewallRulesClient().CreateOrUpdate(ctx, "firewallrulecrudtest-12", "firewallrulecrudtest-6285", "firewallrulecrudtest-3927", armsql.IPv6FirewallRule{ - Properties: &armsql.IPv6ServerFirewallRuleProperties{ - EndIPv6Address: to.Ptr("0000:0000:0000:0000:0000:ffff:0000:0001"), - StartIPv6Address: to.Ptr("0000:0000:0000:0000:0000:ffff:0000:0001"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.IPv6FirewallRule = armsql.IPv6FirewallRule{ - // Name: to.Ptr("firewallrulecrudtest-3927"), - // Type: to.Ptr("Microsoft.Sql/servers/ipv6FirewallRules"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/firewallrulecrudtest-12/providers/Microsoft.Sql/servers/firewallrulecrudtest-6285/ipv6FirewallRules/firewallrulecrudtest-3927"), - // Properties: &armsql.IPv6ServerFirewallRuleProperties{ - // EndIPv6Address: to.Ptr("0000:0000:0000:0000:0000:ffff:0000:0001"), - // StartIPv6Address: to.Ptr("0000:0000:0000:0000:0000:ffff:0000:0001"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/IPv6FirewallRuleDelete.json -func ExampleIPv6FirewallRulesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewIPv6FirewallRulesClient().Delete(ctx, "firewallrulecrudtest-9886", "firewallrulecrudtest-2368", "firewallrulecrudtest-7011", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/sql/armsql/jobagents_client.go b/sdk/resourcemanager/sql/armsql/jobagents_client.go index bdc2c7d69e91..9119e300b99c 100644 --- a/sdk/resourcemanager/sql/armsql/jobagents_client.go +++ b/sdk/resourcemanager/sql/armsql/jobagents_client.go @@ -46,7 +46,7 @@ func NewJobAgentsClient(subscriptionID string, credential azcore.TokenCredential // BeginCreateOrUpdate - Creates or updates a job agent. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -70,7 +70,7 @@ func (client *JobAgentsClient) BeginCreateOrUpdate(ctx context.Context, resource // CreateOrUpdate - Creates or updates a job agent. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview func (client *JobAgentsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, parameters JobAgent, options *JobAgentsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, jobAgentName, parameters, options) @@ -112,7 +112,7 @@ func (client *JobAgentsClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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 *JobAgentsClient) createOrUpdateCreateRequest(ctx context.Context, // BeginDelete - Deletes a job agent. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -146,7 +146,7 @@ func (client *JobAgentsClient) BeginDelete(ctx context.Context, resourceGroupNam // Delete - Deletes a job agent. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview func (client *JobAgentsClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, options *JobAgentsClientBeginDeleteOptions) (*http.Response, error) { var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, jobAgentName, options) @@ -188,7 +188,7 @@ func (client *JobAgentsClient) deleteCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -196,7 +196,7 @@ func (client *JobAgentsClient) deleteCreateRequest(ctx context.Context, resource // Get - Gets a job agent. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -244,7 +244,7 @@ func (client *JobAgentsClient) getCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -261,7 +261,7 @@ func (client *JobAgentsClient) getHandleResponse(resp *http.Response) (JobAgents // NewListByServerPager - Gets a list of job agents in a server. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -315,7 +315,7 @@ func (client *JobAgentsClient) listByServerCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -333,7 +333,7 @@ func (client *JobAgentsClient) listByServerHandleResponse(resp *http.Response) ( // BeginUpdate - Updates a job agent. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -356,7 +356,7 @@ func (client *JobAgentsClient) BeginUpdate(ctx context.Context, resourceGroupNam // Update - Updates a job agent. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview func (client *JobAgentsClient) update(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, parameters JobAgentUpdate, options *JobAgentsClientBeginUpdateOptions) (*http.Response, error) { var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, serverName, jobAgentName, parameters, options) @@ -398,7 +398,7 @@ func (client *JobAgentsClient) updateCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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/sql/armsql/jobagents_client_example_test.go b/sdk/resourcemanager/sql/armsql/jobagents_client_example_test.go deleted file mode 100644 index da1c84247fdb..000000000000 --- a/sdk/resourcemanager/sql/armsql/jobagents_client_example_test.go +++ /dev/null @@ -1,209 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobAgentsByServer.json -func ExampleJobAgentsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewJobAgentsClient().NewListByServerPager("group1", "server1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.JobAgentListResult = armsql.JobAgentListResult{ - // Value: []*armsql.JobAgent{ - // { - // Name: to.Ptr("agent1"), - // Type: to.Ptr("Microsoft.Sql/servers/jobAgents"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1"), - // Location: to.Ptr("southeastasia"), - // Properties: &armsql.JobAgentProperties{ - // DatabaseID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/databases/db1"), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("Agent"), - // Capacity: to.Ptr[int32](200), - // }, - // }, - // { - // Name: to.Ptr("jobAgent2"), - // Type: to.Ptr("Microsoft.Sql/servers/jobAgents"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/jobAgent2"), - // Location: to.Ptr("southeastasia"), - // Properties: &armsql.JobAgentProperties{ - // DatabaseID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/databases/db12"), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("Agent"), - // Capacity: to.Ptr[int32](400), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobAgent.json -func ExampleJobAgentsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewJobAgentsClient().Get(ctx, "group1", "server1", "agent1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.JobAgent = armsql.JobAgent{ - // Name: to.Ptr("agent1"), - // Type: to.Ptr("Microsoft.Sql/servers/jobAgents"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1"), - // Location: to.Ptr("southeastasia"), - // Properties: &armsql.JobAgentProperties{ - // DatabaseID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/databases/db1"), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("Agent"), - // Capacity: to.Ptr[int32](400), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobAgent.json -func ExampleJobAgentsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewJobAgentsClient().BeginCreateOrUpdate(ctx, "group1", "server1", "agent1", armsql.JobAgent{ - Location: to.Ptr("southeastasia"), - Properties: &armsql.JobAgentProperties{ - DatabaseID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/databases/db1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.JobAgent = armsql.JobAgent{ - // Name: to.Ptr("agent1"), - // Type: to.Ptr("Microsoft.Sql/servers/jobAgents"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1"), - // Location: to.Ptr("southeastasia"), - // Properties: &armsql.JobAgentProperties{ - // DatabaseID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/databases/db1"), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("Agent"), - // Capacity: to.Ptr[int32](100), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteJobAgent.json -func ExampleJobAgentsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewJobAgentsClient().BeginDelete(ctx, "group1", "server1", "agent1", 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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/UpdateJobAgent.json -func ExampleJobAgentsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewJobAgentsClient().BeginUpdate(ctx, "group1", "server1", "agent1", armsql.JobAgentUpdate{ - Tags: map[string]*string{ - "mytag1": to.Ptr("myvalue1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.JobAgent = armsql.JobAgent{ - // Name: to.Ptr("agent1"), - // Type: to.Ptr("Microsoft.Sql/servers/jobAgents"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1"), - // Location: to.Ptr("southeastasia"), - // Tags: map[string]*string{ - // "mytag1": to.Ptr("myvalue1"), - // }, - // Properties: &armsql.JobAgentProperties{ - // DatabaseID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/databases/db1"), - // }, - // } -} diff --git a/sdk/resourcemanager/sql/armsql/jobcredentials_client.go b/sdk/resourcemanager/sql/armsql/jobcredentials_client.go index 0a28e5fdc6e1..e6a8f4c06a8e 100644 --- a/sdk/resourcemanager/sql/armsql/jobcredentials_client.go +++ b/sdk/resourcemanager/sql/armsql/jobcredentials_client.go @@ -46,7 +46,7 @@ func NewJobCredentialsClient(subscriptionID string, credential azcore.TokenCrede // CreateOrUpdate - Creates or updates a job credential. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -101,7 +101,7 @@ func (client *JobCredentialsClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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 *JobCredentialsClient) createOrUpdateHandleResponse(resp *http.Resp // Delete - Deletes a job credential. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -174,7 +174,7 @@ func (client *JobCredentialsClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -182,7 +182,7 @@ func (client *JobCredentialsClient) deleteCreateRequest(ctx context.Context, res // Get - Gets a jobs credential. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -235,7 +235,7 @@ func (client *JobCredentialsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -252,7 +252,7 @@ func (client *JobCredentialsClient) getHandleResponse(resp *http.Response) (JobC // NewListByAgentPager - Gets a list of jobs credentials. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -311,7 +311,7 @@ func (client *JobCredentialsClient) listByAgentCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/jobcredentials_client_example_test.go b/sdk/resourcemanager/sql/armsql/jobcredentials_client_example_test.go deleted file mode 100644 index 307ceb3e9d1e..000000000000 --- a/sdk/resourcemanager/sql/armsql/jobcredentials_client_example_test.go +++ /dev/null @@ -1,141 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobCredentialsByAgent.json -func ExampleJobCredentialsClient_NewListByAgentPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewJobCredentialsClient().NewListByAgentPager("group1", "server1", "agent1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.JobCredentialListResult = armsql.JobCredentialListResult{ - // Value: []*armsql.JobCredential{ - // { - // Name: to.Ptr("cred1"), - // Type: to.Ptr("Microsoft.Sql/servers/jobAccounts/credentials"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/cred1"), - // Properties: &armsql.JobCredentialProperties{ - // Username: to.Ptr("myuser"), - // }, - // }, - // { - // Name: to.Ptr("cred2"), - // Type: to.Ptr("Microsoft.Sql/servers/jobAccounts/credentials"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/cred2"), - // Properties: &armsql.JobCredentialProperties{ - // Username: to.Ptr("anotherUser"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobCredential.json -func ExampleJobCredentialsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewJobCredentialsClient().Get(ctx, "group1", "server1", "agent1", "cred1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.JobCredential = armsql.JobCredential{ - // Name: to.Ptr("cred1"), - // Type: to.Ptr("Microsoft.Sql/servers/jobAccounts/credentials"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/cred1"), - // Properties: &armsql.JobCredentialProperties{ - // Username: to.Ptr("myuser"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobCredential.json -func ExampleJobCredentialsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewJobCredentialsClient().CreateOrUpdate(ctx, "group1", "server1", "agent1", "cred1", armsql.JobCredential{ - Properties: &armsql.JobCredentialProperties{ - Password: to.Ptr(""), - Username: to.Ptr("myuser"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.JobCredential = armsql.JobCredential{ - // Name: to.Ptr("cred1"), - // Type: to.Ptr("Microsoft.Sql/servers/jobAccounts/credentials"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/cred1"), - // Properties: &armsql.JobCredentialProperties{ - // Username: to.Ptr("myuser"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteJobCredential.json -func ExampleJobCredentialsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewJobCredentialsClient().Delete(ctx, "group1", "server1", "agent1", "cred1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/sql/armsql/jobexecutions_client.go b/sdk/resourcemanager/sql/armsql/jobexecutions_client.go index 62948e222358..9c875b9e4fde 100644 --- a/sdk/resourcemanager/sql/armsql/jobexecutions_client.go +++ b/sdk/resourcemanager/sql/armsql/jobexecutions_client.go @@ -48,7 +48,7 @@ func NewJobExecutionsClient(subscriptionID string, credential azcore.TokenCreden // Cancel - Requests cancellation of a job execution. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -102,7 +102,7 @@ func (client *JobExecutionsClient) cancelCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -110,7 +110,7 @@ func (client *JobExecutionsClient) cancelCreateRequest(ctx context.Context, reso // BeginCreate - Starts an elastic job execution. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -134,7 +134,7 @@ func (client *JobExecutionsClient) BeginCreate(ctx context.Context, resourceGrou // Create - Starts an elastic job execution. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview func (client *JobExecutionsClient) create(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, options *JobExecutionsClientBeginCreateOptions) (*http.Response, error) { var err error req, err := client.createCreateRequest(ctx, resourceGroupName, serverName, jobAgentName, jobName, options) @@ -180,7 +180,7 @@ func (client *JobExecutionsClient) createCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -189,7 +189,7 @@ func (client *JobExecutionsClient) createCreateRequest(ctx context.Context, reso // BeginCreateOrUpdate - Creates or updates a job execution. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -214,7 +214,7 @@ func (client *JobExecutionsClient) BeginCreateOrUpdate(ctx context.Context, reso // CreateOrUpdate - Creates or updates a job execution. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview func (client *JobExecutionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, jobExecutionID string, options *JobExecutionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, jobAgentName, jobName, jobExecutionID, options) @@ -261,7 +261,7 @@ func (client *JobExecutionsClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -270,7 +270,7 @@ func (client *JobExecutionsClient) createOrUpdateCreateRequest(ctx context.Conte // Get - Gets a job execution. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -325,7 +325,7 @@ func (client *JobExecutionsClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -342,7 +342,7 @@ func (client *JobExecutionsClient) getHandleResponse(resp *http.Response) (JobEx // NewListByAgentPager - Lists all executions in a job agent. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -417,12 +417,12 @@ func (client *JobExecutionsClient) listByAgentCreateRequest(ctx context.Context, reqQP.Set("isActive", strconv.FormatBool(*options.IsActive)) } if options != nil && options.Skip != nil { - reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) + reqQP.Set("$skip", strconv.FormatInt(*options.Skip, 10)) } if options != nil && options.Top != nil { - reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + reqQP.Set("$top", strconv.FormatInt(*options.Top, 10)) } - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -439,7 +439,7 @@ func (client *JobExecutionsClient) listByAgentHandleResponse(resp *http.Response // NewListByJobPager - Lists a job's executions. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -519,12 +519,12 @@ func (client *JobExecutionsClient) listByJobCreateRequest(ctx context.Context, r reqQP.Set("isActive", strconv.FormatBool(*options.IsActive)) } if options != nil && options.Skip != nil { - reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) + reqQP.Set("$skip", strconv.FormatInt(*options.Skip, 10)) } if options != nil && options.Top != nil { - reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + reqQP.Set("$top", strconv.FormatInt(*options.Top, 10)) } - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/jobexecutions_client_example_test.go b/sdk/resourcemanager/sql/armsql/jobexecutions_client_example_test.go deleted file mode 100644 index 6d31943946fb..000000000000 --- a/sdk/resourcemanager/sql/armsql/jobexecutions_client_example_test.go +++ /dev/null @@ -1,355 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobExecutionsByAgentWithFilter.json -func ExampleJobExecutionsClient_NewListByAgentPager_listAllJobExecutionsInAJobAgentWithFiltering() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewJobExecutionsClient().NewListByAgentPager("group1", "server1", "agent1", &armsql.JobExecutionsClientListByAgentOptions{CreateTimeMin: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-21T19:00:00Z"); return t }()), - CreateTimeMax: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-21T19:05:00Z"); return t }()), - EndTimeMin: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-21T19:20:00Z"); return t }()), - EndTimeMax: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-21T19:25:00Z"); return t }()), - IsActive: to.Ptr(false), - Skip: nil, - Top: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.JobExecutionListResult = armsql.JobExecutionListResult{ - // Value: []*armsql.JobExecution{ - // { - // Name: to.Ptr("5555-6666-7777-8888-999999999999"), - // Type: to.Ptr("Microsoft.Sql/servers/jobAgents/jobs/executions"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/jobs/job1/executions/5555-6666-7777-8888-999999999999"), - // Properties: &armsql.JobExecutionProperties{ - // CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-21T19:02:00.8707045Z"); return t}()), - // CurrentAttemptStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-21T19:12:00.8707045Z"); return t}()), - // CurrentAttempts: to.Ptr[int32](0), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-21T19:22:00.8707045Z"); return t}()), - // JobExecutionID: to.Ptr("5A86BF65-43AC-F258-2524-9E92992F97CA"), - // JobVersion: to.Ptr[int32](1), - // LastMessage: to.Ptr("Job execution created."), - // Lifecycle: to.Ptr(armsql.JobExecutionLifecycleCreated), - // ProvisioningState: to.Ptr(armsql.ProvisioningStateSucceeded), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-21T19:12:00.8707045Z"); return t}()), - // }, - // }, - // { - // Name: to.Ptr("aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), - // Type: to.Ptr("Microsoft.Sql/servers/jobAgents/jobs/executions"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/jobs/job2/executions/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), - // Properties: &armsql.JobExecutionProperties{ - // CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-15T19:02:00.8707045Z"); return t}()), - // CurrentAttempts: to.Ptr[int32](1), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-15T19:22:00.8707045Z"); return t}()), - // JobExecutionID: to.Ptr("aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), - // JobVersion: to.Ptr[int32](1), - // LastMessage: to.Ptr("Job execution succeeded."), - // Lifecycle: to.Ptr(armsql.JobExecutionLifecycleSucceeded), - // ProvisioningState: to.Ptr(armsql.ProvisioningStateSucceeded), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-15T19:12:00.8707045Z"); return t}()), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobExecutionsByAgent.json -func ExampleJobExecutionsClient_NewListByAgentPager_listAllJobExecutionsInAJobAgent() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewJobExecutionsClient().NewListByAgentPager("group1", "server1", "agent1", &armsql.JobExecutionsClientListByAgentOptions{CreateTimeMin: nil, - CreateTimeMax: nil, - EndTimeMin: nil, - EndTimeMax: nil, - IsActive: nil, - Skip: nil, - Top: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.JobExecutionListResult = armsql.JobExecutionListResult{ - // Value: []*armsql.JobExecution{ - // { - // Name: to.Ptr("5555-6666-7777-8888-999999999999"), - // Type: to.Ptr("Microsoft.Sql/servers/jobAgents/jobs/executions"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/jobs/job1/executions/5555-6666-7777-8888-999999999999"), - // Properties: &armsql.JobExecutionProperties{ - // CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-21T19:02:00.8707045Z"); return t}()), - // CurrentAttemptStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-21T19:12:00.8707045Z"); return t}()), - // CurrentAttempts: to.Ptr[int32](0), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-21T19:22:00.8707045Z"); return t}()), - // JobExecutionID: to.Ptr("5A86BF65-43AC-F258-2524-9E92992F97CA"), - // JobVersion: to.Ptr[int32](1), - // LastMessage: to.Ptr("Job execution created."), - // Lifecycle: to.Ptr(armsql.JobExecutionLifecycleCreated), - // ProvisioningState: to.Ptr(armsql.ProvisioningStateSucceeded), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-21T19:12:00.8707045Z"); return t}()), - // }, - // }, - // { - // Name: to.Ptr("aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), - // Type: to.Ptr("Microsoft.Sql/servers/jobAgents/jobs/executions"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/jobs/job2/executions/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), - // Properties: &armsql.JobExecutionProperties{ - // CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-15T19:02:00.8707045Z"); return t}()), - // CurrentAttempts: to.Ptr[int32](1), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-15T19:22:00.8707045Z"); return t}()), - // JobExecutionID: to.Ptr("aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), - // JobVersion: to.Ptr[int32](1), - // LastMessage: to.Ptr("Job execution succeeded."), - // Lifecycle: to.Ptr(armsql.JobExecutionLifecycleSucceeded), - // ProvisioningState: to.Ptr(armsql.ProvisioningStateSucceeded), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-15T19:12:00.8707045Z"); return t}()), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CancelJobExecution.json -func ExampleJobExecutionsClient_Cancel() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewJobExecutionsClient().Cancel(ctx, "group1", "server1", "agent1", "job1", "5A86BF65-43AC-F258-2524-9E92992F97CA", 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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateJobExecution.json -func ExampleJobExecutionsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewJobExecutionsClient().BeginCreate(ctx, "group1", "server1", "agent1", "job1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.JobExecution = armsql.JobExecution{ - // Name: to.Ptr("5555-6666-7777-8888-999999999999"), - // Type: to.Ptr("Microsoft.Sql/servers/jobAgents/executions"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/jobs/job1/executions/5555-6666-7777-8888-999999999999"), - // Properties: &armsql.JobExecutionProperties{ - // CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-09-23T01:00:00Z"); return t}()), - // CurrentAttempts: to.Ptr[int32](0), - // JobExecutionID: to.Ptr("5A86BF65-43AC-F258-2524-9E92992F97CA"), - // JobVersion: to.Ptr[int32](1), - // LastMessage: to.Ptr("Job execution created."), - // Lifecycle: to.Ptr(armsql.JobExecutionLifecycleCreated), - // ProvisioningState: to.Ptr(armsql.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobExecutionsByJob.json -func ExampleJobExecutionsClient_NewListByJobPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewJobExecutionsClient().NewListByJobPager("group1", "server1", "agent1", "job1", &armsql.JobExecutionsClientListByJobOptions{CreateTimeMin: nil, - CreateTimeMax: nil, - EndTimeMin: nil, - EndTimeMax: nil, - IsActive: nil, - Skip: nil, - Top: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.JobExecutionListResult = armsql.JobExecutionListResult{ - // Value: []*armsql.JobExecution{ - // { - // Name: to.Ptr("5555-6666-7777-8888-999999999999"), - // Type: to.Ptr("Microsoft.Sql/servers/jobAgents/jobs/executions"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/jobs/job1/executions/5555-6666-7777-8888-999999999999"), - // Properties: &armsql.JobExecutionProperties{ - // CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-21T19:02:00.8707045Z"); return t}()), - // CurrentAttemptStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-21T19:12:00.8707045Z"); return t}()), - // CurrentAttempts: to.Ptr[int32](0), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-21T19:22:00.8707045Z"); return t}()), - // JobExecutionID: to.Ptr("5A86BF65-43AC-F258-2524-9E92992F97CA"), - // JobVersion: to.Ptr[int32](1), - // LastMessage: to.Ptr("Job execution created."), - // Lifecycle: to.Ptr(armsql.JobExecutionLifecycleCreated), - // ProvisioningState: to.Ptr(armsql.ProvisioningStateSucceeded), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-21T19:12:00.8707045Z"); return t}()), - // }, - // }, - // { - // Name: to.Ptr("aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), - // Type: to.Ptr("Microsoft.Sql/servers/jobAgents/jobs/executions"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/jobs/job1/executions/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), - // Properties: &armsql.JobExecutionProperties{ - // CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-15T19:02:00.8707045Z"); return t}()), - // CurrentAttempts: to.Ptr[int32](1), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-15T19:22:00.8707045Z"); return t}()), - // JobExecutionID: to.Ptr("aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), - // JobVersion: to.Ptr[int32](1), - // LastMessage: to.Ptr("Job execution succeeded."), - // Lifecycle: to.Ptr(armsql.JobExecutionLifecycleSucceeded), - // ProvisioningState: to.Ptr(armsql.ProvisioningStateSucceeded), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-15T19:12:00.8707045Z"); return t}()), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobExecution.json -func ExampleJobExecutionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewJobExecutionsClient().Get(ctx, "group1", "server1", "agent1", "job1", "5A86BF65-43AC-F258-2524-9E92992F97CA", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.JobExecution = armsql.JobExecution{ - // Name: to.Ptr("5555-6666-7777-8888-999999999999"), - // Type: to.Ptr("Microsoft.Sql/servers/jobAgents/executions"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/jobs/job1/executions/5555-6666-7777-8888-999999999999"), - // Properties: &armsql.JobExecutionProperties{ - // CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-21T19:02:00.8707045Z"); return t}()), - // CurrentAttemptStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-13T19:12:00.8707045Z"); return t}()), - // CurrentAttempts: to.Ptr[int32](0), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-21T19:22:00.8707045Z"); return t}()), - // JobExecutionID: to.Ptr("5A86BF65-43AC-F258-2524-9E92992F97CA"), - // JobVersion: to.Ptr[int32](1), - // LastMessage: to.Ptr("Job execution created."), - // Lifecycle: to.Ptr(armsql.JobExecutionLifecycleCreated), - // ProvisioningState: to.Ptr(armsql.ProvisioningStateSucceeded), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-21T19:12:00.8707045Z"); return t}()), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobExecution.json -func ExampleJobExecutionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewJobExecutionsClient().BeginCreateOrUpdate(ctx, "group1", "server1", "agent1", "job1", "5A86BF65-43AC-F258-2524-9E92992F97CA", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.JobExecution = armsql.JobExecution{ - // Name: to.Ptr("5555-6666-7777-8888-999999999999"), - // Type: to.Ptr("Microsoft.Sql/servers/jobAgents/executions"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/jobs/job1/executions/5555-6666-7777-8888-999999999999"), - // Properties: &armsql.JobExecutionProperties{ - // CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-18T19:02:00.8707045Z"); return t}()), - // CurrentAttempts: to.Ptr[int32](0), - // JobExecutionID: to.Ptr("5A86BF65-43AC-F258-2524-9E92992F97CA"), - // JobVersion: to.Ptr[int32](1), - // LastMessage: to.Ptr("Job execution created."), - // Lifecycle: to.Ptr(armsql.JobExecutionLifecycleCreated), - // ProvisioningState: to.Ptr(armsql.ProvisioningStateSucceeded), - // }, - // } -} diff --git a/sdk/resourcemanager/sql/armsql/jobs_client.go b/sdk/resourcemanager/sql/armsql/jobs_client.go index bc176d3bd02e..c28024f4656f 100644 --- a/sdk/resourcemanager/sql/armsql/jobs_client.go +++ b/sdk/resourcemanager/sql/armsql/jobs_client.go @@ -46,7 +46,7 @@ func NewJobsClient(subscriptionID string, credential azcore.TokenCredential, opt // CreateOrUpdate - Creates or updates a job. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -100,7 +100,7 @@ func (client *JobsClient) createOrUpdateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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 *JobsClient) createOrUpdateHandleResponse(resp *http.Response) (Job // Delete - Deletes a job. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -173,7 +173,7 @@ func (client *JobsClient) deleteCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -181,7 +181,7 @@ func (client *JobsClient) deleteCreateRequest(ctx context.Context, resourceGroup // Get - Gets a job. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -234,7 +234,7 @@ func (client *JobsClient) getCreateRequest(ctx context.Context, resourceGroupNam return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -251,7 +251,7 @@ func (client *JobsClient) getHandleResponse(resp *http.Response) (JobsClientGetR // NewListByAgentPager - Gets a list of jobs. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -309,7 +309,7 @@ func (client *JobsClient) listByAgentCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/jobs_client_example_test.go b/sdk/resourcemanager/sql/armsql/jobs_client_example_test.go deleted file mode 100644 index e72e95f77d58..000000000000 --- a/sdk/resourcemanager/sql/armsql/jobs_client_example_test.go +++ /dev/null @@ -1,229 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobsByAgent.json -func ExampleJobsClient_NewListByAgentPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewJobsClient().NewListByAgentPager("group1", "server1", "agent1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.JobListResult = armsql.JobListResult{ - // Value: []*armsql.Job{ - // { - // Name: to.Ptr("job1"), - // Type: to.Ptr("Microsoft.Sql/servers/jobAccounts/jobs"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/jobs/job1"), - // Properties: &armsql.JobProperties{ - // Description: to.Ptr("my favourite job"), - // Schedule: &armsql.JobSchedule{ - // Type: to.Ptr(armsql.JobScheduleTypeRecurring), - // Enabled: to.Ptr(true), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-09-24T23:59:59Z"); return t}()), - // Interval: to.Ptr("PT5M"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-09-24T18:30:01Z"); return t}()), - // }, - // Version: to.Ptr[int32](0), - // }, - // }, - // { - // Name: to.Ptr("job3"), - // Type: to.Ptr("Microsoft.Sql/servers/jobAccounts/jobs"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/jobs/job3"), - // Properties: &armsql.JobProperties{ - // Description: to.Ptr("this job will be scheduled once"), - // Schedule: &armsql.JobSchedule{ - // Type: to.Ptr(armsql.JobScheduleTypeOnce), - // Enabled: to.Ptr(true), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-27T06:00:00Z"); return t}()), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-07-01T03:45:00Z"); return t}()), - // }, - // Version: to.Ptr[int32](1), - // }, - // }, - // { - // Name: to.Ptr("job2"), - // Type: to.Ptr("Microsoft.Sql/servers/jobAccounts/jobs"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/jobs/job2"), - // Properties: &armsql.JobProperties{ - // Description: to.Ptr("this job will never be automatically scheduled"), - // Schedule: &armsql.JobSchedule{ - // Type: to.Ptr(armsql.JobScheduleTypeOnce), - // Enabled: to.Ptr(false), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-27T06:00:00Z"); return t}()), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-07-01T03:45:00Z"); return t}()), - // }, - // Version: to.Ptr[int32](1), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJob.json -func ExampleJobsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewJobsClient().Get(ctx, "group1", "server1", "agent1", "job1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Job = armsql.Job{ - // Name: to.Ptr("job1"), - // Type: to.Ptr("Microsoft.Sql/servers/jobAccounts/jobs"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/jobs/job1"), - // Properties: &armsql.JobProperties{ - // Description: to.Ptr("my favourite job"), - // Schedule: &armsql.JobSchedule{ - // Type: to.Ptr(armsql.JobScheduleTypeOnce), - // Enabled: to.Ptr(true), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-09-24T23:59:59Z"); return t}()), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-09-24T18:30:01Z"); return t}()), - // }, - // Version: to.Ptr[int32](0), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobMax.json -func ExampleJobsClient_CreateOrUpdate_createAJobWithAllPropertiesSpecified() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewJobsClient().CreateOrUpdate(ctx, "group1", "server1", "agent1", "job1", armsql.Job{ - Properties: &armsql.JobProperties{ - Description: to.Ptr("my favourite job"), - Schedule: &armsql.JobSchedule{ - Type: to.Ptr(armsql.JobScheduleTypeRecurring), - Enabled: to.Ptr(true), - EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-09-24T23:59:59Z"); return t }()), - Interval: to.Ptr("PT5M"), - StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-09-24T18:30:01Z"); return t }()), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Job = armsql.Job{ - // Name: to.Ptr("job1"), - // Type: to.Ptr("Microsoft.Sql/servers/jobAccounts/jobs"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/jobs/job1"), - // Properties: &armsql.JobProperties{ - // Description: to.Ptr("my favourite job"), - // Schedule: &armsql.JobSchedule{ - // Type: to.Ptr(armsql.JobScheduleTypeRecurring), - // Enabled: to.Ptr(true), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-09-24T23:59:59Z"); return t}()), - // Interval: to.Ptr("PT5M"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-09-24T18:30:01Z"); return t}()), - // }, - // Version: to.Ptr[int32](0), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobMin.json -func ExampleJobsClient_CreateOrUpdate_createAJobWithDefaultProperties() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewJobsClient().CreateOrUpdate(ctx, "group1", "server1", "agent1", "job1", armsql.Job{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Job = armsql.Job{ - // Name: to.Ptr("job1"), - // Type: to.Ptr("Microsoft.Sql/servers/jobAccounts/jobs"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/jobs/job1"), - // Properties: &armsql.JobProperties{ - // Description: to.Ptr(""), - // Schedule: &armsql.JobSchedule{ - // Type: to.Ptr(armsql.JobScheduleTypeOnce), - // Enabled: to.Ptr(false), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "9999-12-31T11:59:59Z"); return t}()), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "0001-01-01T00:00:00Z"); return t}()), - // }, - // Version: to.Ptr[int32](0), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteJob.json -func ExampleJobsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewJobsClient().Delete(ctx, "group1", "server1", "agent1", "job1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/sql/armsql/jobstepexecutions_client.go b/sdk/resourcemanager/sql/armsql/jobstepexecutions_client.go index 0dfd3cba0f6d..1897f2c719e5 100644 --- a/sdk/resourcemanager/sql/armsql/jobstepexecutions_client.go +++ b/sdk/resourcemanager/sql/armsql/jobstepexecutions_client.go @@ -48,7 +48,7 @@ func NewJobStepExecutionsClient(subscriptionID string, credential azcore.TokenCr // Get - Gets a step execution of a job execution. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -108,7 +108,7 @@ func (client *JobStepExecutionsClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -125,7 +125,7 @@ func (client *JobStepExecutionsClient) getHandleResponse(resp *http.Response) (J // NewListByJobExecutionPager - Lists the step executions of a job execution. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -207,12 +207,12 @@ func (client *JobStepExecutionsClient) listByJobExecutionCreateRequest(ctx conte reqQP.Set("isActive", strconv.FormatBool(*options.IsActive)) } if options != nil && options.Skip != nil { - reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) + reqQP.Set("$skip", strconv.FormatInt(*options.Skip, 10)) } if options != nil && options.Top != nil { - reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + reqQP.Set("$top", strconv.FormatInt(*options.Top, 10)) } - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/jobstepexecutions_client_example_test.go b/sdk/resourcemanager/sql/armsql/jobstepexecutions_client_example_test.go deleted file mode 100644 index 082805b798b6..000000000000 --- a/sdk/resourcemanager/sql/armsql/jobstepexecutions_client_example_test.go +++ /dev/null @@ -1,111 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobExecutionSteps.json -func ExampleJobStepExecutionsClient_NewListByJobExecutionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewJobStepExecutionsClient().NewListByJobExecutionPager("group1", "server1", "agent1", "job1", "5A86BF65-43AC-F258-2524-9E92992F97CA", &armsql.JobStepExecutionsClientListByJobExecutionOptions{CreateTimeMin: nil, - CreateTimeMax: nil, - EndTimeMin: nil, - EndTimeMax: nil, - IsActive: nil, - Skip: nil, - Top: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.JobExecutionListResult = armsql.JobExecutionListResult{ - // Value: []*armsql.JobExecution{ - // { - // Name: to.Ptr("step1"), - // Type: to.Ptr("Microsoft.Sql/servers/jobAgents/jobs/executions/steps"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/jobs/job1/executions/5555-6666-7777-8888-999999999999/steps/step1"), - // Properties: &armsql.JobExecutionProperties{ - // CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-03T04:33:15.7189151Z"); return t}()), - // CurrentAttemptStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-03T04:33:17.4840068Z"); return t}()), - // CurrentAttempts: to.Ptr[int32](1), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-03T04:33:19.0600862Z"); return t}()), - // JobExecutionID: to.Ptr("5A86BF65-43AC-F258-2524-9E92992F97CA"), - // JobVersion: to.Ptr[int32](1), - // LastMessage: to.Ptr("Step 1 succeeded."), - // Lifecycle: to.Ptr(armsql.JobExecutionLifecycleSucceeded), - // ProvisioningState: to.Ptr(armsql.ProvisioningStateSucceeded), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-03T04:33:16.176937Z"); return t}()), - // StepID: to.Ptr[int32](1), - // StepName: to.Ptr("step1"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobExecutionStep.json -func ExampleJobStepExecutionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewJobStepExecutionsClient().Get(ctx, "group1", "server1", "agent1", "job1", "5A86BF65-43AC-F258-2524-9E92992F97CA", "step1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.JobExecution = armsql.JobExecution{ - // Name: to.Ptr("step1"), - // Type: to.Ptr("Microsoft.Sql/servers/jobAgents/jobs/executions/steps"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/jobs/job1/executions/5555-6666-7777-8888-999999999999/steps/step1"), - // Properties: &armsql.JobExecutionProperties{ - // CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-27T04:33:15.7189151Z"); return t}()), - // CurrentAttemptStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-27T04:33:17.4840068Z"); return t}()), - // CurrentAttempts: to.Ptr[int32](1), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-27T04:33:19.0600862Z"); return t}()), - // JobExecutionID: to.Ptr("5A86BF65-43AC-F258-2524-9E92992F97CA"), - // JobVersion: to.Ptr[int32](1), - // LastMessage: to.Ptr("Step 1 succeeded."), - // Lifecycle: to.Ptr(armsql.JobExecutionLifecycleSucceeded), - // ProvisioningState: to.Ptr(armsql.ProvisioningStateSucceeded), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-27T04:33:16.176937Z"); return t}()), - // StepID: to.Ptr[int32](1), - // StepName: to.Ptr("step1"), - // }, - // } -} diff --git a/sdk/resourcemanager/sql/armsql/jobsteps_client.go b/sdk/resourcemanager/sql/armsql/jobsteps_client.go index 545a40f700b5..5768f48a1b49 100644 --- a/sdk/resourcemanager/sql/armsql/jobsteps_client.go +++ b/sdk/resourcemanager/sql/armsql/jobsteps_client.go @@ -47,7 +47,7 @@ func NewJobStepsClient(subscriptionID string, credential azcore.TokenCredential, // CreateOrUpdate - Creates or updates a job step. This will implicitly create a new job version. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -106,7 +106,7 @@ func (client *JobStepsClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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 *JobStepsClient) createOrUpdateHandleResponse(resp *http.Response) // Delete - Deletes a job step. This will implicitly create a new job version. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -184,7 +184,7 @@ func (client *JobStepsClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -192,7 +192,7 @@ func (client *JobStepsClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Gets a job step in a job's current version. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -250,7 +250,7 @@ func (client *JobStepsClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -268,7 +268,7 @@ func (client *JobStepsClient) getHandleResponse(resp *http.Response) (JobStepsCl // GetByVersion - Gets the specified version of a job step. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -328,7 +328,7 @@ func (client *JobStepsClient) getByVersionCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -345,7 +345,7 @@ func (client *JobStepsClient) getByVersionHandleResponse(resp *http.Response) (J // NewListByJobPager - Gets all job steps for a job's current version. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -408,7 +408,7 @@ func (client *JobStepsClient) listByJobCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -425,7 +425,7 @@ func (client *JobStepsClient) listByJobHandleResponse(resp *http.Response) (JobS // NewListByVersionPager - Gets all job steps in the specified job version. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -491,7 +491,7 @@ func (client *JobStepsClient) listByVersionCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/jobsteps_client_example_test.go b/sdk/resourcemanager/sql/armsql/jobsteps_client_example_test.go deleted file mode 100644 index 50ad77561f77..000000000000 --- a/sdk/resourcemanager/sql/armsql/jobsteps_client_example_test.go +++ /dev/null @@ -1,454 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobStepsByVersion.json -func ExampleJobStepsClient_NewListByVersionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewJobStepsClient().NewListByVersionPager("group1", "server1", "agent1", "job1", 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.JobStepListResult = armsql.JobStepListResult{ - // Value: []*armsql.JobStep{ - // { - // Name: to.Ptr("step1"), - // Type: to.Ptr("Microsoft.Sql/servers/jobAgents/jobs/versions/steps"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/jobs/job1/versions/1/steps/step1"), - // Properties: &armsql.JobStepProperties{ - // Action: &armsql.JobStepAction{ - // Type: to.Ptr(armsql.JobStepActionTypeTSQL), - // Source: to.Ptr(armsql.JobStepActionSourceInline), - // Value: to.Ptr("select 2"), - // }, - // Credential: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/cred1"), - // ExecutionOptions: &armsql.JobStepExecutionOptions{ - // InitialRetryIntervalSeconds: to.Ptr[int32](11), - // MaximumRetryIntervalSeconds: to.Ptr[int32](222), - // RetryAttempts: to.Ptr[int32](42), - // RetryIntervalBackoffMultiplier: to.Ptr[float32](3), - // TimeoutSeconds: to.Ptr[int32](1234), - // }, - // Output: &armsql.JobStepOutput{ - // Type: to.Ptr(armsql.JobStepOutputTypeSQLDatabase), - // Credential: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/cred0"), - // DatabaseName: to.Ptr("database3"), - // ResourceGroupName: to.Ptr("group3"), - // SchemaName: to.Ptr("myschema1234"), - // ServerName: to.Ptr("server3"), - // SubscriptionID: to.Ptr("3501b905-a848-4b5d-96e8-b253f62d735a"), - // TableName: to.Ptr("mytable5678"), - // }, - // StepID: to.Ptr[int32](1), - // TargetGroup: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/targetGroups/targetGroup1"), - // }, - // }, - // { - // Name: to.Ptr("step2"), - // Type: to.Ptr("Microsoft.Sql/servers/jobAgents/jobs/versions/steps"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/jobs/job1/versions/1/steps/step2"), - // Properties: &armsql.JobStepProperties{ - // Action: &armsql.JobStepAction{ - // Type: to.Ptr(armsql.JobStepActionTypeTSQL), - // Source: to.Ptr(armsql.JobStepActionSourceInline), - // Value: to.Ptr("select 2"), - // }, - // Credential: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/cred1"), - // ExecutionOptions: &armsql.JobStepExecutionOptions{ - // InitialRetryIntervalSeconds: to.Ptr[int32](11), - // MaximumRetryIntervalSeconds: to.Ptr[int32](222), - // RetryAttempts: to.Ptr[int32](42), - // RetryIntervalBackoffMultiplier: to.Ptr[float32](3), - // TimeoutSeconds: to.Ptr[int32](1234), - // }, - // Output: &armsql.JobStepOutput{ - // Type: to.Ptr(armsql.JobStepOutputTypeSQLDatabase), - // Credential: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/cred0"), - // DatabaseName: to.Ptr("database3"), - // ResourceGroupName: to.Ptr("group3"), - // SchemaName: to.Ptr("myschema1234"), - // ServerName: to.Ptr("server3"), - // SubscriptionID: to.Ptr("3501b905-a848-4b5d-96e8-b253f62d735a"), - // TableName: to.Ptr("mytable5678"), - // }, - // StepID: to.Ptr[int32](2), - // TargetGroup: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/targetGroups/targetGroup1"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobStepByVersion.json -func ExampleJobStepsClient_GetByVersion() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewJobStepsClient().GetByVersion(ctx, "group1", "server1", "agent1", "job1", 1, "step1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.JobStep = armsql.JobStep{ - // Name: to.Ptr("step1"), - // Type: to.Ptr("Microsoft.Sql/servers/jobAgents/jobs/versions/steps"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/jobs/job1/versions/1/steps/step1"), - // Properties: &armsql.JobStepProperties{ - // Action: &armsql.JobStepAction{ - // Type: to.Ptr(armsql.JobStepActionTypeTSQL), - // Source: to.Ptr(armsql.JobStepActionSourceInline), - // Value: to.Ptr("select 2"), - // }, - // Credential: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/cred1"), - // ExecutionOptions: &armsql.JobStepExecutionOptions{ - // InitialRetryIntervalSeconds: to.Ptr[int32](11), - // MaximumRetryIntervalSeconds: to.Ptr[int32](222), - // RetryAttempts: to.Ptr[int32](42), - // RetryIntervalBackoffMultiplier: to.Ptr[float32](3), - // TimeoutSeconds: to.Ptr[int32](1234), - // }, - // Output: &armsql.JobStepOutput{ - // Type: to.Ptr(armsql.JobStepOutputTypeSQLDatabase), - // Credential: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/cred0"), - // DatabaseName: to.Ptr("database3"), - // ResourceGroupName: to.Ptr("group3"), - // SchemaName: to.Ptr("myschema1234"), - // ServerName: to.Ptr("server3"), - // SubscriptionID: to.Ptr("3501b905-a848-4b5d-96e8-b253f62d735a"), - // TableName: to.Ptr("mytable5678"), - // }, - // StepID: to.Ptr[int32](1), - // TargetGroup: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/targetGroups/targetGroup1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobStepsByJob.json -func ExampleJobStepsClient_NewListByJobPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewJobStepsClient().NewListByJobPager("group1", "server1", "agent1", "job1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.JobStepListResult = armsql.JobStepListResult{ - // Value: []*armsql.JobStep{ - // { - // Name: to.Ptr("step1"), - // Type: to.Ptr("Microsoft.Sql/servers/jobAgents/jobs/steps"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/jobs/job1/steps/step1"), - // Properties: &armsql.JobStepProperties{ - // Action: &armsql.JobStepAction{ - // Type: to.Ptr(armsql.JobStepActionTypeTSQL), - // Source: to.Ptr(armsql.JobStepActionSourceInline), - // Value: to.Ptr("select 2"), - // }, - // Credential: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/cred1"), - // ExecutionOptions: &armsql.JobStepExecutionOptions{ - // InitialRetryIntervalSeconds: to.Ptr[int32](11), - // MaximumRetryIntervalSeconds: to.Ptr[int32](222), - // RetryAttempts: to.Ptr[int32](42), - // RetryIntervalBackoffMultiplier: to.Ptr[float32](3), - // TimeoutSeconds: to.Ptr[int32](1234), - // }, - // Output: &armsql.JobStepOutput{ - // Type: to.Ptr(armsql.JobStepOutputTypeSQLDatabase), - // Credential: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/cred0"), - // DatabaseName: to.Ptr("database3"), - // ResourceGroupName: to.Ptr("group3"), - // SchemaName: to.Ptr("myschema1234"), - // ServerName: to.Ptr("server3"), - // SubscriptionID: to.Ptr("3501b905-a848-4b5d-96e8-b253f62d735a"), - // TableName: to.Ptr("mytable5678"), - // }, - // StepID: to.Ptr[int32](1), - // TargetGroup: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/targetGroups/targetGroup1"), - // }, - // }, - // { - // Name: to.Ptr("step2"), - // Type: to.Ptr("Microsoft.Sql/servers/jobAgents/jobs/steps"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/jobs/job1/steps/step2"), - // Properties: &armsql.JobStepProperties{ - // Action: &armsql.JobStepAction{ - // Type: to.Ptr(armsql.JobStepActionTypeTSQL), - // Source: to.Ptr(armsql.JobStepActionSourceInline), - // Value: to.Ptr("select 2"), - // }, - // Credential: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/cred1"), - // ExecutionOptions: &armsql.JobStepExecutionOptions{ - // InitialRetryIntervalSeconds: to.Ptr[int32](11), - // MaximumRetryIntervalSeconds: to.Ptr[int32](222), - // RetryAttempts: to.Ptr[int32](42), - // RetryIntervalBackoffMultiplier: to.Ptr[float32](3), - // TimeoutSeconds: to.Ptr[int32](1234), - // }, - // Output: &armsql.JobStepOutput{ - // Type: to.Ptr(armsql.JobStepOutputTypeSQLDatabase), - // Credential: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/cred0"), - // DatabaseName: to.Ptr("database3"), - // ResourceGroupName: to.Ptr("group3"), - // SchemaName: to.Ptr("myschema1234"), - // ServerName: to.Ptr("server3"), - // SubscriptionID: to.Ptr("3501b905-a848-4b5d-96e8-b253f62d735a"), - // TableName: to.Ptr("mytable5678"), - // }, - // StepID: to.Ptr[int32](2), - // TargetGroup: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/targetGroups/targetGroup1"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobStepByJob.json -func ExampleJobStepsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewJobStepsClient().Get(ctx, "group1", "server1", "agent1", "job1", "step1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.JobStep = armsql.JobStep{ - // Name: to.Ptr("step1"), - // Type: to.Ptr("Microsoft.Sql/servers/jobAgents/jobs/steps"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/jobs/job1/steps/step1"), - // Properties: &armsql.JobStepProperties{ - // Action: &armsql.JobStepAction{ - // Type: to.Ptr(armsql.JobStepActionTypeTSQL), - // Source: to.Ptr(armsql.JobStepActionSourceInline), - // Value: to.Ptr("select 2"), - // }, - // Credential: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/cred1"), - // ExecutionOptions: &armsql.JobStepExecutionOptions{ - // InitialRetryIntervalSeconds: to.Ptr[int32](11), - // MaximumRetryIntervalSeconds: to.Ptr[int32](222), - // RetryAttempts: to.Ptr[int32](42), - // RetryIntervalBackoffMultiplier: to.Ptr[float32](3), - // TimeoutSeconds: to.Ptr[int32](1234), - // }, - // Output: &armsql.JobStepOutput{ - // Type: to.Ptr(armsql.JobStepOutputTypeSQLDatabase), - // Credential: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/cred0"), - // DatabaseName: to.Ptr("database3"), - // ResourceGroupName: to.Ptr("group3"), - // SchemaName: to.Ptr("myschema1234"), - // ServerName: to.Ptr("server3"), - // SubscriptionID: to.Ptr("3501b905-a848-4b5d-96e8-b253f62d735a"), - // TableName: to.Ptr("mytable5678"), - // }, - // StepID: to.Ptr[int32](1), - // TargetGroup: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/targetGroups/targetGroup1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobStepMax.json -func ExampleJobStepsClient_CreateOrUpdate_createOrUpdateAJobStepWithAllPropertiesSpecified() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewJobStepsClient().CreateOrUpdate(ctx, "group1", "server1", "agent1", "job1", "step1", armsql.JobStep{ - Properties: &armsql.JobStepProperties{ - Action: &armsql.JobStepAction{ - Type: to.Ptr(armsql.JobStepActionTypeTSQL), - Source: to.Ptr(armsql.JobStepActionSourceInline), - Value: to.Ptr("select 2"), - }, - Credential: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/cred1"), - ExecutionOptions: &armsql.JobStepExecutionOptions{ - InitialRetryIntervalSeconds: to.Ptr[int32](11), - MaximumRetryIntervalSeconds: to.Ptr[int32](222), - RetryAttempts: to.Ptr[int32](42), - RetryIntervalBackoffMultiplier: to.Ptr[float32](3), - TimeoutSeconds: to.Ptr[int32](1234), - }, - Output: &armsql.JobStepOutput{ - Type: to.Ptr(armsql.JobStepOutputTypeSQLDatabase), - Credential: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/cred0"), - DatabaseName: to.Ptr("database3"), - ResourceGroupName: to.Ptr("group3"), - SchemaName: to.Ptr("myschema1234"), - ServerName: to.Ptr("server3"), - SubscriptionID: to.Ptr("3501b905-a848-4b5d-96e8-b253f62d735a"), - TableName: to.Ptr("mytable5678"), - }, - StepID: to.Ptr[int32](1), - TargetGroup: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/targetGroups/targetGroup1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.JobStep = armsql.JobStep{ - // Name: to.Ptr("step1"), - // Type: to.Ptr("Microsoft.Sql/servers/jobAgents/jobs/steps"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/jobs/job1/steps/step1"), - // Properties: &armsql.JobStepProperties{ - // Action: &armsql.JobStepAction{ - // Type: to.Ptr(armsql.JobStepActionTypeTSQL), - // Source: to.Ptr(armsql.JobStepActionSourceInline), - // Value: to.Ptr("select 2"), - // }, - // Credential: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/cred1"), - // ExecutionOptions: &armsql.JobStepExecutionOptions{ - // InitialRetryIntervalSeconds: to.Ptr[int32](11), - // MaximumRetryIntervalSeconds: to.Ptr[int32](222), - // RetryAttempts: to.Ptr[int32](42), - // RetryIntervalBackoffMultiplier: to.Ptr[float32](3), - // TimeoutSeconds: to.Ptr[int32](1234), - // }, - // Output: &armsql.JobStepOutput{ - // Type: to.Ptr(armsql.JobStepOutputTypeSQLDatabase), - // Credential: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/cred0"), - // DatabaseName: to.Ptr("database3"), - // ResourceGroupName: to.Ptr("group3"), - // SchemaName: to.Ptr("myschema1234"), - // ServerName: to.Ptr("server3"), - // SubscriptionID: to.Ptr("3501b905-a848-4b5d-96e8-b253f62d735a"), - // TableName: to.Ptr("mytable5678"), - // }, - // StepID: to.Ptr[int32](1), - // TargetGroup: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/targetGroups/targetGroup1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobStepMin.json -func ExampleJobStepsClient_CreateOrUpdate_createOrUpdateAJobStepWithMinimalPropertiesSpecified() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewJobStepsClient().CreateOrUpdate(ctx, "group1", "server1", "agent1", "job1", "step1", armsql.JobStep{ - Properties: &armsql.JobStepProperties{ - Action: &armsql.JobStepAction{ - Value: to.Ptr("select 1"), - }, - Credential: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/cred0"), - TargetGroup: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/targetGroups/targetGroup0"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.JobStep = armsql.JobStep{ - // Name: to.Ptr("step1"), - // Type: to.Ptr("Microsoft.Sql/servers/jobAgents/jobs/steps"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/jobs/job1/steps/step1"), - // Properties: &armsql.JobStepProperties{ - // Action: &armsql.JobStepAction{ - // Type: to.Ptr(armsql.JobStepActionTypeTSQL), - // Source: to.Ptr(armsql.JobStepActionSourceInline), - // Value: to.Ptr("select 1"), - // }, - // Credential: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/cred0"), - // ExecutionOptions: &armsql.JobStepExecutionOptions{ - // InitialRetryIntervalSeconds: to.Ptr[int32](1), - // MaximumRetryIntervalSeconds: to.Ptr[int32](120), - // RetryAttempts: to.Ptr[int32](10), - // RetryIntervalBackoffMultiplier: to.Ptr[float32](2), - // TimeoutSeconds: to.Ptr[int32](43200), - // }, - // StepID: to.Ptr[int32](1), - // TargetGroup: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/targetGroups/targetGroup0"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteJobStep.json -func ExampleJobStepsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewJobStepsClient().Delete(ctx, "group1", "server1", "agent1", "job1", "step1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/sql/armsql/jobtargetexecutions_client.go b/sdk/resourcemanager/sql/armsql/jobtargetexecutions_client.go index f146b1eb8fcf..2bb559332170 100644 --- a/sdk/resourcemanager/sql/armsql/jobtargetexecutions_client.go +++ b/sdk/resourcemanager/sql/armsql/jobtargetexecutions_client.go @@ -48,7 +48,7 @@ func NewJobTargetExecutionsClient(subscriptionID string, credential azcore.Token // Get - Gets a target execution. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -110,7 +110,7 @@ func (client *JobTargetExecutionsClient) getCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -127,7 +127,7 @@ func (client *JobTargetExecutionsClient) getHandleResponse(resp *http.Response) // NewListByJobExecutionPager - Lists target executions for all steps of a job execution. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -209,12 +209,12 @@ func (client *JobTargetExecutionsClient) listByJobExecutionCreateRequest(ctx con reqQP.Set("isActive", strconv.FormatBool(*options.IsActive)) } if options != nil && options.Skip != nil { - reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) + reqQP.Set("$skip", strconv.FormatInt(*options.Skip, 10)) } if options != nil && options.Top != nil { - reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + reqQP.Set("$top", strconv.FormatInt(*options.Top, 10)) } - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -231,7 +231,7 @@ func (client *JobTargetExecutionsClient) listByJobExecutionHandleResponse(resp * // NewListByStepPager - Lists the target executions of a job step execution. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -318,12 +318,12 @@ func (client *JobTargetExecutionsClient) listByStepCreateRequest(ctx context.Con reqQP.Set("isActive", strconv.FormatBool(*options.IsActive)) } if options != nil && options.Skip != nil { - reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) + reqQP.Set("$skip", strconv.FormatInt(*options.Skip, 10)) } if options != nil && options.Top != nil { - reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + reqQP.Set("$top", strconv.FormatInt(*options.Top, 10)) } - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/jobtargetexecutions_client_example_test.go b/sdk/resourcemanager/sql/armsql/jobtargetexecutions_client_example_test.go deleted file mode 100644 index 2bb130d2295f..000000000000 --- a/sdk/resourcemanager/sql/armsql/jobtargetexecutions_client_example_test.go +++ /dev/null @@ -1,180 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobExecutionTargetsByExecution.json -func ExampleJobTargetExecutionsClient_NewListByJobExecutionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewJobTargetExecutionsClient().NewListByJobExecutionPager("group1", "server1", "agent1", "job1", "5A86BF65-43AC-F258-2524-9E92992F97CA", &armsql.JobTargetExecutionsClientListByJobExecutionOptions{CreateTimeMin: nil, - CreateTimeMax: nil, - EndTimeMin: nil, - EndTimeMax: nil, - IsActive: nil, - Skip: nil, - Top: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.JobExecutionListResult = armsql.JobExecutionListResult{ - // Value: []*armsql.JobExecution{ - // { - // Name: to.Ptr("aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), - // Type: to.Ptr("Microsoft.Sql/servers/jobAgents/jobs/executions/steps/targets"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/jobs/job1/executions/5555-6666-7777-8888-999999999999/steps/step1/targets/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), - // Properties: &armsql.JobExecutionProperties{ - // CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-07-01T04:33:17.5133333Z"); return t}()), - // CurrentAttemptStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-07-01T04:33:18.2391013Z"); return t}()), - // CurrentAttempts: to.Ptr[int32](1), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-07-01T04:33:18.7031029Z"); return t}()), - // JobExecutionID: to.Ptr("5A86BF65-43AC-F258-2524-9E92992F97CA"), - // JobVersion: to.Ptr[int32](1), - // LastMessage: to.Ptr("Step 1 succeeded execution on target (server 'server1', database 'database1')."), - // Lifecycle: to.Ptr(armsql.JobExecutionLifecycleSucceeded), - // ProvisioningState: to.Ptr(armsql.ProvisioningStateSucceeded), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-07-01T04:33:18.1230403Z"); return t}()), - // StepID: to.Ptr[int32](1), - // StepName: to.Ptr("step1"), - // Target: &armsql.JobExecutionTarget{ - // Type: to.Ptr(armsql.JobTargetTypeSQLDatabase), - // DatabaseName: to.Ptr("database1"), - // ServerName: to.Ptr("server1"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobExecutionTargetsByStep.json -func ExampleJobTargetExecutionsClient_NewListByStepPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewJobTargetExecutionsClient().NewListByStepPager("group1", "server1", "agent1", "job1", "5A86BF65-43AC-F258-2524-9E92992F97CA", "step1", &armsql.JobTargetExecutionsClientListByStepOptions{CreateTimeMin: nil, - CreateTimeMax: nil, - EndTimeMin: nil, - EndTimeMax: nil, - IsActive: nil, - Skip: nil, - Top: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.JobExecutionListResult = armsql.JobExecutionListResult{ - // Value: []*armsql.JobExecution{ - // { - // Name: to.Ptr("aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), - // Type: to.Ptr("Microsoft.Sql/servers/jobAgents/jobs/executions/steps/targets"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/jobs/job1/executions/5555-6666-7777-8888-999999999999/steps/step1/targets/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), - // Properties: &armsql.JobExecutionProperties{ - // CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-07-01T04:33:17.5133333Z"); return t}()), - // CurrentAttemptStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-07-01T04:33:18.2391013Z"); return t}()), - // CurrentAttempts: to.Ptr[int32](1), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-07-01T04:33:18.7031029Z"); return t}()), - // JobExecutionID: to.Ptr("5A86BF65-43AC-F258-2524-9E92992F97CA"), - // JobVersion: to.Ptr[int32](1), - // LastMessage: to.Ptr("Step 1 succeeded execution on target (server 'server1', database 'database1')."), - // Lifecycle: to.Ptr(armsql.JobExecutionLifecycleSucceeded), - // ProvisioningState: to.Ptr(armsql.ProvisioningStateSucceeded), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-07-01T04:33:18.1230403Z"); return t}()), - // StepID: to.Ptr[int32](1), - // StepName: to.Ptr("step1"), - // Target: &armsql.JobExecutionTarget{ - // Type: to.Ptr(armsql.JobTargetTypeSQLDatabase), - // DatabaseName: to.Ptr("database1"), - // ServerName: to.Ptr("server1"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobExecutionTarget.json -func ExampleJobTargetExecutionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewJobTargetExecutionsClient().Get(ctx, "group1", "server1", "agent1", "job1", "5A86BF65-43AC-F258-2524-9E92992F97CA", "step1", "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.JobExecution = armsql.JobExecution{ - // Name: to.Ptr("aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), - // Type: to.Ptr("Microsoft.Sql/servers/jobAgents/jobs/executions/steps/targets"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/jobs/job1/executions/5555-6666-7777-8888-999999999999/steps/step1/targets/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), - // Properties: &armsql.JobExecutionProperties{ - // CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-05T04:33:17.5133333Z"); return t}()), - // CurrentAttemptStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-05T04:33:18.2391013Z"); return t}()), - // CurrentAttempts: to.Ptr[int32](1), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-05T04:33:18.7031029Z"); return t}()), - // JobExecutionID: to.Ptr("5A86BF65-43AC-F258-2524-9E92992F97CA"), - // JobVersion: to.Ptr[int32](1), - // LastMessage: to.Ptr("Step 1 succeeded execution on target (server 'server1', database 'database1')."), - // Lifecycle: to.Ptr(armsql.JobExecutionLifecycleSucceeded), - // ProvisioningState: to.Ptr(armsql.ProvisioningStateSucceeded), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-05T04:33:18.1230403Z"); return t}()), - // StepID: to.Ptr[int32](1), - // StepName: to.Ptr("step1"), - // Target: &armsql.JobExecutionTarget{ - // Type: to.Ptr(armsql.JobTargetTypeSQLDatabase), - // DatabaseName: to.Ptr("database1"), - // ServerName: to.Ptr("server1"), - // }, - // }, - // } -} diff --git a/sdk/resourcemanager/sql/armsql/jobtargetgroups_client.go b/sdk/resourcemanager/sql/armsql/jobtargetgroups_client.go index e878d5b086ea..2b96a6cd067e 100644 --- a/sdk/resourcemanager/sql/armsql/jobtargetgroups_client.go +++ b/sdk/resourcemanager/sql/armsql/jobtargetgroups_client.go @@ -46,7 +46,7 @@ func NewJobTargetGroupsClient(subscriptionID string, credential azcore.TokenCred // CreateOrUpdate - Creates or updates a target group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -101,7 +101,7 @@ func (client *JobTargetGroupsClient) createOrUpdateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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 *JobTargetGroupsClient) createOrUpdateHandleResponse(resp *http.Res // Delete - Deletes a target group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -174,7 +174,7 @@ func (client *JobTargetGroupsClient) deleteCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -182,7 +182,7 @@ func (client *JobTargetGroupsClient) deleteCreateRequest(ctx context.Context, re // Get - Gets a target group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -235,7 +235,7 @@ func (client *JobTargetGroupsClient) getCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -252,7 +252,7 @@ func (client *JobTargetGroupsClient) getHandleResponse(resp *http.Response) (Job // NewListByAgentPager - Gets all target groups in an agent. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -311,7 +311,7 @@ func (client *JobTargetGroupsClient) listByAgentCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/jobtargetgroups_client_example_test.go b/sdk/resourcemanager/sql/armsql/jobtargetgroups_client_example_test.go deleted file mode 100644 index 6d912b44d861..000000000000 --- a/sdk/resourcemanager/sql/armsql/jobtargetgroups_client_example_test.go +++ /dev/null @@ -1,269 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobTargetGroups.json -func ExampleJobTargetGroupsClient_NewListByAgentPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewJobTargetGroupsClient().NewListByAgentPager("group1", "server1", "agent1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.JobTargetGroupListResult = armsql.JobTargetGroupListResult{ - // Value: []*armsql.JobTargetGroup{ - // { - // Name: to.Ptr("targetGroup1"), - // Type: to.Ptr("Microsoft.Sql/servers/jobAgents/targetGroups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/targetGroups/targetGroup1"), - // Properties: &armsql.JobTargetGroupProperties{ - // Members: []*armsql.JobTarget{ - // { - // Type: to.Ptr(armsql.JobTargetTypeSQLDatabase), - // DatabaseName: to.Ptr("database1"), - // MembershipType: to.Ptr(armsql.JobTargetGroupMembershipTypeExclude), - // ServerName: to.Ptr("server1"), - // }, - // { - // Type: to.Ptr(armsql.JobTargetTypeSQLServer), - // MembershipType: to.Ptr(armsql.JobTargetGroupMembershipTypeInclude), - // RefreshCredential: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/testCredential"), - // ServerName: to.Ptr("server1"), - // }, - // { - // Type: to.Ptr(armsql.JobTargetTypeSQLElasticPool), - // ElasticPoolName: to.Ptr("pool1"), - // MembershipType: to.Ptr(armsql.JobTargetGroupMembershipTypeInclude), - // RefreshCredential: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/testCredential"), - // ServerName: to.Ptr("server2"), - // }, - // { - // Type: to.Ptr(armsql.JobTargetTypeSQLShardMap), - // MembershipType: to.Ptr(armsql.JobTargetGroupMembershipTypeInclude), - // RefreshCredential: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/testCredential"), - // ServerName: to.Ptr("server3"), - // ShardMapName: to.Ptr("shardMap1"), - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobTargetGroup.json -func ExampleJobTargetGroupsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewJobTargetGroupsClient().Get(ctx, "group1", "server1", "agent1", "targetGroup1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.JobTargetGroup = armsql.JobTargetGroup{ - // Name: to.Ptr("targetGroup1"), - // Type: to.Ptr("Microsoft.Sql/servers/jobAgents/targetGroups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/targetGroups/targetGroup1"), - // Properties: &armsql.JobTargetGroupProperties{ - // Members: []*armsql.JobTarget{ - // { - // Type: to.Ptr(armsql.JobTargetTypeSQLDatabase), - // DatabaseName: to.Ptr("database1"), - // MembershipType: to.Ptr(armsql.JobTargetGroupMembershipTypeExclude), - // ServerName: to.Ptr("server1"), - // }, - // { - // Type: to.Ptr(armsql.JobTargetTypeSQLServer), - // MembershipType: to.Ptr(armsql.JobTargetGroupMembershipTypeInclude), - // RefreshCredential: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/testCredential"), - // ServerName: to.Ptr("server1"), - // }, - // { - // Type: to.Ptr(armsql.JobTargetTypeSQLElasticPool), - // ElasticPoolName: to.Ptr("pool1"), - // MembershipType: to.Ptr(armsql.JobTargetGroupMembershipTypeInclude), - // RefreshCredential: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/testCredential"), - // ServerName: to.Ptr("server2"), - // }, - // { - // Type: to.Ptr(armsql.JobTargetTypeSQLShardMap), - // MembershipType: to.Ptr(armsql.JobTargetGroupMembershipTypeInclude), - // RefreshCredential: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/testCredential"), - // ServerName: to.Ptr("server3"), - // ShardMapName: to.Ptr("shardMap1"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobTargetGroupMax.json -func ExampleJobTargetGroupsClient_CreateOrUpdate_createOrUpdateATargetGroupWithAllProperties() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewJobTargetGroupsClient().CreateOrUpdate(ctx, "group1", "server1", "agent1", "targetGroup1", armsql.JobTargetGroup{ - Properties: &armsql.JobTargetGroupProperties{ - Members: []*armsql.JobTarget{ - { - Type: to.Ptr(armsql.JobTargetTypeSQLDatabase), - DatabaseName: to.Ptr("database1"), - MembershipType: to.Ptr(armsql.JobTargetGroupMembershipTypeExclude), - ServerName: to.Ptr("server1"), - }, - { - Type: to.Ptr(armsql.JobTargetTypeSQLServer), - MembershipType: to.Ptr(armsql.JobTargetGroupMembershipTypeInclude), - RefreshCredential: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/testCredential"), - ServerName: to.Ptr("server1"), - }, - { - Type: to.Ptr(armsql.JobTargetTypeSQLElasticPool), - ElasticPoolName: to.Ptr("pool1"), - MembershipType: to.Ptr(armsql.JobTargetGroupMembershipTypeInclude), - RefreshCredential: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/testCredential"), - ServerName: to.Ptr("server2"), - }, - { - Type: to.Ptr(armsql.JobTargetTypeSQLShardMap), - MembershipType: to.Ptr(armsql.JobTargetGroupMembershipTypeInclude), - RefreshCredential: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/testCredential"), - ServerName: to.Ptr("server3"), - ShardMapName: to.Ptr("shardMap1"), - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.JobTargetGroup = armsql.JobTargetGroup{ - // Name: to.Ptr("targetGroup1"), - // Type: to.Ptr("Microsoft.Sql/servers/jobAgents/targetGroups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/targetGroups/targetGroup1"), - // Properties: &armsql.JobTargetGroupProperties{ - // Members: []*armsql.JobTarget{ - // { - // Type: to.Ptr(armsql.JobTargetTypeSQLDatabase), - // DatabaseName: to.Ptr("database1"), - // MembershipType: to.Ptr(armsql.JobTargetGroupMembershipTypeExclude), - // ServerName: to.Ptr("server1"), - // }, - // { - // Type: to.Ptr(armsql.JobTargetTypeSQLServer), - // MembershipType: to.Ptr(armsql.JobTargetGroupMembershipTypeInclude), - // RefreshCredential: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/testCredential"), - // ServerName: to.Ptr("server1"), - // }, - // { - // Type: to.Ptr(armsql.JobTargetTypeSQLElasticPool), - // ElasticPoolName: to.Ptr("pool1"), - // MembershipType: to.Ptr(armsql.JobTargetGroupMembershipTypeInclude), - // RefreshCredential: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/testCredential"), - // ServerName: to.Ptr("server2"), - // }, - // { - // Type: to.Ptr(armsql.JobTargetTypeSQLShardMap), - // MembershipType: to.Ptr(armsql.JobTargetGroupMembershipTypeInclude), - // RefreshCredential: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/testCredential"), - // ServerName: to.Ptr("server3"), - // ShardMapName: to.Ptr("shardMap1"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobTargetGroupMin.json -func ExampleJobTargetGroupsClient_CreateOrUpdate_createOrUpdateATargetGroupWithMinimalProperties() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewJobTargetGroupsClient().CreateOrUpdate(ctx, "group1", "server1", "agent1", "targetGroup1", armsql.JobTargetGroup{ - Properties: &armsql.JobTargetGroupProperties{ - Members: []*armsql.JobTarget{}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.JobTargetGroup = armsql.JobTargetGroup{ - // Name: to.Ptr("targetGroup1"), - // Type: to.Ptr("Microsoft.Sql/servers/jobAgents/targetGroups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/targetGroups/targetGroup1"), - // Properties: &armsql.JobTargetGroupProperties{ - // Members: []*armsql.JobTarget{ - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteJobTargetGroup.json -func ExampleJobTargetGroupsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewJobTargetGroupsClient().Delete(ctx, "group1", "server1", "agent1", "targetGroup1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/sql/armsql/jobversions_client.go b/sdk/resourcemanager/sql/armsql/jobversions_client.go index a6117ffa1bb9..eeb7f5a1901a 100644 --- a/sdk/resourcemanager/sql/armsql/jobversions_client.go +++ b/sdk/resourcemanager/sql/armsql/jobversions_client.go @@ -47,7 +47,7 @@ func NewJobVersionsClient(subscriptionID string, credential azcore.TokenCredenti // Get - Gets a job version. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -102,7 +102,7 @@ func (client *JobVersionsClient) getCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -119,7 +119,7 @@ func (client *JobVersionsClient) getHandleResponse(resp *http.Response) (JobVers // NewListByJobPager - Gets all versions of a job. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -183,7 +183,7 @@ func (client *JobVersionsClient) listByJobCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/jobversions_client_example_test.go b/sdk/resourcemanager/sql/armsql/jobversions_client_example_test.go deleted file mode 100644 index e9a1901ba77b..000000000000 --- a/sdk/resourcemanager/sql/armsql/jobversions_client_example_test.go +++ /dev/null @@ -1,81 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobVersions.json -func ExampleJobVersionsClient_NewListByJobPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewJobVersionsClient().NewListByJobPager("group1", "server1", "agent1", "job1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.JobVersionListResult = armsql.JobVersionListResult{ - // Value: []*armsql.JobVersion{ - // { - // Name: to.Ptr("1"), - // Type: to.Ptr("Microsoft.Sql/servers/jobAgents/jobs/versions"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/jobs/job1/versions/1"), - // }, - // { - // Name: to.Ptr("2"), - // Type: to.Ptr("Microsoft.Sql/servers/jobAgents/jobs/versions"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/jobs/job1/versions/2"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobVersion.json -func ExampleJobVersionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewJobVersionsClient().Get(ctx, "group1", "server1", "agent1", "job1", 1, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.JobVersion = armsql.JobVersion{ - // Name: to.Ptr("1"), - // Type: to.Ptr("Microsoft.Sql/servers/jobAgents/jobs/versions"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/jobs/job1/versions/1"), - // } -} diff --git a/sdk/resourcemanager/sql/armsql/ledgerdigestuploads_client.go b/sdk/resourcemanager/sql/armsql/ledgerdigestuploads_client.go index 94ff8a243f87..1b3cc9fd0641 100644 --- a/sdk/resourcemanager/sql/armsql/ledgerdigestuploads_client.go +++ b/sdk/resourcemanager/sql/armsql/ledgerdigestuploads_client.go @@ -46,7 +46,7 @@ func NewLedgerDigestUploadsClient(subscriptionID string, credential azcore.Token // BeginCreateOrUpdate - Enables upload ledger digests to an Azure Storage account or an Azure Confidential Ledger instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-02-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -69,7 +69,7 @@ func (client *LedgerDigestUploadsClient) BeginCreateOrUpdate(ctx context.Context // CreateOrUpdate - Enables upload ledger digests to an Azure Storage account or an Azure Confidential Ledger instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-02-01-preview +// Generated from API version 2023-05-01-preview func (client *LedgerDigestUploadsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, ledgerDigestUploads LedgerDigestUploadsName, parameters LedgerDigestUploads, options *LedgerDigestUploadsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, ledgerDigestUploads, parameters, options) @@ -115,7 +115,7 @@ func (client *LedgerDigestUploadsClient) createOrUpdateCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-02-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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 *LedgerDigestUploadsClient) createOrUpdateCreateRequest(ctx context // BeginDisable - Disables uploading ledger digests to an Azure Storage account or an Azure Confidential Ledger instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-02-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -150,7 +150,7 @@ func (client *LedgerDigestUploadsClient) BeginDisable(ctx context.Context, resou // Disable - Disables uploading ledger digests to an Azure Storage account or an Azure Confidential Ledger instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-02-01-preview +// Generated from API version 2023-05-01-preview func (client *LedgerDigestUploadsClient) disable(ctx context.Context, resourceGroupName string, serverName string, databaseName string, ledgerDigestUploads LedgerDigestUploadsName, options *LedgerDigestUploadsClientBeginDisableOptions) (*http.Response, error) { var err error req, err := client.disableCreateRequest(ctx, resourceGroupName, serverName, databaseName, ledgerDigestUploads, options) @@ -196,7 +196,7 @@ func (client *LedgerDigestUploadsClient) disableCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-02-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -205,7 +205,7 @@ func (client *LedgerDigestUploadsClient) disableCreateRequest(ctx context.Contex // Get - Gets the current ledger digest upload configuration for a database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-02-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -257,7 +257,7 @@ func (client *LedgerDigestUploadsClient) getCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-02-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -274,7 +274,7 @@ func (client *LedgerDigestUploadsClient) getHandleResponse(resp *http.Response) // NewListByDatabasePager - Gets all ledger digest upload settings on a database. // -// Generated from API version 2021-02-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -333,7 +333,7 @@ func (client *LedgerDigestUploadsClient) listByDatabaseCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-02-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/ledgerdigestuploads_client_example_test.go b/sdk/resourcemanager/sql/armsql/ledgerdigestuploads_client_example_test.go deleted file mode 100644 index a39f6c3869eb..000000000000 --- a/sdk/resourcemanager/sql/armsql/ledgerdigestuploads_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 armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/LedgerDigestUploadsGet.json -func ExampleLedgerDigestUploadsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLedgerDigestUploadsClient().Get(ctx, "ledgertestrg", "ledgertestserver", "testdb", armsql.LedgerDigestUploadsNameCurrent, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LedgerDigestUploads = armsql.LedgerDigestUploads{ - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/ledgerDigestUploads"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/ledgertestrg/providers/Microsoft.Sql/servers/ledgertestserver/databases/testdb/current"), - // Properties: &armsql.LedgerDigestUploadsProperties{ - // DigestStorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - // State: to.Ptr(armsql.LedgerDigestUploadsStateEnabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/LedgerDigestUploadsEnable.json -func ExampleLedgerDigestUploadsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLedgerDigestUploadsClient().BeginCreateOrUpdate(ctx, "ledgertestrg", "ledgertestserver", "testdb", armsql.LedgerDigestUploadsNameCurrent, armsql.LedgerDigestUploads{ - Properties: &armsql.LedgerDigestUploadsProperties{ - DigestStorageEndpoint: to.Ptr("https://MyAccount.blob.core.windows.net"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LedgerDigestUploads = armsql.LedgerDigestUploads{ - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/ledgerDigestUploads"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/ledgertestrg/providers/Microsoft.Sql/servers/ledgertestserver/databases/testdb/ledgerDigestUpload/current"), - // Properties: &armsql.LedgerDigestUploadsProperties{ - // DigestStorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - // State: to.Ptr(armsql.LedgerDigestUploadsStateEnabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/LedgerDigestUploadsList.json -func ExampleLedgerDigestUploadsClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLedgerDigestUploadsClient().NewListByDatabasePager("ledgertestrg", "ledgertestserver", "testdb", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.LedgerDigestUploadsListResult = armsql.LedgerDigestUploadsListResult{ - // Value: []*armsql.LedgerDigestUploads{ - // { - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/ledgerDigestUploads"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/ledgertestrg/providers/Microsoft.Sql/servers/ledgertestserver/databases/testdb/current"), - // Properties: &armsql.LedgerDigestUploadsProperties{ - // DigestStorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - // State: to.Ptr(armsql.LedgerDigestUploadsStateEnabled), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/LedgerDigestUploadsDisable.json -func ExampleLedgerDigestUploadsClient_BeginDisable() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLedgerDigestUploadsClient().BeginDisable(ctx, "ledgertestrg", "ledgertestserver", "testdb", armsql.LedgerDigestUploadsNameCurrent, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LedgerDigestUploads = armsql.LedgerDigestUploads{ - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/ledgerDigestUploads"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/ledgertestrg/providers/Microsoft.Sql/servers/ledgertestserver/databases/testdb/ledgerDigestUpload/current/disable"), - // Properties: &armsql.LedgerDigestUploadsProperties{ - // State: to.Ptr(armsql.LedgerDigestUploadsStateDisabled), - // }, - // } -} diff --git a/sdk/resourcemanager/sql/armsql/longtermretentionbackups_client.go b/sdk/resourcemanager/sql/armsql/longtermretentionbackups_client.go index 8fe73b745cbc..67f5dce6573c 100644 --- a/sdk/resourcemanager/sql/armsql/longtermretentionbackups_client.go +++ b/sdk/resourcemanager/sql/armsql/longtermretentionbackups_client.go @@ -47,7 +47,7 @@ func NewLongTermRetentionBackupsClient(subscriptionID string, credential azcore. // BeginCopy - Copy an existing long term retention backup. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-05-01-preview +// Generated from API version 2023-05-01-preview // - locationName - The location of the database. // - longTermRetentionServerName - The name of the server // - longTermRetentionDatabaseName - The name of the database @@ -71,7 +71,7 @@ func (client *LongTermRetentionBackupsClient) BeginCopy(ctx context.Context, loc // Copy - Copy an existing long term retention backup. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-05-01-preview +// Generated from API version 2023-05-01-preview func (client *LongTermRetentionBackupsClient) copyOperation(ctx context.Context, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string, parameters CopyLongTermRetentionBackupParameters, options *LongTermRetentionBackupsClientBeginCopyOptions) (*http.Response, error) { var err error req, err := client.copyCreateRequest(ctx, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, parameters, options) @@ -117,7 +117,7 @@ func (client *LongTermRetentionBackupsClient) copyCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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 *LongTermRetentionBackupsClient) copyCreateRequest(ctx context.Cont // BeginCopyByResourceGroup - Copy an existing long term retention backup to a different server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-05-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - locationName - The location of the database. @@ -155,7 +155,7 @@ func (client *LongTermRetentionBackupsClient) BeginCopyByResourceGroup(ctx conte // CopyByResourceGroup - Copy an existing long term retention backup to a different server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-05-01-preview +// Generated from API version 2023-05-01-preview func (client *LongTermRetentionBackupsClient) copyByResourceGroup(ctx context.Context, resourceGroupName string, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string, parameters CopyLongTermRetentionBackupParameters, options *LongTermRetentionBackupsClientBeginCopyByResourceGroupOptions) (*http.Response, error) { var err error req, err := client.copyByResourceGroupCreateRequest(ctx, resourceGroupName, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, parameters, options) @@ -205,7 +205,7 @@ func (client *LongTermRetentionBackupsClient) copyByResourceGroupCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -217,7 +217,7 @@ func (client *LongTermRetentionBackupsClient) copyByResourceGroupCreateRequest(c // BeginDelete - Deletes a long term retention backup. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-05-01-preview +// Generated from API version 2023-05-01-preview // - locationName - The location of the database // - longTermRetentionServerName - The name of the server // - longTermRetentionDatabaseName - The name of the database @@ -240,7 +240,7 @@ func (client *LongTermRetentionBackupsClient) BeginDelete(ctx context.Context, l // Delete - Deletes a long term retention backup. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-05-01-preview +// Generated from API version 2023-05-01-preview func (client *LongTermRetentionBackupsClient) deleteOperation(ctx context.Context, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string, options *LongTermRetentionBackupsClientBeginDeleteOptions) (*http.Response, error) { var err error req, err := client.deleteCreateRequest(ctx, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, options) @@ -286,7 +286,7 @@ func (client *LongTermRetentionBackupsClient) deleteCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -294,7 +294,7 @@ func (client *LongTermRetentionBackupsClient) deleteCreateRequest(ctx context.Co // BeginDeleteByResourceGroup - Deletes a long term retention backup. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-05-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - locationName - The location of the database @@ -319,7 +319,7 @@ func (client *LongTermRetentionBackupsClient) BeginDeleteByResourceGroup(ctx con // DeleteByResourceGroup - Deletes a long term retention backup. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-05-01-preview +// Generated from API version 2023-05-01-preview func (client *LongTermRetentionBackupsClient) deleteByResourceGroup(ctx context.Context, resourceGroupName string, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string, options *LongTermRetentionBackupsClientBeginDeleteByResourceGroupOptions) (*http.Response, error) { var err error req, err := client.deleteByResourceGroupCreateRequest(ctx, resourceGroupName, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, options) @@ -369,7 +369,7 @@ func (client *LongTermRetentionBackupsClient) deleteByResourceGroupCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -377,7 +377,7 @@ func (client *LongTermRetentionBackupsClient) deleteByResourceGroupCreateRequest // Get - Gets a long term retention backup. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-05-01-preview +// Generated from API version 2023-05-01-preview // - locationName - The location of the database. // - longTermRetentionServerName - The name of the server // - longTermRetentionDatabaseName - The name of the database @@ -430,7 +430,7 @@ func (client *LongTermRetentionBackupsClient) getCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -448,7 +448,7 @@ func (client *LongTermRetentionBackupsClient) getHandleResponse(resp *http.Respo // GetByResourceGroup - Gets a long term retention backup. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-05-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - locationName - The location of the database. @@ -507,7 +507,7 @@ func (client *LongTermRetentionBackupsClient) getByResourceGroupCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -524,7 +524,7 @@ func (client *LongTermRetentionBackupsClient) getByResourceGroupHandleResponse(r // NewListByDatabasePager - Lists all long term retention backups for a database. // -// Generated from API version 2021-05-01-preview +// Generated from API version 2023-05-01-preview // - locationName - The location of the database // - longTermRetentionServerName - The name of the server // - longTermRetentionDatabaseName - The name of the database @@ -588,7 +588,7 @@ func (client *LongTermRetentionBackupsClient) listByDatabaseCreateRequest(ctx co if options != nil && options.DatabaseState != nil { reqQP.Set("databaseState", string(*options.DatabaseState)) } - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -605,7 +605,7 @@ func (client *LongTermRetentionBackupsClient) listByDatabaseHandleResponse(resp // NewListByLocationPager - Lists the long term retention backups for a given location. // -// Generated from API version 2021-05-01-preview +// Generated from API version 2023-05-01-preview // - locationName - The location of the database // - options - LongTermRetentionBackupsClientListByLocationOptions contains the optional parameters for the LongTermRetentionBackupsClient.NewListByLocationPager // method. @@ -659,7 +659,7 @@ func (client *LongTermRetentionBackupsClient) listByLocationCreateRequest(ctx co if options != nil && options.DatabaseState != nil { reqQP.Set("databaseState", string(*options.DatabaseState)) } - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -676,7 +676,7 @@ func (client *LongTermRetentionBackupsClient) listByLocationHandleResponse(resp // NewListByResourceGroupDatabasePager - Lists all long term retention backups for a database. // -// Generated from API version 2021-05-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - locationName - The location of the database @@ -746,7 +746,7 @@ func (client *LongTermRetentionBackupsClient) listByResourceGroupDatabaseCreateR if options != nil && options.DatabaseState != nil { reqQP.Set("databaseState", string(*options.DatabaseState)) } - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -763,7 +763,7 @@ func (client *LongTermRetentionBackupsClient) listByResourceGroupDatabaseHandleR // NewListByResourceGroupLocationPager - Lists the long term retention backups for a given location. // -// Generated from API version 2021-05-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - locationName - The location of the database @@ -823,7 +823,7 @@ func (client *LongTermRetentionBackupsClient) listByResourceGroupLocationCreateR if options != nil && options.DatabaseState != nil { reqQP.Set("databaseState", string(*options.DatabaseState)) } - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -840,7 +840,7 @@ func (client *LongTermRetentionBackupsClient) listByResourceGroupLocationHandleR // NewListByResourceGroupServerPager - Lists the long term retention backups for a given server. // -// Generated from API version 2021-05-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - locationName - The location of the database @@ -905,7 +905,7 @@ func (client *LongTermRetentionBackupsClient) listByResourceGroupServerCreateReq if options != nil && options.DatabaseState != nil { reqQP.Set("databaseState", string(*options.DatabaseState)) } - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -922,7 +922,7 @@ func (client *LongTermRetentionBackupsClient) listByResourceGroupServerHandleRes // NewListByServerPager - Lists the long term retention backups for a given server. // -// Generated from API version 2021-05-01-preview +// Generated from API version 2023-05-01-preview // - locationName - The location of the database // - longTermRetentionServerName - The name of the server // - options - LongTermRetentionBackupsClientListByServerOptions contains the optional parameters for the LongTermRetentionBackupsClient.NewListByServerPager @@ -981,7 +981,7 @@ func (client *LongTermRetentionBackupsClient) listByServerCreateRequest(ctx cont if options != nil && options.DatabaseState != nil { reqQP.Set("databaseState", string(*options.DatabaseState)) } - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -999,7 +999,7 @@ func (client *LongTermRetentionBackupsClient) listByServerHandleResponse(resp *h // BeginUpdate - Updates an existing long term retention backup. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-05-01-preview +// Generated from API version 2023-05-01-preview // - locationName - The location of the database. // - longTermRetentionServerName - The name of the server // - longTermRetentionDatabaseName - The name of the database @@ -1023,7 +1023,7 @@ func (client *LongTermRetentionBackupsClient) BeginUpdate(ctx context.Context, l // Update - Updates an existing long term retention backup. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-05-01-preview +// Generated from API version 2023-05-01-preview func (client *LongTermRetentionBackupsClient) update(ctx context.Context, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string, parameters UpdateLongTermRetentionBackupParameters, options *LongTermRetentionBackupsClientBeginUpdateOptions) (*http.Response, error) { var err error req, err := client.updateCreateRequest(ctx, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, parameters, options) @@ -1069,7 +1069,7 @@ func (client *LongTermRetentionBackupsClient) updateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -1081,7 +1081,7 @@ func (client *LongTermRetentionBackupsClient) updateCreateRequest(ctx context.Co // BeginUpdateByResourceGroup - Updates an existing long term retention backup. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-05-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - locationName - The location of the database. @@ -1107,7 +1107,7 @@ func (client *LongTermRetentionBackupsClient) BeginUpdateByResourceGroup(ctx con // UpdateByResourceGroup - Updates an existing long term retention backup. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-05-01-preview +// Generated from API version 2023-05-01-preview func (client *LongTermRetentionBackupsClient) updateByResourceGroup(ctx context.Context, resourceGroupName string, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string, parameters UpdateLongTermRetentionBackupParameters, options *LongTermRetentionBackupsClientBeginUpdateByResourceGroupOptions) (*http.Response, error) { var err error req, err := client.updateByResourceGroupCreateRequest(ctx, resourceGroupName, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, parameters, options) @@ -1157,7 +1157,7 @@ func (client *LongTermRetentionBackupsClient) updateByResourceGroupCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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/sql/armsql/longtermretentionbackups_client_example_test.go b/sdk/resourcemanager/sql/armsql/longtermretentionbackups_client_example_test.go deleted file mode 100644 index 27698ac056c2..000000000000 --- a/sdk/resourcemanager/sql/armsql/longtermretentionbackups_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 armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/LongTermRetentionBackupCopy.json -func ExampleLongTermRetentionBackupsClient_BeginCopy() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLongTermRetentionBackupsClient().BeginCopy(ctx, "japaneast", "testserver", "testDatabase", "55555555-6666-7777-8888-999999999999;131637960820000000", armsql.CopyLongTermRetentionBackupParameters{ - Properties: &armsql.CopyLongTermRetentionBackupParametersProperties{ - TargetBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - TargetDatabaseName: to.Ptr("testDatabase2"), - TargetServerResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/resourceGroups/resourceGroup/servers/testserver2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LongTermRetentionBackupOperationResult = armsql.LongTermRetentionBackupOperationResult{ - // Name: to.Ptr("a1aa7c77-961b-4fbb-bcd6-aa9acfcd1706"), - // Type: to.Ptr("Microsoft.Sql/locations/longTermRetentionBackupOperationResults"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japanEast/longTermRetentionBackupOperationResults/a1aa7c77-961b-4fbb-bcd6-aa9acfcd1706"), - // Properties: &armsql.LongTermRetentionOperationResultProperties{ - // FromBackupResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japanEast/longTermRetentionServers/testserver/longterRetentionDatabases/testDatabase/longTermRetentionBackups/55555555-6666-7777-8888-999999999999;131637960820000000"), - // OperationType: to.Ptr("CopyBackup"), - // RequestID: to.Ptr("a1aa7c77-961b-4fbb-bcd6-aa9acfcd1706"), - // Status: to.Ptr("Succeeded"), - // TargetBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // ToBackupResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/resourceGroup/providers/Microsoft.Sql/locations/japanEast/longTermRetentionServers/testserver2/longterRetentionDatabases/testDatabase2/longTermRetentionBackups/55555555-6666-7777-8888-111111111111;131637960820000000"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/LongTermRetentionBackupUpdate.json -func ExampleLongTermRetentionBackupsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLongTermRetentionBackupsClient().BeginUpdate(ctx, "japaneast", "testserver", "testDatabase", "55555555-6666-7777-8888-999999999999;131637960820000000", armsql.UpdateLongTermRetentionBackupParameters{ - Properties: &armsql.UpdateLongTermRetentionBackupParametersProperties{ - RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LongTermRetentionBackupOperationResult = armsql.LongTermRetentionBackupOperationResult{ - // Name: to.Ptr("a1aa7c77-961b-4fbb-bcd6-aa9acfcd1706"), - // Type: to.Ptr("Microsoft.Sql/locations/longTermRetentionBackupOperationResults"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japanEast/longTermRetentionBackupOperationResults/a1aa7c77-961b-4fbb-bcd6-aa9acfcd1706"), - // Properties: &armsql.LongTermRetentionOperationResultProperties{ - // FromBackupResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japanEast/longTermRetentionServers/testserver/longterRetentionDatabases/testDatabase/longTermRetentionBackups/55555555-6666-7777-8888-999999999999;131637960820000000"), - // OperationType: to.Ptr("UpdateBackup"), - // RequestID: to.Ptr("a1aa7c77-961b-4fbb-bcd6-aa9acfcd1706"), - // Status: to.Ptr("Succeeded"), - // TargetBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/LongTermRetentionBackupGet.json -func ExampleLongTermRetentionBackupsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLongTermRetentionBackupsClient().Get(ctx, "japaneast", "testserver", "testDatabase", "55555555-6666-7777-8888-999999999999;131637960820000000", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LongTermRetentionBackup = armsql.LongTermRetentionBackup{ - // Name: to.Ptr("2017-03-10T08:00:00.000Z;55555555-6666-7777-8888-999999999999;131637960820000000"), - // Type: to.Ptr("Microsoft.Sql/locations/longTermRetentionServers/longTermRetentionDatabases/longTermRetentionBackups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/longTermRetentionServers/testserver/longTermRetentionDatabases/testDatabase/longTermRetentionBackups/2017-03-10T08:00:00.000Z;55555555-6666-7777-8888-999999999999;2017-09-06T08:00:00.000Z"), - // Properties: &armsql.LongTermRetentionBackupProperties{ - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // BackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-06T08:00:00Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase"), - // ServerCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00Z"); return t}()), - // ServerName: to.Ptr("testserver"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/LongTermRetentionBackupDelete.json -func ExampleLongTermRetentionBackupsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLongTermRetentionBackupsClient().BeginDelete(ctx, "japaneast", "testserver", "testDatabase", "55555555-6666-7777-8888-999999999999;131637960820000000", 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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/LongTermRetentionBackupListByDatabase.json -func ExampleLongTermRetentionBackupsClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLongTermRetentionBackupsClient().NewListByDatabasePager("japaneast", "testserver", "testDatabase", &armsql.LongTermRetentionBackupsClientListByDatabaseOptions{OnlyLatestPerDatabase: nil, - DatabaseState: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.LongTermRetentionBackupListResult = armsql.LongTermRetentionBackupListResult{ - // Value: []*armsql.LongTermRetentionBackup{ - // { - // Name: to.Ptr("55555555-6666-7777-8888-999999999999;131637960820000000"), - // Type: to.Ptr("Microsoft.Sql/locations/longTermRetentionServers/longTermRetentionDatabases/longTermRetentionBackups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/longTermRetentionServers/testserver/longTermRetentionDatabases/testDatabase/longTermRetentionBackups/55555555-6666-7777-8888-999999999999;131637960820000000"), - // Properties: &armsql.LongTermRetentionBackupProperties{ - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // BackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-23T08:00:00Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase"), - // ServerCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00Z"); return t}()), - // ServerName: to.Ptr("testserver"), - // }, - // }, - // { - // Name: to.Ptr("55555555-6666-7777-8888-999999999999;131657960820000000"), - // Type: to.Ptr("Microsoft.Sql/locations/longTermRetentionServers/longTermRetentionDatabases/longTermRetentionBackups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/longTermRetentionServers/testserver/longTermRetentionDatabases/testDatabase/longTermRetentionBackups/55555555-6666-7777-8888-999999999999;131657960820000000"), - // Properties: &armsql.LongTermRetentionBackupProperties{ - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // BackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-30T08:00:00Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase"), - // ServerCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00Z"); return t}()), - // ServerName: to.Ptr("testserver"), - // }, - // }, - // { - // Name: to.Ptr("55555555-6666-7777-8888-999999999999;131677960820000000"), - // Type: to.Ptr("Microsoft.Sql/locations/longTermRetentionServers/longTermRetentionDatabases/longTermRetentionBackups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/longTermRetentionServers/testserver/longTermRetentionDatabases/testDatabase/longTermRetentionBackups/55555555-6666-7777-8888-999999999999;131677960820000000"), - // Properties: &armsql.LongTermRetentionBackupProperties{ - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // BackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-06T08:00:00Z"); return t}()), - // DatabaseDeletionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-07T08:00:00Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase"), - // ServerCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00Z"); return t}()), - // ServerName: to.Ptr("testserver"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/LongTermRetentionBackupListByLocation.json -func ExampleLongTermRetentionBackupsClient_NewListByLocationPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLongTermRetentionBackupsClient().NewListByLocationPager("japaneast", &armsql.LongTermRetentionBackupsClientListByLocationOptions{OnlyLatestPerDatabase: nil, - DatabaseState: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.LongTermRetentionBackupListResult = armsql.LongTermRetentionBackupListResult{ - // Value: []*armsql.LongTermRetentionBackup{ - // { - // Name: to.Ptr("55555555-6666-7777-8888-999999999999;2017-08-23T08:00:00.000Z"), - // Type: to.Ptr("Microsoft.Sql/locations/longTermRetentionServers/longTermRetentionDatabases/longTermRetentionBackups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/longTermRetentionServers/testserver1/longTermRetentionDatabases/testDatabase1/longTermRetentionBackups/55555555-6666-7777-8888-999999999999;131637960820000000"), - // Properties: &armsql.LongTermRetentionBackupProperties{ - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // BackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-23T08:00:00Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase1"), - // ServerCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00Z"); return t}()), - // ServerName: to.Ptr("testserver1"), - // }, - // }, - // { - // Name: to.Ptr("12341234-1234-1234-1234-123123123123;2017-08-30T08:00:00.000Z"), - // Type: to.Ptr("Microsoft.Sql/locations/longTermRetentionServers/longTermRetentionDatabases/longTermRetentionBackups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/longTermRetentionServers/testserver2/longTermRetentionDatabases/testDatabase2/longTermRetentionBackups/12341234-1234-1234-1234-123123123123;131657960820000000"), - // Properties: &armsql.LongTermRetentionBackupProperties{ - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // BackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-30T08:00:00Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase2"), - // ServerCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-10T08:00:00Z"); return t}()), - // ServerName: to.Ptr("testserver2"), - // }, - // }, - // { - // Name: to.Ptr("43214321-4321-4321-4321-321321321321;2017-09-06T08:00:00.000Z"), - // Type: to.Ptr("Microsoft.Sql/locations/longTermRetentionServers/longTermRetentionDatabases/longTermRetentionBackups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/longTermRetentionServers/testserver3/longTermRetentionDatabases/testDatabase3/longTermRetentionBackups/43214321-4321-4321-4321-321321321321;131677960820000000"), - // Properties: &armsql.LongTermRetentionBackupProperties{ - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // BackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-06T08:00:00Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase3"), - // ServerCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-10T08:00:00Z"); return t}()), - // ServerName: to.Ptr("testserver3"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/LongTermRetentionBackupListByServer.json -func ExampleLongTermRetentionBackupsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLongTermRetentionBackupsClient().NewListByServerPager("japaneast", "testserver", &armsql.LongTermRetentionBackupsClientListByServerOptions{OnlyLatestPerDatabase: nil, - DatabaseState: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.LongTermRetentionBackupListResult = armsql.LongTermRetentionBackupListResult{ - // Value: []*armsql.LongTermRetentionBackup{ - // { - // Name: to.Ptr("55555555-6666-7777-8888-999999999999;131637960820000000"), - // Type: to.Ptr("Microsoft.Sql/locations/longTermRetentionServers/longTermRetentionDatabases/longTermRetentionBackups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/longTermRetentionServers/testserver/longTermRetentionDatabases/testDatabase1/longTermRetentionBackups/55555555-6666-7777-8888-999999999999;131637960820000000"), - // Properties: &armsql.LongTermRetentionBackupProperties{ - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // BackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-23T08:00:00Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase1"), - // ServerCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00Z"); return t}()), - // ServerName: to.Ptr("testserver"), - // }, - // }, - // { - // Name: to.Ptr("12341234-1234-1234-1234-123123123123;131657960820000000"), - // Type: to.Ptr("Microsoft.Sql/locations/longTermRetentionServers/longTermRetentionDatabases/longTermRetentionBackups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/longTermRetentionServers/testserver/longTermRetentionDatabases/testDatabase2/longTermRetentionBackups/12341234-1234-1234-1234-123123123123;131657960820000000"), - // Properties: &armsql.LongTermRetentionBackupProperties{ - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // BackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-30T08:00:00Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase2"), - // ServerCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00Z"); return t}()), - // ServerName: to.Ptr("testserver"), - // }, - // }, - // { - // Name: to.Ptr("43214321-4321-4321-4321-321321321321;131667960820000000"), - // Type: to.Ptr("Microsoft.Sql/locations/longTermRetentionServers/longTermRetentionDatabases/longTermRetentionBackups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/longTermRetentionServers/testserver/longTermRetentionDatabases/testDatabase3/longTermRetentionBackups/43214321-4321-4321-4321-321321321321;131677960820000000"), - // Properties: &armsql.LongTermRetentionBackupProperties{ - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // BackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-06T08:00:00Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase3"), - // ServerCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00Z"); return t}()), - // ServerName: to.Ptr("testserver"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedLongTermRetentionBackupCopy.json -func ExampleLongTermRetentionBackupsClient_BeginCopyByResourceGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLongTermRetentionBackupsClient().BeginCopyByResourceGroup(ctx, "testResourceGroup", "japaneast", "testserver", "testDatabase", "55555555-6666-7777-8888-999999999999;131637960820000000", armsql.CopyLongTermRetentionBackupParameters{ - Properties: &armsql.CopyLongTermRetentionBackupParametersProperties{ - TargetBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - TargetDatabaseName: to.Ptr("testDatabase2"), - TargetServerResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/resourceGroups/resourceGroup/servers/testserver2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LongTermRetentionBackupOperationResult = armsql.LongTermRetentionBackupOperationResult{ - // Name: to.Ptr("a1aa7c77-961b-4fbb-bcd6-aa9acfcd1706"), - // Type: to.Ptr("Microsoft.Sql/locations/longTermRetentionBackupOperationResults"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testResourceGroup/providers/Microsoft.Sql/locations/japanEast/longTermRetentionBackupOperationResults/a1aa7c77-961b-4fbb-bcd6-aa9acfcd1706"), - // Properties: &armsql.LongTermRetentionOperationResultProperties{ - // FromBackupResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testResourceGroup/providers/Microsoft.Sql/locations/japanEast/longTermRetentionServers/testserver/longterRetentionDatabases/testDatabase/longTermRetentionBackups/55555555-6666-7777-8888-999999999999;131637960820000000"), - // OperationType: to.Ptr("CopyBackup"), - // RequestID: to.Ptr("a1aa7c77-961b-4fbb-bcd6-aa9acfcd1706"), - // Status: to.Ptr("Succeeded"), - // TargetBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // ToBackupResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/resourceGroup/providers/Microsoft.Sql/locations/japanEast/longTermRetentionServers/testserver2/longterRetentionDatabases/testDatabase2/longTermRetentionBackups/55555555-6666-7777-8888-111111111111;131637960820000000"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedLongTermRetentionBackupUpdate.json -func ExampleLongTermRetentionBackupsClient_BeginUpdateByResourceGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLongTermRetentionBackupsClient().BeginUpdateByResourceGroup(ctx, "testResourceGroup", "japaneast", "testserver", "testDatabase", "55555555-6666-7777-8888-999999999999;131637960820000000", armsql.UpdateLongTermRetentionBackupParameters{ - Properties: &armsql.UpdateLongTermRetentionBackupParametersProperties{ - RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LongTermRetentionBackupOperationResult = armsql.LongTermRetentionBackupOperationResult{ - // Name: to.Ptr("a1aa7c77-961b-4fbb-bcd6-aa9acfcd1706"), - // Type: to.Ptr("Microsoft.Sql/locations/longTermRetentionBackupOperationResults"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testResourceGroup/providers/Microsoft.Sql/locations/japanEast/longTermRetentionBackupOperationResults/a1aa7c77-961b-4fbb-bcd6-aa9acfcd1706"), - // Properties: &armsql.LongTermRetentionOperationResultProperties{ - // FromBackupResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testResourceGroup/providers/Microsoft.Sql/locations/japanEast/longTermRetentionServers/testserver/longterRetentionDatabases/testDatabase/longTermRetentionBackups/55555555-6666-7777-8888-999999999999;131637960820000000"), - // OperationType: to.Ptr("UpdateBackup"), - // RequestID: to.Ptr("a1aa7c77-961b-4fbb-bcd6-aa9acfcd1706"), - // Status: to.Ptr("Succeeded"), - // TargetBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedLongTermRetentionBackupGet.json -func ExampleLongTermRetentionBackupsClient_GetByResourceGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLongTermRetentionBackupsClient().GetByResourceGroup(ctx, "testResourceGroup", "japaneast", "testserver", "testDatabase", "55555555-6666-7777-8888-999999999999;131637960820000000", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LongTermRetentionBackup = armsql.LongTermRetentionBackup{ - // Name: to.Ptr("2017-03-10T08:00:00.000Z;55555555-6666-7777-8888-999999999999;131637960820000000"), - // Type: to.Ptr("Microsoft.Sql/locations/longTermRetentionServers/longTermRetentionDatabases/longTermRetentionBackups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testResourceGroup/providers/Microsoft.Sql/locations/japaneast/longTermRetentionServers/testserver/longTermRetentionDatabases/testDatabase/longTermRetentionBackups/2017-03-10T08:00:00.000Z;55555555-6666-7777-8888-999999999999;2017-09-06T08:00:00.000Z"), - // Properties: &armsql.LongTermRetentionBackupProperties{ - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // BackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-06T08:00:00Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase"), - // ServerCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00Z"); return t}()), - // ServerName: to.Ptr("testserver"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedLongTermRetentionBackupDelete.json -func ExampleLongTermRetentionBackupsClient_BeginDeleteByResourceGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLongTermRetentionBackupsClient().BeginDeleteByResourceGroup(ctx, "testResourceGroup", "japaneast", "testserver", "testDatabase", "55555555-6666-7777-8888-999999999999;131637960820000000", 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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedLongTermRetentionBackupListByDatabase.json -func ExampleLongTermRetentionBackupsClient_NewListByResourceGroupDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLongTermRetentionBackupsClient().NewListByResourceGroupDatabasePager("testResourceGroup", "japaneast", "testserver", "testDatabase", &armsql.LongTermRetentionBackupsClientListByResourceGroupDatabaseOptions{OnlyLatestPerDatabase: nil, - DatabaseState: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.LongTermRetentionBackupListResult = armsql.LongTermRetentionBackupListResult{ - // Value: []*armsql.LongTermRetentionBackup{ - // { - // Name: to.Ptr("55555555-6666-7777-8888-999999999999;131637960820000000"), - // Type: to.Ptr("Microsoft.Sql/locations/longTermRetentionServers/longTermRetentionDatabases/longTermRetentionBackups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testResourceGroup/providers/Microsoft.Sql/locations/japaneast/longTermRetentionServers/testserver/longTermRetentionDatabases/testDatabase/longTermRetentionBackups/55555555-6666-7777-8888-999999999999;131637960820000000"), - // Properties: &armsql.LongTermRetentionBackupProperties{ - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // BackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-23T08:00:00Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase"), - // ServerCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00Z"); return t}()), - // ServerName: to.Ptr("testserver"), - // }, - // }, - // { - // Name: to.Ptr("55555555-6666-7777-8888-999999999999;131657960820000000"), - // Type: to.Ptr("Microsoft.Sql/locations/longTermRetentionServers/longTermRetentionDatabases/longTermRetentionBackups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testResourceGroup/providers/Microsoft.Sql/locations/japaneast/longTermRetentionServers/testserver/longTermRetentionDatabases/testDatabase/longTermRetentionBackups/55555555-6666-7777-8888-999999999999;131657960820000000"), - // Properties: &armsql.LongTermRetentionBackupProperties{ - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // BackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-30T08:00:00Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase"), - // ServerCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00Z"); return t}()), - // ServerName: to.Ptr("testserver"), - // }, - // }, - // { - // Name: to.Ptr("55555555-6666-7777-8888-999999999999;131677960820000000"), - // Type: to.Ptr("Microsoft.Sql/locations/longTermRetentionServers/longTermRetentionDatabases/longTermRetentionBackups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testResourceGroup/providers/Microsoft.Sql/locations/japaneast/longTermRetentionServers/testserver/longTermRetentionDatabases/testDatabase/longTermRetentionBackups/55555555-6666-7777-8888-999999999999;131677960820000000"), - // Properties: &armsql.LongTermRetentionBackupProperties{ - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // BackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-06T08:00:00Z"); return t}()), - // DatabaseDeletionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-07T08:00:00Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase"), - // ServerCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00Z"); return t}()), - // ServerName: to.Ptr("testserver"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedLongTermRetentionBackupListByLocation.json -func ExampleLongTermRetentionBackupsClient_NewListByResourceGroupLocationPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLongTermRetentionBackupsClient().NewListByResourceGroupLocationPager("testResourceGroup", "japaneast", &armsql.LongTermRetentionBackupsClientListByResourceGroupLocationOptions{OnlyLatestPerDatabase: nil, - DatabaseState: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.LongTermRetentionBackupListResult = armsql.LongTermRetentionBackupListResult{ - // Value: []*armsql.LongTermRetentionBackup{ - // { - // Name: to.Ptr("55555555-6666-7777-8888-999999999999;2017-08-23T08:00:00.000Z"), - // Type: to.Ptr("Microsoft.Sql/locations/longTermRetentionServers/longTermRetentionDatabases/longTermRetentionBackups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testResourceGroup/providers/Microsoft.Sql/locations/japaneast/longTermRetentionServers/testserver1/longTermRetentionDatabases/testDatabase1/longTermRetentionBackups/55555555-6666-7777-8888-999999999999;131637960820000000"), - // Properties: &armsql.LongTermRetentionBackupProperties{ - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // BackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-23T08:00:00Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase1"), - // ServerCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00Z"); return t}()), - // ServerName: to.Ptr("testserver1"), - // }, - // }, - // { - // Name: to.Ptr("12341234-1234-1234-1234-123123123123;2017-08-30T08:00:00.000Z"), - // Type: to.Ptr("Microsoft.Sql/locations/longTermRetentionServers/longTermRetentionDatabases/longTermRetentionBackups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testResourceGroup/providers/Microsoft.Sql/locations/japaneast/longTermRetentionServers/testserver2/longTermRetentionDatabases/testDatabase2/longTermRetentionBackups/12341234-1234-1234-1234-123123123123;131657960820000000"), - // Properties: &armsql.LongTermRetentionBackupProperties{ - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // BackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-30T08:00:00Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase2"), - // ServerCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-10T08:00:00Z"); return t}()), - // ServerName: to.Ptr("testserver2"), - // }, - // }, - // { - // Name: to.Ptr("43214321-4321-4321-4321-321321321321;2017-09-06T08:00:00.000Z"), - // Type: to.Ptr("Microsoft.Sql/locations/longTermRetentionServers/longTermRetentionDatabases/longTermRetentionBackups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testResourceGroup/providers/Microsoft.Sql/locations/japaneast/longTermRetentionServers/testserver3/longTermRetentionDatabases/testDatabase3/longTermRetentionBackups/43214321-4321-4321-4321-321321321321;131677960820000000"), - // Properties: &armsql.LongTermRetentionBackupProperties{ - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // BackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-06T08:00:00Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase3"), - // ServerCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-10T08:00:00Z"); return t}()), - // ServerName: to.Ptr("testserver3"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedLongTermRetentionBackupListByServer.json -func ExampleLongTermRetentionBackupsClient_NewListByResourceGroupServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLongTermRetentionBackupsClient().NewListByResourceGroupServerPager("testResourceGroup", "japaneast", "testserver", &armsql.LongTermRetentionBackupsClientListByResourceGroupServerOptions{OnlyLatestPerDatabase: nil, - DatabaseState: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.LongTermRetentionBackupListResult = armsql.LongTermRetentionBackupListResult{ - // Value: []*armsql.LongTermRetentionBackup{ - // { - // Name: to.Ptr("55555555-6666-7777-8888-999999999999;131637960820000000"), - // Type: to.Ptr("Microsoft.Sql/locations/longTermRetentionServers/longTermRetentionDatabases/longTermRetentionBackups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testResourceGroup/providers/Microsoft.Sql/locations/japaneast/longTermRetentionServers/testserver/longTermRetentionDatabases/testDatabase1/longTermRetentionBackups/55555555-6666-7777-8888-999999999999;131637960820000000"), - // Properties: &armsql.LongTermRetentionBackupProperties{ - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // BackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-23T08:00:00Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase1"), - // ServerCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00Z"); return t}()), - // ServerName: to.Ptr("testserver"), - // }, - // }, - // { - // Name: to.Ptr("12341234-1234-1234-1234-123123123123;131657960820000000"), - // Type: to.Ptr("Microsoft.Sql/locations/longTermRetentionServers/longTermRetentionDatabases/longTermRetentionBackups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testResourceGroup/providers/Microsoft.Sql/locations/japaneast/longTermRetentionServers/testserver/longTermRetentionDatabases/testDatabase2/longTermRetentionBackups/12341234-1234-1234-1234-123123123123;131657960820000000"), - // Properties: &armsql.LongTermRetentionBackupProperties{ - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // BackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-30T08:00:00Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase2"), - // ServerCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00Z"); return t}()), - // ServerName: to.Ptr("testserver"), - // }, - // }, - // { - // Name: to.Ptr("43214321-4321-4321-4321-321321321321;131667960820000000"), - // Type: to.Ptr("Microsoft.Sql/locations/longTermRetentionServers/longTermRetentionDatabases/longTermRetentionBackups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testResourceGroup/providers/Microsoft.Sql/locations/japaneast/longTermRetentionServers/testserver/longTermRetentionDatabases/testDatabase3/longTermRetentionBackups/43214321-4321-4321-4321-321321321321;131677960820000000"), - // Properties: &armsql.LongTermRetentionBackupProperties{ - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // BackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-06T08:00:00Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase3"), - // ServerCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00Z"); return t}()), - // ServerName: to.Ptr("testserver"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/sql/armsql/longtermretentionmanagedinstancebackups_client.go b/sdk/resourcemanager/sql/armsql/longtermretentionmanagedinstancebackups_client.go index aa29dcdf051f..3d3c1ca63f3b 100644 --- a/sdk/resourcemanager/sql/armsql/longtermretentionmanagedinstancebackups_client.go +++ b/sdk/resourcemanager/sql/armsql/longtermretentionmanagedinstancebackups_client.go @@ -47,7 +47,7 @@ func NewLongTermRetentionManagedInstanceBackupsClient(subscriptionID string, cre // BeginDelete - Deletes a long term retention backup. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-05-01-preview +// Generated from API version 2023-05-01-preview // - locationName - The location of the database. // - managedInstanceName - The name of the managed instance. // - databaseName - The name of the managed database. @@ -70,7 +70,7 @@ func (client *LongTermRetentionManagedInstanceBackupsClient) BeginDelete(ctx con // Delete - Deletes a long term retention backup. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-05-01-preview +// Generated from API version 2023-05-01-preview func (client *LongTermRetentionManagedInstanceBackupsClient) deleteOperation(ctx context.Context, locationName string, managedInstanceName string, databaseName string, backupName string, options *LongTermRetentionManagedInstanceBackupsClientBeginDeleteOptions) (*http.Response, error) { var err error req, err := client.deleteCreateRequest(ctx, locationName, managedInstanceName, databaseName, backupName, options) @@ -116,7 +116,7 @@ func (client *LongTermRetentionManagedInstanceBackupsClient) deleteCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -124,7 +124,7 @@ func (client *LongTermRetentionManagedInstanceBackupsClient) deleteCreateRequest // BeginDeleteByResourceGroup - Deletes a long term retention backup. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-05-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - locationName - The location of the database @@ -149,7 +149,7 @@ func (client *LongTermRetentionManagedInstanceBackupsClient) BeginDeleteByResour // DeleteByResourceGroup - Deletes a long term retention backup. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-05-01-preview +// Generated from API version 2023-05-01-preview func (client *LongTermRetentionManagedInstanceBackupsClient) deleteByResourceGroup(ctx context.Context, resourceGroupName string, locationName string, managedInstanceName string, databaseName string, backupName string, options *LongTermRetentionManagedInstanceBackupsClientBeginDeleteByResourceGroupOptions) (*http.Response, error) { var err error req, err := client.deleteByResourceGroupCreateRequest(ctx, resourceGroupName, locationName, managedInstanceName, databaseName, backupName, options) @@ -199,7 +199,7 @@ func (client *LongTermRetentionManagedInstanceBackupsClient) deleteByResourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -207,7 +207,7 @@ func (client *LongTermRetentionManagedInstanceBackupsClient) deleteByResourceGro // Get - Gets a long term retention backup for a managed database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-05-01-preview +// Generated from API version 2023-05-01-preview // - locationName - The location of the database. // - managedInstanceName - The name of the managed instance. // - databaseName - The name of the managed database. @@ -260,7 +260,7 @@ func (client *LongTermRetentionManagedInstanceBackupsClient) getCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -278,7 +278,7 @@ func (client *LongTermRetentionManagedInstanceBackupsClient) getHandleResponse(r // GetByResourceGroup - Gets a long term retention backup for a managed database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-05-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - locationName - The location of the database. @@ -337,7 +337,7 @@ func (client *LongTermRetentionManagedInstanceBackupsClient) getByResourceGroupC return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -354,7 +354,7 @@ func (client *LongTermRetentionManagedInstanceBackupsClient) getByResourceGroupH // NewListByDatabasePager - Lists all long term retention backups for a managed database. // -// Generated from API version 2021-05-01-preview +// Generated from API version 2023-05-01-preview // - locationName - The location of the database. // - managedInstanceName - The name of the managed instance. // - databaseName - The name of the managed database. @@ -418,7 +418,7 @@ func (client *LongTermRetentionManagedInstanceBackupsClient) listByDatabaseCreat if options != nil && options.DatabaseState != nil { reqQP.Set("databaseState", string(*options.DatabaseState)) } - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -435,7 +435,7 @@ func (client *LongTermRetentionManagedInstanceBackupsClient) listByDatabaseHandl // NewListByInstancePager - Lists the long term retention backups for a given managed instance. // -// Generated from API version 2021-05-01-preview +// Generated from API version 2023-05-01-preview // - locationName - The location of the database // - managedInstanceName - The name of the managed instance. // - options - LongTermRetentionManagedInstanceBackupsClientListByInstanceOptions contains the optional parameters for the LongTermRetentionManagedInstanceBackupsClient.NewListByInstancePager @@ -494,7 +494,7 @@ func (client *LongTermRetentionManagedInstanceBackupsClient) listByInstanceCreat if options != nil && options.DatabaseState != nil { reqQP.Set("databaseState", string(*options.DatabaseState)) } - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -511,7 +511,7 @@ func (client *LongTermRetentionManagedInstanceBackupsClient) listByInstanceHandl // NewListByLocationPager - Lists the long term retention backups for managed databases in a given location. // -// Generated from API version 2021-05-01-preview +// Generated from API version 2023-05-01-preview // - locationName - The location of the database. // - options - LongTermRetentionManagedInstanceBackupsClientListByLocationOptions contains the optional parameters for the LongTermRetentionManagedInstanceBackupsClient.NewListByLocationPager // method. @@ -565,7 +565,7 @@ func (client *LongTermRetentionManagedInstanceBackupsClient) listByLocationCreat if options != nil && options.DatabaseState != nil { reqQP.Set("databaseState", string(*options.DatabaseState)) } - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -582,7 +582,7 @@ func (client *LongTermRetentionManagedInstanceBackupsClient) listByLocationHandl // NewListByResourceGroupDatabasePager - Lists all long term retention backups for a managed database. // -// Generated from API version 2021-05-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - locationName - The location of the database @@ -652,7 +652,7 @@ func (client *LongTermRetentionManagedInstanceBackupsClient) listByResourceGroup if options != nil && options.DatabaseState != nil { reqQP.Set("databaseState", string(*options.DatabaseState)) } - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -669,7 +669,7 @@ func (client *LongTermRetentionManagedInstanceBackupsClient) listByResourceGroup // NewListByResourceGroupInstancePager - Lists the long term retention backups for a given managed instance. // -// Generated from API version 2021-05-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - locationName - The location of the database. @@ -734,7 +734,7 @@ func (client *LongTermRetentionManagedInstanceBackupsClient) listByResourceGroup if options != nil && options.DatabaseState != nil { reqQP.Set("databaseState", string(*options.DatabaseState)) } - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -751,7 +751,7 @@ func (client *LongTermRetentionManagedInstanceBackupsClient) listByResourceGroup // NewListByResourceGroupLocationPager - Lists the long term retention backups for managed databases in a given location. // -// Generated from API version 2021-05-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - locationName - The location of the database. @@ -811,7 +811,7 @@ func (client *LongTermRetentionManagedInstanceBackupsClient) listByResourceGroup if options != nil && options.DatabaseState != nil { reqQP.Set("databaseState", string(*options.DatabaseState)) } - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/longtermretentionmanagedinstancebackups_client_example_test.go b/sdk/resourcemanager/sql/armsql/longtermretentionmanagedinstancebackups_client_example_test.go deleted file mode 100644 index 86e7f2d5149b..000000000000 --- a/sdk/resourcemanager/sql/armsql/longtermretentionmanagedinstancebackups_client_example_test.go +++ /dev/null @@ -1,522 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceLongTermRetentionBackupGet.json -func ExampleLongTermRetentionManagedInstanceBackupsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLongTermRetentionManagedInstanceBackupsClient().Get(ctx, "japaneast", "testInstance", "testDatabase", "55555555-6666-7777-8888-999999999999;131637960820000000", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedInstanceLongTermRetentionBackup = armsql.ManagedInstanceLongTermRetentionBackup{ - // Name: to.Ptr("55555555-6666-7777-8888-999999999999;131637960820000000"), - // Type: to.Ptr("Microsoft.Sql/locations/longTermRetentionManagedInstances/longTermRetentionDatabases/longTermRetentionManagedInstanceBackups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/Locations/japaneast/longTermRetentionManagedInstances/testInstance/longTermRetentionDatabases/testDatabase/longTermRetentionManagedInstanceBackups/55555555-6666-7777-8888-999999999999;131637960820000000"), - // Properties: &armsql.ManagedInstanceLongTermRetentionBackupProperties{ - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // BackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-23T08:00:00Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase"), - // ManagedInstanceCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-01T08:00:00Z"); return t}()), - // ManagedInstanceName: to.Ptr("testInstance"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceLongTermRetentionBackupDelete.json -func ExampleLongTermRetentionManagedInstanceBackupsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLongTermRetentionManagedInstanceBackupsClient().BeginDelete(ctx, "japaneast", "testInstance", "testDatabase", "55555555-6666-7777-8888-999999999999;131637960820000000", 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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceLongTermRetentionBackupListByDatabase.json -func ExampleLongTermRetentionManagedInstanceBackupsClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLongTermRetentionManagedInstanceBackupsClient().NewListByDatabasePager("japaneast", "testInstance", "testDatabase", &armsql.LongTermRetentionManagedInstanceBackupsClientListByDatabaseOptions{OnlyLatestPerDatabase: nil, - DatabaseState: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ManagedInstanceLongTermRetentionBackupListResult = armsql.ManagedInstanceLongTermRetentionBackupListResult{ - // Value: []*armsql.ManagedInstanceLongTermRetentionBackup{ - // { - // Name: to.Ptr("2018-06-01T08:00:00.000Z;55555555-6666-7777-8888-999999999999;2018-08-23T08:00:00.000Z"), - // Type: to.Ptr("Microsoft.Sql/locations/longTermRetentionManagedInstances/longTermRetentionDatabases/longTermRetentionManagedInstanceBackups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/Locations/japaneast/longTermRetentionManagedInstances/testInstance/longTermRetentionDatabases/testDatabase/longTermRetentionManagedInstanceBackups/2018-06-01T08:00:00.000Z;55555555-6666-7777-8888-999999999999;2018-08-23T08:00:00.000Z"), - // Properties: &armsql.ManagedInstanceLongTermRetentionBackupProperties{ - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // BackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-23T08:00:00Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase"), - // ManagedInstanceCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00Z"); return t}()), - // ManagedInstanceName: to.Ptr("testInstance"), - // }, - // }, - // { - // Name: to.Ptr("2018-06-01T08:00:00.000Z;55555555-6666-7777-8888-999999999999;2018-08-30T08:00:00.000Z"), - // Type: to.Ptr("Microsoft.Sql/locations/longTermRetentionManagedInstances/longTermRetentionDatabases/longTermRetentionManagedInstanceBackups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/Locations/japaneast/longTermRetentionManagedInstances/testInstance/longTermRetentionDatabases/testDatabase/longTermRetentionManagedInstanceBackups/2018-06-01T08:00:00.000Z;55555555-6666-7777-8888-999999999999;2018-08-30T08:00:00.000Z"), - // Properties: &armsql.ManagedInstanceLongTermRetentionBackupProperties{ - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // BackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-30T08:00:00Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase"), - // ManagedInstanceCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00Z"); return t}()), - // ManagedInstanceName: to.Ptr("testInstance"), - // }, - // }, - // { - // Name: to.Ptr("2018-06-01T08:00:00.000Z;55555555-6666-7777-8888-999999999999;2018-09-06T08:00:00.000Z"), - // Type: to.Ptr("Microsoft.Sql/locations/longTermRetentionManagedInstances/longTermRetentionDatabases/longTermRetentionManagedInstanceBackups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/Locations/japaneast/longTermRetentionManagedInstances/testInstance/longTermRetentionDatabases/testDatabase/longTermRetentionManagedInstanceBackups/2018-06-01T08:00:00.000Z;55555555-6666-7777-8888-999999999999;2018-09-06T08:00:00.000Z"), - // Properties: &armsql.ManagedInstanceLongTermRetentionBackupProperties{ - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // BackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-06T08:00:00Z"); return t}()), - // DatabaseDeletionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-07T08:00:00Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase"), - // ManagedInstanceCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00Z"); return t}()), - // ManagedInstanceName: to.Ptr("testInstance"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceLongTermRetentionBackupListByInstance.json -func ExampleLongTermRetentionManagedInstanceBackupsClient_NewListByInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLongTermRetentionManagedInstanceBackupsClient().NewListByInstancePager("japaneast", "testInstance", &armsql.LongTermRetentionManagedInstanceBackupsClientListByInstanceOptions{OnlyLatestPerDatabase: nil, - DatabaseState: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ManagedInstanceLongTermRetentionBackupListResult = armsql.ManagedInstanceLongTermRetentionBackupListResult{ - // Value: []*armsql.ManagedInstanceLongTermRetentionBackup{ - // { - // Name: to.Ptr("55555555-6666-7777-8888-999999999999;131637960820000000"), - // Type: to.Ptr("Microsoft.Sql/locations/longTermRetentionManagedInstances/longTermRetentionDatabases/longTermRetentionManagedInstanceBackups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/longTermRetentionManagedInstances/testInstance/longTermRetentionDatabases/testDatabase1/longTermRetentionManagedInstanceBackups/55555555-6666-7777-8888-999999999999;131637960820000000"), - // Properties: &armsql.ManagedInstanceLongTermRetentionBackupProperties{ - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // BackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-23T08:00:00Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase1"), - // ManagedInstanceCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00Z"); return t}()), - // ManagedInstanceName: to.Ptr("testInstance"), - // }, - // }, - // { - // Name: to.Ptr("12341234-1234-1234-1234-123123123123;131657960820000000"), - // Type: to.Ptr("Microsoft.Sql/locations/longTermRetentionManagedInstances/longTermRetentionDatabases/longTermRetentionManagedInstanceBackups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/longTermRetentionManagedInstances/testInstance/longTermRetentionDatabases/testDatabase2/longTermRetentionManagedInstanceBackups/12341234-1234-1234-1234-123123123123;131657960820000000"), - // Properties: &armsql.ManagedInstanceLongTermRetentionBackupProperties{ - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // BackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-30T08:00:00Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase2"), - // ManagedInstanceCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00Z"); return t}()), - // ManagedInstanceName: to.Ptr("testInstance"), - // }, - // }, - // { - // Name: to.Ptr("43214321-4321-4321-4321-321321321321;131667960820000000"), - // Type: to.Ptr("Microsoft.Sql/locations/longTermRetentionManagedInstances/longTermRetentionDatabases/longTermRetentionManagedInstanceBackups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/longTermRetentionManagedInstances/testInstance/longTermRetentionDatabases/testDatabase3/longTermRetentionManagedInstanceBackups/43214321-4321-4321-4321-321321321321;131677960820000000"), - // Properties: &armsql.ManagedInstanceLongTermRetentionBackupProperties{ - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // BackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-06T08:00:00Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase3"), - // ManagedInstanceCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00Z"); return t}()), - // ManagedInstanceName: to.Ptr("testInstance"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceLongTermRetentionBackupListByLocation.json -func ExampleLongTermRetentionManagedInstanceBackupsClient_NewListByLocationPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLongTermRetentionManagedInstanceBackupsClient().NewListByLocationPager("japaneast", &armsql.LongTermRetentionManagedInstanceBackupsClientListByLocationOptions{OnlyLatestPerDatabase: nil, - DatabaseState: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ManagedInstanceLongTermRetentionBackupListResult = armsql.ManagedInstanceLongTermRetentionBackupListResult{ - // Value: []*armsql.ManagedInstanceLongTermRetentionBackup{ - // { - // Name: to.Ptr("55555555-6666-7777-8888-999999999999;2017-08-23T08:00:00.000Z"), - // Type: to.Ptr("Microsoft.Sql/locations/longTermRetentionManagedInstances/longTermRetentionDatabases/longTermRetentionBackups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/longTermRetentionManagedInstances/testserver1/longTermRetentionDatabases/testDatabase1/longTermRetentionManagedInstanceBackups/55555555-6666-7777-8888-999999999999;131637960820000000"), - // Properties: &armsql.ManagedInstanceLongTermRetentionBackupProperties{ - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // BackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-23T08:00:00Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase1"), - // ManagedInstanceCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00Z"); return t}()), - // ManagedInstanceName: to.Ptr("testInstance1"), - // }, - // }, - // { - // Name: to.Ptr("12341234-1234-1234-1234-123123123123;2017-08-30T08:00:00.000Z"), - // Type: to.Ptr("Microsoft.Sql/locations/longTermRetentionServers/longTermRetentionDatabases/longTermRetentionBackups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/longTermRetentionManagedInstances/testserver2/longTermRetentionDatabases/testDatabase2/longTermRetentionManagedInstanceBackups/12341234-1234-1234-1234-123123123123;131657960820000000"), - // Properties: &armsql.ManagedInstanceLongTermRetentionBackupProperties{ - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // BackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-30T08:00:00Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase2"), - // ManagedInstanceCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-10T08:00:00Z"); return t}()), - // ManagedInstanceName: to.Ptr("testInstance2"), - // }, - // }, - // { - // Name: to.Ptr("43214321-4321-4321-4321-321321321321;2017-09-06T08:00:00.000Z"), - // Type: to.Ptr("Microsoft.Sql/locations/longTermRetentionManagedInstances/longTermRetentionDatabases/longTermRetentionManagedInstanceBackups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/longTermRetentionManagedInstances/testserver3/longTermRetentionDatabases/testDatabase3/longTermRetentionManagedInstanceBackups/43214321-4321-4321-4321-321321321321;131677960820000000"), - // Properties: &armsql.ManagedInstanceLongTermRetentionBackupProperties{ - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // BackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-06T08:00:00Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase3"), - // ManagedInstanceCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-10T08:00:00Z"); return t}()), - // ManagedInstanceName: to.Ptr("testInstance3"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedManagedInstanceLongTermRetentionBackupGet.json -func ExampleLongTermRetentionManagedInstanceBackupsClient_GetByResourceGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLongTermRetentionManagedInstanceBackupsClient().GetByResourceGroup(ctx, "testResourceGroup", "japaneast", "testInstance", "testDatabase", "55555555-6666-7777-8888-999999999999;131637960820000000", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedInstanceLongTermRetentionBackup = armsql.ManagedInstanceLongTermRetentionBackup{ - // Name: to.Ptr("55555555-6666-7777-8888-999999999999;131637960820000000"), - // Type: to.Ptr("Microsoft.Sql/locations/longTermRetentionManagedInstances/longTermRetentionDatabases/longTermRetentionManagedInstanceBackups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testResourceGroup/providers/Microsoft.Sql/Locations/japaneast/longTermRetentionManagedInstances/testInstance/longTermRetentionDatabases/testDatabase/longTermRetentionManagedInstanceBackups/55555555-6666-7777-8888-999999999999;131637960820000000"), - // Properties: &armsql.ManagedInstanceLongTermRetentionBackupProperties{ - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // BackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-06T08:00:00Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase"), - // ManagedInstanceCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00Z"); return t}()), - // ManagedInstanceName: to.Ptr("testInstance"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedManagedInstanceLongTermRetentionBackupDelete.json -func ExampleLongTermRetentionManagedInstanceBackupsClient_BeginDeleteByResourceGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLongTermRetentionManagedInstanceBackupsClient().BeginDeleteByResourceGroup(ctx, "testResourceGroup", "japaneast", "testInstance", "testDatabase", "55555555-6666-7777-8888-999999999999;131637960820000000", 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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedManagedInstanceLongTermRetentionBackupListByDatabase.json -func ExampleLongTermRetentionManagedInstanceBackupsClient_NewListByResourceGroupDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLongTermRetentionManagedInstanceBackupsClient().NewListByResourceGroupDatabasePager("testResourceGroup", "japaneast", "testInstance", "testDatabase", &armsql.LongTermRetentionManagedInstanceBackupsClientListByResourceGroupDatabaseOptions{OnlyLatestPerDatabase: nil, - DatabaseState: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ManagedInstanceLongTermRetentionBackupListResult = armsql.ManagedInstanceLongTermRetentionBackupListResult{ - // Value: []*armsql.ManagedInstanceLongTermRetentionBackup{ - // { - // Name: to.Ptr("2018-06-01T08:00:00.000Z;55555555-6666-7777-8888-999999999999;2018-08-23T08:00:00.000Z"), - // Type: to.Ptr("Microsoft.Sql/locations/longTermRetentionManagedInstances/longTermRetentionDatabases/longTermRetentionManagedInstanceBackups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testResourceGroup/providers/Microsoft.Sql/Locations/japaneast/longTermRetentionManagedInstances/testInstance/longTermRetentionDatabases/testDatabase/longTermRetentionManagedInstanceBackups/2018-06-01T08:00:00.000Z;55555555-6666-7777-8888-999999999999;2018-08-23T08:00:00.000Z"), - // Properties: &armsql.ManagedInstanceLongTermRetentionBackupProperties{ - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // BackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-23T08:00:00Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase"), - // ManagedInstanceCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00Z"); return t}()), - // ManagedInstanceName: to.Ptr("testInstance"), - // }, - // }, - // { - // Name: to.Ptr("2018-06-01T08:00:00.000Z;55555555-6666-7777-8888-999999999999;2018-08-30T08:00:00.000Z"), - // Type: to.Ptr("Microsoft.Sql/locations/longTermRetentionManagedInstances/longTermRetentionDatabases/longTermRetentionManagedInstanceBackups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testResourceGroup/providers/Microsoft.Sql/Locations/japaneast/longTermRetentionManagedInstances/testInstance/longTermRetentionDatabases/testDatabase/longTermRetentionManagedInstanceBackups/2018-06-01T08:00:00.000Z;55555555-6666-7777-8888-999999999999;2018-08-30T08:00:00.000Z"), - // Properties: &armsql.ManagedInstanceLongTermRetentionBackupProperties{ - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // BackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-30T08:00:00Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase"), - // ManagedInstanceCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00Z"); return t}()), - // ManagedInstanceName: to.Ptr("testInstance"), - // }, - // }, - // { - // Name: to.Ptr("2018-06-01T08:00:00.000Z;55555555-6666-7777-8888-999999999999;2018-09-06T08:00:00.000Z"), - // Type: to.Ptr("Microsoft.Sql/locations/longTermRetentionManagedInstances/longTermRetentionDatabases/longTermRetentionManagedInstanceBackups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testResourceGroup/providers/Microsoft.Sql/Locations/japaneast/longTermRetentionManagedInstances/testInstance/longTermRetentionDatabases/testDatabase/longTermRetentionManagedInstanceBackups/2018-06-01T08:00:00.000Z;55555555-6666-7777-8888-999999999999;2018-09-06T08:00:00.000Z"), - // Properties: &armsql.ManagedInstanceLongTermRetentionBackupProperties{ - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // BackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-06T08:00:00Z"); return t}()), - // DatabaseDeletionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-07T08:00:00Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase"), - // ManagedInstanceCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-10T08:00:00Z"); return t}()), - // ManagedInstanceName: to.Ptr("testInstance"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedManagedInstanceLongTermRetentionBackupListByInstance.json -func ExampleLongTermRetentionManagedInstanceBackupsClient_NewListByResourceGroupInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLongTermRetentionManagedInstanceBackupsClient().NewListByResourceGroupInstancePager("testResourceGroup", "japaneast", "testInstance", &armsql.LongTermRetentionManagedInstanceBackupsClientListByResourceGroupInstanceOptions{OnlyLatestPerDatabase: nil, - DatabaseState: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ManagedInstanceLongTermRetentionBackupListResult = armsql.ManagedInstanceLongTermRetentionBackupListResult{ - // Value: []*armsql.ManagedInstanceLongTermRetentionBackup{ - // { - // Name: to.Ptr("55555555-6666-7777-8888-999999999999;131637960820000000"), - // Type: to.Ptr("Microsoft.Sql/locations/longTermRetentionManagedInstances/longTermRetentionDatabases/longTermRetentionManagedInstanceBackups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testResourceGroup/providers/Microsoft.Sql/locations/japaneast/longTermRetentionManagedInstances/testInstance/longTermRetentionDatabases/testDatabase1/longTermRetentionManagedInstanceBackups/55555555-6666-7777-8888-999999999999;131637960820000000"), - // Properties: &armsql.ManagedInstanceLongTermRetentionBackupProperties{ - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // BackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-23T08:00:00Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase1"), - // ManagedInstanceCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00Z"); return t}()), - // ManagedInstanceName: to.Ptr("testInstance"), - // }, - // }, - // { - // Name: to.Ptr("12341234-1234-1234-1234-123123123123;131657960820000000"), - // Type: to.Ptr("Microsoft.Sql/locations/longTermRetentionManagedInstances/longTermRetentionDatabases/longTermRetentionManagedInstanceBackups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testResourceGroup/providers/Microsoft.Sql/locations/japaneast/longTermRetentionManagedInstances/testInstance/longTermRetentionDatabases/testDatabase2/longTermRetentionManagedInstanceBackups/12341234-1234-1234-1234-123123123123;131657960820000000"), - // Properties: &armsql.ManagedInstanceLongTermRetentionBackupProperties{ - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // BackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-30T08:00:00Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase2"), - // ManagedInstanceCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00Z"); return t}()), - // ManagedInstanceName: to.Ptr("testInstance"), - // }, - // }, - // { - // Name: to.Ptr("43214321-4321-4321-4321-321321321321;131667960820000000"), - // Type: to.Ptr("Microsoft.Sql/locations/longTermRetentionManagedInstances/longTermRetentionDatabases/longTermRetentionManagedInstanceBackups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testResourceGroup/providers/Microsoft.Sql/locations/japaneast/longTermRetentionManagedInstances/testInstance/longTermRetentionDatabases/testDatabase3/longTermRetentionManagedInstanceBackups/43214321-4321-4321-4321-321321321321;131677960820000000"), - // Properties: &armsql.ManagedInstanceLongTermRetentionBackupProperties{ - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // BackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-06T08:00:00Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase3"), - // ManagedInstanceCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00Z"); return t}()), - // ManagedInstanceName: to.Ptr("testInstance"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedManagedInstanceLongTermRetentionBackupListByLocation.json -func ExampleLongTermRetentionManagedInstanceBackupsClient_NewListByResourceGroupLocationPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLongTermRetentionManagedInstanceBackupsClient().NewListByResourceGroupLocationPager("testResourceGroup", "japaneast", &armsql.LongTermRetentionManagedInstanceBackupsClientListByResourceGroupLocationOptions{OnlyLatestPerDatabase: nil, - DatabaseState: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ManagedInstanceLongTermRetentionBackupListResult = armsql.ManagedInstanceLongTermRetentionBackupListResult{ - // Value: []*armsql.ManagedInstanceLongTermRetentionBackup{ - // { - // Name: to.Ptr("55555555-6666-7777-8888-999999999999;2017-08-23T08:00:00.000Z"), - // Type: to.Ptr("Microsoft.Sql/locations/longTermRetentionManagedInstances/longTermRetentionDatabases/longTermRetentionManagedInstanceBackups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testResourceGroup/providers/Microsoft.Sql/locations/japaneast/longTermRetentionManagedInstances/testInstance1/longTermRetentionDatabases/testDatabase1/longTermRetentionManagedInstanceBackups/55555555-6666-7777-8888-999999999999;131637960820000000"), - // Properties: &armsql.ManagedInstanceLongTermRetentionBackupProperties{ - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // BackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-23T08:00:00Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase1"), - // ManagedInstanceCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00Z"); return t}()), - // ManagedInstanceName: to.Ptr("testInstance1"), - // }, - // }, - // { - // Name: to.Ptr("12341234-1234-1234-1234-123123123123;2017-08-30T08:00:00.000Z"), - // Type: to.Ptr("Microsoft.Sql/locations/longTermRetentionManagedInstances/longTermRetentionDatabases/longTermRetentionManagedInstanceBackups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testResourceGroup/providers/Microsoft.Sql/locations/japaneast/longTermRetentionManagedInstances/testInstance2/longTermRetentionDatabases/testDatabase2/longTermRetentionManagedInstanceBackups/12341234-1234-1234-1234-123123123123;131657960820000000"), - // Properties: &armsql.ManagedInstanceLongTermRetentionBackupProperties{ - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // BackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-30T08:00:00Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase2"), - // ManagedInstanceCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-10T08:00:00Z"); return t}()), - // ManagedInstanceName: to.Ptr("testInstance2"), - // }, - // }, - // { - // Name: to.Ptr("43214321-4321-4321-4321-321321321321;2017-09-06T08:00:00.000Z"), - // Type: to.Ptr("Microsoft.Sql/locations/longTermRetentionManagedInstances/longTermRetentionDatabases/longTermRetentionManagedInstanceBackups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testResourceGroup/providers/Microsoft.Sql/locations/japaneast/longTermRetentionManagedInstances/testInstance3/longTermRetentionDatabases/testDatabase3/longTermRetentionManagedInstanceBackups/43214321-4321-4321-4321-321321321321;131677960820000000"), - // Properties: &armsql.ManagedInstanceLongTermRetentionBackupProperties{ - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // BackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-06T08:00:00Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase3"), - // ManagedInstanceCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-10T08:00:00Z"); return t}()), - // ManagedInstanceName: to.Ptr("testInstance3"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/sql/armsql/longtermretentionpolicies_client.go b/sdk/resourcemanager/sql/armsql/longtermretentionpolicies_client.go index a3a7bc2f7345..35574a68f0d0 100644 --- a/sdk/resourcemanager/sql/armsql/longtermretentionpolicies_client.go +++ b/sdk/resourcemanager/sql/armsql/longtermretentionpolicies_client.go @@ -43,10 +43,10 @@ func NewLongTermRetentionPoliciesClient(subscriptionID string, credential azcore return client, nil } -// BeginCreateOrUpdate - Sets a database's long term retention policy. +// BeginCreateOrUpdate - Set or update a database's long term retention policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -68,10 +68,10 @@ func (client *LongTermRetentionPoliciesClient) BeginCreateOrUpdate(ctx context.C } } -// CreateOrUpdate - Sets a database's long term retention policy. +// CreateOrUpdate - Set or update a database's long term retention policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview func (client *LongTermRetentionPoliciesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, policyName LongTermRetentionPolicyName, parameters LongTermRetentionPolicy, options *LongTermRetentionPoliciesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, policyName, parameters, options) @@ -117,7 +117,7 @@ func (client *LongTermRetentionPoliciesClient) createOrUpdateCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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 *LongTermRetentionPoliciesClient) createOrUpdateCreateRequest(ctx c // Get - Gets a database's long term retention policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -183,7 +183,7 @@ func (client *LongTermRetentionPoliciesClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -200,7 +200,7 @@ func (client *LongTermRetentionPoliciesClient) getHandleResponse(resp *http.Resp // NewListByDatabasePager - Gets a database's long term retention policy. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -259,7 +259,7 @@ func (client *LongTermRetentionPoliciesClient) listByDatabaseCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/longtermretentionpolicies_client_example_test.go b/sdk/resourcemanager/sql/armsql/longtermretentionpolicies_client_example_test.go deleted file mode 100644 index 38d3b97ce858..000000000000 --- a/sdk/resourcemanager/sql/armsql/longtermretentionpolicies_client_example_test.go +++ /dev/null @@ -1,131 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/LongTermRetentionPolicyGet.json -func ExampleLongTermRetentionPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLongTermRetentionPoliciesClient().Get(ctx, "resourceGroup", "testserver", "testDatabase", armsql.LongTermRetentionPolicyNameDefault, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LongTermRetentionPolicy = armsql.LongTermRetentionPolicy{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/resourceGroups/servers/databases/backupLongTermRetentionPolicies"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/resourceGroups/resourceGroup/servers/testserver/databases/testDatabase/backupLongTermRetentionPolicies/default"), - // Properties: &armsql.BaseLongTermRetentionPolicyProperties{ - // MonthlyRetention: to.Ptr("P1Y"), - // WeekOfYear: to.Ptr[int32](5), - // WeeklyRetention: to.Ptr("P1M"), - // YearlyRetention: to.Ptr("P5Y"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/LongTermRetentionPolicyCreateOrUpdate.json -func ExampleLongTermRetentionPoliciesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLongTermRetentionPoliciesClient().BeginCreateOrUpdate(ctx, "resourceGroup", "testserver", "testDatabase", armsql.LongTermRetentionPolicyNameDefault, armsql.LongTermRetentionPolicy{ - Properties: &armsql.BaseLongTermRetentionPolicyProperties{ - MonthlyRetention: to.Ptr("P1Y"), - WeekOfYear: to.Ptr[int32](5), - WeeklyRetention: to.Ptr("P1M"), - YearlyRetention: to.Ptr("P5Y"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LongTermRetentionPolicy = armsql.LongTermRetentionPolicy{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/resourceGroups/servers/databases/backupLongTermRetentionPolicies"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/resourceGroups/resourceGroup/servers/testserver/databases/testDatabase/backupLongTermRetentionPolicies/default"), - // Properties: &armsql.BaseLongTermRetentionPolicyProperties{ - // MonthlyRetention: to.Ptr("P1Y"), - // WeekOfYear: to.Ptr[int32](5), - // WeeklyRetention: to.Ptr("P1M"), - // YearlyRetention: to.Ptr("P5Y"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/LongTermRetentionPolicyListByDatabase.json -func ExampleLongTermRetentionPoliciesClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLongTermRetentionPoliciesClient().NewListByDatabasePager("resourceGroup", "testserver", "testDatabase", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.LongTermRetentionPolicyListResult = armsql.LongTermRetentionPolicyListResult{ - // Value: []*armsql.LongTermRetentionPolicy{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/resourceGroups/servers/databases/backupLongTermRetentionPolicies"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/resourceGroups/resourceGroup/servers/testserver/databases/testDatabase/backupLongTermRetentionPolicies/default"), - // Properties: &armsql.BaseLongTermRetentionPolicyProperties{ - // MonthlyRetention: to.Ptr("P1Y"), - // WeekOfYear: to.Ptr[int32](5), - // WeeklyRetention: to.Ptr("P1M"), - // YearlyRetention: to.Ptr("P5Y"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/sql/armsql/maintenancewindowoptions_client.go b/sdk/resourcemanager/sql/armsql/maintenancewindowoptions_client.go index 44c1f7ca5889..f6a2f0f74a0e 100644 --- a/sdk/resourcemanager/sql/armsql/maintenancewindowoptions_client.go +++ b/sdk/resourcemanager/sql/armsql/maintenancewindowoptions_client.go @@ -46,7 +46,7 @@ func NewMaintenanceWindowOptionsClient(subscriptionID string, credential azcore. // Get - Gets a list of available maintenance windows. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -97,7 +97,7 @@ func (client *MaintenanceWindowOptionsClient) getCreateRequest(ctx context.Conte } reqQP := req.Raw().URL.Query() reqQP.Set("maintenanceWindowOptionsName", maintenanceWindowOptionsName) - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/maintenancewindowoptions_client_example_test.go b/sdk/resourcemanager/sql/armsql/maintenancewindowoptions_client_example_test.go deleted file mode 100644 index becb4c097c08..000000000000 --- a/sdk/resourcemanager/sql/armsql/maintenancewindowoptions_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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetMaintenanceWindowOptions.json -func ExampleMaintenanceWindowOptionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMaintenanceWindowOptionsClient().Get(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", "current", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MaintenanceWindowOptions = armsql.MaintenanceWindowOptions{ - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/maintenancewindows"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb/maintenancewindowoptions/current"), - // Properties: &armsql.MaintenanceWindowOptionsProperties{ - // AllowMultipleMaintenanceWindowsPerCycle: to.Ptr(true), - // DefaultDurationInMinutes: to.Ptr[int32](120), - // IsEnabled: to.Ptr(true), - // MaintenanceWindowCycles: []*armsql.MaintenanceWindowTimeRange{ - // { - // DayOfWeek: to.Ptr(armsql.DayOfWeekSaturday), - // Duration: to.Ptr("PT60M"), - // StartTime: to.Ptr("00:00:00"), - // }}, - // MinCycles: to.Ptr[int32](2), - // MinDurationInMinutes: to.Ptr[int32](60), - // TimeGranularityInMinutes: to.Ptr[int32](5), - // }, - // } -} diff --git a/sdk/resourcemanager/sql/armsql/maintenancewindows_client.go b/sdk/resourcemanager/sql/armsql/maintenancewindows_client.go index 6fb19f5c593b..c38eb3186dbf 100644 --- a/sdk/resourcemanager/sql/armsql/maintenancewindows_client.go +++ b/sdk/resourcemanager/sql/armsql/maintenancewindows_client.go @@ -46,7 +46,7 @@ func NewMaintenanceWindowsClient(subscriptionID string, credential azcore.TokenC // CreateOrUpdate - Sets maintenance windows settings for a database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -96,7 +96,7 @@ func (client *MaintenanceWindowsClient) createOrUpdateCreateRequest(ctx context. } reqQP := req.Raw().URL.Query() reqQP.Set("maintenanceWindowName", maintenanceWindowName) - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err @@ -107,7 +107,7 @@ func (client *MaintenanceWindowsClient) createOrUpdateCreateRequest(ctx context. // Get - Gets maintenance windows settings for a database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -157,7 +157,7 @@ func (client *MaintenanceWindowsClient) getCreateRequest(ctx context.Context, re } reqQP := req.Raw().URL.Query() reqQP.Set("maintenanceWindowName", maintenanceWindowName) - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/maintenancewindows_client_example_test.go b/sdk/resourcemanager/sql/armsql/maintenancewindows_client_example_test.go deleted file mode 100644 index 4f3f4500e788..000000000000 --- a/sdk/resourcemanager/sql/armsql/maintenancewindows_client_example_test.go +++ /dev/null @@ -1,78 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetMaintenanceWindows.json -func ExampleMaintenanceWindowsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMaintenanceWindowsClient().Get(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", "current", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MaintenanceWindows = armsql.MaintenanceWindows{ - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/maintenancewindows"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb/maintenancewindows/current"), - // Properties: &armsql.MaintenanceWindowsProperties{ - // TimeRanges: []*armsql.MaintenanceWindowTimeRange{ - // { - // DayOfWeek: to.Ptr(armsql.DayOfWeekSaturday), - // Duration: to.Ptr("PT60M"), - // StartTime: to.Ptr("00:00:00"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateMaintenanceWindows.json -func ExampleMaintenanceWindowsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewMaintenanceWindowsClient().CreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdwdb", "current", armsql.MaintenanceWindows{ - Properties: &armsql.MaintenanceWindowsProperties{ - TimeRanges: []*armsql.MaintenanceWindowTimeRange{ - { - DayOfWeek: to.Ptr(armsql.DayOfWeekSaturday), - Duration: to.Ptr("PT60M"), - StartTime: to.Ptr("00:00:00"), - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/sql/armsql/managedbackupshorttermretentionpolicies_client.go b/sdk/resourcemanager/sql/armsql/managedbackupshorttermretentionpolicies_client.go index dbf138d7996b..e0a6e686b5b0 100644 --- a/sdk/resourcemanager/sql/armsql/managedbackupshorttermretentionpolicies_client.go +++ b/sdk/resourcemanager/sql/armsql/managedbackupshorttermretentionpolicies_client.go @@ -46,7 +46,7 @@ func NewManagedBackupShortTermRetentionPoliciesClient(subscriptionID string, cre // BeginCreateOrUpdate - Updates a managed database's short term retention policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -71,7 +71,7 @@ func (client *ManagedBackupShortTermRetentionPoliciesClient) BeginCreateOrUpdate // CreateOrUpdate - Updates a managed database's short term retention policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview func (client *ManagedBackupShortTermRetentionPoliciesClient) createOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, policyName ManagedShortTermRetentionPolicyName, parameters ManagedBackupShortTermRetentionPolicy, options *ManagedBackupShortTermRetentionPoliciesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, policyName, parameters, options) @@ -117,7 +117,7 @@ func (client *ManagedBackupShortTermRetentionPoliciesClient) createOrUpdateCreat return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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 *ManagedBackupShortTermRetentionPoliciesClient) createOrUpdateCreat // Get - Gets a managed database's short term retention policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -183,7 +183,7 @@ func (client *ManagedBackupShortTermRetentionPoliciesClient) getCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -200,7 +200,7 @@ func (client *ManagedBackupShortTermRetentionPoliciesClient) getHandleResponse(r // NewListByDatabasePager - Gets a managed database's short term retention policy list. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -259,7 +259,7 @@ func (client *ManagedBackupShortTermRetentionPoliciesClient) listByDatabaseCreat return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -277,7 +277,7 @@ func (client *ManagedBackupShortTermRetentionPoliciesClient) listByDatabaseHandl // BeginUpdate - Updates a managed database's short term retention policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -302,7 +302,7 @@ func (client *ManagedBackupShortTermRetentionPoliciesClient) BeginUpdate(ctx con // Update - Updates a managed database's short term retention policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview func (client *ManagedBackupShortTermRetentionPoliciesClient) update(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, policyName ManagedShortTermRetentionPolicyName, parameters ManagedBackupShortTermRetentionPolicy, options *ManagedBackupShortTermRetentionPoliciesClientBeginUpdateOptions) (*http.Response, error) { var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, policyName, parameters, options) @@ -348,7 +348,7 @@ func (client *ManagedBackupShortTermRetentionPoliciesClient) updateCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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/sql/armsql/managedbackupshorttermretentionpolicies_client_example_test.go b/sdk/resourcemanager/sql/armsql/managedbackupshorttermretentionpolicies_client_example_test.go deleted file mode 100644 index e1aa4f4a6a73..000000000000 --- a/sdk/resourcemanager/sql/armsql/managedbackupshorttermretentionpolicies_client_example_test.go +++ /dev/null @@ -1,119 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetManagedShortTermRetentionPolicy.json -func ExampleManagedBackupShortTermRetentionPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedBackupShortTermRetentionPoliciesClient().Get(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", armsql.ManagedShortTermRetentionPolicyNameDefault, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedBackupShortTermRetentionPolicy = armsql.ManagedBackupShortTermRetentionPolicy{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/databases/backupShortTermRetentionPolicies"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/testsvr/databases/testdb/backupShortTermRetentionPolicies/default"), - // Properties: &armsql.ManagedBackupShortTermRetentionPolicyProperties{ - // RetentionDays: to.Ptr[int32](14), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/UpdateManagedShortTermRetentionPolicy.json -func ExampleManagedBackupShortTermRetentionPoliciesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedBackupShortTermRetentionPoliciesClient().BeginCreateOrUpdate(ctx, "resourceGroup", "testsvr", "testdb", armsql.ManagedShortTermRetentionPolicyNameDefault, armsql.ManagedBackupShortTermRetentionPolicy{ - Properties: &armsql.ManagedBackupShortTermRetentionPolicyProperties{ - RetentionDays: to.Ptr[int32](14), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedBackupShortTermRetentionPolicy = armsql.ManagedBackupShortTermRetentionPolicy{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/databases/backupShortTermRetentionPolicies"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/resourceGroup/providers/Microsoft.Sql/managedInstances/testsvr/databases/testdb/backupShortTermRetentionPolicies/default"), - // Properties: &armsql.ManagedBackupShortTermRetentionPolicyProperties{ - // RetentionDays: to.Ptr[int32](14), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetListManagedShortTermRetentionPolicy.json -func ExampleManagedBackupShortTermRetentionPoliciesClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagedBackupShortTermRetentionPoliciesClient().NewListByDatabasePager("Default-SQL-SouthEastAsia", "testsvr", "testdb", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ManagedBackupShortTermRetentionPolicyListResult = armsql.ManagedBackupShortTermRetentionPolicyListResult{ - // Value: []*armsql.ManagedBackupShortTermRetentionPolicy{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/restorableDroppedDatabases/backupShortTermRetentionPolicies"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/testsvr/databases/testdb,131403269876900000/backupShortTermRetentionPolicies/default"), - // Properties: &armsql.ManagedBackupShortTermRetentionPolicyProperties{ - // RetentionDays: to.Ptr[int32](14), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/sql/armsql/manageddatabaseadvancedthreatprotectionsettings_client.go b/sdk/resourcemanager/sql/armsql/manageddatabaseadvancedthreatprotectionsettings_client.go index 4e9995f3ef01..eb308d179048 100644 --- a/sdk/resourcemanager/sql/armsql/manageddatabaseadvancedthreatprotectionsettings_client.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabaseadvancedthreatprotectionsettings_client.go @@ -46,7 +46,7 @@ func NewManagedDatabaseAdvancedThreatProtectionSettingsClient(subscriptionID str // CreateOrUpdate - Creates or updates a managed database's Advanced Threat Protection state. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-02-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -101,7 +101,7 @@ func (client *ManagedDatabaseAdvancedThreatProtectionSettingsClient) createOrUpd return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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 *ManagedDatabaseAdvancedThreatProtectionSettingsClient) createOrUpd // Get - Gets a managed database's Advanced Threat Protection state. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-02-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -176,7 +176,7 @@ func (client *ManagedDatabaseAdvancedThreatProtectionSettingsClient) getCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -193,7 +193,7 @@ func (client *ManagedDatabaseAdvancedThreatProtectionSettingsClient) getHandleRe // NewListByDatabasePager - Gets a list of managed database's Advanced Threat Protection states. // -// Generated from API version 2022-02-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -252,7 +252,7 @@ func (client *ManagedDatabaseAdvancedThreatProtectionSettingsClient) listByDatab return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/manageddatabaseadvancedthreatprotectionsettings_client_example_test.go b/sdk/resourcemanager/sql/armsql/manageddatabaseadvancedthreatprotectionsettings_client_example_test.go deleted file mode 100644 index c3273d9bf5b6..000000000000 --- a/sdk/resourcemanager/sql/armsql/manageddatabaseadvancedthreatprotectionsettings_client_example_test.go +++ /dev/null @@ -1,183 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedDatabaseAdvancedThreatProtectionSettingsListByDatabase.json -func ExampleManagedDatabaseAdvancedThreatProtectionSettingsClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagedDatabaseAdvancedThreatProtectionSettingsClient().NewListByDatabasePager("threatprotection-6852", "threatprotection-2080", "testdb", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ManagedDatabaseAdvancedThreatProtectionListResult = armsql.ManagedDatabaseAdvancedThreatProtectionListResult{ - // Value: []*armsql.ManagedDatabaseAdvancedThreatProtection{ - // { - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/databases/advancedThreatProtectionSettings"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/threatprotection-6852/providers/Microsoft.Sql/managedInstances/threatprotection-2080/databases/testdb/advancedThreatProtectionSettings"), - // Properties: &armsql.AdvancedThreatProtectionProperties{ - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // State: to.Ptr(armsql.AdvancedThreatProtectionStateEnabled), - // }, - // SystemData: &armsql.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsql.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsql.CreatedByTypeUser), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedDatabaseAdvancedThreatProtectionSettingsGet.json -func ExampleManagedDatabaseAdvancedThreatProtectionSettingsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedDatabaseAdvancedThreatProtectionSettingsClient().Get(ctx, "threatprotection-6852", "threatprotection-2080", "testdb", armsql.AdvancedThreatProtectionNameDefault, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedDatabaseAdvancedThreatProtection = armsql.ManagedDatabaseAdvancedThreatProtection{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/databases/advancedThreatProtectionSettings"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/threatprotection-4799/providers/Microsoft.Sql/managedInstances/threatprotection-6440/advancedThreatProtectionSettings/Default"), - // Properties: &armsql.AdvancedThreatProtectionProperties{ - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // State: to.Ptr(armsql.AdvancedThreatProtectionStateEnabled), - // }, - // SystemData: &armsql.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsql.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsql.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedDatabaseAdvancedThreatProtectionSettingsCreateMax.json -func ExampleManagedDatabaseAdvancedThreatProtectionSettingsClient_CreateOrUpdate_updateAManagedDatabasesAdvancedThreatProtectionSettingsWithAllParameters() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedDatabaseAdvancedThreatProtectionSettingsClient().CreateOrUpdate(ctx, "threatprotection-4799", "threatprotection-6440", "testdb", armsql.AdvancedThreatProtectionNameDefault, armsql.ManagedDatabaseAdvancedThreatProtection{ - Properties: &armsql.AdvancedThreatProtectionProperties{ - State: to.Ptr(armsql.AdvancedThreatProtectionStateEnabled), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedDatabaseAdvancedThreatProtection = armsql.ManagedDatabaseAdvancedThreatProtection{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/databases/advancedThreatProtectionSettings"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/threatprotection-4799/providers/Microsoft.Sql/managedInstances/threatprotection-6440/advancedThreatProtectionSettings/Default"), - // Properties: &armsql.AdvancedThreatProtectionProperties{ - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // State: to.Ptr(armsql.AdvancedThreatProtectionStateEnabled), - // }, - // SystemData: &armsql.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsql.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsql.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedDatabaseAdvancedThreatProtectionSettingsCreateMin.json -func ExampleManagedDatabaseAdvancedThreatProtectionSettingsClient_CreateOrUpdate_updateAManagedDatabasesAdvancedThreatProtectionSettingsWithMinimalParameters() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedDatabaseAdvancedThreatProtectionSettingsClient().CreateOrUpdate(ctx, "threatprotection-4799", "threatprotection-6440", "testdb", armsql.AdvancedThreatProtectionNameDefault, armsql.ManagedDatabaseAdvancedThreatProtection{ - Properties: &armsql.AdvancedThreatProtectionProperties{ - State: to.Ptr(armsql.AdvancedThreatProtectionStateDisabled), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedDatabaseAdvancedThreatProtection = armsql.ManagedDatabaseAdvancedThreatProtection{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/databases/advancedThreatProtectionSettings"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/threatprotection-4799/providers/Microsoft.Sql/managedInstances/threatprotection-6440/advancedThreatProtectionSettings/Default"), - // Properties: &armsql.AdvancedThreatProtectionProperties{ - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // State: to.Ptr(armsql.AdvancedThreatProtectionStateDisabled), - // }, - // SystemData: &armsql.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsql.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsql.CreatedByTypeUser), - // }, - // } -} diff --git a/sdk/resourcemanager/sql/armsql/manageddatabasecolumns_client.go b/sdk/resourcemanager/sql/armsql/manageddatabasecolumns_client.go index 6c452cf89b9a..b8ae35c38f67 100644 --- a/sdk/resourcemanager/sql/armsql/manageddatabasecolumns_client.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabasecolumns_client.go @@ -46,7 +46,7 @@ func NewManagedDatabaseColumnsClient(subscriptionID string, credential azcore.To // Get - Get managed database column // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -110,7 +110,7 @@ func (client *ManagedDatabaseColumnsClient) getCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -127,7 +127,7 @@ func (client *ManagedDatabaseColumnsClient) getHandleResponse(resp *http.Respons // NewListByDatabasePager - List managed database columns // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -209,7 +209,7 @@ func (client *ManagedDatabaseColumnsClient) listByDatabaseCreateRequest(ctx cont if options != nil && options.Skiptoken != nil { reqQP.Set("$skiptoken", *options.Skiptoken) } - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -226,7 +226,7 @@ func (client *ManagedDatabaseColumnsClient) listByDatabaseHandleResponse(resp *h // NewListByTablePager - List managed database columns // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -298,7 +298,7 @@ func (client *ManagedDatabaseColumnsClient) listByTableCreateRequest(ctx context if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/manageddatabasecolumns_client_example_test.go b/sdk/resourcemanager/sql/armsql/manageddatabasecolumns_client_example_test.go deleted file mode 100644 index 896204d34cf0..000000000000 --- a/sdk/resourcemanager/sql/armsql/manageddatabasecolumns_client_example_test.go +++ /dev/null @@ -1,196 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedColumnsListByDatabaseMax.json -func ExampleManagedDatabaseColumnsClient_NewListByDatabasePager_filterManagedDatabaseColumns() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagedDatabaseColumnsClient().NewListByDatabasePager("myRG", "serverName", "myDatabase", &armsql.ManagedDatabaseColumnsClientListByDatabaseOptions{Schema: []string{ - "dbo"}, - Table: []string{ - "customer", - "address"}, - Column: []string{ - "username"}, - OrderBy: []string{ - "schema asc", - "table", - "column desc"}, - 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.DatabaseColumnListResult = armsql.DatabaseColumnListResult{ - // Value: []*armsql.DatabaseColumn{ - // { - // Name: to.Ptr("username"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/databases/schemas/tables/columns"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myRG/providers/Microsoft.Sql/managedInstances/serverName/databases/myDatabase/schemas/dbo/tables/customer/columns/username"), - // Properties: &armsql.DatabaseColumnProperties{ - // ColumnType: to.Ptr(armsql.ColumnDataTypeNvarchar), - // IsComputed: to.Ptr(false), - // MemoryOptimized: to.Ptr(false), - // TemporalType: to.Ptr(armsql.TableTemporalTypeNonTemporalTable), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedColumnsListByDatabaseMin.json -func ExampleManagedDatabaseColumnsClient_NewListByDatabasePager_listManagedDatabaseColumns() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagedDatabaseColumnsClient().NewListByDatabasePager("myRG", "serverName", "myDatabase", &armsql.ManagedDatabaseColumnsClientListByDatabaseOptions{Schema: []string{}, - Table: []string{}, - Column: []string{}, - OrderBy: []string{}, - 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.DatabaseColumnListResult = armsql.DatabaseColumnListResult{ - // Value: []*armsql.DatabaseColumn{ - // { - // Name: to.Ptr("col1"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/databases/schemas/tables/columns"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myRG/providers/Microsoft.Sql/managedInstances/serverName/databases/myDatabase/schemas/dbo/tables/table1/columns/col1"), - // Properties: &armsql.DatabaseColumnProperties{ - // ColumnType: to.Ptr(armsql.ColumnDataTypeInt), - // IsComputed: to.Ptr(false), - // MemoryOptimized: to.Ptr(false), - // TemporalType: to.Ptr(armsql.TableTemporalTypeNonTemporalTable), - // }, - // }, - // { - // Name: to.Ptr("col2"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/databases/schemas/tables/columns"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myRG/providers/Microsoft.Sql/managedInstances/serverName/databases/myDatabase/schemas/dbo/tables/table1/columns/col2"), - // Properties: &armsql.DatabaseColumnProperties{ - // ColumnType: to.Ptr(armsql.ColumnDataTypeBit), - // IsComputed: to.Ptr(false), - // MemoryOptimized: to.Ptr(false), - // TemporalType: to.Ptr(armsql.TableTemporalTypeSystemVersionedTemporalTable), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseColumnListByTable.json -func ExampleManagedDatabaseColumnsClient_NewListByTablePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagedDatabaseColumnsClient().NewListByTablePager("myRG", "myManagedInstanceName", "myDatabase", "dbo", "table1", &armsql.ManagedDatabaseColumnsClientListByTableOptions{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.DatabaseColumnListResult = armsql.DatabaseColumnListResult{ - // Value: []*armsql.DatabaseColumn{ - // { - // Name: to.Ptr("col1"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/databases/schemas/tables/columns"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myRG/providers/Microsoft.Sql/managedInstances/myManagedInstanceName/databases/myDatabase/schemas/dbo/tables/table1/columns/col1"), - // Properties: &armsql.DatabaseColumnProperties{ - // ColumnType: to.Ptr(armsql.ColumnDataTypeNvarchar), - // }, - // }, - // { - // Name: to.Ptr("col2"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/databases/schemas/tables/columns"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myRG/providers/Microsoft.Sql/managedInstances/myManagedInstanceName/databases/myDatabase/schemas/dbo/tables/table1/columns/col2"), - // Properties: &armsql.DatabaseColumnProperties{ - // ColumnType: to.Ptr(armsql.ColumnDataTypeBit), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseColumnGet.json -func ExampleManagedDatabaseColumnsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedDatabaseColumnsClient().Get(ctx, "myRG", "myManagedInstanceName", "myDatabase", "dbo", "table1", "column1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DatabaseColumn = armsql.DatabaseColumn{ - // Name: to.Ptr("column1"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/databases/schemas/tables/columns"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myRG/providers/Microsoft.Sql/managedInstances/myManagedInstanceName/databases/myDatabase/schemas/dbo/tables/table1/columns/column1"), - // Properties: &armsql.DatabaseColumnProperties{ - // ColumnType: to.Ptr(armsql.ColumnDataTypeBit), - // }, - // } -} diff --git a/sdk/resourcemanager/sql/armsql/manageddatabasemoveoperations_client.go b/sdk/resourcemanager/sql/armsql/manageddatabasemoveoperations_client.go index 542931136cbb..ca61a3838b6c 100644 --- a/sdk/resourcemanager/sql/armsql/manageddatabasemoveoperations_client.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabasemoveoperations_client.go @@ -47,7 +47,7 @@ func NewManagedDatabaseMoveOperationsClient(subscriptionID string, credential az // Get - Gets a managed database move operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - options - ManagedDatabaseMoveOperationsClientGetOptions contains the optional parameters for the ManagedDatabaseMoveOperationsClient.Get @@ -91,7 +91,7 @@ func (client *ManagedDatabaseMoveOperationsClient) getCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -108,7 +108,7 @@ func (client *ManagedDatabaseMoveOperationsClient) getHandleResponse(resp *http. // NewListByLocationPager - Lists managed database move operations. // -// Generated from API version 2022-05-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - options - ManagedDatabaseMoveOperationsClientListByLocationOptions contains the optional parameters for the ManagedDatabaseMoveOperationsClient.NewListByLocationPager @@ -167,7 +167,7 @@ func (client *ManagedDatabaseMoveOperationsClient) listByLocationCreateRequest(c if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/manageddatabasemoveoperations_client_example_test.go b/sdk/resourcemanager/sql/armsql/manageddatabasemoveoperations_client_example_test.go deleted file mode 100644 index afb75f3da536..000000000000 --- a/sdk/resourcemanager/sql/armsql/manageddatabasemoveoperations_client_example_test.go +++ /dev/null @@ -1,262 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/ManagedDatabaseMoveOperationResultList.json -func ExampleManagedDatabaseMoveOperationsClient_NewListByLocationPager_getsAllManagedDatabaseMoveOperationsForSpecifiedSubscriptionResourceGroupAndLocation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagedDatabaseMoveOperationsClient().NewListByLocationPager("rg1", "westeurope", &armsql.ManagedDatabaseMoveOperationsClientListByLocationOptions{OnlyLatestPerDatabase: nil, - 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.ManagedDatabaseMoveOperationListResult = armsql.ManagedDatabaseMoveOperationListResult{ - // Value: []*armsql.ManagedDatabaseMoveOperationResult{ - // { - // Name: to.Ptr("15961324-d809-46ed-86b9-d786953140e2"), - // Type: to.Ptr("Microsoft.Sql/locations/managedDatabaseMoveOperationResults"), - // ID: to.Ptr("subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg1/providers/Microsoft.Sql/locations/westeurope/managedDatabaseMoveOperationResults/15961324-d809-46ed-86b9-d786953140e2"), - // Properties: &armsql.ManagedDatabaseMoveOperationResultProperties{ - // IsCancellable: to.Ptr(false), - // Operation: to.Ptr("startManagedInstanceDatabaseMove"), - // OperationFriendlyName: to.Ptr("Start Azure SQL Managed Instance database move"), - // OperationMode: to.Ptr(armsql.MoveOperationModeMove), - // SourceDatabaseName: to.Ptr("db1"), - // SourceManagedInstanceID: to.Ptr("subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg1/providers/Microsoft.Sql/managedInstances/mi1"), - // SourceManagedInstanceName: to.Ptr("mi1"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-24T12:54:29.72Z"); return t}()), - // State: to.Ptr(armsql.ManagementOperationStateSucceeded), - // TargetDatabaseName: to.Ptr("db1"), - // TargetManagedInstanceID: to.Ptr("subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg2/providers/Microsoft.Sql/managedInstances/mi2"), - // TargetManagedInstanceName: to.Ptr("mi2"), - // }, - // }, - // { - // Name: to.Ptr("12341324-e123-45cd-86b9-d786953131a5"), - // Type: to.Ptr("Microsoft.Sql/locations/managedDatabaseMoveOperationResults"), - // ID: to.Ptr("subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg1/providers/Microsoft.Sql/locations/westeurope/managedDatabaseMoveOperationResults/12341324-e123-45cd-86b9-d786953131a5"), - // Properties: &armsql.ManagedDatabaseMoveOperationResultProperties{ - // IsCancellable: to.Ptr(true), - // Operation: to.Ptr("ContinueManagedInstanceDatabaseMove"), - // OperationFriendlyName: to.Ptr("Complete Azure SQL Managed Instance database move"), - // OperationMode: to.Ptr(armsql.MoveOperationModeMove), - // SourceDatabaseName: to.Ptr("db1"), - // SourceManagedInstanceID: to.Ptr("subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg1/providers/Microsoft.Sql/managedInstances/mi1"), - // SourceManagedInstanceName: to.Ptr("mi1"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-24T12:54:29.72Z"); return t}()), - // State: to.Ptr(armsql.ManagementOperationStateInProgress), - // TargetDatabaseName: to.Ptr("db1"), - // TargetManagedInstanceID: to.Ptr("subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg2/providers/Microsoft.Sql/managedInstances/mi2"), - // TargetManagedInstanceName: to.Ptr("mi2"), - // }, - // }, - // { - // Name: to.Ptr("87654321-30a2-f39a-z171-b78695fg32a8"), - // Type: to.Ptr("Microsoft.Sql/locations/managedDatabaseMoveOperationResults"), - // ID: to.Ptr("subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg1/providers/Microsoft.Sql/locations/westeurope/managedDatabaseMoveOperationResults/87654321-30a2-f39a-z171-b78695fg32a8"), - // Properties: &armsql.ManagedDatabaseMoveOperationResultProperties{ - // IsCancellable: to.Ptr(true), - // Operation: to.Ptr("StartManagedInstanceDatabaseMove"), - // OperationFriendlyName: to.Ptr("Start Azure SQL Managed Instance database move"), - // OperationMode: to.Ptr(armsql.MoveOperationModeCopy), - // SourceDatabaseName: to.Ptr("db2"), - // SourceManagedInstanceID: to.Ptr("subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg1/providers/Microsoft.Sql/managedInstances/mi1"), - // SourceManagedInstanceName: to.Ptr("mi1"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-24T13:37:19.71Z"); return t}()), - // State: to.Ptr(armsql.ManagementOperationStateInProgress), - // TargetDatabaseName: to.Ptr("db2"), - // TargetManagedInstanceID: to.Ptr("subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg2/providers/Microsoft.Sql/managedInstances/mi2"), - // TargetManagedInstanceName: to.Ptr("mi2"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/ManagedDatabaseMoveOperationResultListMax.json -func ExampleManagedDatabaseMoveOperationsClient_NewListByLocationPager_getsTheLatestManagedDatabaseMoveOperationsForEachDatabaseUnderSpecifiedSubscriptionResourceGroupAndLocationFilteredByOperationType() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagedDatabaseMoveOperationsClient().NewListByLocationPager("rg1", "westeurope", &armsql.ManagedDatabaseMoveOperationsClientListByLocationOptions{OnlyLatestPerDatabase: nil, - Filter: to.Ptr("Properties/Operation eq 'StartManagedInstanceDatabaseMove'"), - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ManagedDatabaseMoveOperationListResult = armsql.ManagedDatabaseMoveOperationListResult{ - // Value: []*armsql.ManagedDatabaseMoveOperationResult{ - // { - // Name: to.Ptr("87654321-30a2-f39a-z171-b78695fg32a8"), - // Type: to.Ptr("Microsoft.Sql/locations/managedDatabaseMoveOperationResults"), - // ID: to.Ptr("subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg1/providers/Microsoft.Sql/locations/westeurope/managedDatabaseMoveOperationResults/87654321-30a2-f39a-z171-b78695fg32a8"), - // Properties: &armsql.ManagedDatabaseMoveOperationResultProperties{ - // IsCancellable: to.Ptr(true), - // Operation: to.Ptr("StartManagedInstanceDatabaseMove"), - // OperationFriendlyName: to.Ptr("Start Azure SQL Managed Instance database move"), - // OperationMode: to.Ptr(armsql.MoveOperationModeCopy), - // SourceDatabaseName: to.Ptr("db1"), - // SourceManagedInstanceID: to.Ptr("subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg1/providers/Microsoft.Sql/managedInstances/mi1"), - // SourceManagedInstanceName: to.Ptr("mi1"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-24T12:54:29.72Z"); return t}()), - // State: to.Ptr(armsql.ManagementOperationStateInProgress), - // TargetDatabaseName: to.Ptr("db1"), - // TargetManagedInstanceID: to.Ptr("subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg2/providers/Microsoft.Sql/managedInstances/mi2"), - // TargetManagedInstanceName: to.Ptr("mi2"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/ManagedDatabaseMoveOperationResultListLastOperations.json -func ExampleManagedDatabaseMoveOperationsClient_NewListByLocationPager_getsTheLatestManagedDatabaseMoveOperationsForEachDatabaseUnderSpecifiedSubscriptionResourceGroupAndLocation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagedDatabaseMoveOperationsClient().NewListByLocationPager("rg1", "westeurope", &armsql.ManagedDatabaseMoveOperationsClientListByLocationOptions{OnlyLatestPerDatabase: nil, - 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.ManagedDatabaseMoveOperationListResult = armsql.ManagedDatabaseMoveOperationListResult{ - // Value: []*armsql.ManagedDatabaseMoveOperationResult{ - // { - // Name: to.Ptr("12341324-e123-45cd-86b9-d786953131a5"), - // Type: to.Ptr("Microsoft.Sql/locations/managedDatabaseMoveOperationResults"), - // ID: to.Ptr("subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg1/providers/Microsoft.Sql/locations/westeurope/managedDatabaseMoveOperationResults/12341324-e123-45cd-86b9-d786953131a5"), - // Properties: &armsql.ManagedDatabaseMoveOperationResultProperties{ - // IsCancellable: to.Ptr(true), - // Operation: to.Ptr("ContinueManagedInstanceDatabaseMove"), - // OperationFriendlyName: to.Ptr("Complete Azure SQL Managed Instance database move"), - // OperationMode: to.Ptr(armsql.MoveOperationModeMove), - // SourceDatabaseName: to.Ptr("db1"), - // SourceManagedInstanceID: to.Ptr("subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg1/providers/Microsoft.Sql/managedInstances/mi1"), - // SourceManagedInstanceName: to.Ptr("mi1"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-24T12:54:29.72Z"); return t}()), - // State: to.Ptr(armsql.ManagementOperationStateInProgress), - // TargetDatabaseName: to.Ptr("db1"), - // TargetManagedInstanceID: to.Ptr("subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg2/providers/Microsoft.Sql/managedInstances/mi2"), - // TargetManagedInstanceName: to.Ptr("mi2"), - // }, - // }, - // { - // Name: to.Ptr("87654321-30a2-f39a-z171-b78695fg32a8"), - // Type: to.Ptr("Microsoft.Sql/locations/managedDatabaseMoveOperationResults"), - // ID: to.Ptr("subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg1/providers/Microsoft.Sql/locations/westeurope/managedDatabaseMoveOperationResults/87654321-30a2-f39a-z171-b78695fg32a8"), - // Properties: &armsql.ManagedDatabaseMoveOperationResultProperties{ - // IsCancellable: to.Ptr(true), - // Operation: to.Ptr("StartManagedInstanceDatabaseMove"), - // OperationFriendlyName: to.Ptr("Start Azure SQL Managed Instance database move"), - // OperationMode: to.Ptr(armsql.MoveOperationModeCopy), - // SourceDatabaseName: to.Ptr("db2"), - // SourceManagedInstanceID: to.Ptr("subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg1/providers/Microsoft.Sql/managedInstances/mi1"), - // SourceManagedInstanceName: to.Ptr("mi1"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-24T13:37:19.71Z"); return t}()), - // State: to.Ptr(armsql.ManagementOperationStateInProgress), - // TargetDatabaseName: to.Ptr("db2"), - // TargetManagedInstanceID: to.Ptr("subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg2/providers/Microsoft.Sql/managedInstances/mi2"), - // TargetManagedInstanceName: to.Ptr("mi2"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/ManagedDatabaseMoveOperationResultGet.json -func ExampleManagedDatabaseMoveOperationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedDatabaseMoveOperationsClient().Get(ctx, "rg1", "westeurope", "15961324-d809-46ed-86b9-d786953140e2", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedDatabaseMoveOperationResult = armsql.ManagedDatabaseMoveOperationResult{ - // Name: to.Ptr("15961324-d809-46ed-86b9-d786953140e2"), - // Type: to.Ptr("Microsoft.Sql/locations/managedDatabaseMoveOperationResults"), - // ID: to.Ptr("subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg1/providers/Microsoft.Sql/locations/westeurope/managedDatabaseMoveOperationResults/15961324-d809-46ed-86b9-d786953140e2"), - // Properties: &armsql.ManagedDatabaseMoveOperationResultProperties{ - // IsCancellable: to.Ptr(true), - // Operation: to.Ptr("StartManagedInstanceDatabaseMove"), - // OperationFriendlyName: to.Ptr("Start Azure SQL Managed Instance database move"), - // OperationMode: to.Ptr(armsql.MoveOperationModeMove), - // SourceDatabaseName: to.Ptr("db1"), - // SourceManagedInstanceID: to.Ptr("subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg1/providers/Microsoft.Sql/managedInstances/mi1"), - // SourceManagedInstanceName: to.Ptr("mi1"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-24T12:54:29.72Z"); return t}()), - // State: to.Ptr(armsql.ManagementOperationStateInProgress), - // TargetDatabaseName: to.Ptr("db1"), - // TargetManagedInstanceID: to.Ptr("subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg2/providers/Microsoft.Sql/managedInstances/mi2"), - // TargetManagedInstanceName: to.Ptr("mi2"), - // }, - // } -} diff --git a/sdk/resourcemanager/sql/armsql/manageddatabasequeries_client.go b/sdk/resourcemanager/sql/armsql/manageddatabasequeries_client.go index c3e649d30907..92fd0229d8d6 100644 --- a/sdk/resourcemanager/sql/armsql/manageddatabasequeries_client.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabasequeries_client.go @@ -46,7 +46,7 @@ func NewManagedDatabaseQueriesClient(subscriptionID string, credential azcore.To // Get - Get query by query id. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -99,7 +99,7 @@ func (client *ManagedDatabaseQueriesClient) getCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -116,7 +116,7 @@ func (client *ManagedDatabaseQueriesClient) getHandleResponse(resp *http.Respons // NewListByQueryPager - Get query execution statistics by query id. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -188,7 +188,7 @@ func (client *ManagedDatabaseQueriesClient) listByQueryCreateRequest(ctx context if options != nil && options.Interval != nil { reqQP.Set("interval", string(*options.Interval)) } - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/manageddatabasequeries_client_example_test.go b/sdk/resourcemanager/sql/armsql/manageddatabasequeries_client_example_test.go deleted file mode 100644 index 9494aa603e68..000000000000 --- a/sdk/resourcemanager/sql/armsql/manageddatabasequeries_client_example_test.go +++ /dev/null @@ -1,538 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceQueryGet.json -func ExampleManagedDatabaseQueriesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedDatabaseQueriesClient().Get(ctx, "sqlcrudtest-7398", "sqlcrudtest-4645", "database_1", "42", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedInstanceQuery = armsql.ManagedInstanceQuery{ - // Type: to.Ptr("Microsoft.Sql/managedInstances/databases/queries"), - // ID: to.Ptr("42"), - // Properties: &armsql.QueryProperties{ - // QueryText: to.Ptr("select * from DUMMY_TABLE"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceQueryStatisticsList.json -func ExampleManagedDatabaseQueriesClient_NewListByQueryPager_obtainQueryExecutionStatistics() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagedDatabaseQueriesClient().NewListByQueryPager("sqlcrudtest-7398", "sqlcrudtest-4645", "database_1", "42", &armsql.ManagedDatabaseQueriesClientListByQueryOptions{StartTime: nil, - EndTime: nil, - Interval: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ManagedInstanceQueryStatistics = armsql.ManagedInstanceQueryStatistics{ - // Value: []*armsql.QueryStatistics{ - // { - // Type: to.Ptr("Microsoft.Sql/managedInstances/databases/queries/statistics"), - // ID: to.Ptr("35"), - // Properties: &armsql.QueryStatisticsProperties{ - // DatabaseName: to.Ptr("db1"), - // EndTime: to.Ptr("03/02/2020 18:34:58"), - // Intervals: []*armsql.QueryMetricInterval{ - // { - // ExecutionCount: to.Ptr[int64](160), - // IntervalStartTime: to.Ptr("03/02/2020 08:00:00"), - // IntervalType: to.Ptr(armsql.QueryTimeGrainTypePT1H), - // Metrics: []*armsql.QueryMetricProperties{ - // { - // Name: to.Ptr("cpu"), - // Avg: to.Ptr[float64](0.00001665347222222222), - // DisplayName: to.Ptr("Cpu"), - // Max: to.Ptr[float64](0.000025243055555555557), - // Min: to.Ptr[float64](0.00001507638888888889), - // Stdev: to.Ptr[float64](0.0000014894345929850385), - // Sum: to.Ptr[float64](0.0026645555555555554), - // Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage), - // Value: to.Ptr[float64](0), - // }, - // { - // Name: to.Ptr("io"), - // Avg: to.Ptr[float64](0), - // DisplayName: to.Ptr("Physical Io Reads"), - // Max: to.Ptr[float64](0), - // Min: to.Ptr[float64](0), - // Stdev: to.Ptr[float64](0), - // Sum: to.Ptr[float64](0), - // Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage), - // Value: to.Ptr[float64](0), - // }, - // { - // Name: to.Ptr("logIo"), - // Avg: to.Ptr[float64](0), - // DisplayName: to.Ptr("Log Writes"), - // Max: to.Ptr[float64](0), - // Min: to.Ptr[float64](0), - // Stdev: to.Ptr[float64](0), - // Sum: to.Ptr[float64](0), - // Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage), - // Value: to.Ptr[float64](0), - // }, - // { - // Name: to.Ptr("memory"), - // Avg: to.Ptr[float64](0), - // DisplayName: to.Ptr("Memory consumption"), - // Max: to.Ptr[float64](0), - // Min: to.Ptr[float64](0), - // Stdev: to.Ptr[float64](0), - // Sum: to.Ptr[float64](0), - // Unit: to.Ptr(armsql.QueryMetricUnitTypeKB), - // Value: to.Ptr[float64](0), - // }, - // { - // Name: to.Ptr("duration"), - // Avg: to.Ptr[float64](5026.625), - // DisplayName: to.Ptr("Query duration"), - // Max: to.Ptr[float64](18490), - // Min: to.Ptr[float64](4373), - // Stdev: to.Ptr[float64](1487.3520882343225), - // Sum: to.Ptr[float64](804260), - // Unit: to.Ptr(armsql.QueryMetricUnitTypeMicroseconds), - // Value: to.Ptr[float64](0), - // }}, - // }, - // { - // ExecutionCount: to.Ptr[int64](20), - // IntervalStartTime: to.Ptr("03/02/2020 09:00:00"), - // IntervalType: to.Ptr(armsql.QueryTimeGrainTypePT1H), - // Metrics: []*armsql.QueryMetricProperties{ - // { - // Name: to.Ptr("cpu"), - // Avg: to.Ptr[float64](0.00004479774305555555), - // DisplayName: to.Ptr("Cpu"), - // Max: to.Ptr[float64](0.00014645833333333332), - // Min: to.Ptr[float64](0.000023430555555555557), - // Stdev: to.Ptr[float64](0.00003830118344204395), - // Sum: to.Ptr[float64](0.0008959548611111111), - // Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage), - // Value: to.Ptr[float64](0), - // }, - // { - // Name: to.Ptr("io"), - // Avg: to.Ptr[float64](0), - // DisplayName: to.Ptr("Physical Io Reads"), - // Max: to.Ptr[float64](0), - // Min: to.Ptr[float64](0), - // Stdev: to.Ptr[float64](0), - // Sum: to.Ptr[float64](0), - // Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage), - // Value: to.Ptr[float64](0), - // }, - // { - // Name: to.Ptr("logIo"), - // Avg: to.Ptr[float64](0), - // DisplayName: to.Ptr("Log Writes"), - // Max: to.Ptr[float64](0), - // Min: to.Ptr[float64](0), - // Stdev: to.Ptr[float64](0), - // Sum: to.Ptr[float64](0), - // Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage), - // Value: to.Ptr[float64](0), - // }, - // { - // Name: to.Ptr("memory"), - // Avg: to.Ptr[float64](0), - // DisplayName: to.Ptr("Memory consumption"), - // Max: to.Ptr[float64](0), - // Min: to.Ptr[float64](0), - // Stdev: to.Ptr[float64](0), - // Sum: to.Ptr[float64](0), - // Unit: to.Ptr(armsql.QueryMetricUnitTypeKB), - // Value: to.Ptr[float64](0), - // }, - // { - // Name: to.Ptr("duration"), - // Avg: to.Ptr[float64](12963.2), - // DisplayName: to.Ptr("Query duration"), - // Max: to.Ptr[float64](42289), - // Min: to.Ptr[float64](6813), - // Stdev: to.Ptr[float64](11040.140794392071), - // Sum: to.Ptr[float64](259264), - // Unit: to.Ptr(armsql.QueryMetricUnitTypeMicroseconds), - // Value: to.Ptr[float64](0), - // }}, - // }, - // { - // ExecutionCount: to.Ptr[int64](80), - // IntervalStartTime: to.Ptr("03/02/2020 15:00:00"), - // IntervalType: to.Ptr(armsql.QueryTimeGrainTypePT1H), - // Metrics: []*armsql.QueryMetricProperties{ - // { - // Name: to.Ptr("cpu"), - // Avg: to.Ptr[float64](0.000019315538194444445), - // DisplayName: to.Ptr("Cpu"), - // Max: to.Ptr[float64](0.00002764236111111111), - // Min: to.Ptr[float64](0.000018215277777777777), - // Stdev: to.Ptr[float64](0.0000010716305801875179), - // Sum: to.Ptr[float64](0.0015452430555555556), - // Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage), - // Value: to.Ptr[float64](0), - // }, - // { - // Name: to.Ptr("io"), - // Avg: to.Ptr[float64](0), - // DisplayName: to.Ptr("Physical Io Reads"), - // Max: to.Ptr[float64](0), - // Min: to.Ptr[float64](0), - // Stdev: to.Ptr[float64](0), - // Sum: to.Ptr[float64](0), - // Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage), - // Value: to.Ptr[float64](0), - // }, - // { - // Name: to.Ptr("logIo"), - // Avg: to.Ptr[float64](0), - // DisplayName: to.Ptr("Log Writes"), - // Max: to.Ptr[float64](0), - // Min: to.Ptr[float64](0), - // Stdev: to.Ptr[float64](0), - // Sum: to.Ptr[float64](0), - // Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage), - // Value: to.Ptr[float64](0), - // }, - // { - // Name: to.Ptr("memory"), - // Avg: to.Ptr[float64](0), - // DisplayName: to.Ptr("Memory consumption"), - // Max: to.Ptr[float64](0), - // Min: to.Ptr[float64](0), - // Stdev: to.Ptr[float64](0), - // Sum: to.Ptr[float64](0), - // Unit: to.Ptr(armsql.QueryMetricUnitTypeKB), - // Value: to.Ptr[float64](0), - // }, - // { - // Name: to.Ptr("duration"), - // Avg: to.Ptr[float64](5586.2625), - // DisplayName: to.Ptr("Query duration"), - // Max: to.Ptr[float64](7982), - // Min: to.Ptr[float64](5264), - // Stdev: to.Ptr[float64](310.4915757210727), - // Sum: to.Ptr[float64](446901), - // Unit: to.Ptr(armsql.QueryMetricUnitTypeMicroseconds), - // Value: to.Ptr[float64](0), - // }}, - // }, - // { - // ExecutionCount: to.Ptr[int64](80), - // IntervalStartTime: to.Ptr("03/02/2020 17:00:00"), - // IntervalType: to.Ptr(armsql.QueryTimeGrainTypePT1H), - // Metrics: []*armsql.QueryMetricProperties{ - // { - // Name: to.Ptr("cpu"), - // Avg: to.Ptr[float64](0.000019085373263888888), - // DisplayName: to.Ptr("Cpu"), - // Max: to.Ptr[float64](0.00002782638888888889), - // Min: to.Ptr[float64](0.000017819444444444443), - // Stdev: to.Ptr[float64](0.0000012309244108727927), - // Sum: to.Ptr[float64](0.0015268298611111112), - // Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage), - // Value: to.Ptr[float64](0), - // }, - // { - // Name: to.Ptr("io"), - // Avg: to.Ptr[float64](0), - // DisplayName: to.Ptr("Physical Io Reads"), - // Max: to.Ptr[float64](0), - // Min: to.Ptr[float64](0), - // Stdev: to.Ptr[float64](0), - // Sum: to.Ptr[float64](0), - // Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage), - // Value: to.Ptr[float64](0), - // }, - // { - // Name: to.Ptr("logIo"), - // Avg: to.Ptr[float64](0), - // DisplayName: to.Ptr("Log Writes"), - // Max: to.Ptr[float64](0), - // Min: to.Ptr[float64](0), - // Stdev: to.Ptr[float64](0), - // Sum: to.Ptr[float64](0), - // Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage), - // Value: to.Ptr[float64](0), - // }, - // { - // Name: to.Ptr("memory"), - // Avg: to.Ptr[float64](0), - // DisplayName: to.Ptr("Memory consumption"), - // Max: to.Ptr[float64](0), - // Min: to.Ptr[float64](0), - // Stdev: to.Ptr[float64](0), - // Sum: to.Ptr[float64](0), - // Unit: to.Ptr(armsql.QueryMetricUnitTypeKB), - // Value: to.Ptr[float64](0), - // }, - // { - // Name: to.Ptr("duration"), - // Avg: to.Ptr[float64](5517.2), - // DisplayName: to.Ptr("Query duration"), - // Max: to.Ptr[float64](8052), - // Min: to.Ptr[float64](5147), - // Stdev: to.Ptr[float64](356.8763581410226), - // Sum: to.Ptr[float64](441376), - // Unit: to.Ptr(armsql.QueryMetricUnitTypeMicroseconds), - // Value: to.Ptr[float64](0), - // }}, - // }}, - // QueryID: to.Ptr("35"), - // StartTime: to.Ptr("03/01/2020 18:34:58"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceQueryStatisticsListMax.json -func ExampleManagedDatabaseQueriesClient_NewListByQueryPager_obtainQueryExecutionStatisticsExampleWithAllRequestParameters() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagedDatabaseQueriesClient().NewListByQueryPager("sqlcrudtest-7398", "sqlcrudtest-4645", "database_1", "42", &armsql.ManagedDatabaseQueriesClientListByQueryOptions{StartTime: to.Ptr("03/01/2020 16:23:09"), - EndTime: to.Ptr("03/11/2020 14:00:00"), - Interval: to.Ptr(armsql.QueryTimeGrainTypeP1D), - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ManagedInstanceQueryStatistics = armsql.ManagedInstanceQueryStatistics{ - // Value: []*armsql.QueryStatistics{ - // { - // Type: to.Ptr("Microsoft.Sql/managedInstances/databases/queries/statistics"), - // ID: to.Ptr("28"), - // Properties: &armsql.QueryStatisticsProperties{ - // DatabaseName: to.Ptr("db1"), - // EndTime: to.Ptr("03/11/2020 14:00:00"), - // Intervals: []*armsql.QueryMetricInterval{ - // { - // ExecutionCount: to.Ptr[int64](1), - // IntervalStartTime: to.Ptr("03/11/2020 00:00:00"), - // IntervalType: to.Ptr(armsql.QueryTimeGrainTypeP1D), - // Metrics: []*armsql.QueryMetricProperties{ - // { - // Name: to.Ptr("cpu"), - // Avg: to.Ptr[float64](0.0015934667245370371), - // DisplayName: to.Ptr("Cpu"), - // Max: to.Ptr[float64](0.0015934667245370371), - // Min: to.Ptr[float64](0.0015934667245370371), - // Stdev: to.Ptr[float64](0), - // Sum: to.Ptr[float64](0.0015934667245370371), - // Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage), - // Value: to.Ptr[float64](0), - // }, - // { - // Name: to.Ptr("io"), - // Avg: to.Ptr[float64](0.000004224537037037037), - // DisplayName: to.Ptr("Physical Io Reads"), - // Max: to.Ptr[float64](0.000004224537037037037), - // Min: to.Ptr[float64](0.000004224537037037037), - // Stdev: to.Ptr[float64](0), - // Sum: to.Ptr[float64](0.000004224537037037037), - // Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage), - // Value: to.Ptr[float64](0), - // }, - // { - // Name: to.Ptr("logIo"), - // Avg: to.Ptr[float64](0), - // DisplayName: to.Ptr("Log Writes"), - // Max: to.Ptr[float64](0), - // Min: to.Ptr[float64](0), - // Stdev: to.Ptr[float64](0), - // Sum: to.Ptr[float64](0), - // Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage), - // Value: to.Ptr[float64](0), - // }, - // { - // Name: to.Ptr("memory"), - // Avg: to.Ptr[float64](8336), - // DisplayName: to.Ptr("Memory consumption"), - // Max: to.Ptr[float64](8336), - // Min: to.Ptr[float64](8336), - // Stdev: to.Ptr[float64](0), - // Sum: to.Ptr[float64](8336), - // Unit: to.Ptr(armsql.QueryMetricUnitTypeKB), - // Value: to.Ptr[float64](0), - // }, - // { - // Name: to.Ptr("duration"), - // Avg: to.Ptr[float64](11091296), - // DisplayName: to.Ptr("Query duration"), - // Max: to.Ptr[float64](11091296), - // Min: to.Ptr[float64](11091296), - // Stdev: to.Ptr[float64](0), - // Sum: to.Ptr[float64](11091296), - // Unit: to.Ptr(armsql.QueryMetricUnitTypeMicroseconds), - // Value: to.Ptr[float64](0), - // }}, - // }}, - // QueryID: to.Ptr("28"), - // StartTime: to.Ptr("03/01/2020 16:23:09"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceQueryStatisticsListMin.json -func ExampleManagedDatabaseQueriesClient_NewListByQueryPager_obtainQueryExecutionStatisticsMinimalExampleWithOnlyMandatoryRequestParameters() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagedDatabaseQueriesClient().NewListByQueryPager("sqlcrudtest-7398", "sqlcrudtest-4645", "database_1", "42", &armsql.ManagedDatabaseQueriesClientListByQueryOptions{StartTime: nil, - EndTime: nil, - Interval: to.Ptr(armsql.QueryTimeGrainTypePT1H), - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ManagedInstanceQueryStatistics = armsql.ManagedInstanceQueryStatistics{ - // Value: []*armsql.QueryStatistics{ - // { - // Type: to.Ptr("Microsoft.Sql/managedInstances/databases/queries/statistics"), - // ID: to.Ptr("28"), - // Properties: &armsql.QueryStatisticsProperties{ - // DatabaseName: to.Ptr("db1"), - // EndTime: to.Ptr("03/11/2020 14:00:30"), - // Intervals: []*armsql.QueryMetricInterval{ - // { - // ExecutionCount: to.Ptr[int64](1), - // IntervalStartTime: to.Ptr("03/11/2020 11:00:00"), - // IntervalType: to.Ptr(armsql.QueryTimeGrainTypePT1H), - // Metrics: []*armsql.QueryMetricProperties{ - // { - // Name: to.Ptr("cpu"), - // Avg: to.Ptr[float64](0.03824320138888889), - // DisplayName: to.Ptr("Cpu"), - // Max: to.Ptr[float64](0.03824320138888889), - // Min: to.Ptr[float64](0.03824320138888889), - // Stdev: to.Ptr[float64](0), - // Sum: to.Ptr[float64](0.03824320138888889), - // Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage), - // Value: to.Ptr[float64](0), - // }, - // { - // Name: to.Ptr("io"), - // Avg: to.Ptr[float64](0.0001013888888888889), - // DisplayName: to.Ptr("Physical Io Reads"), - // Max: to.Ptr[float64](0.0001013888888888889), - // Min: to.Ptr[float64](0.0001013888888888889), - // Stdev: to.Ptr[float64](0), - // Sum: to.Ptr[float64](0.0001013888888888889), - // Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage), - // Value: to.Ptr[float64](0), - // }, - // { - // Name: to.Ptr("logIo"), - // Avg: to.Ptr[float64](0), - // DisplayName: to.Ptr("Log Writes"), - // Max: to.Ptr[float64](0), - // Min: to.Ptr[float64](0), - // Stdev: to.Ptr[float64](0), - // Sum: to.Ptr[float64](0), - // Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage), - // Value: to.Ptr[float64](0), - // }, - // { - // Name: to.Ptr("memory"), - // Avg: to.Ptr[float64](8336), - // DisplayName: to.Ptr("Memory consumption"), - // Max: to.Ptr[float64](8336), - // Min: to.Ptr[float64](8336), - // Stdev: to.Ptr[float64](0), - // Sum: to.Ptr[float64](8336), - // Unit: to.Ptr(armsql.QueryMetricUnitTypeKB), - // Value: to.Ptr[float64](0), - // }, - // { - // Name: to.Ptr("duration"), - // Avg: to.Ptr[float64](11091296), - // DisplayName: to.Ptr("Query duration"), - // Max: to.Ptr[float64](11091296), - // Min: to.Ptr[float64](11091296), - // Stdev: to.Ptr[float64](0), - // Sum: to.Ptr[float64](11091296), - // Unit: to.Ptr(armsql.QueryMetricUnitTypeMicroseconds), - // Value: to.Ptr[float64](0), - // }}, - // }}, - // QueryID: to.Ptr("28"), - // StartTime: to.Ptr("03/10/2020 14:00:30"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/sql/armsql/manageddatabaserecommendedsensitivitylabels_client.go b/sdk/resourcemanager/sql/armsql/manageddatabaserecommendedsensitivitylabels_client.go index 9768556b637f..addd50699cee 100644 --- a/sdk/resourcemanager/sql/armsql/manageddatabaserecommendedsensitivitylabels_client.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabaserecommendedsensitivitylabels_client.go @@ -46,7 +46,7 @@ func NewManagedDatabaseRecommendedSensitivityLabelsClient(subscriptionID string, // Update - Update recommended sensitivity labels states of a given database using an operations batch. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -94,7 +94,7 @@ func (client *ManagedDatabaseRecommendedSensitivityLabelsClient) updateCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err diff --git a/sdk/resourcemanager/sql/armsql/manageddatabaserecommendedsensitivitylabels_client_example_test.go b/sdk/resourcemanager/sql/armsql/manageddatabaserecommendedsensitivitylabels_client_example_test.go deleted file mode 100644 index 44d2662bdea3..000000000000 --- a/sdk/resourcemanager/sql/armsql/manageddatabaserecommendedsensitivitylabels_client_example_test.go +++ /dev/null @@ -1,62 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSensitivityLabelsRecommendedUpdate.json -func ExampleManagedDatabaseRecommendedSensitivityLabelsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewManagedDatabaseRecommendedSensitivityLabelsClient().Update(ctx, "myRG", "myManagedInstanceName", "myDatabase", armsql.RecommendedSensitivityLabelUpdateList{ - Operations: []*armsql.RecommendedSensitivityLabelUpdate{ - { - Properties: &armsql.RecommendedSensitivityLabelUpdateProperties{ - Schema: to.Ptr("dbo"), - Column: to.Ptr("column1"), - Op: to.Ptr(armsql.RecommendedSensitivityLabelUpdateKindEnable), - Table: to.Ptr("table1"), - }, - }, - { - Properties: &armsql.RecommendedSensitivityLabelUpdateProperties{ - Schema: to.Ptr("dbo"), - Column: to.Ptr("column2"), - Op: to.Ptr(armsql.RecommendedSensitivityLabelUpdateKindDisable), - Table: to.Ptr("table2"), - }, - }, - { - Properties: &armsql.RecommendedSensitivityLabelUpdateProperties{ - Schema: to.Ptr("dbo"), - Column: to.Ptr("Column3"), - Op: to.Ptr(armsql.RecommendedSensitivityLabelUpdateKindDisable), - Table: to.Ptr("Table1"), - }, - }}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/sql/armsql/manageddatabaserestoredetails_client.go b/sdk/resourcemanager/sql/armsql/manageddatabaserestoredetails_client.go index 7ff474aa6c62..15bad3195861 100644 --- a/sdk/resourcemanager/sql/armsql/manageddatabaserestoredetails_client.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabaserestoredetails_client.go @@ -46,7 +46,7 @@ func NewManagedDatabaseRestoreDetailsClient(subscriptionID string, credential az // Get - Gets managed database restore details. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -100,7 +100,7 @@ func (client *ManagedDatabaseRestoreDetailsClient) getCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/manageddatabaserestoredetails_client_example_test.go b/sdk/resourcemanager/sql/armsql/manageddatabaserestoredetails_client_example_test.go deleted file mode 100644 index 3f2f2bc9120a..000000000000 --- a/sdk/resourcemanager/sql/armsql/manageddatabaserestoredetails_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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/ManagedDatabaseRestoreDetails.json -func ExampleManagedDatabaseRestoreDetailsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedDatabaseRestoreDetailsClient().Get(ctx, "Default-SQL-SouthEastAsia", "managedInstance", "testdb", armsql.RestoreDetailsNameDefault, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedDatabaseRestoreDetailsResult = armsql.ManagedDatabaseRestoreDetailsResult{ - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/databases/restoreDetails"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/managedInstance/databases/testdb/restoreDetails/current"), - // Properties: &armsql.ManagedDatabaseRestoreDetailsProperties{ - // Type: to.Ptr("LRSRestore"), - // CurrentBackupType: to.Ptr("Log"), - // CurrentRestorePlanSizeMB: to.Ptr[int32](47), - // CurrentRestoredSizeMB: to.Ptr[int32](25), - // CurrentRestoringFileName: to.Ptr("RestoreDetailsFullBlownExampleLog10.bak"), - // DiffBackupSets: []*armsql.ManagedDatabaseRestoreDetailsBackupSetProperties{ - // { - // BackupSizeMB: to.Ptr[int32](0), - // FirstStripeName: to.Ptr("RestoreDetailsFullBlownExampleDiff2.bak"), - // NumberOfStripes: to.Ptr[int32](1), - // Status: to.Ptr("Skipped"), - // }, - // { - // BackupSizeMB: to.Ptr[int32](1), - // FirstStripeName: to.Ptr("RestoreDetailsFullBlownExampleDiff3_1.bak"), - // NumberOfStripes: to.Ptr[int32](3), - // RestoreFinishedTimestampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-09T12:20:21.3667454Z"); return t}()), - // RestoreStartedTimestampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-09T12:19:40.5455092Z"); return t}()), - // Status: to.Ptr("Restored"), - // }}, - // FullBackupSets: []*armsql.ManagedDatabaseRestoreDetailsBackupSetProperties{ - // { - // BackupSizeMB: to.Ptr[int32](2), - // FirstStripeName: to.Ptr("RestoreDetailsFullBlownExampleFull2.bak"), - // NumberOfStripes: to.Ptr[int32](1), - // Status: to.Ptr("Skipped"), - // }, - // { - // BackupSizeMB: to.Ptr[int32](3), - // FirstStripeName: to.Ptr("RestoreDetailsFullBlownExampleFull3_1.bak"), - // NumberOfStripes: to.Ptr[int32](3), - // RestoreFinishedTimestampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-09T12:18:41.3785089Z"); return t}()), - // RestoreStartedTimestampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-09T12:15:40.3143263Z"); return t}()), - // Status: to.Ptr("Restored"), - // }}, - // LastRestoredFileName: to.Ptr("RestoreDetailsFullBlownExampleLog9_1.bak"), - // LastRestoredFileTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-09T12:27:20.4936305Z"); return t}()), - // LastUploadedFileName: to.Ptr("RestoreDetailsFullBlownExampleLog11.bak"), - // LastUploadedFileTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-01T07:54:21Z"); return t}()), - // LogBackupSets: []*armsql.ManagedDatabaseRestoreDetailsBackupSetProperties{ - // { - // BackupSizeMB: to.Ptr[int32](0), - // FirstStripeName: to.Ptr("RestoreDetailsFullBlownExampleLog2.bak"), - // NumberOfStripes: to.Ptr[int32](1), - // Status: to.Ptr("Skipped"), - // }, - // { - // BackupSizeMB: to.Ptr[int32](8), - // FirstStripeName: to.Ptr("RestoreDetailsFullBlownExampleLog3.bak"), - // NumberOfStripes: to.Ptr[int32](1), - // Status: to.Ptr("Skipped"), - // }, - // { - // BackupSizeMB: to.Ptr[int32](11), - // FirstStripeName: to.Ptr("RestoreDetailsFullBlownExampleLog4.bak"), - // NumberOfStripes: to.Ptr[int32](1), - // Status: to.Ptr("Skipped"), - // }, - // { - // BackupSizeMB: to.Ptr[int32](7), - // FirstStripeName: to.Ptr("RestoreDetailsFullBlownExampleLog5.bak"), - // NumberOfStripes: to.Ptr[int32](1), - // RestoreFinishedTimestampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-09T12:21:54.7557851Z"); return t}()), - // RestoreStartedTimestampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-09T12:21:01.7717453Z"); return t}()), - // Status: to.Ptr("Restored"), - // }, - // { - // BackupSizeMB: to.Ptr[int32](3), - // FirstStripeName: to.Ptr("RestoreDetailsFullBlownExampleLog6.bak"), - // NumberOfStripes: to.Ptr[int32](1), - // RestoreFinishedTimestampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-09T12:23:03.709407Z"); return t}()), - // RestoreStartedTimestampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-09T12:22:41.8784062Z"); return t}()), - // Status: to.Ptr("Restored"), - // }, - // { - // BackupSizeMB: to.Ptr[int32](4), - // FirstStripeName: to.Ptr("RestoreDetailsFullBlownExampleLog7.bak"), - // NumberOfStripes: to.Ptr[int32](1), - // RestoreFinishedTimestampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-09T12:23:52.9274047Z"); return t}()), - // RestoreStartedTimestampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-09T12:23:36.6264066Z"); return t}()), - // Status: to.Ptr("Restored"), - // }, - // { - // BackupSizeMB: to.Ptr[int32](3), - // FirstStripeName: to.Ptr("RestoreDetailsFullBlownExampleLog8.bak"), - // NumberOfStripes: to.Ptr[int32](1), - // RestoreFinishedTimestampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-09T12:24:37.9954063Z"); return t}()), - // RestoreStartedTimestampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-09T12:24:25.899407Z"); return t}()), - // Status: to.Ptr("Restored"), - // }, - // { - // BackupSizeMB: to.Ptr[int32](4), - // FirstStripeName: to.Ptr("RestoreDetailsFullBlownExampleLog9_1.bak"), - // NumberOfStripes: to.Ptr[int32](4), - // RestoreFinishedTimestampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-09T12:25:27.808409Z"); return t}()), - // RestoreStartedTimestampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-09T12:25:10.8804065Z"); return t}()), - // Status: to.Ptr("Restored"), - // }, - // { - // BackupSizeMB: to.Ptr[int32](15), - // FirstStripeName: to.Ptr("RestoreDetailsFullBlownExampleLog10.bak"), - // NumberOfStripes: to.Ptr[int32](1), - // RestoreStartedTimestampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-09T12:26:00.7813103Z"); return t}()), - // Status: to.Ptr("Restoring"), - // }, - // { - // BackupSizeMB: to.Ptr[int32](7), - // FirstStripeName: to.Ptr("RestoreDetailsFullBlownExampleLog11.bak"), - // NumberOfStripes: to.Ptr[int32](1), - // Status: to.Ptr("Queued"), - // }}, - // NumberOfFilesDetected: to.Ptr[int32](25), - // NumberOfFilesQueued: to.Ptr[int32](1), - // NumberOfFilesRestored: to.Ptr[int32](14), - // NumberOfFilesRestoring: to.Ptr[int32](1), - // NumberOfFilesSkipped: to.Ptr[int32](8), - // NumberOfFilesUnrestorable: to.Ptr[int32](1), - // PercentCompleted: to.Ptr[int32](53), - // Status: to.Ptr("Restoring"), - // UnrestorableFiles: []*armsql.ManagedDatabaseRestoreDetailsUnrestorableFileProperties{ - // { - // Name: to.Ptr("ImageFile.JPG"), - // }}, - // }, - // } -} diff --git a/sdk/resourcemanager/sql/armsql/manageddatabases_client.go b/sdk/resourcemanager/sql/armsql/manageddatabases_client.go index 124639567594..f4e88557e7d6 100644 --- a/sdk/resourcemanager/sql/armsql/manageddatabases_client.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabases_client.go @@ -46,7 +46,7 @@ func NewManagedDatabasesClient(subscriptionID string, credential azcore.TokenCre // BeginCancelMove - Cancels a managed database move operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -70,7 +70,7 @@ func (client *ManagedDatabasesClient) BeginCancelMove(ctx context.Context, resou // CancelMove - Cancels a managed database move operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview func (client *ManagedDatabasesClient) cancelMove(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters ManagedDatabaseMoveDefinition, options *ManagedDatabasesClientBeginCancelMoveOptions) (*http.Response, error) { var err error req, err := client.cancelMoveCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, parameters, options) @@ -112,7 +112,7 @@ func (client *ManagedDatabasesClient) cancelMoveCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err @@ -123,7 +123,7 @@ func (client *ManagedDatabasesClient) cancelMoveCreateRequest(ctx context.Contex // BeginCompleteMove - Completes a managed database move operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -147,7 +147,7 @@ func (client *ManagedDatabasesClient) BeginCompleteMove(ctx context.Context, res // CompleteMove - Completes a managed database move operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview func (client *ManagedDatabasesClient) completeMove(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters ManagedDatabaseMoveDefinition, options *ManagedDatabasesClientBeginCompleteMoveOptions) (*http.Response, error) { var err error req, err := client.completeMoveCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, parameters, options) @@ -189,7 +189,7 @@ func (client *ManagedDatabasesClient) completeMoveCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err @@ -200,7 +200,7 @@ func (client *ManagedDatabasesClient) completeMoveCreateRequest(ctx context.Cont // BeginCompleteRestore - Completes the restore operation on a managed database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -224,7 +224,7 @@ func (client *ManagedDatabasesClient) BeginCompleteRestore(ctx context.Context, // CompleteRestore - Completes the restore operation on a managed database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview func (client *ManagedDatabasesClient) completeRestore(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters CompleteDatabaseRestoreDefinition, options *ManagedDatabasesClientBeginCompleteRestoreOptions) (*http.Response, error) { var err error req, err := client.completeRestoreCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, parameters, options) @@ -266,7 +266,7 @@ func (client *ManagedDatabasesClient) completeRestoreCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err @@ -277,7 +277,7 @@ func (client *ManagedDatabasesClient) completeRestoreCreateRequest(ctx context.C // BeginCreateOrUpdate - Creates a new database or updates an existing database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -301,7 +301,7 @@ func (client *ManagedDatabasesClient) BeginCreateOrUpdate(ctx context.Context, r // CreateOrUpdate - Creates a new database or updates an existing database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview func (client *ManagedDatabasesClient) createOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters ManagedDatabase, options *ManagedDatabasesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, parameters, options) @@ -343,7 +343,7 @@ func (client *ManagedDatabasesClient) createOrUpdateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -355,7 +355,7 @@ func (client *ManagedDatabasesClient) createOrUpdateCreateRequest(ctx context.Co // BeginDelete - Deletes a managed database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -378,7 +378,7 @@ func (client *ManagedDatabasesClient) BeginDelete(ctx context.Context, resourceG // Delete - Deletes a managed database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview func (client *ManagedDatabasesClient) deleteOperation(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, options *ManagedDatabasesClientBeginDeleteOptions) (*http.Response, error) { var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, options) @@ -420,7 +420,7 @@ func (client *ManagedDatabasesClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -428,7 +428,7 @@ func (client *ManagedDatabasesClient) deleteCreateRequest(ctx context.Context, r // Get - Gets a managed database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -476,7 +476,7 @@ func (client *ManagedDatabasesClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -493,7 +493,7 @@ func (client *ManagedDatabasesClient) getHandleResponse(resp *http.Response) (Ma // NewListByInstancePager - Gets a list of managed databases. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -547,7 +547,7 @@ func (client *ManagedDatabasesClient) listByInstanceCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -564,7 +564,7 @@ func (client *ManagedDatabasesClient) listByInstanceHandleResponse(resp *http.Re // NewListInaccessibleByInstancePager - Gets a list of inaccessible managed databases in a managed instance // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -618,7 +618,7 @@ func (client *ManagedDatabasesClient) listInaccessibleByInstanceCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -636,7 +636,7 @@ func (client *ManagedDatabasesClient) listInaccessibleByInstanceHandleResponse(r // BeginStartMove - Starts a managed database move operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -660,7 +660,7 @@ func (client *ManagedDatabasesClient) BeginStartMove(ctx context.Context, resour // StartMove - Starts a managed database move operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview func (client *ManagedDatabasesClient) startMove(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters ManagedDatabaseStartMoveDefinition, options *ManagedDatabasesClientBeginStartMoveOptions) (*http.Response, error) { var err error req, err := client.startMoveCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, parameters, options) @@ -702,7 +702,7 @@ func (client *ManagedDatabasesClient) startMoveCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err @@ -713,7 +713,7 @@ func (client *ManagedDatabasesClient) startMoveCreateRequest(ctx context.Context // BeginUpdate - Updates an existing database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -737,7 +737,7 @@ func (client *ManagedDatabasesClient) BeginUpdate(ctx context.Context, resourceG // Update - Updates an existing database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview func (client *ManagedDatabasesClient) update(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters ManagedDatabaseUpdate, options *ManagedDatabasesClientBeginUpdateOptions) (*http.Response, error) { var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, parameters, options) @@ -779,7 +779,7 @@ func (client *ManagedDatabasesClient) updateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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/sql/armsql/manageddatabases_client_example_test.go b/sdk/resourcemanager/sql/armsql/manageddatabases_client_example_test.go deleted file mode 100644 index f4fc8cd7262d..000000000000 --- a/sdk/resourcemanager/sql/armsql/manageddatabases_client_example_test.go +++ /dev/null @@ -1,786 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedDatabaseListByManagedInstance.json -func ExampleManagedDatabasesClient_NewListByInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagedDatabasesClient().NewListByInstancePager("Test1", "managedInstance", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ManagedDatabaseListResult = armsql.ManagedDatabaseListResult{ - // Value: []*armsql.ManagedDatabase{ - // { - // Name: to.Ptr("testdb1"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/databases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testcl/databases/testdb1"), - // Location: to.Ptr("southeastasia"), - // Properties: &armsql.ManagedDatabaseProperties{ - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-04T15:00:17.73Z"); return t}()), - // DefaultSecondaryLocation: to.Ptr("North Europe"), - // IsLedgerOn: to.Ptr(false), - // Status: to.Ptr(armsql.ManagedDatabaseStatusOnline), - // }, - // }, - // { - // Name: to.Ptr("testdb2"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/databases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testcl/databases/testdb2"), - // Location: to.Ptr("southeastasia"), - // Properties: &armsql.ManagedDatabaseProperties{ - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-04T15:00:17.73Z"); return t}()), - // DefaultSecondaryLocation: to.Ptr("North Europe"), - // IsLedgerOn: to.Ptr(false), - // Status: to.Ptr(armsql.ManagedDatabaseStatusOnline), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedDatabaseGet.json -func ExampleManagedDatabasesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedDatabasesClient().Get(ctx, "Test1", "managedInstance", "managedDatabase", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedDatabase = armsql.ManagedDatabase{ - // Name: to.Ptr("testdb1"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/databases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testcl/databases/testdb1"), - // Location: to.Ptr("southeastasia"), - // Properties: &armsql.ManagedDatabaseProperties{ - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-04T15:00:17.73Z"); return t}()), - // DefaultSecondaryLocation: to.Ptr("North Europe"), - // IsLedgerOn: to.Ptr(false), - // Status: to.Ptr(armsql.ManagedDatabaseStatusOnline), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedDatabaseCreateRestoreExternalBackup.json -func ExampleManagedDatabasesClient_BeginCreateOrUpdate_createsANewManagedDatabaseByRestoringFromAnExternalBackup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "managedInstance", "managedDatabase", armsql.ManagedDatabase{ - Location: to.Ptr("southeastasia"), - Properties: &armsql.ManagedDatabaseProperties{ - AutoCompleteRestore: to.Ptr(true), - Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - CreateMode: to.Ptr(armsql.ManagedDatabaseCreateModeRestoreExternalBackup), - LastBackupName: to.Ptr("last_backup_name"), - StorageContainerSasToken: to.Ptr("sv=2015-12-11&sr=c&sp=rl&sig=1234"), - StorageContainerURI: to.Ptr("https://myaccountname.blob.core.windows.net/backups"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedDatabase = armsql.ManagedDatabase{ - // Name: to.Ptr("testdb1"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/databases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/testsvr/databases/testdb1"), - // Location: to.Ptr("southeastasia"), - // Tags: map[string]*string{ - // "tagKey1": to.Ptr("TagValue1"), - // }, - // Properties: &armsql.ManagedDatabaseProperties{ - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), - // DefaultSecondaryLocation: to.Ptr("North Europe"), - // IsLedgerOn: to.Ptr(false), - // Status: to.Ptr(armsql.ManagedDatabaseStatusOnline), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedDatabaseCreateRestoreExternalBackupManagedIdentity.json -func ExampleManagedDatabasesClient_BeginCreateOrUpdate_createsANewManagedDatabaseByRestoringFromAnExternalBackupUsingManagedIdentity() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "managedInstance", "managedDatabase", armsql.ManagedDatabase{ - Location: to.Ptr("southeastasia"), - Properties: &armsql.ManagedDatabaseProperties{ - AutoCompleteRestore: to.Ptr(true), - Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - CreateMode: to.Ptr(armsql.ManagedDatabaseCreateModeRestoreExternalBackup), - LastBackupName: to.Ptr("last_backup_name"), - StorageContainerIdentity: to.Ptr("ManagedIdentity"), - StorageContainerURI: to.Ptr("https://myaccountname.blob.core.windows.net/backups"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedDatabase = armsql.ManagedDatabase{ - // Name: to.Ptr("testdb1"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/databases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/testsvr/databases/testdb1"), - // Location: to.Ptr("southeastasia"), - // Tags: map[string]*string{ - // "tagKey1": to.Ptr("TagValue1"), - // }, - // Properties: &armsql.ManagedDatabaseProperties{ - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), - // DefaultSecondaryLocation: to.Ptr("North Europe"), - // IsLedgerOn: to.Ptr(false), - // Status: to.Ptr(armsql.ManagedDatabaseStatusOnline), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedDatabaseCreateRecovery.json -func ExampleManagedDatabasesClient_BeginCreateOrUpdate_createsANewManagedDatabaseFromRestoringAGeoReplicatedBackup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "server1", "testdb_recovered", armsql.ManagedDatabase{ - Location: to.Ptr("southeastasia"), - Properties: &armsql.ManagedDatabaseProperties{ - CreateMode: to.Ptr(armsql.ManagedDatabaseCreateModeRecovery), - RecoverableDatabaseID: to.Ptr("/subscriptions/11111111-2222-3333-4444-555555555555/resourceGroups/Default-SQL-WestEurope/providers/Microsoft.Sql/managedInstances/testsvr/recoverableDatabases/testdb"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedDatabase = armsql.ManagedDatabase{ - // Name: to.Ptr("testdb_recovered"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/databases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/server1/recoverableDatabases/testdb_recovered"), - // Location: to.Ptr("southeastasia"), - // Tags: map[string]*string{ - // "tagKey1": to.Ptr("TagValue1"), - // }, - // Properties: &armsql.ManagedDatabaseProperties{ - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-07T04:41:33.937Z"); return t}()), - // IsLedgerOn: to.Ptr(false), - // Status: to.Ptr(armsql.ManagedDatabaseStatusOnline), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedDatabaseCreateRestoreLtrBackup.json -func ExampleManagedDatabasesClient_BeginCreateOrUpdate_createsANewManagedDatabaseFromRestoringALongTermRetentionBackup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "managedInstance", "managedDatabase", armsql.ManagedDatabase{ - Location: to.Ptr("southeastasia"), - Properties: &armsql.ManagedDatabaseProperties{ - Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - CreateMode: to.Ptr(armsql.ManagedDatabaseCreateModeRestoreExternalBackup), - StorageContainerSasToken: to.Ptr("sv=2015-12-11&sr=c&sp=rl&sig=1234"), - StorageContainerURI: to.Ptr("https://myaccountname.blob.core.windows.net/backups"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedDatabase = armsql.ManagedDatabase{ - // Name: to.Ptr("testdb1"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/databases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/testsvr/databases/testdb1"), - // Location: to.Ptr("southeastasia"), - // Tags: map[string]*string{ - // "tagKey1": to.Ptr("TagValue1"), - // }, - // Properties: &armsql.ManagedDatabaseProperties{ - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), - // DefaultSecondaryLocation: to.Ptr("North Europe"), - // IsLedgerOn: to.Ptr(false), - // Status: to.Ptr(armsql.ManagedDatabaseStatusOnline), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedDatabaseCreateCrossSubscriptionPointInTimeRestore.json -func ExampleManagedDatabasesClient_BeginCreateOrUpdate_createsANewManagedDatabaseUsingCrossSubscriptionPointInTimeRestore() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "managedInstance", "managedDatabase", armsql.ManagedDatabase{ - Location: to.Ptr("southeastasia"), - Properties: &armsql.ManagedDatabaseProperties{ - CreateMode: to.Ptr(armsql.ManagedDatabaseCreateModePointInTimeRestore), - CrossSubscriptionSourceDatabaseID: to.Ptr("/subscriptions/11111111-2222-3333-4444-555555555555/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/testsvr2/databases/testdb"), - CrossSubscriptionTargetManagedInstanceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/testsvr"), - RestorePointInTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-07-14T05:35:31.503Z"); 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.ManagedDatabase = armsql.ManagedDatabase{ - // Name: to.Ptr("testdb1"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/databases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/testsvr/databases/testdb1"), - // Location: to.Ptr("southeastasia"), - // Tags: map[string]*string{ - // "tagKey1": to.Ptr("TagValue1"), - // }, - // Properties: &armsql.ManagedDatabaseProperties{ - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), - // DefaultSecondaryLocation: to.Ptr("North Europe"), - // IsLedgerOn: to.Ptr(false), - // Status: to.Ptr(armsql.ManagedDatabaseStatusOnline), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedDatabaseCreatePointInTimeRestore.json -func ExampleManagedDatabasesClient_BeginCreateOrUpdate_createsANewManagedDatabaseUsingPointInTimeRestore() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "managedInstance", "managedDatabase", armsql.ManagedDatabase{ - Location: to.Ptr("southeastasia"), - Properties: &armsql.ManagedDatabaseProperties{ - CreateMode: to.Ptr(armsql.ManagedDatabaseCreateModePointInTimeRestore), - RestorePointInTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-07-14T05:35:31.503Z"); return t }()), - SourceDatabaseID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/testsvr/databases/testdb"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedDatabase = armsql.ManagedDatabase{ - // Name: to.Ptr("testdb1"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/databases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/testsvr/databases/testdb1"), - // Location: to.Ptr("southeastasia"), - // Tags: map[string]*string{ - // "tagKey1": to.Ptr("TagValue1"), - // }, - // Properties: &armsql.ManagedDatabaseProperties{ - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), - // DefaultSecondaryLocation: to.Ptr("North Europe"), - // IsLedgerOn: to.Ptr(false), - // Status: to.Ptr(armsql.ManagedDatabaseStatusOnline), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CreateManagedDatabaseLedger.json -func ExampleManagedDatabasesClient_BeginCreateOrUpdate_createsANewManagedDatabaseWithLedgerOn() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "managedInstance", "managedDatabase", armsql.ManagedDatabase{ - Location: to.Ptr("southeastasia"), - Properties: &armsql.ManagedDatabaseProperties{ - IsLedgerOn: 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.ManagedDatabase = armsql.ManagedDatabase{ - // Name: to.Ptr("testdb1"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/databases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/testcl/databases/testdb1"), - // Location: to.Ptr("southeastasia"), - // Tags: map[string]*string{ - // "tagKey1": to.Ptr("TagValue1"), - // }, - // Properties: &armsql.ManagedDatabaseProperties{ - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), - // DefaultSecondaryLocation: to.Ptr("North Europe"), - // IsLedgerOn: to.Ptr(true), - // Status: to.Ptr(armsql.ManagedDatabaseStatusOnline), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedDatabaseCreateMax.json -func ExampleManagedDatabasesClient_BeginCreateOrUpdate_createsANewManagedDatabaseWithMaximalProperties() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "managedInstance", "managedDatabase", armsql.ManagedDatabase{ - Location: to.Ptr("southeastasia"), - Tags: map[string]*string{ - "tagKey1": to.Ptr("TagValue1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedDatabase = armsql.ManagedDatabase{ - // Name: to.Ptr("testdb1"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/databases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/testsvr/databases/testdb1"), - // Location: to.Ptr("southeastasia"), - // Tags: map[string]*string{ - // "tagKey1": to.Ptr("TagValue1"), - // }, - // Properties: &armsql.ManagedDatabaseProperties{ - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), - // DefaultSecondaryLocation: to.Ptr("North Europe"), - // IsLedgerOn: to.Ptr(false), - // Status: to.Ptr(armsql.ManagedDatabaseStatusOnline), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedDatabaseCreateMin.json -func ExampleManagedDatabasesClient_BeginCreateOrUpdate_createsANewManagedDatabaseWithMinimalProperties() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedDatabasesClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "managedInstance", "managedDatabase", armsql.ManagedDatabase{ - Location: to.Ptr("southeastasia"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedDatabase = armsql.ManagedDatabase{ - // Name: to.Ptr("testdb1"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/databases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/testsvr/databases/testdb1"), - // Location: to.Ptr("southeastasia"), - // Properties: &armsql.ManagedDatabaseProperties{ - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), - // DefaultSecondaryLocation: to.Ptr("North Europe"), - // IsLedgerOn: to.Ptr(false), - // Status: to.Ptr(armsql.ManagedDatabaseStatusOnline), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedDatabaseDelete.json -func ExampleManagedDatabasesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedDatabasesClient().BeginDelete(ctx, "Default-SQL-SouthEastAsia", "managedInstance", "testdb", 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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedDatabaseUpdateMax.json -func ExampleManagedDatabasesClient_BeginUpdate_updatesAManagedDatabaseWithMaximalProperties() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedDatabasesClient().BeginUpdate(ctx, "Default-SQL-SouthEastAsia", "managedInstance", "testdb", armsql.ManagedDatabaseUpdate{ - Tags: map[string]*string{ - "tagKey1": to.Ptr("TagValue1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedDatabase = armsql.ManagedDatabase{ - // Name: to.Ptr("testdb"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"), - // Location: to.Ptr("southeastasia"), - // Tags: map[string]*string{ - // "tagKey1": to.Ptr("TagValue1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedDatabaseUpdateMin.json -func ExampleManagedDatabasesClient_BeginUpdate_updatesAManagedDatabaseWithMinimalProperties() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedDatabasesClient().BeginUpdate(ctx, "Default-SQL-SouthEastAsia", "managedInstance", "testdb", armsql.ManagedDatabaseUpdate{ - Tags: map[string]*string{ - "tagKey1": to.Ptr("TagValue1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedDatabase = armsql.ManagedDatabase{ - // Name: to.Ptr("testdb"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"), - // Location: to.Ptr("southeastasia"), - // Tags: map[string]*string{ - // "tagKey1": to.Ptr("TagValue1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedDatabaseCancelMove.json -func ExampleManagedDatabasesClient_BeginCancelMove() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedDatabasesClient().BeginCancelMove(ctx, "group1", "testInstanceSrc", "testDatabase", armsql.ManagedDatabaseMoveDefinition{ - DestinationManagedDatabaseID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/managedInstances/testInstanceTgt/databases/testDatabase"), - }, 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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedDatabaseCompleteMove.json -func ExampleManagedDatabasesClient_BeginCompleteMove() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedDatabasesClient().BeginCompleteMove(ctx, "group1", "testInstanceSrc", "testDatabase", armsql.ManagedDatabaseMoveDefinition{ - DestinationManagedDatabaseID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/managedInstances/testInstanceTgt/databases/testDatabase"), - }, 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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedDatabaseCompleteExternalRestore.json -func ExampleManagedDatabasesClient_BeginCompleteRestore() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedDatabasesClient().BeginCompleteRestore(ctx, "myRG", "myManagedInstanceName", "myDatabase", armsql.CompleteDatabaseRestoreDefinition{ - LastBackupName: to.Ptr("testdb1_log4"), - }, 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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedDatabaseStartMoveMax.json -func ExampleManagedDatabasesClient_BeginStartMove_startsAManagedDatabaseMoveWithAllOptionalParametersSpecified() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedDatabasesClient().BeginStartMove(ctx, "group1", "testInstanceSrc", "testDatabase", armsql.ManagedDatabaseStartMoveDefinition{ - DestinationManagedDatabaseID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/managedInstances/testInstanceTgt/databases/testDatabase"), - OperationMode: to.Ptr(armsql.MoveOperationModeCopy), - }, 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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedDatabaseStartMoveMin.json -func ExampleManagedDatabasesClient_BeginStartMove_startsAManagedDatabaseMoveWithNoOptionalParametersSpecified() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedDatabasesClient().BeginStartMove(ctx, "group1", "testInstanceSrc", "testDatabase", armsql.ManagedDatabaseStartMoveDefinition{ - DestinationManagedDatabaseID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/managedInstances/testInstanceTgt/databases/testDatabase"), - }, 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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/InaccessibleManagedDatabaseListByManagedInstance.json -func ExampleManagedDatabasesClient_NewListInaccessibleByInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagedDatabasesClient().NewListInaccessibleByInstancePager("testrg", "testcl", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ManagedDatabaseListResult = armsql.ManagedDatabaseListResult{ - // Value: []*armsql.ManagedDatabase{ - // { - // Name: to.Ptr("testdb1"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/databases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testcl/databases/testdb1"), - // Location: to.Ptr("southeastasia"), - // Properties: &armsql.ManagedDatabaseProperties{ - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-04T15:00:17.73Z"); return t}()), - // DefaultSecondaryLocation: to.Ptr("North Europe"), - // Status: to.Ptr(armsql.ManagedDatabaseStatusInaccessible), - // }, - // }, - // { - // Name: to.Ptr("testdb2"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/databases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testcl/databases/testdb2"), - // Location: to.Ptr("southeastasia"), - // Properties: &armsql.ManagedDatabaseProperties{ - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-04T15:00:17.73Z"); return t}()), - // DefaultSecondaryLocation: to.Ptr("North Europe"), - // Status: to.Ptr(armsql.ManagedDatabaseStatusInaccessible), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/sql/armsql/manageddatabaseschemas_client.go b/sdk/resourcemanager/sql/armsql/manageddatabaseschemas_client.go index 07b67e6cbf28..6145a636ce8d 100644 --- a/sdk/resourcemanager/sql/armsql/manageddatabaseschemas_client.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabaseschemas_client.go @@ -46,7 +46,7 @@ func NewManagedDatabaseSchemasClient(subscriptionID string, credential azcore.To // Get - Get managed database schema // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -100,7 +100,7 @@ func (client *ManagedDatabaseSchemasClient) getCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -117,7 +117,7 @@ func (client *ManagedDatabaseSchemasClient) getHandleResponse(resp *http.Respons // NewListByDatabasePager - List managed database schemas // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -179,7 +179,7 @@ func (client *ManagedDatabaseSchemasClient) listByDatabaseCreateRequest(ctx cont if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/manageddatabaseschemas_client_example_test.go b/sdk/resourcemanager/sql/armsql/manageddatabaseschemas_client_example_test.go deleted file mode 100644 index 4946238a6927..000000000000 --- a/sdk/resourcemanager/sql/armsql/manageddatabaseschemas_client_example_test.go +++ /dev/null @@ -1,81 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSchemaListByDatabase.json -func ExampleManagedDatabaseSchemasClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagedDatabaseSchemasClient().NewListByDatabasePager("myRG", "myManagedInstanceName", "myDatabase", &armsql.ManagedDatabaseSchemasClientListByDatabaseOptions{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.DatabaseSchemaListResult = armsql.DatabaseSchemaListResult{ - // Value: []*armsql.DatabaseSchema{ - // { - // Name: to.Ptr("dbo"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/databases/schemas"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myRG/providers/Microsoft.Sql/managedInstances/myManagedInstanceName/databases/myDatabase/schemas/dbo"), - // }, - // { - // Name: to.Ptr("schema2"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/databases/schemas"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myRG/providers/Microsoft.Sql/managedInstances/myManagedInstanceName/databases/myDatabase/schemas/schema2"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSchemaGet.json -func ExampleManagedDatabaseSchemasClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedDatabaseSchemasClient().Get(ctx, "myRG", "myManagedInstanceName", "myDatabase", "dbo", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DatabaseSchema = armsql.DatabaseSchema{ - // Name: to.Ptr("dbo"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/databases/schemas"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myRG/providers/Microsoft.Sql/managedInstances/myManagedInstanceName/databases/myDatabase/schemas/dbo"), - // } -} diff --git a/sdk/resourcemanager/sql/armsql/manageddatabasesecurityalertpolicies_client.go b/sdk/resourcemanager/sql/armsql/manageddatabasesecurityalertpolicies_client.go index 795159864b67..fc00425478d7 100644 --- a/sdk/resourcemanager/sql/armsql/manageddatabasesecurityalertpolicies_client.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabasesecurityalertpolicies_client.go @@ -46,7 +46,7 @@ func NewManagedDatabaseSecurityAlertPoliciesClient(subscriptionID string, creden // CreateOrUpdate - Creates or updates a database's security alert policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -101,7 +101,7 @@ func (client *ManagedDatabaseSecurityAlertPoliciesClient) createOrUpdateCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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 *ManagedDatabaseSecurityAlertPoliciesClient) createOrUpdateHandleRe // Get - Gets a managed database's security alert policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -176,7 +176,7 @@ func (client *ManagedDatabaseSecurityAlertPoliciesClient) getCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -193,7 +193,7 @@ func (client *ManagedDatabaseSecurityAlertPoliciesClient) getHandleResponse(resp // NewListByDatabasePager - Gets a list of managed database's security alert policies. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -252,7 +252,7 @@ func (client *ManagedDatabaseSecurityAlertPoliciesClient) listByDatabaseCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/manageddatabasesecurityalertpolicies_client_example_test.go b/sdk/resourcemanager/sql/armsql/manageddatabasesecurityalertpolicies_client_example_test.go deleted file mode 100644 index 312bfef493b4..000000000000 --- a/sdk/resourcemanager/sql/armsql/manageddatabasesecurityalertpolicies_client_example_test.go +++ /dev/null @@ -1,193 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSecurityAlertGet.json -func ExampleManagedDatabaseSecurityAlertPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedDatabaseSecurityAlertPoliciesClient().Get(ctx, "securityalert-6852", "securityalert-2080", "testdb", armsql.SecurityAlertPolicyNameDefault, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedDatabaseSecurityAlertPolicy = armsql.ManagedDatabaseSecurityAlertPolicy{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/databases/securityAlertPolicies"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/securityalert-6852/providers/Microsoft.Sql/managedInstances/securityalert-2080/databases/testdb"), - // Properties: &armsql.SecurityAlertPolicyProperties{ - // DisabledAlerts: []*string{ - // to.Ptr("Usage_Anomaly")}, - // EmailAccountAdmins: to.Ptr(true), - // EmailAddresses: []*string{ - // to.Ptr("test@contoso.com"), - // to.Ptr("user@contoso.com")}, - // RetentionDays: to.Ptr[int32](0), - // State: to.Ptr(armsql.SecurityAlertPolicyStateEnabled), - // StorageAccountAccessKey: to.Ptr(""), - // StorageEndpoint: to.Ptr(""), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSecurityAlertCreateMax.json -func ExampleManagedDatabaseSecurityAlertPoliciesClient_CreateOrUpdate_updateADatabasesThreatDetectionPolicyWithAllParameters() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedDatabaseSecurityAlertPoliciesClient().CreateOrUpdate(ctx, "securityalert-4799", "securityalert-6440", "testdb", armsql.SecurityAlertPolicyNameDefault, armsql.ManagedDatabaseSecurityAlertPolicy{ - Properties: &armsql.SecurityAlertPolicyProperties{ - DisabledAlerts: []*string{ - to.Ptr("Sql_Injection"), - to.Ptr("Usage_Anomaly")}, - EmailAccountAdmins: to.Ptr(true), - EmailAddresses: []*string{ - to.Ptr("test@contoso.com"), - to.Ptr("user@contoso.com")}, - RetentionDays: to.Ptr[int32](6), - State: to.Ptr(armsql.SecurityAlertPolicyStateEnabled), - StorageAccountAccessKey: to.Ptr("sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD=="), - StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedDatabaseSecurityAlertPolicy = armsql.ManagedDatabaseSecurityAlertPolicy{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/databases/securityAlertPolicies"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/securityalert-4799/providers/Microsoft.Sql/managedInstances/securityalert-6440/databases/testdb"), - // Properties: &armsql.SecurityAlertPolicyProperties{ - // DisabledAlerts: []*string{ - // to.Ptr("Sql_Injection"), - // to.Ptr("Usage_Anomaly")}, - // EmailAccountAdmins: to.Ptr(true), - // EmailAddresses: []*string{ - // to.Ptr("test@contoso.com"), - // to.Ptr("user@contoso.com")}, - // RetentionDays: to.Ptr[int32](6), - // State: to.Ptr(armsql.SecurityAlertPolicyStateEnabled), - // StorageAccountAccessKey: to.Ptr(""), - // StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSecurityAlertCreateMin.json -func ExampleManagedDatabaseSecurityAlertPoliciesClient_CreateOrUpdate_updateADatabasesThreatDetectionPolicyWithMinimalParameters() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedDatabaseSecurityAlertPoliciesClient().CreateOrUpdate(ctx, "securityalert-4799", "securityalert-6440", "testdb", armsql.SecurityAlertPolicyNameDefault, armsql.ManagedDatabaseSecurityAlertPolicy{ - Properties: &armsql.SecurityAlertPolicyProperties{ - State: to.Ptr(armsql.SecurityAlertPolicyStateEnabled), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedDatabaseSecurityAlertPolicy = armsql.ManagedDatabaseSecurityAlertPolicy{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.Sql/managedInstance/databases/securityAlertPolicies"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/securityalert-4799/providers/Microsoft.Sql/managedInstances/securityalert-6440/databases/testdb"), - // Properties: &armsql.SecurityAlertPolicyProperties{ - // DisabledAlerts: []*string{ - // }, - // EmailAccountAdmins: to.Ptr(true), - // EmailAddresses: []*string{ - // }, - // RetentionDays: to.Ptr[int32](0), - // State: to.Ptr(armsql.SecurityAlertPolicyStateEnabled), - // StorageAccountAccessKey: to.Ptr(""), - // StorageEndpoint: to.Ptr(""), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSecurityAlertListByDatabase.json -func ExampleManagedDatabaseSecurityAlertPoliciesClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagedDatabaseSecurityAlertPoliciesClient().NewListByDatabasePager("securityalert-6852", "securityalert-2080", "testdb", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ManagedDatabaseSecurityAlertPolicyListResult = armsql.ManagedDatabaseSecurityAlertPolicyListResult{ - // Value: []*armsql.ManagedDatabaseSecurityAlertPolicy{ - // { - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/databases/securityAlertPolicies"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/securityalert-6852/providers/Microsoft.Sql/managedInstances/securityalert-2080/databases/testdb"), - // Properties: &armsql.SecurityAlertPolicyProperties{ - // DisabledAlerts: []*string{ - // to.Ptr("Usage_Anomaly")}, - // EmailAccountAdmins: to.Ptr(true), - // EmailAddresses: []*string{ - // to.Ptr("test@contoso.com"), - // to.Ptr("user@contoso.com")}, - // RetentionDays: to.Ptr[int32](0), - // State: to.Ptr(armsql.SecurityAlertPolicyStateEnabled), - // StorageAccountAccessKey: to.Ptr(""), - // StorageEndpoint: to.Ptr(""), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/sql/armsql/manageddatabasesecurityevents_client.go b/sdk/resourcemanager/sql/armsql/manageddatabasesecurityevents_client.go index c6cddedbd549..83c6ff6c4c9b 100644 --- a/sdk/resourcemanager/sql/armsql/manageddatabasesecurityevents_client.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabasesecurityevents_client.go @@ -46,7 +46,7 @@ func NewManagedDatabaseSecurityEventsClient(subscriptionID string, credential az // NewListByDatabasePager - Gets a list of security events. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -109,15 +109,15 @@ func (client *ManagedDatabaseSecurityEventsClient) listByDatabaseCreateRequest(c reqQP.Set("$filter", *options.Filter) } if options != nil && options.Skip != nil { - reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) + reqQP.Set("$skip", strconv.FormatInt(*options.Skip, 10)) } if options != nil && options.Top != nil { - reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + reqQP.Set("$top", strconv.FormatInt(*options.Top, 10)) } if options != nil && options.Skiptoken != nil { reqQP.Set("$skiptoken", *options.Skiptoken) } - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/manageddatabasesecurityevents_client_example_test.go b/sdk/resourcemanager/sql/armsql/manageddatabasesecurityevents_client_example_test.go deleted file mode 100644 index 4102dfba3458..000000000000 --- a/sdk/resourcemanager/sql/armsql/manageddatabasesecurityevents_client_example_test.go +++ /dev/null @@ -1,179 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSecurityEventsGetMax.json -func ExampleManagedDatabaseSecurityEventsClient_NewListByDatabasePager_getTheManagedDatabasesSecurityEventsWithMaximalParameters() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagedDatabaseSecurityEventsClient().NewListByDatabasePager("testrg", "testcl", "database1", &armsql.ManagedDatabaseSecurityEventsClientListByDatabaseOptions{Filter: to.Ptr("ShowServerRecords eq true"), - Skip: to.Ptr[int32](0), - Top: to.Ptr[int32](1), - Skiptoken: to.Ptr("eyJCbG9iTmFtZURhdGVUaW1lIjoiXC9EYXRlKDE1MTIyODg4MTIwMTArMDIwMClcLyIsIkJsb2JOYW1lUm9sbG92ZXJJbmRleCI6IjAiLCJFbmREYXRlIjoiXC9EYXRlKDE1MTI0NjYyMDA1MjkpXC8iLCJJc1NraXBUb2tlblNldCI6ZmFsc2UsIklzVjJCbG9iVGltZUZvcm1hdCI6dHJ1ZSwiU2hvd1NlcnZlclJlY29yZHMiOmZhbHNlLCJTa2lwVmFsdWUiOjAsIlRha2VWYWx1ZSI6MTB9"), - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SecurityEventCollection = armsql.SecurityEventCollection{ - // Value: []*armsql.SecurityEvent{ - // { - // Name: to.Ptr("06364798761800000000000000001"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/securityEvents"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testcl/databases/database1/securityEvents/06364798761800000000000000001"), - // Properties: &armsql.SecurityEventProperties{ - // ApplicationName: to.Ptr("myApp"), - // ClientIP: to.Ptr("10.166.113.220"), - // Database: to.Ptr("database1"), - // EventTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-24T10:13:24.729Z"); return t}()), - // PrincipalName: to.Ptr("maliciousUser"), - // SecurityEventSQLInjectionAdditionalProperties: &armsql.SecurityEventSQLInjectionAdditionalProperties{ - // ErrorCode: to.Ptr[int32](0), - // ErrorMessage: to.Ptr(""), - // ErrorSeverity: to.Ptr[int32](0), - // Statement: to.Ptr("select * from sys.databases where database_id like '' or 1 = 1 --' and family = 'test11'"), - // StatementHighlightLength: to.Ptr[int32](13), - // StatementHighlightOffset: to.Ptr[int32](52), - // ThreatID: to.Ptr("1"), - // }, - // SecurityEventType: to.Ptr(armsql.SecurityEventTypeSQLInjectionExploit), - // Server: to.Ptr("testcl"), - // Subscription: to.Ptr("00000000-1111-2222-3333-444444444444"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSecurityEventsGetMin.json -func ExampleManagedDatabaseSecurityEventsClient_NewListByDatabasePager_getTheManagedDatabasesSecurityEventsWithMinimalParameters() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagedDatabaseSecurityEventsClient().NewListByDatabasePager("testrg", "testcl", "database1", &armsql.ManagedDatabaseSecurityEventsClientListByDatabaseOptions{Filter: nil, - Skip: nil, - 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.SecurityEventCollection = armsql.SecurityEventCollection{ - // Value: []*armsql.SecurityEvent{ - // { - // Name: to.Ptr("06364798761800000000000000001"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/securityEvents"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testcl/databases/database1/securityEvents/06364798761800000000000000001"), - // Properties: &armsql.SecurityEventProperties{ - // ApplicationName: to.Ptr("myApp"), - // ClientIP: to.Ptr("10.166.113.220"), - // Database: to.Ptr("database1"), - // EventTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-24T10:13:24.729Z"); return t}()), - // PrincipalName: to.Ptr("maliciousUser"), - // SecurityEventSQLInjectionAdditionalProperties: &armsql.SecurityEventSQLInjectionAdditionalProperties{ - // ErrorCode: to.Ptr[int32](0), - // ErrorMessage: to.Ptr(""), - // ErrorSeverity: to.Ptr[int32](0), - // Statement: to.Ptr("select * from sys.databases where database_id like '' or 1 = 1 --' and family = 'test11'"), - // StatementHighlightLength: to.Ptr[int32](13), - // StatementHighlightOffset: to.Ptr[int32](52), - // ThreatID: to.Ptr("1"), - // }, - // SecurityEventType: to.Ptr(armsql.SecurityEventTypeSQLInjectionExploit), - // Server: to.Ptr("testcl"), - // Subscription: to.Ptr("00000000-1111-2222-3333-444444444444"), - // }, - // }, - // { - // Name: to.Ptr("06364798761800000000000000002"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/securityEvents"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testcl/databases/database1/securityEvents/06364798761800000000000000002"), - // Properties: &armsql.SecurityEventProperties{ - // ApplicationName: to.Ptr("myApp"), - // ClientIP: to.Ptr("10.166.113.220"), - // Database: to.Ptr("database1"), - // EventTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-24T10:11:14.121Z"); return t}()), - // PrincipalName: to.Ptr("maliciousUser"), - // SecurityEventSQLInjectionAdditionalProperties: &armsql.SecurityEventSQLInjectionAdditionalProperties{ - // ErrorCode: to.Ptr[int32](0), - // ErrorMessage: to.Ptr(""), - // ErrorSeverity: to.Ptr[int32](0), - // Statement: to.Ptr("select * from sys.databases where database_id like '' or 1 = 1 --' and family = 'test10'"), - // StatementHighlightLength: to.Ptr[int32](13), - // StatementHighlightOffset: to.Ptr[int32](52), - // ThreatID: to.Ptr("1"), - // }, - // SecurityEventType: to.Ptr(armsql.SecurityEventTypeSQLInjectionExploit), - // Server: to.Ptr("testcl"), - // Subscription: to.Ptr("00000000-1111-2222-3333-444444444444"), - // }, - // }, - // { - // Name: to.Ptr("06364798761800000000000000003"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/securityEvents"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testcl/databases/database1/securityEvents/06364798761800000000000000003"), - // Properties: &armsql.SecurityEventProperties{ - // ApplicationName: to.Ptr("myApp"), - // ClientIP: to.Ptr("10.166.113.220"), - // Database: to.Ptr("database1"), - // EventTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-24T10:03:17.066Z"); return t}()), - // PrincipalName: to.Ptr("maliciousUser"), - // SecurityEventSQLInjectionAdditionalProperties: &armsql.SecurityEventSQLInjectionAdditionalProperties{ - // ErrorCode: to.Ptr[int32](0), - // ErrorMessage: to.Ptr(""), - // ErrorSeverity: to.Ptr[int32](0), - // Statement: to.Ptr("select * from sys.databases where database_id like '' or 1 = 1 --' and family = 'test9'"), - // StatementHighlightLength: to.Ptr[int32](13), - // StatementHighlightOffset: to.Ptr[int32](52), - // ThreatID: to.Ptr("1"), - // }, - // SecurityEventType: to.Ptr(armsql.SecurityEventTypeSQLInjectionExploit), - // Server: to.Ptr("testcl"), - // Subscription: to.Ptr("00000000-1111-2222-3333-444444444444"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/sql/armsql/manageddatabasesensitivitylabels_client.go b/sdk/resourcemanager/sql/armsql/manageddatabasesensitivitylabels_client.go index 7f26defe09f3..f34a66e4077a 100644 --- a/sdk/resourcemanager/sql/armsql/manageddatabasesensitivitylabels_client.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabasesensitivitylabels_client.go @@ -47,7 +47,7 @@ func NewManagedDatabaseSensitivityLabelsClient(subscriptionID string, credential // CreateOrUpdate - Creates or updates the sensitivity label of a given column // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -113,7 +113,7 @@ func (client *ManagedDatabaseSensitivityLabelsClient) createOrUpdateCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -134,7 +134,7 @@ func (client *ManagedDatabaseSensitivityLabelsClient) createOrUpdateHandleRespon // Delete - Deletes the sensitivity label of a given column // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -198,7 +198,7 @@ func (client *ManagedDatabaseSensitivityLabelsClient) deleteCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -206,7 +206,7 @@ func (client *ManagedDatabaseSensitivityLabelsClient) deleteCreateRequest(ctx co // DisableRecommendation - Disables sensitivity recommendations on a given column // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -270,7 +270,7 @@ func (client *ManagedDatabaseSensitivityLabelsClient) disableRecommendationCreat return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -279,7 +279,7 @@ func (client *ManagedDatabaseSensitivityLabelsClient) disableRecommendationCreat // all columns) // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -343,7 +343,7 @@ func (client *ManagedDatabaseSensitivityLabelsClient) enableRecommendationCreate return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -351,7 +351,7 @@ func (client *ManagedDatabaseSensitivityLabelsClient) enableRecommendationCreate // Get - Gets the sensitivity label of a given column // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -420,7 +420,7 @@ func (client *ManagedDatabaseSensitivityLabelsClient) getCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -435,9 +435,88 @@ func (client *ManagedDatabaseSensitivityLabelsClient) getHandleResponse(resp *ht return result, nil } +// NewListByDatabasePager - Gets the sensitivity labels of a given database +// +// Generated from API version 2023-05-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the database. +// - options - ManagedDatabaseSensitivityLabelsClientListByDatabaseOptions contains the optional parameters for the ManagedDatabaseSensitivityLabelsClient.NewListByDatabasePager +// method. +func (client *ManagedDatabaseSensitivityLabelsClient) NewListByDatabasePager(resourceGroupName string, managedInstanceName string, databaseName string, options *ManagedDatabaseSensitivityLabelsClientListByDatabaseOptions) *runtime.Pager[ManagedDatabaseSensitivityLabelsClientListByDatabaseResponse] { + return runtime.NewPager(runtime.PagingHandler[ManagedDatabaseSensitivityLabelsClientListByDatabaseResponse]{ + More: func(page ManagedDatabaseSensitivityLabelsClientListByDatabaseResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ManagedDatabaseSensitivityLabelsClientListByDatabaseResponse) (ManagedDatabaseSensitivityLabelsClientListByDatabaseResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByDatabaseCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ManagedDatabaseSensitivityLabelsClientListByDatabaseResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ManagedDatabaseSensitivityLabelsClientListByDatabaseResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ManagedDatabaseSensitivityLabelsClientListByDatabaseResponse{}, runtime.NewResponseError(resp) + } + return client.listByDatabaseHandleResponse(resp) + }, + }) +} + +// listByDatabaseCreateRequest creates the ListByDatabase request. +func (client *ManagedDatabaseSensitivityLabelsClient) listByDatabaseCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, options *ManagedDatabaseSensitivityLabelsClientListByDatabaseOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/sensitivityLabels" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if managedInstanceName == "" { + return nil, errors.New("parameter managedInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedInstanceName}", url.PathEscape(managedInstanceName)) + if databaseName == "" { + return nil, errors.New("parameter databaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + 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.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + reqQP.Set("api-version", "2023-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByDatabaseHandleResponse handles the ListByDatabase response. +func (client *ManagedDatabaseSensitivityLabelsClient) listByDatabaseHandleResponse(resp *http.Response) (ManagedDatabaseSensitivityLabelsClientListByDatabaseResponse, error) { + result := ManagedDatabaseSensitivityLabelsClientListByDatabaseResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SensitivityLabelListResult); err != nil { + return ManagedDatabaseSensitivityLabelsClientListByDatabaseResponse{}, err + } + return result, nil +} + // NewListCurrentByDatabasePager - Gets the sensitivity labels of a given database // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -505,7 +584,7 @@ func (client *ManagedDatabaseSensitivityLabelsClient) listCurrentByDatabaseCreat if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -522,7 +601,7 @@ func (client *ManagedDatabaseSensitivityLabelsClient) listCurrentByDatabaseHandl // NewListRecommendedByDatabasePager - Gets the sensitivity labels of a given database // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -590,7 +669,7 @@ func (client *ManagedDatabaseSensitivityLabelsClient) listRecommendedByDatabaseC if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -608,7 +687,7 @@ func (client *ManagedDatabaseSensitivityLabelsClient) listRecommendedByDatabaseH // Update - Update sensitivity labels of a given database using an operations batch. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -656,7 +735,7 @@ func (client *ManagedDatabaseSensitivityLabelsClient) updateCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err diff --git a/sdk/resourcemanager/sql/armsql/manageddatabasesensitivitylabels_client_example_test.go b/sdk/resourcemanager/sql/armsql/manageddatabasesensitivitylabels_client_example_test.go deleted file mode 100644 index d2ba32ad13a0..000000000000 --- a/sdk/resourcemanager/sql/armsql/manageddatabasesensitivitylabels_client_example_test.go +++ /dev/null @@ -1,327 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseColumnSensitivityLabelGet.json -func ExampleManagedDatabaseSensitivityLabelsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedDatabaseSensitivityLabelsClient().Get(ctx, "myRG", "myManagedInstanceName", "myDatabase", "dbo", "myTable", "myColumn", armsql.SensitivityLabelSourceCurrent, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SensitivityLabel = armsql.SensitivityLabel{ - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/databases/schemas/tables/columns/sensitivityLabels"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myRG/providers/Microsoft.Sql/managedInstances/myManagedInstanceName/databases/myDatabase/schemas/dbo/tables/myTable/columns/myColumn/sensitivityLabels/current"), - // Properties: &armsql.SensitivityLabelProperties{ - // ColumnName: to.Ptr("myColumn"), - // InformationType: to.Ptr("PhoneNumber"), - // InformationTypeID: to.Ptr("d22fa6e9-5ee4-3bde-4c2b-a409604c4646"), - // LabelID: to.Ptr("bf91e08c-f4f0-478a-b016-25164b2a65ff"), - // LabelName: to.Ptr("PII"), - // Rank: to.Ptr(armsql.SensitivityLabelRankLow), - // SchemaName: to.Ptr("dbo"), - // TableName: to.Ptr("myTable"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseColumnSensitivityLabelCreate.json -func ExampleManagedDatabaseSensitivityLabelsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedDatabaseSensitivityLabelsClient().CreateOrUpdate(ctx, "myRG", "myManagedInstanceName", "myDatabase", "dbo", "myTable", "myColumn", armsql.SensitivityLabel{ - Properties: &armsql.SensitivityLabelProperties{ - InformationType: to.Ptr("PhoneNumber"), - InformationTypeID: to.Ptr("d22fa6e9-5ee4-3bde-4c2b-a409604c4646"), - LabelID: to.Ptr("bf91e08c-f4f0-478a-b016-25164b2a65ff"), - LabelName: to.Ptr("PII"), - Rank: to.Ptr(armsql.SensitivityLabelRankHigh), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SensitivityLabel = armsql.SensitivityLabel{ - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/databases/schemas/tables/columns/sensitivityLabels"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myRG/providers/Microsoft.Sql/managedInstances/myManagedInstanceName/databases/myDatabase/schemas/dbo/tables/myTable/columns/myColumn/sensitivityLabels/current"), - // Properties: &armsql.SensitivityLabelProperties{ - // ColumnName: to.Ptr("myColumn"), - // InformationType: to.Ptr("PhoneNumber"), - // InformationTypeID: to.Ptr("d22fa6e9-5ee4-3bde-4c2b-a409604c4646"), - // LabelID: to.Ptr("bf91e08c-f4f0-478a-b016-25164b2a65ff"), - // LabelName: to.Ptr("PII"), - // Rank: to.Ptr(armsql.SensitivityLabelRankHigh), - // SchemaName: to.Ptr("dbo"), - // TableName: to.Ptr("myTable"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseColumnSensitivityLabelDelete.json -func ExampleManagedDatabaseSensitivityLabelsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewManagedDatabaseSensitivityLabelsClient().Delete(ctx, "myRG", "myManagedInstanceName", "myDatabase", "dbo", "myTable", "myColumn", 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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseRecommendedColumnSensitivityLabelDisable.json -func ExampleManagedDatabaseSensitivityLabelsClient_DisableRecommendation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewManagedDatabaseSensitivityLabelsClient().DisableRecommendation(ctx, "myRG", "myManagedInstanceName", "myDatabase", "dbo", "myTable", "myColumn", 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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseRecommendedColumnSensitivityLabelEnable.json -func ExampleManagedDatabaseSensitivityLabelsClient_EnableRecommendation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewManagedDatabaseSensitivityLabelsClient().EnableRecommendation(ctx, "myRG", "myManagedInstanceName", "myDatabase", "dbo", "myTable", "myColumn", 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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSensitivityLabelsListByDatabaseCurrent.json -func ExampleManagedDatabaseSensitivityLabelsClient_NewListCurrentByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagedDatabaseSensitivityLabelsClient().NewListCurrentByDatabasePager("myRG", "myManagedInstanceName", "myDatabase", &armsql.ManagedDatabaseSensitivityLabelsClientListCurrentByDatabaseOptions{SkipToken: nil, - Count: nil, - 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.SensitivityLabelListResult = armsql.SensitivityLabelListResult{ - // Value: []*armsql.SensitivityLabel{ - // { - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/databases/schemas/tables/columns/sensitivityLabels"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myRG/providers/Microsoft.Sql/managedInstances/myManagedInstanceName/databases/myDatabase/schemas/dbo/tables/myTable/columns/myColumn/sensitivityLabels/current"), - // Properties: &armsql.SensitivityLabelProperties{ - // ColumnName: to.Ptr("myColumn"), - // InformationType: to.Ptr("Financial"), - // InformationTypeID: to.Ptr("d22fa6e9-5ee4-3bde-4c2b-a409604c4646"), - // LabelID: to.Ptr("05e6eaa1-075a-4fb4-a732-a92215a2444a"), - // LabelName: to.Ptr("Sensitive"), - // Rank: to.Ptr(armsql.SensitivityLabelRankCritical), - // SchemaName: to.Ptr("dbo"), - // TableName: to.Ptr("myTable"), - // }, - // }, - // { - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/databases/schemas/tables/columns/sensitivityLabels"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myRG/providers/Microsoft.Sql/managedInstances/myManagedInstanceName/databases/myDatabase/schemas/dbo/tables/myTable/columns/myColumn3/sensitivityLabels/current"), - // Properties: &armsql.SensitivityLabelProperties{ - // ColumnName: to.Ptr("myColumn3"), - // InformationType: to.Ptr("Email"), - // InformationTypeID: to.Ptr("d22fa6e9-5ee4-3bde-4c2b-a409604c4646"), - // LabelID: to.Ptr("bf91e08c-f4f0-478a-b016-25164b2a65ff"), - // LabelName: to.Ptr("PII"), - // Rank: to.Ptr(armsql.SensitivityLabelRankHigh), - // SchemaName: to.Ptr("dbo"), - // TableName: to.Ptr("myTable"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSensitivityLabelsCurrentUpdate.json -func ExampleManagedDatabaseSensitivityLabelsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewManagedDatabaseSensitivityLabelsClient().Update(ctx, "myRG", "myManagedInstanceName", "myDatabase", armsql.SensitivityLabelUpdateList{ - Operations: []*armsql.SensitivityLabelUpdate{ - { - Properties: &armsql.SensitivityLabelUpdateProperties{ - Schema: to.Ptr("dbo"), - Column: to.Ptr("column1"), - Op: to.Ptr(armsql.SensitivityLabelUpdateKindSet), - SensitivityLabel: &armsql.SensitivityLabel{ - Properties: &armsql.SensitivityLabelProperties{ - InformationType: to.Ptr("Financial"), - InformationTypeID: to.Ptr("1D3652D6-422C-4115-82F1-65DAEBC665C8"), - LabelID: to.Ptr("3A477B16-9423-432B-AA97-6069B481CEC3"), - LabelName: to.Ptr("Highly Confidential"), - }, - }, - Table: to.Ptr("table1"), - }, - }, - { - Properties: &armsql.SensitivityLabelUpdateProperties{ - Schema: to.Ptr("dbo"), - Column: to.Ptr("column2"), - Op: to.Ptr(armsql.SensitivityLabelUpdateKindSet), - SensitivityLabel: &armsql.SensitivityLabel{ - Properties: &armsql.SensitivityLabelProperties{ - InformationType: to.Ptr("PhoneNumber"), - InformationTypeID: to.Ptr("d22fa6e9-5ee4-3bde-4c2b-a409604c4646"), - LabelID: to.Ptr("bf91e08c-f4f0-478a-b016-25164b2a65ff"), - LabelName: to.Ptr("PII"), - }, - }, - Table: to.Ptr("table2"), - }, - }, - { - Properties: &armsql.SensitivityLabelUpdateProperties{ - Schema: to.Ptr("dbo"), - Column: to.Ptr("Column3"), - Op: to.Ptr(armsql.SensitivityLabelUpdateKindRemove), - Table: to.Ptr("Table1"), - }, - }}, - }, 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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSensitivityLabelsListByDatabaseRecommended.json -func ExampleManagedDatabaseSensitivityLabelsClient_NewListRecommendedByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagedDatabaseSensitivityLabelsClient().NewListRecommendedByDatabasePager("myRG", "myManagedInstanceName", "myDatabase", &armsql.ManagedDatabaseSensitivityLabelsClientListRecommendedByDatabaseOptions{SkipToken: nil, - IncludeDisabledRecommendations: nil, - 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.SensitivityLabelListResult = armsql.SensitivityLabelListResult{ - // Value: []*armsql.SensitivityLabel{ - // { - // Name: to.Ptr("recommended"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/databases/schemas/tables/columns/sensitivityLabels"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myRG/providers/Microsoft.Sql/managedInstances/myManagedInstanceName/databases/myDatabase/schemas/dbo/tables/myTable/columns/myColumn2/sensitivityLabels/recommended"), - // Properties: &armsql.SensitivityLabelProperties{ - // ColumnName: to.Ptr("myColumn2"), - // InformationType: to.Ptr("Financial"), - // InformationTypeID: to.Ptr("d22fa6e9-5ee4-3bde-4c2b-a409604c4646"), - // LabelID: to.Ptr("05e6eaa1-075a-4fb4-a732-a92215a2444a"), - // LabelName: to.Ptr("Sensitive"), - // SchemaName: to.Ptr("dbo"), - // TableName: to.Ptr("myTable"), - // }, - // }, - // { - // Name: to.Ptr("recommended"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/databases/schemas/tables/columns/sensitivityLabels"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myRG/providers/Microsoft.Sql/managedInstances/myManagedInstanceName/databases/myDatabase/schemas/dbo/tables/myTable/columns/myColumn4/sensitivityLabels/recommended"), - // Properties: &armsql.SensitivityLabelProperties{ - // ColumnName: to.Ptr("myColumn4"), - // InformationType: to.Ptr("Email"), - // InformationTypeID: to.Ptr("d22fa6e9-5ee4-3bde-4c2b-a409604c4646"), - // LabelID: to.Ptr("bf91e08c-f4f0-478a-b016-25164b2a65ff"), - // LabelName: to.Ptr("PII"), - // SchemaName: to.Ptr("dbo"), - // TableName: to.Ptr("myTable"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/sql/armsql/manageddatabasetables_client.go b/sdk/resourcemanager/sql/armsql/manageddatabasetables_client.go index 0e9407b1929d..337f5097f145 100644 --- a/sdk/resourcemanager/sql/armsql/manageddatabasetables_client.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabasetables_client.go @@ -46,7 +46,7 @@ func NewManagedDatabaseTablesClient(subscriptionID string, credential azcore.Tok // Get - Get managed database table // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -105,7 +105,7 @@ func (client *ManagedDatabaseTablesClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -122,7 +122,7 @@ func (client *ManagedDatabaseTablesClient) getHandleResponse(resp *http.Response // NewListBySchemaPager - List managed database tables // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -189,7 +189,7 @@ func (client *ManagedDatabaseTablesClient) listBySchemaCreateRequest(ctx context if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/manageddatabasetables_client_example_test.go b/sdk/resourcemanager/sql/armsql/manageddatabasetables_client_example_test.go deleted file mode 100644 index 988ea9ee5487..000000000000 --- a/sdk/resourcemanager/sql/armsql/manageddatabasetables_client_example_test.go +++ /dev/null @@ -1,81 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseTableListBySchema.json -func ExampleManagedDatabaseTablesClient_NewListBySchemaPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagedDatabaseTablesClient().NewListBySchemaPager("myRG", "myManagedInstanceName", "myDatabase", "dbo", &armsql.ManagedDatabaseTablesClientListBySchemaOptions{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.DatabaseTableListResult = armsql.DatabaseTableListResult{ - // Value: []*armsql.DatabaseTable{ - // { - // Name: to.Ptr("table1"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/databases/schemas/tables"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myRG/providers/Microsoft.Sql/managedInstances/myManagedInstanceName/databases/myDatabase/schemas/dbo/tables/table1"), - // }, - // { - // Name: to.Ptr("table2"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/databases/schemas/tables"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myRG/providers/Microsoft.Sql/managedInstances/myManagedInstanceName/databases/myDatabase/schemas/dbo/tables/table2"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseTableGet.json -func ExampleManagedDatabaseTablesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedDatabaseTablesClient().Get(ctx, "myRG", "myManagedInstanceName", "myDatabase", "dbo", "table1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DatabaseTable = armsql.DatabaseTable{ - // Name: to.Ptr("table1"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/databases/schemas/tables"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myRG/providers/Microsoft.Sql/managedInstances/myManagedInstanceName/databases/myDatabase/schemas/dbo/tables/table1"), - // } -} diff --git a/sdk/resourcemanager/sql/armsql/manageddatabasetransparentdataencryption_client.go b/sdk/resourcemanager/sql/armsql/manageddatabasetransparentdataencryption_client.go index 678075b260ed..cc5f4c496ac3 100644 --- a/sdk/resourcemanager/sql/armsql/manageddatabasetransparentdataencryption_client.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabasetransparentdataencryption_client.go @@ -46,7 +46,7 @@ func NewManagedDatabaseTransparentDataEncryptionClient(subscriptionID string, cr // CreateOrUpdate - Updates a database's transparent data encryption configuration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -101,7 +101,7 @@ func (client *ManagedDatabaseTransparentDataEncryptionClient) createOrUpdateCrea return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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 *ManagedDatabaseTransparentDataEncryptionClient) createOrUpdateHand // Get - Gets a managed database's transparent data encryption. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -176,7 +176,7 @@ func (client *ManagedDatabaseTransparentDataEncryptionClient) getCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -193,7 +193,7 @@ func (client *ManagedDatabaseTransparentDataEncryptionClient) getHandleResponse( // NewListByDatabasePager - Gets a list of managed database's transparent data encryptions. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -252,7 +252,7 @@ func (client *ManagedDatabaseTransparentDataEncryptionClient) listByDatabaseCrea return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/manageddatabasetransparentdataencryption_client_example_test.go b/sdk/resourcemanager/sql/armsql/manageddatabasetransparentdataencryption_client_example_test.go deleted file mode 100644 index 80b280df8f33..000000000000 --- a/sdk/resourcemanager/sql/armsql/manageddatabasetransparentdataencryption_client_example_test.go +++ /dev/null @@ -1,115 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedTransparentDataEncryptionGet.json -func ExampleManagedDatabaseTransparentDataEncryptionClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedDatabaseTransparentDataEncryptionClient().Get(ctx, "security-tde-resourcegroup", "securitytde", "testdb", armsql.TransparentDataEncryptionNameCurrent, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedTransparentDataEncryption = armsql.ManagedTransparentDataEncryption{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/databases/transparentDataEncryption"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/security-tde-resourcegroup/providers/Microsoft.Sql/managedInstances/securitytde/databases/testdb"), - // Properties: &armsql.ManagedTransparentDataEncryptionProperties{ - // State: to.Ptr(armsql.TransparentDataEncryptionStateEnabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedTransparentDataEncryptionUpdate.json -func ExampleManagedDatabaseTransparentDataEncryptionClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedDatabaseTransparentDataEncryptionClient().CreateOrUpdate(ctx, "securitytde-42-rg", "securitytde-42", "testdb", armsql.TransparentDataEncryptionNameCurrent, armsql.ManagedTransparentDataEncryption{ - Properties: &armsql.ManagedTransparentDataEncryptionProperties{ - State: to.Ptr(armsql.TransparentDataEncryptionStateEnabled), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedTransparentDataEncryption = armsql.ManagedTransparentDataEncryption{ - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.Sql/managedInstance/databases/transparentDataEncryption"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/securitytde-42-rg/providers/Microsoft.Sql/managedInstances/securitytde-42/databases/testdb/transparentDataEncryption"), - // Properties: &armsql.ManagedTransparentDataEncryptionProperties{ - // State: to.Ptr(armsql.TransparentDataEncryptionStateEnabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedTransparentDataEncryptionList.json -func ExampleManagedDatabaseTransparentDataEncryptionClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagedDatabaseTransparentDataEncryptionClient().NewListByDatabasePager("security-tde-resourcegroup", "securitytde", "testdb", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ManagedTransparentDataEncryptionListResult = armsql.ManagedTransparentDataEncryptionListResult{ - // Value: []*armsql.ManagedTransparentDataEncryption{ - // { - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/databases/transparentDataEncryption"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/security-tde-resourcegroup/providers/Microsoft.Sql/managedInstances/securitytde/databases/testdb"), - // Properties: &armsql.ManagedTransparentDataEncryptionProperties{ - // State: to.Ptr(armsql.TransparentDataEncryptionStateEnabled), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessmentrulebaselines_client.go b/sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessmentrulebaselines_client.go index 6e2e727a2318..1a65650550c1 100644 --- a/sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessmentrulebaselines_client.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessmentrulebaselines_client.go @@ -46,7 +46,7 @@ func NewManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient(subscriptionID // CreateOrUpdate - Creates or updates a database's vulnerability assessment rule baseline. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -112,7 +112,7 @@ func (client *ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient) createO return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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 *ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient) createO // Delete - Removes the database's vulnerability assessment rule baseline. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -197,7 +197,7 @@ func (client *ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient) deleteC return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -205,7 +205,7 @@ func (client *ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient) deleteC // Get - Gets a database's vulnerability assessment rule baseline. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -270,7 +270,7 @@ func (client *ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient) getCrea return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessmentrulebaselines_client_example_test.go b/sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessmentrulebaselines_client_example_test.go deleted file mode 100644 index dd2bb6ee4dc6..000000000000 --- a/sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessmentrulebaselines_client_example_test.go +++ /dev/null @@ -1,144 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentRuleBaselineGet.json -func ExampleManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient().Get(ctx, "vulnerabilityaseessmenttest-4711", "vulnerabilityaseessmenttest-6411", "testdb", armsql.VulnerabilityAssessmentNameDefault, "VA1001", armsql.VulnerabilityAssessmentPolicyBaselineNameMaster, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DatabaseVulnerabilityAssessmentRuleBaseline = armsql.DatabaseVulnerabilityAssessmentRuleBaseline{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/vulnerabilityAssessments/rules/baselines"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/managedInstances/vulnerabilityaseessmenttest-6440/databases/testdb/vulnerabilityAssessments/default/rules/VA1001/baselines/default"), - // Properties: &armsql.DatabaseVulnerabilityAssessmentRuleBaselineProperties{ - // BaselineResults: []*armsql.DatabaseVulnerabilityAssessmentRuleBaselineItem{ - // { - // Result: []*string{ - // to.Ptr("userA"), - // to.Ptr("SELECT")}, - // }, - // { - // Result: []*string{ - // to.Ptr("userB"), - // to.Ptr("SELECT")}, - // }, - // { - // Result: []*string{ - // to.Ptr("userC"), - // to.Ptr("SELECT"), - // to.Ptr("tableId_4")}, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentRuleBaselineCreate.json -func ExampleManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient().CreateOrUpdate(ctx, "vulnerabilityaseessmenttest-4799", "vulnerabilityaseessmenttest-6440", "testdb", armsql.VulnerabilityAssessmentNameDefault, "VA1001", armsql.VulnerabilityAssessmentPolicyBaselineNameDefault, armsql.DatabaseVulnerabilityAssessmentRuleBaseline{ - Properties: &armsql.DatabaseVulnerabilityAssessmentRuleBaselineProperties{ - BaselineResults: []*armsql.DatabaseVulnerabilityAssessmentRuleBaselineItem{ - { - Result: []*string{ - to.Ptr("userA"), - to.Ptr("SELECT")}, - }, - { - Result: []*string{ - to.Ptr("userB"), - to.Ptr("SELECT")}, - }, - { - Result: []*string{ - to.Ptr("userC"), - to.Ptr("SELECT"), - to.Ptr("tableId_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.DatabaseVulnerabilityAssessmentRuleBaseline = armsql.DatabaseVulnerabilityAssessmentRuleBaseline{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/vulnerabilityAssessments/rules/baselines"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/managedInstances/vulnerabilityaseessmenttest-6440/databases/testdb/vulnerabilityAssessments/default/rules/VA1001/baselines/default"), - // Properties: &armsql.DatabaseVulnerabilityAssessmentRuleBaselineProperties{ - // BaselineResults: []*armsql.DatabaseVulnerabilityAssessmentRuleBaselineItem{ - // { - // Result: []*string{ - // to.Ptr("userA"), - // to.Ptr("SELECT")}, - // }, - // { - // Result: []*string{ - // to.Ptr("userB"), - // to.Ptr("SELECT")}, - // }, - // { - // Result: []*string{ - // to.Ptr("userC"), - // to.Ptr("SELECT"), - // to.Ptr("tableId_4")}, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentRuleBaselineDelete.json -func ExampleManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient().Delete(ctx, "vulnerabilityaseessmenttest-4799", "vulnerabilityaseessmenttest-6440", "testdb", armsql.VulnerabilityAssessmentNameDefault, "VA1001", armsql.VulnerabilityAssessmentPolicyBaselineNameDefault, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessments_client.go b/sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessments_client.go index 66a14c6272d1..5f617ea1ce8b 100644 --- a/sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessments_client.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessments_client.go @@ -46,7 +46,7 @@ func NewManagedDatabaseVulnerabilityAssessmentsClient(subscriptionID string, cre // CreateOrUpdate - Creates or updates the database's vulnerability assessment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -101,7 +101,7 @@ func (client *ManagedDatabaseVulnerabilityAssessmentsClient) createOrUpdateCreat return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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 *ManagedDatabaseVulnerabilityAssessmentsClient) createOrUpdateHandl // Delete - Removes the database's vulnerability assessment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -175,7 +175,7 @@ func (client *ManagedDatabaseVulnerabilityAssessmentsClient) deleteCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -183,7 +183,7 @@ func (client *ManagedDatabaseVulnerabilityAssessmentsClient) deleteCreateRequest // Get - Gets the database's vulnerability assessment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -237,7 +237,7 @@ func (client *ManagedDatabaseVulnerabilityAssessmentsClient) getCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -254,7 +254,7 @@ func (client *ManagedDatabaseVulnerabilityAssessmentsClient) getHandleResponse(r // NewListByDatabasePager - Lists the vulnerability assessments of a managed database. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -313,7 +313,7 @@ func (client *ManagedDatabaseVulnerabilityAssessmentsClient) listByDatabaseCreat return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessments_client_example_test.go b/sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessments_client_example_test.go deleted file mode 100644 index 38cd23de2e43..000000000000 --- a/sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessments_client_example_test.go +++ /dev/null @@ -1,196 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentGet.json -func ExampleManagedDatabaseVulnerabilityAssessmentsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedDatabaseVulnerabilityAssessmentsClient().Get(ctx, "vulnerabilityaseessmenttest-4799", "vulnerabilityaseessmenttest-6440", "testdb", armsql.VulnerabilityAssessmentNameDefault, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DatabaseVulnerabilityAssessment = armsql.DatabaseVulnerabilityAssessment{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/vulnerabilityAssessments"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/managedInstances/vulnerabilityaseessmenttest-6440/databases/testdb/vulnerabilityAssessments/default"), - // Properties: &armsql.DatabaseVulnerabilityAssessmentProperties{ - // RecurringScans: &armsql.VulnerabilityAssessmentRecurringScansProperties{ - // EmailSubscriptionAdmins: to.Ptr(true), - // Emails: []*string{ - // to.Ptr("email1@mail.com"), - // to.Ptr("email2@mail.com")}, - // IsEnabled: to.Ptr(true), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentCreateMax.json -func ExampleManagedDatabaseVulnerabilityAssessmentsClient_CreateOrUpdate_createADatabasesVulnerabilityAssessmentWithAllParameters() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedDatabaseVulnerabilityAssessmentsClient().CreateOrUpdate(ctx, "vulnerabilityaseessmenttest-4799", "vulnerabilityaseessmenttest-6440", "testdb", armsql.VulnerabilityAssessmentNameDefault, armsql.DatabaseVulnerabilityAssessment{ - Properties: &armsql.DatabaseVulnerabilityAssessmentProperties{ - RecurringScans: &armsql.VulnerabilityAssessmentRecurringScansProperties{ - EmailSubscriptionAdmins: to.Ptr(true), - Emails: []*string{ - to.Ptr("email1@mail.com"), - to.Ptr("email2@mail.com")}, - IsEnabled: to.Ptr(true), - }, - StorageContainerPath: to.Ptr("https://myStorage.blob.core.windows.net/vulnerability-assessment/"), - StorageContainerSasKey: to.Ptr("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DatabaseVulnerabilityAssessment = armsql.DatabaseVulnerabilityAssessment{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/vulnerabilityAssessments"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/managedInstances/vulnerabilityaseessmenttest-6440/databases/testdb/vulnerabilityAssessments/default"), - // Properties: &armsql.DatabaseVulnerabilityAssessmentProperties{ - // RecurringScans: &armsql.VulnerabilityAssessmentRecurringScansProperties{ - // EmailSubscriptionAdmins: to.Ptr(true), - // Emails: []*string{ - // to.Ptr("email1@mail.com"), - // to.Ptr("email2@mail.com")}, - // IsEnabled: to.Ptr(true), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentCreateMin.json -func ExampleManagedDatabaseVulnerabilityAssessmentsClient_CreateOrUpdate_createADatabasesVulnerabilityAssessmentWithMinimalParameters() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedDatabaseVulnerabilityAssessmentsClient().CreateOrUpdate(ctx, "vulnerabilityaseessmenttest-4799", "vulnerabilityaseessmenttest-6440", "testdb", armsql.VulnerabilityAssessmentNameDefault, armsql.DatabaseVulnerabilityAssessment{ - Properties: &armsql.DatabaseVulnerabilityAssessmentProperties{ - StorageContainerPath: to.Ptr("https://myStorage.blob.core.windows.net/vulnerability-assessment/"), - StorageContainerSasKey: to.Ptr("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DatabaseVulnerabilityAssessment = armsql.DatabaseVulnerabilityAssessment{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/vulnerabilityAssessments"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/managedInstances/vulnerabilityaseessmenttest-6440/databases/testdb/vulnerabilityAssessments/default"), - // Properties: &armsql.DatabaseVulnerabilityAssessmentProperties{ - // RecurringScans: &armsql.VulnerabilityAssessmentRecurringScansProperties{ - // EmailSubscriptionAdmins: to.Ptr(false), - // Emails: []*string{ - // }, - // IsEnabled: to.Ptr(false), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentDelete.json -func ExampleManagedDatabaseVulnerabilityAssessmentsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewManagedDatabaseVulnerabilityAssessmentsClient().Delete(ctx, "vulnerabilityaseessmenttest-4799", "vulnerabilityaseessmenttest-6440", "testdb", armsql.VulnerabilityAssessmentNameDefault, 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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentListByDatabase.json -func ExampleManagedDatabaseVulnerabilityAssessmentsClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagedDatabaseVulnerabilityAssessmentsClient().NewListByDatabasePager("vulnerabilityaseessmenttest-4799", "vulnerabilityaseessmenttest-6440", "testdb", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DatabaseVulnerabilityAssessmentListResult = armsql.DatabaseVulnerabilityAssessmentListResult{ - // Value: []*armsql.DatabaseVulnerabilityAssessment{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/vulnerabilityAssessments"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/managedInstances/vulnerabilityaseessmenttest-6440/databases/testdb/vulnerabilityAssessments/default"), - // Properties: &armsql.DatabaseVulnerabilityAssessmentProperties{ - // RecurringScans: &armsql.VulnerabilityAssessmentRecurringScansProperties{ - // EmailSubscriptionAdmins: to.Ptr(true), - // Emails: []*string{ - // to.Ptr("email1@mail.com"), - // to.Ptr("email2@mail.com")}, - // IsEnabled: to.Ptr(true), - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessmentscans_client.go b/sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessmentscans_client.go index 766e2e4704c9..09ec120acceb 100644 --- a/sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessmentscans_client.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessmentscans_client.go @@ -46,7 +46,7 @@ func NewManagedDatabaseVulnerabilityAssessmentScansClient(subscriptionID string, // Export - Convert an existing scan result to a human readable format. If already exists nothing happens // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -105,7 +105,7 @@ func (client *ManagedDatabaseVulnerabilityAssessmentScansClient) exportCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -123,7 +123,7 @@ func (client *ManagedDatabaseVulnerabilityAssessmentScansClient) exportHandleRes // Get - Gets a vulnerability assessment scan record of a database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -182,7 +182,7 @@ func (client *ManagedDatabaseVulnerabilityAssessmentScansClient) getCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -200,7 +200,7 @@ func (client *ManagedDatabaseVulnerabilityAssessmentScansClient) getHandleRespon // BeginInitiateScan - Executes a Vulnerability Assessment database scan. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -225,7 +225,7 @@ func (client *ManagedDatabaseVulnerabilityAssessmentScansClient) BeginInitiateSc // InitiateScan - Executes a Vulnerability Assessment database scan. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview func (client *ManagedDatabaseVulnerabilityAssessmentScansClient) initiateScan(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, scanID string, options *ManagedDatabaseVulnerabilityAssessmentScansClientBeginInitiateScanOptions) (*http.Response, error) { var err error req, err := client.initiateScanCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, vulnerabilityAssessmentName, scanID, options) @@ -275,14 +275,14 @@ func (client *ManagedDatabaseVulnerabilityAssessmentScansClient) initiateScanCre return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // NewListByDatabasePager - Lists the vulnerability assessment scans of a database. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -346,7 +346,7 @@ func (client *ManagedDatabaseVulnerabilityAssessmentScansClient) listByDatabaseC return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessmentscans_client_example_test.go b/sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessmentscans_client_example_test.go deleted file mode 100644 index 37dceba13694..000000000000 --- a/sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessmentscans_client_example_test.go +++ /dev/null @@ -1,182 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentScansExecute.json -func ExampleManagedDatabaseVulnerabilityAssessmentScansClient_BeginInitiateScan() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedDatabaseVulnerabilityAssessmentScansClient().BeginInitiateScan(ctx, "vulnerabilityassessmenttest-4711", "vulnerabilityassessmenttest-6411", "testdb", armsql.VulnerabilityAssessmentNameDefault, "scan01", 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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentScanExport.json -func ExampleManagedDatabaseVulnerabilityAssessmentScansClient_Export() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedDatabaseVulnerabilityAssessmentScansClient().Export(ctx, "vulnerabilityassessmenttest-4799", "vulnerabilityassessmenttest-6440", "testdb", armsql.VulnerabilityAssessmentNameDefault, "scan001", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DatabaseVulnerabilityAssessmentScansExport = armsql.DatabaseVulnerabilityAssessmentScansExport{ - // Name: to.Ptr("scan001"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/vulnerabilityAssessments/scans/export"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityassessmenttest-4799/providers/Microsoft.Sql/managedInstances/vulnerabilityassessmenttest-6440/databases/testdb/vulnerabilityAssessments/default/scans/scan001/export"), - // Properties: &armsql.DatabaseVulnerabilityAssessmentScanExportProperties{ - // ExportedReportLocation: to.Ptr("https://myaccount.blob.core.windows.net/vulnerabilityAssessment/vulnerabilityassessmenttest-6440/testdb/scan001.xlsx"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentScanRecordsListByDatabase.json -func ExampleManagedDatabaseVulnerabilityAssessmentScansClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagedDatabaseVulnerabilityAssessmentScansClient().NewListByDatabasePager("vulnerabilityassessmenttest-4711", "vulnerabilityassessmenttest-6411", "testdb", armsql.VulnerabilityAssessmentNameDefault, nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VulnerabilityAssessmentScanRecordListResult = armsql.VulnerabilityAssessmentScanRecordListResult{ - // Value: []*armsql.VulnerabilityAssessmentScanRecord{ - // { - // Name: to.Ptr("scan001"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/vulnerabilityAssessments/scans"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityassessmenttest-4799/providers/Microsoft.Sql/managedInstances/vulnerabilityassessmenttest-6440/databases/testdb/vulnerabilityAssessments/default/scans/scan001"), - // Properties: &armsql.VulnerabilityAssessmentScanRecordProperties{ - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-12T17:47:06Z"); return t}()), - // Errors: []*armsql.VulnerabilityAssessmentScanError{ - // }, - // NumberOfFailedSecurityChecks: to.Ptr[int32](9), - // ScanID: to.Ptr("scan001"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-12T17:45:06Z"); return t}()), - // State: to.Ptr(armsql.VulnerabilityAssessmentScanStatePassed), - // StorageContainerPath: to.Ptr("https://myaccount.blob.core.windows.net/vulnerability-assessment"), - // TriggerType: to.Ptr(armsql.VulnerabilityAssessmentScanTriggerTypeOnDemand), - // }, - // }, - // { - // Name: to.Ptr("scan002"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/vulnerabilityAssessments/scans"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityassessmenttest-4799/providers/Microsoft.Sql/managedInstances/vulnerabilityassessmenttest-6440/databases/testdb/vulnerabilityAssessments/default/scans/scan002"), - // Properties: &armsql.VulnerabilityAssessmentScanRecordProperties{ - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-12T17:47:06Z"); return t}()), - // Errors: []*armsql.VulnerabilityAssessmentScanError{ - // }, - // NumberOfFailedSecurityChecks: to.Ptr[int32](9), - // ScanID: to.Ptr("scan002"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-12T17:45:06Z"); return t}()), - // State: to.Ptr(armsql.VulnerabilityAssessmentScanStateFailed), - // StorageContainerPath: to.Ptr("https://myaccount.blob.core.windows.net/vulnerability-assessment"), - // TriggerType: to.Ptr(armsql.VulnerabilityAssessmentScanTriggerTypeRecurring), - // }, - // }, - // { - // Name: to.Ptr("scan003"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/vulnerabilityAssessments/scans"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityassessmenttest-4799/providers/Microsoft.Sql/managedInstances/vulnerabilityassessmenttest-6440/databases/testdb/vulnerabilityAssessments/default/scans/scan003"), - // Properties: &armsql.VulnerabilityAssessmentScanRecordProperties{ - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-12T17:47:06Z"); return t}()), - // Errors: []*armsql.VulnerabilityAssessmentScanError{ - // { - // Code: to.Ptr("StorageNotFound"), - // Message: to.Ptr("Storage not found"), - // }}, - // NumberOfFailedSecurityChecks: to.Ptr[int32](0), - // ScanID: to.Ptr("scan003"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-12T17:45:06Z"); return t}()), - // State: to.Ptr(armsql.VulnerabilityAssessmentScanStateFailedToRun), - // StorageContainerPath: to.Ptr("https://myaccount.blob.core.windows.net/vulnerability-assessment"), - // TriggerType: to.Ptr(armsql.VulnerabilityAssessmentScanTriggerTypeRecurring), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentScanRecordsGet.json -func ExampleManagedDatabaseVulnerabilityAssessmentScansClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedDatabaseVulnerabilityAssessmentScansClient().Get(ctx, "vulnerabilityassessmenttest-4711", "vulnerabilityassessmenttest-6411", "testdb", armsql.VulnerabilityAssessmentNameDefault, "scan001", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VulnerabilityAssessmentScanRecord = armsql.VulnerabilityAssessmentScanRecord{ - // Name: to.Ptr("scan001"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/vulnerabilityAssessments/scans"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityassessmenttest-4799/providers/Microsoft.Sql/managedInstances/vulnerabilityassessmenttest-6440/databases/testdb/vulnerabilityAssessments/default/scans/scan001"), - // Properties: &armsql.VulnerabilityAssessmentScanRecordProperties{ - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-12T17:47:06Z"); return t}()), - // Errors: []*armsql.VulnerabilityAssessmentScanError{ - // }, - // NumberOfFailedSecurityChecks: to.Ptr[int32](9), - // ScanID: to.Ptr("scan001"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-12T17:45:06Z"); return t}()), - // State: to.Ptr(armsql.VulnerabilityAssessmentScanStatePassed), - // StorageContainerPath: to.Ptr("https://myaccount.blob.core.windows.net/vulnerability-assessment"), - // TriggerType: to.Ptr(armsql.VulnerabilityAssessmentScanTriggerTypeOnDemand), - // }, - // } -} diff --git a/sdk/resourcemanager/sql/armsql/managedinstanceadministrators_client.go b/sdk/resourcemanager/sql/armsql/managedinstanceadministrators_client.go index 3568ef0145a0..e38bcf44305a 100644 --- a/sdk/resourcemanager/sql/armsql/managedinstanceadministrators_client.go +++ b/sdk/resourcemanager/sql/armsql/managedinstanceadministrators_client.go @@ -46,7 +46,7 @@ func NewManagedInstanceAdministratorsClient(subscriptionID string, credential az // BeginCreateOrUpdate - Creates or updates a managed instance administrator. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -69,7 +69,7 @@ func (client *ManagedInstanceAdministratorsClient) BeginCreateOrUpdate(ctx conte // CreateOrUpdate - Creates or updates a managed instance administrator. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview func (client *ManagedInstanceAdministratorsClient) createOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, administratorName AdministratorName, parameters ManagedInstanceAdministrator, options *ManagedInstanceAdministratorsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, administratorName, parameters, options) @@ -111,7 +111,7 @@ func (client *ManagedInstanceAdministratorsClient) createOrUpdateCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -123,7 +123,7 @@ func (client *ManagedInstanceAdministratorsClient) createOrUpdateCreateRequest(c // BeginDelete - Deletes a managed instance administrator. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -145,7 +145,7 @@ func (client *ManagedInstanceAdministratorsClient) BeginDelete(ctx context.Conte // Delete - Deletes a managed instance administrator. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview func (client *ManagedInstanceAdministratorsClient) deleteOperation(ctx context.Context, resourceGroupName string, managedInstanceName string, administratorName AdministratorName, options *ManagedInstanceAdministratorsClientBeginDeleteOptions) (*http.Response, error) { var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, managedInstanceName, administratorName, options) @@ -187,7 +187,7 @@ func (client *ManagedInstanceAdministratorsClient) deleteCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -195,7 +195,7 @@ func (client *ManagedInstanceAdministratorsClient) deleteCreateRequest(ctx conte // Get - Gets a managed instance administrator. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -243,7 +243,7 @@ func (client *ManagedInstanceAdministratorsClient) getCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -260,7 +260,7 @@ func (client *ManagedInstanceAdministratorsClient) getHandleResponse(resp *http. // NewListByInstancePager - Gets a list of managed instance administrators. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -314,7 +314,7 @@ func (client *ManagedInstanceAdministratorsClient) listByInstanceCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/managedinstanceadministrators_client_example_test.go b/sdk/resourcemanager/sql/armsql/managedinstanceadministrators_client_example_test.go deleted file mode 100644 index 74ebabd36b1c..000000000000 --- a/sdk/resourcemanager/sql/armsql/managedinstanceadministrators_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 armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAdministratorListByInstance.json -func ExampleManagedInstanceAdministratorsClient_NewListByInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagedInstanceAdministratorsClient().NewListByInstancePager("Default-SQL-SouthEastAsia", "managedInstance", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ManagedInstanceAdministratorListResult = armsql.ManagedInstanceAdministratorListResult{ - // Value: []*armsql.ManagedInstanceAdministrator{ - // { - // Name: to.Ptr("ActiveDirectory"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/administrators"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/managedInstance/administrators/ActiveDirectory"), - // Properties: &armsql.ManagedInstanceAdministratorProperties{ - // AdministratorType: to.Ptr(armsql.ManagedInstanceAdministratorTypeActiveDirectory), - // Login: to.Ptr("bob@contoso.com"), - // Sid: to.Ptr("44444444-3333-2222-1111-000000000000"), - // TenantID: to.Ptr("55555555-4444-3333-2222-111111111111"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAdministratorGet.json -func ExampleManagedInstanceAdministratorsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedInstanceAdministratorsClient().Get(ctx, "Default-SQL-SouthEastAsia", "managedInstance", armsql.AdministratorNameActiveDirectory, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedInstanceAdministrator = armsql.ManagedInstanceAdministrator{ - // Name: to.Ptr("ActiveDirectory"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/administrators"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/managedInstance/administrators/ActiveDirectory"), - // Properties: &armsql.ManagedInstanceAdministratorProperties{ - // AdministratorType: to.Ptr(armsql.ManagedInstanceAdministratorTypeActiveDirectory), - // Login: to.Ptr("bob@contoso.com"), - // Sid: to.Ptr("44444444-3333-2222-1111-000000000000"), - // TenantID: to.Ptr("55555555-4444-3333-2222-111111111111"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAdministratorCreate.json -func ExampleManagedInstanceAdministratorsClient_BeginCreateOrUpdate_createAdministratorOfManagedInstance() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedInstanceAdministratorsClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "managedInstance", armsql.AdministratorNameActiveDirectory, armsql.ManagedInstanceAdministrator{ - Properties: &armsql.ManagedInstanceAdministratorProperties{ - AdministratorType: to.Ptr(armsql.ManagedInstanceAdministratorTypeActiveDirectory), - Login: to.Ptr("bob@contoso.com"), - Sid: to.Ptr("44444444-3333-2222-1111-000000000000"), - TenantID: to.Ptr("55555555-4444-3333-2222-111111111111"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedInstanceAdministrator = armsql.ManagedInstanceAdministrator{ - // Name: to.Ptr("ActiveDirectory"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/administrators"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/managedInstance/administrators/ActiveDirectory"), - // Properties: &armsql.ManagedInstanceAdministratorProperties{ - // AdministratorType: to.Ptr(armsql.ManagedInstanceAdministratorTypeActiveDirectory), - // Login: to.Ptr("bob@contoso.com"), - // Sid: to.Ptr("44444444-3333-2222-1111-000000000000"), - // TenantID: to.Ptr("55555555-4444-3333-2222-111111111111"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAdministratorUpdate.json -func ExampleManagedInstanceAdministratorsClient_BeginCreateOrUpdate_updateAdministratorOfManagedInstance() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedInstanceAdministratorsClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "managedInstance", armsql.AdministratorNameActiveDirectory, armsql.ManagedInstanceAdministrator{ - Properties: &armsql.ManagedInstanceAdministratorProperties{ - AdministratorType: to.Ptr(armsql.ManagedInstanceAdministratorTypeActiveDirectory), - Login: to.Ptr("bob@contoso.com"), - Sid: to.Ptr("44444444-3333-2222-1111-000000000000"), - TenantID: to.Ptr("55555555-4444-3333-2222-111111111111"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedInstanceAdministrator = armsql.ManagedInstanceAdministrator{ - // Name: to.Ptr("ActiveDirectory"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/administrators"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/managedInstance/administrators/ActiveDirectory"), - // Properties: &armsql.ManagedInstanceAdministratorProperties{ - // AdministratorType: to.Ptr(armsql.ManagedInstanceAdministratorTypeActiveDirectory), - // Login: to.Ptr("bob@contoso.com"), - // Sid: to.Ptr("44444444-3333-2222-1111-000000000000"), - // TenantID: to.Ptr("55555555-4444-3333-2222-111111111111"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAdministratorDelete.json -func ExampleManagedInstanceAdministratorsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedInstanceAdministratorsClient().BeginDelete(ctx, "Default-SQL-SouthEastAsia", "managedInstance", armsql.AdministratorNameActiveDirectory, 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/sql/armsql/managedinstanceadvancedthreatprotectionsettings_client.go b/sdk/resourcemanager/sql/armsql/managedinstanceadvancedthreatprotectionsettings_client.go index c7193be14fe4..a3732304456b 100644 --- a/sdk/resourcemanager/sql/armsql/managedinstanceadvancedthreatprotectionsettings_client.go +++ b/sdk/resourcemanager/sql/armsql/managedinstanceadvancedthreatprotectionsettings_client.go @@ -46,7 +46,7 @@ func NewManagedInstanceAdvancedThreatProtectionSettingsClient(subscriptionID str // BeginCreateOrUpdate - Creates or updates Advanced Threat Protection settings. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-02-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -70,7 +70,7 @@ func (client *ManagedInstanceAdvancedThreatProtectionSettingsClient) BeginCreate // CreateOrUpdate - Creates or updates Advanced Threat Protection settings. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-02-01-preview +// Generated from API version 2023-05-01-preview func (client *ManagedInstanceAdvancedThreatProtectionSettingsClient) createOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, advancedThreatProtectionName AdvancedThreatProtectionName, parameters ManagedInstanceAdvancedThreatProtection, options *ManagedInstanceAdvancedThreatProtectionSettingsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, advancedThreatProtectionName, parameters, options) @@ -112,7 +112,7 @@ func (client *ManagedInstanceAdvancedThreatProtectionSettingsClient) createOrUpd return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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 *ManagedInstanceAdvancedThreatProtectionSettingsClient) createOrUpd // Get - Get a managed instance's Advanced Threat Protection state. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-02-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -173,7 +173,7 @@ func (client *ManagedInstanceAdvancedThreatProtectionSettingsClient) getCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -190,7 +190,7 @@ func (client *ManagedInstanceAdvancedThreatProtectionSettingsClient) getHandleRe // NewListByInstancePager - Get the managed instance's Advanced Threat Protection settings. // -// Generated from API version 2022-02-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -244,7 +244,7 @@ func (client *ManagedInstanceAdvancedThreatProtectionSettingsClient) listByInsta return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/managedinstanceadvancedthreatprotectionsettings_client_example_test.go b/sdk/resourcemanager/sql/armsql/managedinstanceadvancedthreatprotectionsettings_client_example_test.go deleted file mode 100644 index bd010d6f5042..000000000000 --- a/sdk/resourcemanager/sql/armsql/managedinstanceadvancedthreatprotectionsettings_client_example_test.go +++ /dev/null @@ -1,191 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedInstanceAdvancedThreatProtectionSettingsListByInstance.json -func ExampleManagedInstanceAdvancedThreatProtectionSettingsClient_NewListByInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagedInstanceAdvancedThreatProtectionSettingsClient().NewListByInstancePager("threatprotection-4799", "threatprotection-6440", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ManagedInstanceAdvancedThreatProtectionListResult = armsql.ManagedInstanceAdvancedThreatProtectionListResult{ - // Value: []*armsql.ManagedInstanceAdvancedThreatProtection{ - // { - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/advancedThreatProtectionSettings"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/threatprotection-4799/providers/Microsoft.Sql/managedInstances/threatprotection-6440/advancedThreatProtectionSettings"), - // Properties: &armsql.AdvancedThreatProtectionProperties{ - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // State: to.Ptr(armsql.AdvancedThreatProtectionStateDisabled), - // }, - // SystemData: &armsql.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsql.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsql.CreatedByTypeUser), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedInstanceAdvancedThreatProtectionSettingsGet.json -func ExampleManagedInstanceAdvancedThreatProtectionSettingsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedInstanceAdvancedThreatProtectionSettingsClient().Get(ctx, "threatprotection-4799", "threatprotection-6440", armsql.AdvancedThreatProtectionNameDefault, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedInstanceAdvancedThreatProtection = armsql.ManagedInstanceAdvancedThreatProtection{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/advancedThreatProtectionSettings"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/threatprotection-4799/providers/Microsoft.Sql/managedInstances/threatprotection-6440/advancedThreatProtectionSettings/Default"), - // Properties: &armsql.AdvancedThreatProtectionProperties{ - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // State: to.Ptr(armsql.AdvancedThreatProtectionStateDisabled), - // }, - // SystemData: &armsql.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsql.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsql.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedInstanceAdvancedThreatProtectionSettingsCreateMax.json -func ExampleManagedInstanceAdvancedThreatProtectionSettingsClient_BeginCreateOrUpdate_updateAManagedInstancesAdvancedThreatProtectionSettingsWithAllParameters() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedInstanceAdvancedThreatProtectionSettingsClient().BeginCreateOrUpdate(ctx, "threatprotection-4799", "threatprotection-6440", armsql.AdvancedThreatProtectionNameDefault, armsql.ManagedInstanceAdvancedThreatProtection{ - Properties: &armsql.AdvancedThreatProtectionProperties{ - State: to.Ptr(armsql.AdvancedThreatProtectionStateEnabled), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedInstanceAdvancedThreatProtection = armsql.ManagedInstanceAdvancedThreatProtection{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/advancedThreatProtectionSettings"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/threatprotection-4799/providers/Microsoft.Sql/managedInstances/threatprotection-6440/advancedThreatProtectionSettings/Default"), - // Properties: &armsql.AdvancedThreatProtectionProperties{ - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // State: to.Ptr(armsql.AdvancedThreatProtectionStateEnabled), - // }, - // SystemData: &armsql.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsql.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsql.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedInstanceAdvancedThreatProtectionSettingsCreateMin.json -func ExampleManagedInstanceAdvancedThreatProtectionSettingsClient_BeginCreateOrUpdate_updateAManagedInstancesAdvancedThreatProtectionSettingsWithMinimalParameters() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedInstanceAdvancedThreatProtectionSettingsClient().BeginCreateOrUpdate(ctx, "threatprotection-4799", "threatprotection-6440", armsql.AdvancedThreatProtectionNameDefault, armsql.ManagedInstanceAdvancedThreatProtection{ - Properties: &armsql.AdvancedThreatProtectionProperties{ - State: to.Ptr(armsql.AdvancedThreatProtectionStateDisabled), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedInstanceAdvancedThreatProtection = armsql.ManagedInstanceAdvancedThreatProtection{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/advancedThreatProtectionSettings"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/threatprotection-4799/providers/Microsoft.Sql/managedInstances/threatprotection-6440/advancedThreatProtectionSettings/Default"), - // Properties: &armsql.AdvancedThreatProtectionProperties{ - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // State: to.Ptr(armsql.AdvancedThreatProtectionStateDisabled), - // }, - // SystemData: &armsql.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsql.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsql.CreatedByTypeUser), - // }, - // } -} diff --git a/sdk/resourcemanager/sql/armsql/managedinstanceazureadonlyauthentications_client.go b/sdk/resourcemanager/sql/armsql/managedinstanceazureadonlyauthentications_client.go index ff0ed12d115d..a3a81eaa983c 100644 --- a/sdk/resourcemanager/sql/armsql/managedinstanceazureadonlyauthentications_client.go +++ b/sdk/resourcemanager/sql/armsql/managedinstanceazureadonlyauthentications_client.go @@ -47,7 +47,7 @@ func NewManagedInstanceAzureADOnlyAuthenticationsClient(subscriptionID string, c // only authentication property. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -72,7 +72,7 @@ func (client *ManagedInstanceAzureADOnlyAuthenticationsClient) BeginCreateOrUpda // only authentication property. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview func (client *ManagedInstanceAzureADOnlyAuthenticationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, authenticationName AuthenticationName, parameters ManagedInstanceAzureADOnlyAuthentication, options *ManagedInstanceAzureADOnlyAuthenticationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, authenticationName, parameters, options) @@ -114,7 +114,7 @@ func (client *ManagedInstanceAzureADOnlyAuthenticationsClient) createOrUpdateCre return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -126,7 +126,7 @@ func (client *ManagedInstanceAzureADOnlyAuthenticationsClient) createOrUpdateCre // BeginDelete - Deletes an existing server Active Directory only authentication property. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -149,7 +149,7 @@ func (client *ManagedInstanceAzureADOnlyAuthenticationsClient) BeginDelete(ctx c // Delete - Deletes an existing server Active Directory only authentication property. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview func (client *ManagedInstanceAzureADOnlyAuthenticationsClient) deleteOperation(ctx context.Context, resourceGroupName string, managedInstanceName string, authenticationName AuthenticationName, options *ManagedInstanceAzureADOnlyAuthenticationsClientBeginDeleteOptions) (*http.Response, error) { var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, managedInstanceName, authenticationName, options) @@ -191,7 +191,7 @@ func (client *ManagedInstanceAzureADOnlyAuthenticationsClient) deleteCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -199,7 +199,7 @@ func (client *ManagedInstanceAzureADOnlyAuthenticationsClient) deleteCreateReque // Get - Gets a specific Azure Active Directory only authentication property. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -248,7 +248,7 @@ func (client *ManagedInstanceAzureADOnlyAuthenticationsClient) getCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -265,7 +265,7 @@ func (client *ManagedInstanceAzureADOnlyAuthenticationsClient) getHandleResponse // NewListByInstancePager - Gets a list of server Azure Active Directory only authentications. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -319,7 +319,7 @@ func (client *ManagedInstanceAzureADOnlyAuthenticationsClient) listByInstanceCre return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/managedinstanceazureadonlyauthentications_client_example_test.go b/sdk/resourcemanager/sql/armsql/managedinstanceazureadonlyauthentications_client_example_test.go deleted file mode 100644 index 1f1de3551805..000000000000 --- a/sdk/resourcemanager/sql/armsql/managedinstanceazureadonlyauthentications_client_example_test.go +++ /dev/null @@ -1,140 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAzureADOnlyAuthGet.json -func ExampleManagedInstanceAzureADOnlyAuthenticationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedInstanceAzureADOnlyAuthenticationsClient().Get(ctx, "Default-SQL-SouthEastAsia", "managedInstance", armsql.AuthenticationNameDefault, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedInstanceAzureADOnlyAuthentication = armsql.ManagedInstanceAzureADOnlyAuthentication{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/azureadonlyauthentications"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/azureADOnlyAuthentications/providers/Microsoft.Sql/managedInstances/managedInstance/azureadonlyauthentications/default"), - // Properties: &armsql.ManagedInstanceAzureADOnlyAuthProperties{ - // AzureADOnlyAuthentication: to.Ptr(true), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAzureADOnlyAuthCreateOrUpdate.json -func ExampleManagedInstanceAzureADOnlyAuthenticationsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedInstanceAzureADOnlyAuthenticationsClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "managedInstance", armsql.AuthenticationNameDefault, armsql.ManagedInstanceAzureADOnlyAuthentication{ - Properties: &armsql.ManagedInstanceAzureADOnlyAuthProperties{ - AzureADOnlyAuthentication: 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.ManagedInstanceAzureADOnlyAuthentication = armsql.ManagedInstanceAzureADOnlyAuthentication{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/azureadonlyauthentications"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/azureADOnlyAuthentications/providers/Microsoft.Sql/managedInstances/managedInstance/azureadonlyauthentications/default"), - // Properties: &armsql.ManagedInstanceAzureADOnlyAuthProperties{ - // AzureADOnlyAuthentication: to.Ptr(false), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAzureADOnlyAuthDelete.json -func ExampleManagedInstanceAzureADOnlyAuthenticationsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedInstanceAzureADOnlyAuthenticationsClient().BeginDelete(ctx, "Default-SQL-SouthEastAsia", "managedInstance", armsql.AuthenticationNameDefault, 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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAzureADOnlyAuthListByInstance.json -func ExampleManagedInstanceAzureADOnlyAuthenticationsClient_NewListByInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagedInstanceAzureADOnlyAuthenticationsClient().NewListByInstancePager("Default-SQL-SouthEastAsia", "managedInstance", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ManagedInstanceAzureADOnlyAuthListResult = armsql.ManagedInstanceAzureADOnlyAuthListResult{ - // Value: []*armsql.ManagedInstanceAzureADOnlyAuthentication{ - // { - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/azureadonlyauthentications"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/azureADOnlyAuthentications/providers/Microsoft.Sql/managedInstances/managedInstance/azureadonlyauthentications/default"), - // Properties: &armsql.ManagedInstanceAzureADOnlyAuthProperties{ - // AzureADOnlyAuthentication: to.Ptr(true), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/sql/armsql/managedinstancedtcs_client.go b/sdk/resourcemanager/sql/armsql/managedinstancedtcs_client.go index 56dc25718b24..1482fafa42e7 100644 --- a/sdk/resourcemanager/sql/armsql/managedinstancedtcs_client.go +++ b/sdk/resourcemanager/sql/armsql/managedinstancedtcs_client.go @@ -46,7 +46,7 @@ func NewManagedInstanceDtcsClient(subscriptionID string, credential azcore.Token // BeginCreateOrUpdate - Updates managed instance DTC settings. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -70,7 +70,7 @@ func (client *ManagedInstanceDtcsClient) BeginCreateOrUpdate(ctx context.Context // CreateOrUpdate - Updates managed instance DTC settings. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01-preview +// Generated from API version 2023-05-01-preview func (client *ManagedInstanceDtcsClient) createOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, dtcName DtcName, parameters ManagedInstanceDtc, options *ManagedInstanceDtcsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, dtcName, parameters, options) @@ -112,7 +112,7 @@ func (client *ManagedInstanceDtcsClient) createOrUpdateCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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 *ManagedInstanceDtcsClient) createOrUpdateCreateRequest(ctx context // Get - Gets managed instance DTC settings. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -172,7 +172,7 @@ func (client *ManagedInstanceDtcsClient) getCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -189,7 +189,7 @@ func (client *ManagedInstanceDtcsClient) getHandleResponse(resp *http.Response) // NewListByManagedInstancePager - Gets a list of managed instance DTC settings. // -// Generated from API version 2022-05-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -243,7 +243,7 @@ func (client *ManagedInstanceDtcsClient) listByManagedInstanceCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/managedinstancedtcs_client_example_test.go b/sdk/resourcemanager/sql/armsql/managedinstancedtcs_client_example_test.go deleted file mode 100644 index abd24cb9971b..000000000000 --- a/sdk/resourcemanager/sql/armsql/managedinstancedtcs_client_example_test.go +++ /dev/null @@ -1,233 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/ManagedInstanceDtcList.json -func ExampleManagedInstanceDtcsClient_NewListByManagedInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagedInstanceDtcsClient().NewListByManagedInstancePager("testrg", "testinstance", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ManagedInstanceDtcListResult = armsql.ManagedInstanceDtcListResult{ - // Value: []*armsql.ManagedInstanceDtc{ - // { - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/dtc"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testinstance/dtc/current"), - // Properties: &armsql.ManagedInstanceDtcProperties{ - // DtcEnabled: to.Ptr(true), - // DtcHostNameDNSSuffix: to.Ptr("dtcHostNameSuffixExample.com"), - // ExternalDNSSuffixSearchList: []*string{ - // to.Ptr("dns.example1.com"), - // to.Ptr("dns.example2.com")}, - // ProvisioningState: to.Ptr(armsql.ProvisioningStateSucceeded), - // SecuritySettings: &armsql.ManagedInstanceDtcSecuritySettings{ - // SnaLu6Point2TransactionsEnabled: to.Ptr(false), - // TransactionManagerCommunicationSettings: &armsql.ManagedInstanceDtcTransactionManagerCommunicationSettings{ - // AllowInboundEnabled: to.Ptr(false), - // AllowOutboundEnabled: to.Ptr(true), - // Authentication: to.Ptr("NoAuth"), - // }, - // XaTransactionsDefaultTimeout: to.Ptr[int32](1000), - // XaTransactionsEnabled: to.Ptr(false), - // XaTransactionsMaximumTimeout: to.Ptr[int32](3000), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/ManagedInstanceDtcGet.json -func ExampleManagedInstanceDtcsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedInstanceDtcsClient().Get(ctx, "testrg", "testinstance", armsql.DtcNameCurrent, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedInstanceDtc = armsql.ManagedInstanceDtc{ - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/dtc"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testinstance/dtc/current"), - // Properties: &armsql.ManagedInstanceDtcProperties{ - // DtcEnabled: to.Ptr(true), - // DtcHostNameDNSSuffix: to.Ptr("dtcHostNameSuffixExample.com"), - // ExternalDNSSuffixSearchList: []*string{ - // to.Ptr("dns.example1.com"), - // to.Ptr("dns.example2.com")}, - // ProvisioningState: to.Ptr(armsql.ProvisioningStateSucceeded), - // SecuritySettings: &armsql.ManagedInstanceDtcSecuritySettings{ - // SnaLu6Point2TransactionsEnabled: to.Ptr(false), - // TransactionManagerCommunicationSettings: &armsql.ManagedInstanceDtcTransactionManagerCommunicationSettings{ - // AllowInboundEnabled: to.Ptr(false), - // AllowOutboundEnabled: to.Ptr(true), - // Authentication: to.Ptr("NoAuth"), - // }, - // XaTransactionsDefaultTimeout: to.Ptr[int32](1000), - // XaTransactionsEnabled: to.Ptr(false), - // XaTransactionsMaximumTimeout: to.Ptr[int32](3000), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/ManagedInstanceDtcUpdateEnableDtc.json -func ExampleManagedInstanceDtcsClient_BeginCreateOrUpdate_updatesManagedInstanceDtcSettingsByEnablingDtc() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedInstanceDtcsClient().BeginCreateOrUpdate(ctx, "testrg", "testinstance", armsql.DtcNameCurrent, armsql.ManagedInstanceDtc{ - Properties: &armsql.ManagedInstanceDtcProperties{ - DtcEnabled: 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.ManagedInstanceDtc = armsql.ManagedInstanceDtc{ - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/dtc"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testinstance/dtc/current"), - // Properties: &armsql.ManagedInstanceDtcProperties{ - // DtcEnabled: to.Ptr(true), - // DtcHostNameDNSSuffix: to.Ptr("dtcHostNameSuffixExample.com"), - // ExternalDNSSuffixSearchList: []*string{ - // to.Ptr("dns.example1.com"), - // to.Ptr("dns.example2.com")}, - // ProvisioningState: to.Ptr(armsql.ProvisioningStateSucceeded), - // SecuritySettings: &armsql.ManagedInstanceDtcSecuritySettings{ - // SnaLu6Point2TransactionsEnabled: to.Ptr(false), - // TransactionManagerCommunicationSettings: &armsql.ManagedInstanceDtcTransactionManagerCommunicationSettings{ - // AllowInboundEnabled: to.Ptr(false), - // AllowOutboundEnabled: to.Ptr(true), - // Authentication: to.Ptr("NoAuth"), - // }, - // XaTransactionsDefaultTimeout: to.Ptr[int32](1000), - // XaTransactionsEnabled: to.Ptr(false), - // XaTransactionsMaximumTimeout: to.Ptr[int32](3000), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/ManagedInstanceDtcUpdateMax.json -func ExampleManagedInstanceDtcsClient_BeginCreateOrUpdate_updatesManagedInstanceDtcSettingsWithAllOptionalParametersSpecified() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedInstanceDtcsClient().BeginCreateOrUpdate(ctx, "testrg", "testinstance", armsql.DtcNameCurrent, armsql.ManagedInstanceDtc{ - Properties: &armsql.ManagedInstanceDtcProperties{ - DtcEnabled: to.Ptr(true), - ExternalDNSSuffixSearchList: []*string{ - to.Ptr("dns.example1.com"), - to.Ptr("dns.example2.com")}, - SecuritySettings: &armsql.ManagedInstanceDtcSecuritySettings{ - SnaLu6Point2TransactionsEnabled: to.Ptr(false), - TransactionManagerCommunicationSettings: &armsql.ManagedInstanceDtcTransactionManagerCommunicationSettings{ - AllowInboundEnabled: to.Ptr(false), - AllowOutboundEnabled: to.Ptr(true), - Authentication: to.Ptr("NoAuth"), - }, - XaTransactionsDefaultTimeout: to.Ptr[int32](1000), - XaTransactionsEnabled: to.Ptr(false), - XaTransactionsMaximumTimeout: to.Ptr[int32](3000), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedInstanceDtc = armsql.ManagedInstanceDtc{ - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/dtc"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testinstance/dtc/current"), - // Properties: &armsql.ManagedInstanceDtcProperties{ - // DtcEnabled: to.Ptr(true), - // DtcHostNameDNSSuffix: to.Ptr("dtcHostNameSuffixExample.com"), - // ExternalDNSSuffixSearchList: []*string{ - // to.Ptr("dns.example1.com"), - // to.Ptr("dns.example2.com")}, - // ProvisioningState: to.Ptr(armsql.ProvisioningStateSucceeded), - // SecuritySettings: &armsql.ManagedInstanceDtcSecuritySettings{ - // SnaLu6Point2TransactionsEnabled: to.Ptr(false), - // TransactionManagerCommunicationSettings: &armsql.ManagedInstanceDtcTransactionManagerCommunicationSettings{ - // AllowInboundEnabled: to.Ptr(false), - // AllowOutboundEnabled: to.Ptr(true), - // Authentication: to.Ptr("NoAuth"), - // }, - // XaTransactionsDefaultTimeout: to.Ptr[int32](1000), - // XaTransactionsEnabled: to.Ptr(false), - // XaTransactionsMaximumTimeout: to.Ptr[int32](3000), - // }, - // }, - // } -} diff --git a/sdk/resourcemanager/sql/armsql/managedinstanceencryptionprotectors_client.go b/sdk/resourcemanager/sql/armsql/managedinstanceencryptionprotectors_client.go index ee97041a5cb9..2f1574ab32a5 100644 --- a/sdk/resourcemanager/sql/armsql/managedinstanceencryptionprotectors_client.go +++ b/sdk/resourcemanager/sql/armsql/managedinstanceencryptionprotectors_client.go @@ -46,7 +46,7 @@ func NewManagedInstanceEncryptionProtectorsClient(subscriptionID string, credent // BeginCreateOrUpdate - Updates an existing encryption protector. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -70,7 +70,7 @@ func (client *ManagedInstanceEncryptionProtectorsClient) BeginCreateOrUpdate(ctx // CreateOrUpdate - Updates an existing encryption protector. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview func (client *ManagedInstanceEncryptionProtectorsClient) createOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, encryptionProtectorName EncryptionProtectorName, parameters ManagedInstanceEncryptionProtector, options *ManagedInstanceEncryptionProtectorsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, encryptionProtectorName, parameters, options) @@ -112,7 +112,7 @@ func (client *ManagedInstanceEncryptionProtectorsClient) createOrUpdateCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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 *ManagedInstanceEncryptionProtectorsClient) createOrUpdateCreateReq // Get - Gets a managed instance encryption protector. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -173,7 +173,7 @@ func (client *ManagedInstanceEncryptionProtectorsClient) getCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -190,7 +190,7 @@ func (client *ManagedInstanceEncryptionProtectorsClient) getHandleResponse(resp // NewListByInstancePager - Gets a list of managed instance encryption protectors // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -244,7 +244,7 @@ func (client *ManagedInstanceEncryptionProtectorsClient) listByInstanceCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -262,7 +262,7 @@ func (client *ManagedInstanceEncryptionProtectorsClient) listByInstanceHandleRes // BeginRevalidate - Revalidates an existing encryption protector. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -285,7 +285,7 @@ func (client *ManagedInstanceEncryptionProtectorsClient) BeginRevalidate(ctx con // Revalidate - Revalidates an existing encryption protector. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview func (client *ManagedInstanceEncryptionProtectorsClient) revalidate(ctx context.Context, resourceGroupName string, managedInstanceName string, encryptionProtectorName EncryptionProtectorName, options *ManagedInstanceEncryptionProtectorsClientBeginRevalidateOptions) (*http.Response, error) { var err error req, err := client.revalidateCreateRequest(ctx, resourceGroupName, managedInstanceName, encryptionProtectorName, options) @@ -327,7 +327,7 @@ func (client *ManagedInstanceEncryptionProtectorsClient) revalidateCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } diff --git a/sdk/resourcemanager/sql/armsql/managedinstanceencryptionprotectors_client_example_test.go b/sdk/resourcemanager/sql/armsql/managedinstanceencryptionprotectors_client_example_test.go deleted file mode 100644 index 44af8003211c..000000000000 --- a/sdk/resourcemanager/sql/armsql/managedinstanceencryptionprotectors_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 armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceEncryptionProtectorRevalidate.json -func ExampleManagedInstanceEncryptionProtectorsClient_BeginRevalidate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedInstanceEncryptionProtectorsClient().BeginRevalidate(ctx, "sqlcrudtest-7398", "sqlcrudtest-4645", armsql.EncryptionProtectorNameCurrent, 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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceEncryptionProtectorList.json -func ExampleManagedInstanceEncryptionProtectorsClient_NewListByInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagedInstanceEncryptionProtectorsClient().NewListByInstancePager("sqlcrudtest-7398", "sqlcrudtest-4645", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ManagedInstanceEncryptionProtectorListResult = armsql.ManagedInstanceEncryptionProtectorListResult{ - // Value: []*armsql.ManagedInstanceEncryptionProtector{ - // { - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/encryptionProtector"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/managedInstances/sqlcrudtest-4645/encryptionProtector/current"), - // Kind: to.Ptr("azurekeyvault"), - // Properties: &armsql.ManagedInstanceEncryptionProtectorProperties{ - // ServerKeyName: to.Ptr("someVault_someKey_01234567890123456789012345678901"), - // ServerKeyType: to.Ptr(armsql.ServerKeyTypeAzureKeyVault), - // URI: to.Ptr("https://someVault.vault.azure.net/keys/someKey/01234567890123456789012345678901"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceEncryptionProtectorGet.json -func ExampleManagedInstanceEncryptionProtectorsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedInstanceEncryptionProtectorsClient().Get(ctx, "sqlcrudtest-7398", "sqlcrudtest-4645", armsql.EncryptionProtectorNameCurrent, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedInstanceEncryptionProtector = armsql.ManagedInstanceEncryptionProtector{ - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/encryptionProtector"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/managedInstances/sqlcrudtest-4645/encryptionProtector/current"), - // Kind: to.Ptr("azurekeyvault"), - // Properties: &armsql.ManagedInstanceEncryptionProtectorProperties{ - // ServerKeyName: to.Ptr("someVault_someKey_01234567890123456789012345678901"), - // ServerKeyType: to.Ptr(armsql.ServerKeyTypeAzureKeyVault), - // URI: to.Ptr("https://someVault.vault.azure.net/keys/someKey/01234567890123456789012345678901"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceEncryptionProtectorCreateOrUpdateKeyVault.json -func ExampleManagedInstanceEncryptionProtectorsClient_BeginCreateOrUpdate_updateTheEncryptionProtectorToKeyVault() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedInstanceEncryptionProtectorsClient().BeginCreateOrUpdate(ctx, "sqlcrudtest-7398", "sqlcrudtest-4645", armsql.EncryptionProtectorNameCurrent, armsql.ManagedInstanceEncryptionProtector{ - Properties: &armsql.ManagedInstanceEncryptionProtectorProperties{ - AutoRotationEnabled: to.Ptr(false), - ServerKeyName: to.Ptr("someVault_someKey_01234567890123456789012345678901"), - ServerKeyType: to.Ptr(armsql.ServerKeyTypeAzureKeyVault), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedInstanceEncryptionProtector = armsql.ManagedInstanceEncryptionProtector{ - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/encryptionProtector"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/managedInstances/sqlcrudtest-4645/encryptionProtector/current"), - // Kind: to.Ptr("azurekeyvault"), - // Properties: &armsql.ManagedInstanceEncryptionProtectorProperties{ - // AutoRotationEnabled: to.Ptr(false), - // ServerKeyName: to.Ptr("someVault_someKey_01234567890123456789012345678901"), - // ServerKeyType: to.Ptr(armsql.ServerKeyTypeAzureKeyVault), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceEncryptionProtectorCreateOrUpdateServiceManaged.json -func ExampleManagedInstanceEncryptionProtectorsClient_BeginCreateOrUpdate_updateTheEncryptionProtectorToServiceManaged() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedInstanceEncryptionProtectorsClient().BeginCreateOrUpdate(ctx, "sqlcrudtest-7398", "sqlcrudtest-4645", armsql.EncryptionProtectorNameCurrent, armsql.ManagedInstanceEncryptionProtector{ - Properties: &armsql.ManagedInstanceEncryptionProtectorProperties{ - ServerKeyName: to.Ptr("ServiceManaged"), - ServerKeyType: to.Ptr(armsql.ServerKeyTypeServiceManaged), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedInstanceEncryptionProtector = armsql.ManagedInstanceEncryptionProtector{ - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/encryptionProtector"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/managedInstances/sqlcrudtest-4645/encryptionProtector/current"), - // Kind: to.Ptr("servicemanaged"), - // Properties: &armsql.ManagedInstanceEncryptionProtectorProperties{ - // ServerKeyName: to.Ptr("ServiceManaged"), - // ServerKeyType: to.Ptr(armsql.ServerKeyTypeServiceManaged), - // }, - // } -} diff --git a/sdk/resourcemanager/sql/armsql/managedinstancekeys_client.go b/sdk/resourcemanager/sql/armsql/managedinstancekeys_client.go index ebf05f865907..2ddeac9074f4 100644 --- a/sdk/resourcemanager/sql/armsql/managedinstancekeys_client.go +++ b/sdk/resourcemanager/sql/armsql/managedinstancekeys_client.go @@ -46,7 +46,7 @@ func NewManagedInstanceKeysClient(subscriptionID string, credential azcore.Token // BeginCreateOrUpdate - Creates or updates a managed instance key. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -70,7 +70,7 @@ func (client *ManagedInstanceKeysClient) BeginCreateOrUpdate(ctx context.Context // CreateOrUpdate - Creates or updates a managed instance key. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview func (client *ManagedInstanceKeysClient) createOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, keyName string, parameters ManagedInstanceKey, options *ManagedInstanceKeysClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, keyName, parameters, options) @@ -112,7 +112,7 @@ func (client *ManagedInstanceKeysClient) createOrUpdateCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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 *ManagedInstanceKeysClient) createOrUpdateCreateRequest(ctx context // BeginDelete - Deletes the managed instance key with the given name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -147,7 +147,7 @@ func (client *ManagedInstanceKeysClient) BeginDelete(ctx context.Context, resour // Delete - Deletes the managed instance key with the given name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview func (client *ManagedInstanceKeysClient) deleteOperation(ctx context.Context, resourceGroupName string, managedInstanceName string, keyName string, options *ManagedInstanceKeysClientBeginDeleteOptions) (*http.Response, error) { var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, managedInstanceName, keyName, options) @@ -189,7 +189,7 @@ func (client *ManagedInstanceKeysClient) deleteCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -197,7 +197,7 @@ func (client *ManagedInstanceKeysClient) deleteCreateRequest(ctx context.Context // Get - Gets a managed instance key. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -245,7 +245,7 @@ func (client *ManagedInstanceKeysClient) getCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -262,7 +262,7 @@ func (client *ManagedInstanceKeysClient) getHandleResponse(resp *http.Response) // NewListByInstancePager - Gets a list of managed instance keys. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -319,7 +319,7 @@ func (client *ManagedInstanceKeysClient) listByInstanceCreateRequest(ctx context if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/managedinstancekeys_client_example_test.go b/sdk/resourcemanager/sql/armsql/managedinstancekeys_client_example_test.go deleted file mode 100644 index cacf5e1f8e9d..000000000000 --- a/sdk/resourcemanager/sql/armsql/managedinstancekeys_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 armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceKeyList.json -func ExampleManagedInstanceKeysClient_NewListByInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagedInstanceKeysClient().NewListByInstancePager("sqlcrudtest-7398", "sqlcrudtest-4645", &armsql.ManagedInstanceKeysClientListByInstanceOptions{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.ManagedInstanceKeyListResult = armsql.ManagedInstanceKeyListResult{ - // Value: []*armsql.ManagedInstanceKey{ - // { - // Name: to.Ptr("someVault_someKey_01234567890123456789012345678901"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/keys"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/managedInstances/sqlcrudtest-4645/keys/someVault_someKey_01234567890123456789012345678901"), - // Kind: to.Ptr("azurekeyvault"), - // Properties: &armsql.ManagedInstanceKeyProperties{ - // AutoRotationEnabled: to.Ptr(false), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-15T00:00:00Z"); return t}()), - // Thumbprint: to.Ptr("00112233445566778899AABBCCDDEEFFAABBCCDD"), - // }, - // }, - // { - // Name: to.Ptr("myVault_myKey_11111111111111111111111111111111"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/keys"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/managedInstances/sqlcrudtest-4645/keys/myVault_myKey_11111111111111111111111111111111"), - // Kind: to.Ptr("azurekeyvault"), - // Properties: &armsql.ManagedInstanceKeyProperties{ - // AutoRotationEnabled: to.Ptr(false), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-15T00:00:00Z"); return t}()), - // Thumbprint: to.Ptr("AAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBB"), - // }, - // }, - // { - // Name: to.Ptr("ServiceManaged"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/keys"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/managedInstances/sqlcrudtest-4645/keys/ServiceManaged"), - // Kind: to.Ptr("servicemanaged"), - // Properties: &armsql.ManagedInstanceKeyProperties{ - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceKeyGet.json -func ExampleManagedInstanceKeysClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedInstanceKeysClient().Get(ctx, "sqlcrudtest-7398", "sqlcrudtest-4645", "someVault_someKey_01234567890123456789012345678901", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedInstanceKey = armsql.ManagedInstanceKey{ - // Name: to.Ptr("sqlcrudtest-4645"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/keys"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/managedInstances/sqlcrudtest-4645/keys/someVault_someKey_01234567890123456789012345678901"), - // Kind: to.Ptr("azurekeyvault"), - // Properties: &armsql.ManagedInstanceKeyProperties{ - // AutoRotationEnabled: to.Ptr(false), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-01T00:00:00Z"); return t}()), - // Thumbprint: to.Ptr("00112233445566778899AABBCCDDEEFFAABBCCDD"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceKeyCreateOrUpdate.json -func ExampleManagedInstanceKeysClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedInstanceKeysClient().BeginCreateOrUpdate(ctx, "sqlcrudtest-7398", "sqlcrudtest-4645", "someVault_someKey_01234567890123456789012345678901", armsql.ManagedInstanceKey{ - Properties: &armsql.ManagedInstanceKeyProperties{ - ServerKeyType: to.Ptr(armsql.ServerKeyTypeAzureKeyVault), - URI: to.Ptr("https://someVault.vault.azure.net/keys/someKey/01234567890123456789012345678901"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedInstanceKey = armsql.ManagedInstanceKey{ - // Name: to.Ptr("sqlcrudtest-4645"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/keys"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/managedInstances/sqlcrudtest-4645/keys/someVault_someKey_01234567890123456789012345678901"), - // Kind: to.Ptr("azurekeyvault"), - // Properties: &armsql.ManagedInstanceKeyProperties{ - // AutoRotationEnabled: to.Ptr(false), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-01T00:00:00Z"); return t}()), - // Thumbprint: to.Ptr("00112233445566778899AABBCCDDEEFFAABBCCDD"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceKeyDelete.json -func ExampleManagedInstanceKeysClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedInstanceKeysClient().BeginDelete(ctx, "sqlcrudtest-7398", "sqlcrudtest-4645", "someVault_someKey_01234567890123456789012345678901", 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/sql/armsql/managedinstancelongtermretentionpolicies_client.go b/sdk/resourcemanager/sql/armsql/managedinstancelongtermretentionpolicies_client.go index f926030af96e..189bf5afa6ce 100644 --- a/sdk/resourcemanager/sql/armsql/managedinstancelongtermretentionpolicies_client.go +++ b/sdk/resourcemanager/sql/armsql/managedinstancelongtermretentionpolicies_client.go @@ -46,7 +46,7 @@ func NewManagedInstanceLongTermRetentionPoliciesClient(subscriptionID string, cr // BeginCreateOrUpdate - Sets a managed database's long term retention policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -71,7 +71,7 @@ func (client *ManagedInstanceLongTermRetentionPoliciesClient) BeginCreateOrUpdat // CreateOrUpdate - Sets a managed database's long term retention policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview func (client *ManagedInstanceLongTermRetentionPoliciesClient) createOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, policyName ManagedInstanceLongTermRetentionPolicyName, parameters ManagedInstanceLongTermRetentionPolicy, options *ManagedInstanceLongTermRetentionPoliciesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, policyName, parameters, options) @@ -117,7 +117,7 @@ func (client *ManagedInstanceLongTermRetentionPoliciesClient) createOrUpdateCrea return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -126,10 +126,89 @@ func (client *ManagedInstanceLongTermRetentionPoliciesClient) createOrUpdateCrea return req, nil } +// BeginDelete - Deletes a managed database's long term retention policy. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the database. +// - policyName - The policy name. Should always be Default. +// - options - ManagedInstanceLongTermRetentionPoliciesClientBeginDeleteOptions contains the optional parameters for the ManagedInstanceLongTermRetentionPoliciesClient.BeginDelete +// method. +func (client *ManagedInstanceLongTermRetentionPoliciesClient) BeginDelete(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, policyName ManagedInstanceLongTermRetentionPolicyName, options *ManagedInstanceLongTermRetentionPoliciesClientBeginDeleteOptions) (*runtime.Poller[ManagedInstanceLongTermRetentionPoliciesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, managedInstanceName, databaseName, policyName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller[ManagedInstanceLongTermRetentionPoliciesClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[ManagedInstanceLongTermRetentionPoliciesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes a managed database's long term retention policy. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01-preview +func (client *ManagedInstanceLongTermRetentionPoliciesClient) deleteOperation(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, policyName ManagedInstanceLongTermRetentionPolicyName, options *ManagedInstanceLongTermRetentionPoliciesClientBeginDeleteOptions) (*http.Response, error) { + var err error + req, err := client.deleteCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, policyName, 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 +} + +// deleteCreateRequest creates the Delete request. +func (client *ManagedInstanceLongTermRetentionPoliciesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, policyName ManagedInstanceLongTermRetentionPolicyName, options *ManagedInstanceLongTermRetentionPoliciesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if managedInstanceName == "" { + return nil, errors.New("parameter managedInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedInstanceName}", url.PathEscape(managedInstanceName)) + if databaseName == "" { + return nil, errors.New("parameter databaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + if policyName == "" { + return nil, errors.New("parameter policyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{policyName}", url.PathEscape(string(policyName))) + 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.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + // Get - Gets a managed database's long term retention policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -183,7 +262,7 @@ func (client *ManagedInstanceLongTermRetentionPoliciesClient) getCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -200,7 +279,7 @@ func (client *ManagedInstanceLongTermRetentionPoliciesClient) getHandleResponse( // NewListByDatabasePager - Gets a database's long term retention policy. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -259,7 +338,7 @@ func (client *ManagedInstanceLongTermRetentionPoliciesClient) listByDatabaseCrea return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/managedinstancelongtermretentionpolicies_client_example_test.go b/sdk/resourcemanager/sql/armsql/managedinstancelongtermretentionpolicies_client_example_test.go deleted file mode 100644 index 7b778c4f5cd0..000000000000 --- a/sdk/resourcemanager/sql/armsql/managedinstancelongtermretentionpolicies_client_example_test.go +++ /dev/null @@ -1,131 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceLongTermRetentionPolicyGet.json -func ExampleManagedInstanceLongTermRetentionPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedInstanceLongTermRetentionPoliciesClient().Get(ctx, "testResourceGroup", "testInstance", "testDatabase", armsql.ManagedInstanceLongTermRetentionPolicyNameDefault, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedInstanceLongTermRetentionPolicy = armsql.ManagedInstanceLongTermRetentionPolicy{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/resourceGroups/managedInstances/databases/backupLongTermRetentionPolicies"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/resourceGroups/testResourceGroup/managedInstances/testInstance/databases/testDatabase/backupLongTermRetentionPolicies/default"), - // Properties: &armsql.BaseLongTermRetentionPolicyProperties{ - // MonthlyRetention: to.Ptr("P1Y"), - // WeekOfYear: to.Ptr[int32](5), - // WeeklyRetention: to.Ptr("P1M"), - // YearlyRetention: to.Ptr("P5Y"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceLongTermRetentionPolicyCreateOrUpdate.json -func ExampleManagedInstanceLongTermRetentionPoliciesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedInstanceLongTermRetentionPoliciesClient().BeginCreateOrUpdate(ctx, "testResourceGroup", "testInstance", "testDatabase", armsql.ManagedInstanceLongTermRetentionPolicyNameDefault, armsql.ManagedInstanceLongTermRetentionPolicy{ - Properties: &armsql.BaseLongTermRetentionPolicyProperties{ - MonthlyRetention: to.Ptr("P1Y"), - WeekOfYear: to.Ptr[int32](5), - WeeklyRetention: to.Ptr("P1M"), - YearlyRetention: to.Ptr("P5Y"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedInstanceLongTermRetentionPolicy = armsql.ManagedInstanceLongTermRetentionPolicy{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/resourceGroups/managedInstances/databases/backupLongTermRetentionPolicies"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testResourceGroup/providers/Microsoft.Sql/managedInstances/testInstance/databases/testDatabase/backupLongTermRetentionPolicies/default"), - // Properties: &armsql.BaseLongTermRetentionPolicyProperties{ - // MonthlyRetention: to.Ptr("P1Y"), - // WeekOfYear: to.Ptr[int32](5), - // WeeklyRetention: to.Ptr("P1M"), - // YearlyRetention: to.Ptr("P5Y"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceLongTermRetentionPolicyListByDatabase.json -func ExampleManagedInstanceLongTermRetentionPoliciesClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagedInstanceLongTermRetentionPoliciesClient().NewListByDatabasePager("testResourceGroup", "testInstance", "testDatabase", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ManagedInstanceLongTermRetentionPolicyListResult = armsql.ManagedInstanceLongTermRetentionPolicyListResult{ - // Value: []*armsql.ManagedInstanceLongTermRetentionPolicy{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/resourceGroups/managedInstances/databases/backupLongTermRetentionPolicies"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testResourceGroup/providers/Microsoft.Sql/managedInstances/testInstance/databases/testDatabase/backupLongTermRetentionPolicies/default"), - // Properties: &armsql.BaseLongTermRetentionPolicyProperties{ - // MonthlyRetention: to.Ptr("P1Y"), - // WeekOfYear: to.Ptr[int32](5), - // WeeklyRetention: to.Ptr("P1M"), - // YearlyRetention: to.Ptr("P5Y"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/sql/armsql/managedinstanceoperations_client.go b/sdk/resourcemanager/sql/armsql/managedinstanceoperations_client.go index 011de2a5d24d..5d21407ebd4d 100644 --- a/sdk/resourcemanager/sql/armsql/managedinstanceoperations_client.go +++ b/sdk/resourcemanager/sql/armsql/managedinstanceoperations_client.go @@ -46,7 +46,7 @@ func NewManagedInstanceOperationsClient(subscriptionID string, credential azcore // Cancel - Cancels the asynchronous operation on the managed instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -90,7 +90,7 @@ func (client *ManagedInstanceOperationsClient) cancelCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -98,7 +98,7 @@ func (client *ManagedInstanceOperationsClient) cancelCreateRequest(ctx context.C // Get - Gets a management operation on a managed instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -143,7 +143,7 @@ func (client *ManagedInstanceOperationsClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -160,7 +160,7 @@ func (client *ManagedInstanceOperationsClient) getHandleResponse(resp *http.Resp // NewListByManagedInstancePager - Gets a list of operations performed on the managed instance. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -214,7 +214,7 @@ func (client *ManagedInstanceOperationsClient) listByManagedInstanceCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/managedinstanceoperations_client_example_test.go b/sdk/resourcemanager/sql/armsql/managedinstanceoperations_client_example_test.go deleted file mode 100644 index 76a06e7101ca..000000000000 --- a/sdk/resourcemanager/sql/armsql/managedinstanceoperations_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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListManagedInstanceOperations.json -func ExampleManagedInstanceOperationsClient_NewListByManagedInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagedInstanceOperationsClient().NewListByManagedInstancePager("sqlcrudtest-7398", "sqlcrudtest-4645", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ManagedInstanceOperationListResult = armsql.ManagedInstanceOperationListResult{ - // Value: []*armsql.ManagedInstanceOperation{ - // { - // Name: to.Ptr("11111111-1111-1111-1111-111111111111"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/operations"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/managedInstances/sqlcrudtest-4645/operations/11111111-1111-1111-1111-111111111111"), - // Properties: &armsql.ManagedInstanceOperationProperties{ - // IsCancellable: to.Ptr(false), - // ManagedInstanceName: to.Ptr("sqlcrudtest-4645"), - // Operation: to.Ptr("UpsertManagedServer"), - // OperationFriendlyName: to.Ptr("UPDATE MANAGED SERVER"), - // PercentComplete: to.Ptr[int32](100), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-06T11:08:44.49Z"); return t}()), - // State: to.Ptr(armsql.ManagementOperationStateCancelled), - // }, - // }, - // { - // Name: to.Ptr("22222222-2222-2222-2222-222222222222"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/operations"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/managedInstances/sqlcrudtest-4645/operations/22222222-2222-2222-2222-222222222222"), - // Properties: &armsql.ManagedInstanceOperationProperties{ - // IsCancellable: to.Ptr(true), - // ManagedInstanceName: to.Ptr("sqlcrudtest-4645"), - // Operation: to.Ptr("UpsertManagedServer"), - // OperationFriendlyName: to.Ptr("UPDATE MANAGED SERVER"), - // OperationParameters: &armsql.ManagedInstanceOperationParametersPair{ - // CurrentParameters: &armsql.UpsertManagedServerOperationParameters{ - // Family: to.Ptr("Gen4"), - // StorageSizeInGB: to.Ptr[int32](32), - // Tier: to.Ptr("GeneralPurpose"), - // VCores: to.Ptr[int32](8), - // }, - // RequestedParameters: &armsql.UpsertManagedServerOperationParameters{ - // Family: to.Ptr("Gen4"), - // StorageSizeInGB: to.Ptr[int32](128), - // Tier: to.Ptr("BusinessCritical"), - // VCores: to.Ptr[int32](8), - // }, - // }, - // OperationSteps: &armsql.ManagedInstanceOperationSteps{ - // CurrentStep: to.Ptr[int32](3), - // StepsList: []*armsql.UpsertManagedServerOperationStep{ - // { - // Name: to.Ptr("Request validation"), - // Order: to.Ptr[int32](1), - // Status: to.Ptr(armsql.UpsertManagedServerOperationStepStatusCompleted), - // }, - // { - // Name: to.Ptr("Virtual Cluster resize/creation"), - // Order: to.Ptr[int32](2), - // Status: to.Ptr(armsql.UpsertManagedServerOperationStepStatusCompleted), - // }, - // { - // Name: to.Ptr("New SQL Instance Startup"), - // Order: to.Ptr[int32](3), - // Status: to.Ptr(armsql.UpsertManagedServerOperationStepStatusInProgress), - // }}, - // TotalSteps: to.Ptr("3"), - // }, - // PercentComplete: to.Ptr[int32](50), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-06T11:08:44.49Z"); return t}()), - // State: to.Ptr(armsql.ManagementOperationStateInProgress), - // }, - // }, - // { - // Name: to.Ptr("33333333-3333-3333-3333-333333333333"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/operations"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/managedInstances/sqlcrudtest-4645/operations/33333333-3333-3333-3333-333333333333"), - // Properties: &armsql.ManagedInstanceOperationProperties{ - // ErrorCode: to.Ptr[int32](45157), - // ErrorDescription: to.Ptr("Server 'sqlcrudtest-4645' is busy with another operation. Please try your operation later."), - // ErrorSeverity: to.Ptr[int32](16), - // IsCancellable: to.Ptr(false), - // IsUserError: to.Ptr(true), - // ManagedInstanceName: to.Ptr("sqlcrudtest-4645"), - // Operation: to.Ptr("UpsertManagedServer"), - // OperationFriendlyName: to.Ptr("UPDATE MANAGED SERVER"), - // PercentComplete: to.Ptr[int32](100), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-06T14:48:34.583Z"); return t}()), - // State: to.Ptr(armsql.ManagementOperationStateFailed), - // }, - // }, - // { - // Name: to.Ptr("44444444-4444-4444-4444-444444444444"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/operations"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/managedInstances/sqlcrudtest-4645/operations/44444444-4444-4444-4444-444444444444"), - // Properties: &armsql.ManagedInstanceOperationProperties{ - // ManagedInstanceName: to.Ptr("sqlcrudtest-4645"), - // Operation: to.Ptr("MakeAllManagedDatabasesAccessible"), - // OperationFriendlyName: to.Ptr("MAKE ALL MANAGED DBS ACCESSIBLE"), - // OperationSteps: &armsql.ManagedInstanceOperationSteps{ - // CurrentStep: to.Ptr[int32](1), - // StepsList: []*armsql.UpsertManagedServerOperationStep{ - // { - // Name: to.Ptr("Request validation"), - // Order: to.Ptr[int32](1), - // Status: to.Ptr(armsql.UpsertManagedServerOperationStepStatusFailed), - // }}, - // TotalSteps: to.Ptr("1"), - // }, - // PercentComplete: to.Ptr[int32](100), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-01T09:00:08.1Z"); return t}()), - // State: to.Ptr(armsql.ManagementOperationStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetManagedInstanceOperation.json -func ExampleManagedInstanceOperationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedInstanceOperationsClient().Get(ctx, "sqlcrudtest-7398", "sqlcrudtest-4645", "00000000-1111-2222-3333-444444444444", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedInstanceOperation = armsql.ManagedInstanceOperation{ - // Name: to.Ptr("11111111-1111-1111-1111-111111111111"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/operations"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/managedInstances/sqlcrudtest-4645/operations/11111111-1111-1111-1111-111111111111"), - // Properties: &armsql.ManagedInstanceOperationProperties{ - // IsCancellable: to.Ptr(false), - // ManagedInstanceName: to.Ptr("sqlcrudtest-4645"), - // Operation: to.Ptr("UpsertManagedServer"), - // OperationFriendlyName: to.Ptr("UPDATE MANAGED SERVER"), - // OperationSteps: &armsql.ManagedInstanceOperationSteps{ - // CurrentStep: to.Ptr[int32](2), - // StepsList: []*armsql.UpsertManagedServerOperationStep{ - // { - // Name: to.Ptr("Request validation"), - // Order: to.Ptr[int32](1), - // Status: to.Ptr(armsql.UpsertManagedServerOperationStepStatusCompleted), - // }, - // { - // Name: to.Ptr("New SQL Instance Startup"), - // Order: to.Ptr[int32](2), - // Status: to.Ptr(armsql.UpsertManagedServerOperationStepStatusCanceled), - // }, - // { - // Name: to.Ptr("Seeding database files"), - // Order: to.Ptr[int32](3), - // Status: to.Ptr(armsql.UpsertManagedServerOperationStepStatusNotStarted), - // }, - // { - // Name: to.Ptr("Preparing Failover and Failover"), - // Order: to.Ptr[int32](4), - // Status: to.Ptr(armsql.UpsertManagedServerOperationStepStatusNotStarted), - // }, - // { - // Name: to.Ptr("Old SQL Instance cleanup"), - // Order: to.Ptr[int32](5), - // Status: to.Ptr(armsql.UpsertManagedServerOperationStepStatusNotStarted), - // }}, - // TotalSteps: to.Ptr("5"), - // }, - // PercentComplete: to.Ptr[int32](100), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-06T11:08:44.49Z"); return t}()), - // State: to.Ptr(armsql.ManagementOperationStateCancelled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CancelManagedInstanceOperation.json -func ExampleManagedInstanceOperationsClient_Cancel() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewManagedInstanceOperationsClient().Cancel(ctx, "sqlcrudtest-7398", "sqlcrudtest-4645", "11111111-1111-1111-1111-111111111111", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/sql/armsql/managedinstanceprivateendpointconnections_client.go b/sdk/resourcemanager/sql/armsql/managedinstanceprivateendpointconnections_client.go index fe986848d5c4..ac1441d0b121 100644 --- a/sdk/resourcemanager/sql/armsql/managedinstanceprivateendpointconnections_client.go +++ b/sdk/resourcemanager/sql/armsql/managedinstanceprivateendpointconnections_client.go @@ -46,7 +46,7 @@ func NewManagedInstancePrivateEndpointConnectionsClient(subscriptionID string, c // BeginCreateOrUpdate - Approve or reject a private endpoint connection with a given name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -68,7 +68,7 @@ func (client *ManagedInstancePrivateEndpointConnectionsClient) BeginCreateOrUpda // CreateOrUpdate - Approve or reject a private endpoint connection with a given name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview func (client *ManagedInstancePrivateEndpointConnectionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, privateEndpointConnectionName string, parameters ManagedInstancePrivateEndpointConnection, options *ManagedInstancePrivateEndpointConnectionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, privateEndpointConnectionName, parameters, options) @@ -110,7 +110,7 @@ func (client *ManagedInstancePrivateEndpointConnectionsClient) createOrUpdateCre return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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 *ManagedInstancePrivateEndpointConnectionsClient) createOrUpdateCre // BeginDelete - Deletes a private endpoint connection with a given name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -144,7 +144,7 @@ func (client *ManagedInstancePrivateEndpointConnectionsClient) BeginDelete(ctx c // Delete - Deletes a private endpoint connection with a given name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview func (client *ManagedInstancePrivateEndpointConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, managedInstanceName string, privateEndpointConnectionName string, options *ManagedInstancePrivateEndpointConnectionsClientBeginDeleteOptions) (*http.Response, error) { var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, managedInstanceName, privateEndpointConnectionName, options) @@ -186,7 +186,7 @@ func (client *ManagedInstancePrivateEndpointConnectionsClient) deleteCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -194,7 +194,7 @@ func (client *ManagedInstancePrivateEndpointConnectionsClient) deleteCreateReque // Get - Gets a private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -243,7 +243,7 @@ func (client *ManagedInstancePrivateEndpointConnectionsClient) getCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -260,7 +260,7 @@ func (client *ManagedInstancePrivateEndpointConnectionsClient) getHandleResponse // NewListByManagedInstancePager - Gets all private endpoint connections on a server. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -314,7 +314,7 @@ func (client *ManagedInstancePrivateEndpointConnectionsClient) listByManagedInst return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/managedinstanceprivateendpointconnections_client_example_test.go b/sdk/resourcemanager/sql/armsql/managedinstanceprivateendpointconnections_client_example_test.go deleted file mode 100644 index a1794f4e2812..000000000000 --- a/sdk/resourcemanager/sql/armsql/managedinstanceprivateendpointconnections_client_example_test.go +++ /dev/null @@ -1,183 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstancePrivateEndpointConnectionGet.json -func ExampleManagedInstancePrivateEndpointConnectionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedInstancePrivateEndpointConnectionsClient().Get(ctx, "Default", "test-cl", "private-endpoint-connection-name", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedInstancePrivateEndpointConnection = armsql.ManagedInstancePrivateEndpointConnection{ - // Name: to.Ptr("private-endpoint-connection-name"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/test-cl/privateEndpointConnections/private-endpoint-connection-name"), - // Properties: &armsql.ManagedInstancePrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armsql.ManagedInstancePrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armsql.ManagedInstancePrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstancePrivateEndpointConnectionUpdate.json -func ExampleManagedInstancePrivateEndpointConnectionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedInstancePrivateEndpointConnectionsClient().BeginCreateOrUpdate(ctx, "Default", "test-cl", "private-endpoint-connection-name", armsql.ManagedInstancePrivateEndpointConnection{ - Properties: &armsql.ManagedInstancePrivateEndpointConnectionProperties{ - PrivateLinkServiceConnectionState: &armsql.ManagedInstancePrivateLinkServiceConnectionStateProperty{ - Description: to.Ptr("Approved by johndoe@contoso.com"), - 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.ManagedInstancePrivateEndpointConnection = armsql.ManagedInstancePrivateEndpointConnection{ - // Name: to.Ptr("private-endpoint-connection-name"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/test-cl/privateEndpointConnections/private-endpoint-connection-name"), - // Properties: &armsql.ManagedInstancePrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armsql.ManagedInstancePrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armsql.ManagedInstancePrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Approved by johndoe@contoso.com"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstancePrivateEndpointConnectionDelete.json -func ExampleManagedInstancePrivateEndpointConnectionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedInstancePrivateEndpointConnectionsClient().BeginDelete(ctx, "Default", "test-cl", "private-endpoint-connection-name", 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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstancePrivateEndpointConnectionList.json -func ExampleManagedInstancePrivateEndpointConnectionsClient_NewListByManagedInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagedInstancePrivateEndpointConnectionsClient().NewListByManagedInstancePager("Default", "test-cl", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ManagedInstancePrivateEndpointConnectionListResult = armsql.ManagedInstancePrivateEndpointConnectionListResult{ - // Value: []*armsql.ManagedInstancePrivateEndpointConnection{ - // { - // Name: to.Ptr("private-endpoint-connection-name"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/test-cl/privateEndpointConnections/private-endpoint-connection-name"), - // Properties: &armsql.ManagedInstancePrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armsql.ManagedInstancePrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armsql.ManagedInstancePrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // }, - // { - // Name: to.Ptr("private-endpoint-connection-name-2"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/test-cl/privateEndpointConnections/private-endpoint-connection-name-2"), - // Properties: &armsql.ManagedInstancePrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armsql.ManagedInstancePrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name-2"), - // }, - // PrivateLinkServiceConnectionState: &armsql.ManagedInstancePrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/sql/armsql/managedinstanceprivatelinkresources_client.go b/sdk/resourcemanager/sql/armsql/managedinstanceprivatelinkresources_client.go index 7ee57e15ccae..6291f912b337 100644 --- a/sdk/resourcemanager/sql/armsql/managedinstanceprivatelinkresources_client.go +++ b/sdk/resourcemanager/sql/armsql/managedinstanceprivatelinkresources_client.go @@ -46,7 +46,7 @@ func NewManagedInstancePrivateLinkResourcesClient(subscriptionID string, credent // Get - Gets a private link resource for SQL server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -95,7 +95,7 @@ func (client *ManagedInstancePrivateLinkResourcesClient) getCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -112,7 +112,7 @@ func (client *ManagedInstancePrivateLinkResourcesClient) getHandleResponse(resp // NewListByManagedInstancePager - Gets the private link resources for SQL server. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -166,7 +166,7 @@ func (client *ManagedInstancePrivateLinkResourcesClient) listByManagedInstanceCr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/managedinstanceprivatelinkresources_client_example_test.go b/sdk/resourcemanager/sql/armsql/managedinstanceprivatelinkresources_client_example_test.go deleted file mode 100644 index a596c3c80b3a..000000000000 --- a/sdk/resourcemanager/sql/armsql/managedinstanceprivatelinkresources_client_example_test.go +++ /dev/null @@ -1,86 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstancePrivateLinkResourcesList.json -func ExampleManagedInstancePrivateLinkResourcesClient_NewListByManagedInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagedInstancePrivateLinkResourcesClient().NewListByManagedInstancePager("Default", "test-cl", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ManagedInstancePrivateLinkListResult = armsql.ManagedInstancePrivateLinkListResult{ - // Value: []*armsql.ManagedInstancePrivateLink{ - // { - // Name: to.Ptr("plr"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/privateLinkResources"), - // ID: to.Ptr("subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/test-cl/privateLinkResources/plr"), - // Properties: &armsql.ManagedInstancePrivateLinkProperties{ - // GroupID: to.Ptr("managedInstance"), - // RequiredMembers: []*string{ - // to.Ptr("managedInstance")}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstancePrivateLinkResourcesGet.json -func ExampleManagedInstancePrivateLinkResourcesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedInstancePrivateLinkResourcesClient().Get(ctx, "Default", "test-cl", "plr", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedInstancePrivateLink = armsql.ManagedInstancePrivateLink{ - // Name: to.Ptr("plr"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/privateLinkResources"), - // ID: to.Ptr("subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/test-cl/privateLinkResources/plr"), - // Properties: &armsql.ManagedInstancePrivateLinkProperties{ - // GroupID: to.Ptr("managedInstance"), - // RequiredMembers: []*string{ - // to.Ptr("managedInstance")}, - // }, - // } -} diff --git a/sdk/resourcemanager/sql/armsql/managedinstances_client.go b/sdk/resourcemanager/sql/armsql/managedinstances_client.go index f63e7d750a74..0c26684a536e 100644 --- a/sdk/resourcemanager/sql/armsql/managedinstances_client.go +++ b/sdk/resourcemanager/sql/armsql/managedinstances_client.go @@ -47,7 +47,7 @@ func NewManagedInstancesClient(subscriptionID string, credential azcore.TokenCre // BeginCreateOrUpdate - Creates or updates a managed instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -70,7 +70,7 @@ func (client *ManagedInstancesClient) BeginCreateOrUpdate(ctx context.Context, r // CreateOrUpdate - Creates or updates a managed instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview func (client *ManagedInstancesClient) createOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, parameters ManagedInstance, options *ManagedInstancesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, parameters, options) @@ -108,7 +108,7 @@ func (client *ManagedInstancesClient) createOrUpdateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -120,7 +120,7 @@ func (client *ManagedInstancesClient) createOrUpdateCreateRequest(ctx context.Co // BeginDelete - Deletes a managed instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -142,7 +142,7 @@ func (client *ManagedInstancesClient) BeginDelete(ctx context.Context, resourceG // Delete - Deletes a managed instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview func (client *ManagedInstancesClient) deleteOperation(ctx context.Context, resourceGroupName string, managedInstanceName string, options *ManagedInstancesClientBeginDeleteOptions) (*http.Response, error) { var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, managedInstanceName, options) @@ -180,7 +180,7 @@ func (client *ManagedInstancesClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -188,7 +188,7 @@ func (client *ManagedInstancesClient) deleteCreateRequest(ctx context.Context, r // BeginFailover - Failovers a managed instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance to failover. @@ -210,7 +210,7 @@ func (client *ManagedInstancesClient) BeginFailover(ctx context.Context, resourc // Failover - Failovers a managed instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview func (client *ManagedInstancesClient) failover(ctx context.Context, resourceGroupName string, managedInstanceName string, options *ManagedInstancesClientBeginFailoverOptions) (*http.Response, error) { var err error req, err := client.failoverCreateRequest(ctx, resourceGroupName, managedInstanceName, options) @@ -251,7 +251,7 @@ func (client *ManagedInstancesClient) failoverCreateRequest(ctx context.Context, if options != nil && options.ReplicaType != nil { reqQP.Set("replicaType", string(*options.ReplicaType)) } - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -259,7 +259,7 @@ func (client *ManagedInstancesClient) failoverCreateRequest(ctx context.Context, // Get - Gets a managed instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -305,7 +305,7 @@ func (client *ManagedInstancesClient) getCreateRequest(ctx context.Context, reso if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -322,7 +322,7 @@ func (client *ManagedInstancesClient) getHandleResponse(resp *http.Response) (Ma // NewListPager - Gets a list of all managed instances in the subscription. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - options - ManagedInstancesClientListOptions contains the optional parameters for the ManagedInstancesClient.NewListPager // method. func (client *ManagedInstancesClient) NewListPager(options *ManagedInstancesClientListOptions) *runtime.Pager[ManagedInstancesClientListResponse] { @@ -368,7 +368,7 @@ func (client *ManagedInstancesClient) listCreateRequest(ctx context.Context, opt if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -385,7 +385,7 @@ func (client *ManagedInstancesClient) listHandleResponse(resp *http.Response) (M // NewListByInstancePoolPager - Gets a list of all managed instances in an instance pool. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - instancePoolName - The instance pool name. @@ -442,7 +442,7 @@ func (client *ManagedInstancesClient) listByInstancePoolCreateRequest(ctx contex if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -459,7 +459,7 @@ func (client *ManagedInstancesClient) listByInstancePoolHandleResponse(resp *htt // NewListByManagedInstancePager - Get top resource consuming queries of a managed instance. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -534,7 +534,7 @@ func (client *ManagedInstancesClient) listByManagedInstanceCreateRequest(ctx con if options != nil && options.ObservationMetric != nil { reqQP.Set("observationMetric", string(*options.ObservationMetric)) } - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -551,7 +551,7 @@ func (client *ManagedInstancesClient) listByManagedInstanceHandleResponse(resp * // NewListByResourceGroupPager - Gets a list of managed instances in a resource group. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - options - ManagedInstancesClientListByResourceGroupOptions contains the optional parameters for the ManagedInstancesClient.NewListByResourceGroupPager @@ -603,7 +603,7 @@ func (client *ManagedInstancesClient) listByResourceGroupCreateRequest(ctx conte if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -621,7 +621,7 @@ func (client *ManagedInstancesClient) listByResourceGroupHandleResponse(resp *ht // NewListOutboundNetworkDependenciesByManagedInstancePager - Gets the collection of outbound network dependencies for the // given managed instance. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -675,7 +675,7 @@ func (client *ManagedInstancesClient) listOutboundNetworkDependenciesByManagedIn return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -690,10 +690,81 @@ func (client *ManagedInstancesClient) listOutboundNetworkDependenciesByManagedIn return result, nil } +// BeginRefreshStatus - Refresh external governance enablement status. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - options - ManagedInstancesClientBeginRefreshStatusOptions contains the optional parameters for the ManagedInstancesClient.BeginRefreshStatus +// method. +func (client *ManagedInstancesClient) BeginRefreshStatus(ctx context.Context, resourceGroupName string, managedInstanceName string, options *ManagedInstancesClientBeginRefreshStatusOptions) (*runtime.Poller[ManagedInstancesClientRefreshStatusResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.refreshStatus(ctx, resourceGroupName, managedInstanceName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ManagedInstancesClientRefreshStatusResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[ManagedInstancesClientRefreshStatusResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// RefreshStatus - Refresh external governance enablement status. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01-preview +func (client *ManagedInstancesClient) refreshStatus(ctx context.Context, resourceGroupName string, managedInstanceName string, options *ManagedInstancesClientBeginRefreshStatusOptions) (*http.Response, error) { + var err error + req, err := client.refreshStatusCreateRequest(ctx, resourceGroupName, managedInstanceName, 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 +} + +// refreshStatusCreateRequest creates the RefreshStatus request. +func (client *ManagedInstancesClient) refreshStatusCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, options *ManagedInstancesClientBeginRefreshStatusOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/refreshExternalGovernanceStatus" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if managedInstanceName == "" { + return nil, errors.New("parameter managedInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedInstanceName}", url.PathEscape(managedInstanceName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + // BeginStart - Starts the managed instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -717,7 +788,7 @@ func (client *ManagedInstancesClient) BeginStart(ctx context.Context, resourceGr // Start - Starts the managed instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview func (client *ManagedInstancesClient) start(ctx context.Context, resourceGroupName string, managedInstanceName string, options *ManagedInstancesClientBeginStartOptions) (*http.Response, error) { var err error req, err := client.startCreateRequest(ctx, resourceGroupName, managedInstanceName, options) @@ -728,7 +799,7 @@ func (client *ManagedInstancesClient) start(ctx context.Context, resourceGroupNa if err != nil { return nil, err } - if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { err = runtime.NewResponseError(httpResp) return nil, err } @@ -755,15 +826,16 @@ func (client *ManagedInstancesClient) startCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // BeginStop - Stops the managed instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -787,7 +859,7 @@ func (client *ManagedInstancesClient) BeginStop(ctx context.Context, resourceGro // Stop - Stops the managed instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview func (client *ManagedInstancesClient) stop(ctx context.Context, resourceGroupName string, managedInstanceName string, options *ManagedInstancesClientBeginStopOptions) (*http.Response, error) { var err error req, err := client.stopCreateRequest(ctx, resourceGroupName, managedInstanceName, options) @@ -798,7 +870,7 @@ func (client *ManagedInstancesClient) stop(ctx context.Context, resourceGroupNam if err != nil { return nil, err } - if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { err = runtime.NewResponseError(httpResp) return nil, err } @@ -825,15 +897,16 @@ func (client *ManagedInstancesClient) stopCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // BeginUpdate - Updates a managed instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -856,7 +929,7 @@ func (client *ManagedInstancesClient) BeginUpdate(ctx context.Context, resourceG // Update - Updates a managed instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview func (client *ManagedInstancesClient) update(ctx context.Context, resourceGroupName string, managedInstanceName string, parameters ManagedInstanceUpdate, options *ManagedInstancesClientBeginUpdateOptions) (*http.Response, error) { var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, managedInstanceName, parameters, options) @@ -894,7 +967,7 @@ func (client *ManagedInstancesClient) updateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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/sql/armsql/managedinstances_client_example_test.go b/sdk/resourcemanager/sql/armsql/managedinstances_client_example_test.go deleted file mode 100644 index f7a8b8ca2d02..000000000000 --- a/sdk/resourcemanager/sql/armsql/managedinstances_client_example_test.go +++ /dev/null @@ -1,1826 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceList.json -func ExampleManagedInstancesClient_NewListPager_listManagedInstances() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagedInstancesClient().NewListPager(&armsql.ManagedInstancesClientListOptions{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.ManagedInstanceListResult = armsql.ManagedInstanceListResult{ - // Value: []*armsql.ManagedInstance{ - // { - // Name: to.Ptr("testinstance1"), - // Type: to.Ptr("Microsoft.Sql/managedInstances"), - // ID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/Test1/providers/Microsoft.Sql/managedInstances/testinstance1"), - // Location: to.Ptr("japaneast"), - // Properties: &armsql.ManagedInstanceProperties{ - // AdministratorLogin: to.Ptr("dummylogin"), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // DNSZone: to.Ptr("1b4e2caff2530"), - // FullyQualifiedDomainName: to.Ptr("testinstance1.1b4e2caff2530.database.windows.net"), - // LicenseType: to.Ptr(armsql.ManagedInstanceLicenseTypeLicenseIncluded), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_1"), - // MinimalTLSVersion: to.Ptr("1.2"), - // ProvisioningState: to.Ptr(armsql.ManagedInstancePropertiesProvisioningStateSucceeded), - // ProxyOverride: to.Ptr(armsql.ManagedInstanceProxyOverrideDefault), - // PublicDataEndpointEnabled: to.Ptr(false), - // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // State: to.Ptr("Ready"), - // StorageSizeInGB: to.Ptr[int32](1024), - // SubnetID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // VCores: to.Ptr[int32](8), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("GP_Gen4"), - // Capacity: to.Ptr[int32](8), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr("GeneralPurpose"), - // }, - // }, - // { - // Name: to.Ptr("testinstance2"), - // Type: to.Ptr("Microsoft.Sql/managedInstances"), - // ID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/Test1/providers/Microsoft.Sql/managedInstances/testinstance2"), - // Location: to.Ptr("japaneast"), - // Properties: &armsql.ManagedInstanceProperties{ - // AdministratorLogin: to.Ptr("dummylogin"), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // DNSZone: to.Ptr("2c3d1bdae3412"), - // FullyQualifiedDomainName: to.Ptr("testinstance2.2c3d1bdae3412.database.windows.net"), - // LicenseType: to.Ptr(armsql.ManagedInstanceLicenseType("Full")), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_1"), - // MinimalTLSVersion: to.Ptr("1.2"), - // ProvisioningState: to.Ptr(armsql.ManagedInstancePropertiesProvisioningStateSucceeded), - // ProxyOverride: to.Ptr(armsql.ManagedInstanceProxyOverrideDefault), - // PublicDataEndpointEnabled: to.Ptr(false), - // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // State: to.Ptr("Ready"), - // StorageSizeInGB: to.Ptr[int32](1024), - // SubnetID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/subnet2"), - // VCores: to.Ptr[int32](16), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("BC_Gen5"), - // Capacity: to.Ptr[int32](16), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr("BusinessCritical"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceListWithExpandEqualsAdministrators.json -func ExampleManagedInstancesClient_NewListPager_listManagedInstancesWithExpandAdministratorsActivedirectory() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagedInstancesClient().NewListPager(&armsql.ManagedInstancesClientListOptions{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.ManagedInstanceListResult = armsql.ManagedInstanceListResult{ - // Value: []*armsql.ManagedInstance{ - // { - // Name: to.Ptr("testinstance1"), - // Type: to.Ptr("Microsoft.Sql/managedInstances"), - // ID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/Test1/providers/Microsoft.Sql/managedInstances/testinstance1"), - // Location: to.Ptr("japaneast"), - // Properties: &armsql.ManagedInstanceProperties{ - // AdministratorLogin: to.Ptr("dummylogin"), - // Administrators: &armsql.ManagedInstanceExternalAdministrator{ - // AzureADOnlyAuthentication: to.Ptr(true), - // Login: to.Ptr("bob@contoso.com"), - // PrincipalType: to.Ptr(armsql.PrincipalTypeUser), - // Sid: to.Ptr("00000011-1111-2222-2222-123456789111"), - // TenantID: to.Ptr("00000011-1111-2222-2222-123456789111"), - // }, - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // DNSZone: to.Ptr("1b4e2caff2530"), - // FullyQualifiedDomainName: to.Ptr("testinstance1.1b4e2caff2530.database.windows.net"), - // LicenseType: to.Ptr(armsql.ManagedInstanceLicenseTypeLicenseIncluded), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_1"), - // MinimalTLSVersion: to.Ptr("1.2"), - // ProvisioningState: to.Ptr(armsql.ManagedInstancePropertiesProvisioningStateSucceeded), - // ProxyOverride: to.Ptr(armsql.ManagedInstanceProxyOverrideDefault), - // PublicDataEndpointEnabled: to.Ptr(false), - // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // State: to.Ptr("Ready"), - // StorageSizeInGB: to.Ptr[int32](1024), - // SubnetID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // VCores: to.Ptr[int32](8), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("GP_Gen4"), - // Capacity: to.Ptr[int32](8), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr("GeneralPurpose"), - // }, - // }, - // { - // Name: to.Ptr("testinstance2"), - // Type: to.Ptr("Microsoft.Sql/managedInstances"), - // ID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/Test1/providers/Microsoft.Sql/managedInstances/testinstance2"), - // Location: to.Ptr("japaneast"), - // Properties: &armsql.ManagedInstanceProperties{ - // AdministratorLogin: to.Ptr("dummylogin"), - // Administrators: &armsql.ManagedInstanceExternalAdministrator{ - // AzureADOnlyAuthentication: to.Ptr(true), - // Login: to.Ptr("bob@contoso.com"), - // PrincipalType: to.Ptr(armsql.PrincipalTypeUser), - // Sid: to.Ptr("00000011-1111-2222-2222-123456789111"), - // TenantID: to.Ptr("00000011-1111-2222-2222-123456789111"), - // }, - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // DNSZone: to.Ptr("2c3d1bdae3412"), - // FullyQualifiedDomainName: to.Ptr("testinstance2.2c3d1bdae3412.database.windows.net"), - // LicenseType: to.Ptr(armsql.ManagedInstanceLicenseType("Full")), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_2"), - // MinimalTLSVersion: to.Ptr("1.2"), - // ProvisioningState: to.Ptr(armsql.ManagedInstancePropertiesProvisioningStateSucceeded), - // ProxyOverride: to.Ptr(armsql.ManagedInstanceProxyOverrideDefault), - // PublicDataEndpointEnabled: to.Ptr(false), - // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // State: to.Ptr("Ready"), - // StorageSizeInGB: to.Ptr[int32](1024), - // SubnetID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/subnet2"), - // VCores: to.Ptr[int32](16), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("BC_Gen5"), - // Capacity: to.Ptr[int32](16), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr("BusinessCritical"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceListByInstancePool.json -func ExampleManagedInstancesClient_NewListByInstancePoolPager_listManagedInstancesByInstancePool() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagedInstancesClient().NewListByInstancePoolPager("Test1", "pool1", &armsql.ManagedInstancesClientListByInstancePoolOptions{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.ManagedInstanceListResult = armsql.ManagedInstanceListResult{ - // Value: []*armsql.ManagedInstance{ - // { - // Name: to.Ptr("testinstance1"), - // Type: to.Ptr("Microsoft.Sql/managedInstances"), - // ID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/Test1/providers/Microsoft.Sql/managedInstances/testinstance1"), - // Location: to.Ptr("canadacentral"), - // Properties: &armsql.ManagedInstanceProperties{ - // AdministratorLogin: to.Ptr("dummylogin"), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // DNSZone: to.Ptr("1b4e2caff2530"), - // FullyQualifiedDomainName: to.Ptr("testinstance1.1b4e2caff2530.database.windows.net"), - // InstancePoolID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/Test1/providers/Microsoft.Sql/instancePools/pool1"), - // LicenseType: to.Ptr(armsql.ManagedInstanceLicenseTypeLicenseIncluded), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_CanadaCentral_MI_1"), - // MinimalTLSVersion: to.Ptr("1.2"), - // ProvisioningState: to.Ptr(armsql.ManagedInstancePropertiesProvisioningStateSucceeded), - // ProxyOverride: to.Ptr(armsql.ManagedInstanceProxyOverrideRedirect), - // PublicDataEndpointEnabled: to.Ptr(false), - // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // State: to.Ptr("Ready"), - // StorageSizeInGB: to.Ptr[int32](1024), - // SubnetID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/Test1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // VCores: to.Ptr[int32](8), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("GP_Gen5"), - // Capacity: to.Ptr[int32](8), - // Family: to.Ptr("Gen5"), - // Tier: to.Ptr("GeneralPurpose"), - // }, - // }, - // { - // Name: to.Ptr("testinstance2"), - // Type: to.Ptr("Microsoft.Sql/managedInstances"), - // ID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/Test1/providers/Microsoft.Sql/managedInstances/testinstance2"), - // Location: to.Ptr("canadacentral"), - // Properties: &armsql.ManagedInstanceProperties{ - // AdministratorLogin: to.Ptr("dummylogin"), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // DNSZone: to.Ptr("2c3d1bdae3412"), - // FullyQualifiedDomainName: to.Ptr("testinstance2.2c3d1bdae3412.database.windows.net"), - // InstancePoolID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/Test1/providers/Microsoft.Sql/instancePools/pool1"), - // LicenseType: to.Ptr(armsql.ManagedInstanceLicenseType("Full")), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_CanadaCentral_MI_1"), - // MinimalTLSVersion: to.Ptr("1.2"), - // ProvisioningState: to.Ptr(armsql.ManagedInstancePropertiesProvisioningStateSucceeded), - // ProxyOverride: to.Ptr(armsql.ManagedInstanceProxyOverrideRedirect), - // PublicDataEndpointEnabled: to.Ptr(false), - // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // State: to.Ptr("Ready"), - // StorageSizeInGB: to.Ptr[int32](1024), - // SubnetID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/Test1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // VCores: to.Ptr[int32](16), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("GP_Gen5"), - // Capacity: to.Ptr[int32](16), - // Family: to.Ptr("Gen5"), - // Tier: to.Ptr("GeneralPurpose"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceListByInstancePoolWithExpandEqualsAdministrators.json -func ExampleManagedInstancesClient_NewListByInstancePoolPager_listManagedInstancesByInstancePoolWithExpandAdministratorsActivedirectory() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagedInstancesClient().NewListByInstancePoolPager("Test1", "pool1", &armsql.ManagedInstancesClientListByInstancePoolOptions{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.ManagedInstanceListResult = armsql.ManagedInstanceListResult{ - // Value: []*armsql.ManagedInstance{ - // { - // Name: to.Ptr("testinstance1"), - // Type: to.Ptr("Microsoft.Sql/managedInstances"), - // ID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/Test1/providers/Microsoft.Sql/managedInstances/testinstance1"), - // Location: to.Ptr("canadacentral"), - // Properties: &armsql.ManagedInstanceProperties{ - // AdministratorLogin: to.Ptr("dummylogin"), - // Administrators: &armsql.ManagedInstanceExternalAdministrator{ - // AzureADOnlyAuthentication: to.Ptr(true), - // Login: to.Ptr("bob@contoso.com"), - // PrincipalType: to.Ptr(armsql.PrincipalTypeUser), - // Sid: to.Ptr("00000011-1111-2222-2222-123456789111"), - // TenantID: to.Ptr("00000011-1111-2222-2222-123456789111"), - // }, - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // DNSZone: to.Ptr("1b4e2caff2530"), - // FullyQualifiedDomainName: to.Ptr("testinstance1.1b4e2caff2530.database.windows.net"), - // InstancePoolID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/Test1/providers/Microsoft.Sql/instancePools/pool1"), - // LicenseType: to.Ptr(armsql.ManagedInstanceLicenseTypeLicenseIncluded), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_CanadaCentral_MI_1"), - // MinimalTLSVersion: to.Ptr("1.2"), - // ProvisioningState: to.Ptr(armsql.ManagedInstancePropertiesProvisioningStateSucceeded), - // ProxyOverride: to.Ptr(armsql.ManagedInstanceProxyOverrideRedirect), - // PublicDataEndpointEnabled: to.Ptr(false), - // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // State: to.Ptr("Ready"), - // StorageSizeInGB: to.Ptr[int32](1024), - // SubnetID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/Test1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // VCores: to.Ptr[int32](8), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("GP_Gen5"), - // Capacity: to.Ptr[int32](8), - // Family: to.Ptr("Gen5"), - // Tier: to.Ptr("GeneralPurpose"), - // }, - // }, - // { - // Name: to.Ptr("testinstance2"), - // Type: to.Ptr("Microsoft.Sql/managedInstances"), - // ID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/Test1/providers/Microsoft.Sql/managedInstances/testinstance2"), - // Location: to.Ptr("canadacentral"), - // Properties: &armsql.ManagedInstanceProperties{ - // AdministratorLogin: to.Ptr("dummylogin"), - // Administrators: &armsql.ManagedInstanceExternalAdministrator{ - // AzureADOnlyAuthentication: to.Ptr(true), - // Login: to.Ptr("bob@contoso.com"), - // PrincipalType: to.Ptr(armsql.PrincipalTypeUser), - // Sid: to.Ptr("00000011-1111-2222-2222-123456789111"), - // TenantID: to.Ptr("00000011-1111-2222-2222-123456789111"), - // }, - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // DNSZone: to.Ptr("2c3d1bdae3412"), - // FullyQualifiedDomainName: to.Ptr("testinstance2.2c3d1bdae3412.database.windows.net"), - // InstancePoolID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/Test1/providers/Microsoft.Sql/instancePools/pool1"), - // LicenseType: to.Ptr(armsql.ManagedInstanceLicenseType("Full")), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_CanadaCentral_MI_2"), - // MinimalTLSVersion: to.Ptr("1.2"), - // ProvisioningState: to.Ptr(armsql.ManagedInstancePropertiesProvisioningStateSucceeded), - // ProxyOverride: to.Ptr(armsql.ManagedInstanceProxyOverrideRedirect), - // PublicDataEndpointEnabled: to.Ptr(false), - // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // State: to.Ptr("Ready"), - // StorageSizeInGB: to.Ptr[int32](1024), - // SubnetID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/Test1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // VCores: to.Ptr[int32](16), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("GP_Gen5"), - // Capacity: to.Ptr[int32](16), - // Family: to.Ptr("Gen5"), - // Tier: to.Ptr("GeneralPurpose"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceListByResourceGroup.json -func ExampleManagedInstancesClient_NewListByResourceGroupPager_listManagedInstancesByResourceGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagedInstancesClient().NewListByResourceGroupPager("Test1", &armsql.ManagedInstancesClientListByResourceGroupOptions{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.ManagedInstanceListResult = armsql.ManagedInstanceListResult{ - // Value: []*armsql.ManagedInstance{ - // { - // Name: to.Ptr("testinstance1"), - // Type: to.Ptr("Microsoft.Sql/managedInstances"), - // ID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/Test1/providers/Microsoft.Sql/managedInstances/testinstance1"), - // Location: to.Ptr("japaneast"), - // Properties: &armsql.ManagedInstanceProperties{ - // AdministratorLogin: to.Ptr("dummylogin"), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // DNSZone: to.Ptr("1b4e2caff2530"), - // FullyQualifiedDomainName: to.Ptr("testinstance1.1b4e2caff2530.database.windows.net"), - // LicenseType: to.Ptr(armsql.ManagedInstanceLicenseTypeLicenseIncluded), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_1"), - // MinimalTLSVersion: to.Ptr("1.2"), - // ProvisioningState: to.Ptr(armsql.ManagedInstancePropertiesProvisioningStateSucceeded), - // ProxyOverride: to.Ptr(armsql.ManagedInstanceProxyOverrideDefault), - // PublicDataEndpointEnabled: to.Ptr(false), - // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // State: to.Ptr("Ready"), - // StorageSizeInGB: to.Ptr[int32](1024), - // SubnetID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // VCores: to.Ptr[int32](8), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("GP_Gen4"), - // Capacity: to.Ptr[int32](8), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr("GeneralPurpose"), - // }, - // }, - // { - // Name: to.Ptr("testinstance2"), - // Type: to.Ptr("Microsoft.Sql/managedInstances"), - // ID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/Test1/providers/Microsoft.Sql/managedInstances/testinstance2"), - // Location: to.Ptr("japaneast"), - // Properties: &armsql.ManagedInstanceProperties{ - // AdministratorLogin: to.Ptr("dummylogin"), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // DNSZone: to.Ptr("2c3d1bdae3412"), - // FullyQualifiedDomainName: to.Ptr("testinstance2.2c3d1bdae3412.database.windows.net"), - // LicenseType: to.Ptr(armsql.ManagedInstanceLicenseType("Full")), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_1"), - // MinimalTLSVersion: to.Ptr("1.2"), - // ProvisioningState: to.Ptr(armsql.ManagedInstancePropertiesProvisioningStateSucceeded), - // ProxyOverride: to.Ptr(armsql.ManagedInstanceProxyOverrideDefault), - // PublicDataEndpointEnabled: to.Ptr(false), - // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // State: to.Ptr("Ready"), - // StorageSizeInGB: to.Ptr[int32](1024), - // SubnetID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/subnet2"), - // VCores: to.Ptr[int32](16), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("BC_Gen5"), - // Capacity: to.Ptr[int32](16), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr("BusinessCritical"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceListByResourceGroupWithExpandEqualsAdministrators.json -func ExampleManagedInstancesClient_NewListByResourceGroupPager_listManagedInstancesByResourceGroupWithExpandAdministratorsActivedirectory() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagedInstancesClient().NewListByResourceGroupPager("Test1", &armsql.ManagedInstancesClientListByResourceGroupOptions{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.ManagedInstanceListResult = armsql.ManagedInstanceListResult{ - // Value: []*armsql.ManagedInstance{ - // { - // Name: to.Ptr("testinstance1"), - // Type: to.Ptr("Microsoft.Sql/managedInstances"), - // ID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/Test1/providers/Microsoft.Sql/managedInstances/testinstance1"), - // Location: to.Ptr("japaneast"), - // Properties: &armsql.ManagedInstanceProperties{ - // AdministratorLogin: to.Ptr("dummylogin"), - // Administrators: &armsql.ManagedInstanceExternalAdministrator{ - // AzureADOnlyAuthentication: to.Ptr(true), - // Login: to.Ptr("bob@contoso.com"), - // PrincipalType: to.Ptr(armsql.PrincipalTypeUser), - // Sid: to.Ptr("00000011-1111-2222-2222-123456789111"), - // TenantID: to.Ptr("00000011-1111-2222-2222-123456789111"), - // }, - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // DNSZone: to.Ptr("1b4e2caff2530"), - // FullyQualifiedDomainName: to.Ptr("testinstance1.1b4e2caff2530.database.windows.net"), - // LicenseType: to.Ptr(armsql.ManagedInstanceLicenseTypeLicenseIncluded), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_1"), - // MinimalTLSVersion: to.Ptr("1.2"), - // ProvisioningState: to.Ptr(armsql.ManagedInstancePropertiesProvisioningStateSucceeded), - // ProxyOverride: to.Ptr(armsql.ManagedInstanceProxyOverrideDefault), - // PublicDataEndpointEnabled: to.Ptr(false), - // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // State: to.Ptr("Ready"), - // StorageSizeInGB: to.Ptr[int32](1024), - // SubnetID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // VCores: to.Ptr[int32](8), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("GP_Gen4"), - // Capacity: to.Ptr[int32](8), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr("GeneralPurpose"), - // }, - // }, - // { - // Name: to.Ptr("testinstance2"), - // Type: to.Ptr("Microsoft.Sql/managedInstances"), - // ID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/Test1/providers/Microsoft.Sql/managedInstances/testinstance2"), - // Location: to.Ptr("japaneast"), - // Properties: &armsql.ManagedInstanceProperties{ - // AdministratorLogin: to.Ptr("dummylogin"), - // Administrators: &armsql.ManagedInstanceExternalAdministrator{ - // AzureADOnlyAuthentication: to.Ptr(true), - // Login: to.Ptr("bob@contoso.com"), - // PrincipalType: to.Ptr(armsql.PrincipalTypeUser), - // Sid: to.Ptr("00000011-1111-2222-2222-123456789111"), - // TenantID: to.Ptr("00000011-1111-2222-2222-123456789111"), - // }, - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // DNSZone: to.Ptr("2c3d1bdae3412"), - // FullyQualifiedDomainName: to.Ptr("testinstance2.2c3d1bdae3412.database.windows.net"), - // LicenseType: to.Ptr(armsql.ManagedInstanceLicenseType("Full")), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_2"), - // MinimalTLSVersion: to.Ptr("1.2"), - // ProvisioningState: to.Ptr(armsql.ManagedInstancePropertiesProvisioningStateSucceeded), - // ProxyOverride: to.Ptr(armsql.ManagedInstanceProxyOverrideDefault), - // PublicDataEndpointEnabled: to.Ptr(false), - // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // State: to.Ptr("Ready"), - // StorageSizeInGB: to.Ptr[int32](1024), - // SubnetID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/subnet2"), - // VCores: to.Ptr[int32](16), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("BC_Gen5"), - // Capacity: to.Ptr[int32](16), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr("BusinessCritical"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceGet.json -func ExampleManagedInstancesClient_Get_getManagedInstance() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedInstancesClient().Get(ctx, "testrg", "testinstance", &armsql.ManagedInstancesClientGetOptions{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.ManagedInstance = armsql.ManagedInstance{ - // Name: to.Ptr("testinstance"), - // Type: to.Ptr("Microsoft.Sql/managedInstances"), - // ID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testinstance"), - // Location: to.Ptr("japaneast"), - // Tags: map[string]*string{ - // "key": to.Ptr("value"), - // }, - // Properties: &armsql.ManagedInstanceProperties{ - // AdministratorLogin: to.Ptr("dummylogin"), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // DNSZone: to.Ptr("1b4e2caff2530"), - // FullyQualifiedDomainName: to.Ptr("testinstance.1b4e2caff2530.database.windows.net"), - // InstancePoolID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/testrg/providers/Microsoft.Sql/instancePools/instancePool1"), - // LicenseType: to.Ptr(armsql.ManagedInstanceLicenseTypeLicenseIncluded), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_1"), - // MinimalTLSVersion: to.Ptr("1.2"), - // ProvisioningState: to.Ptr(armsql.ManagedInstancePropertiesProvisioningStateSucceeded), - // ProxyOverride: to.Ptr(armsql.ManagedInstanceProxyOverrideDefault), - // PublicDataEndpointEnabled: to.Ptr(false), - // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // ServicePrincipal: &armsql.ServicePrincipal{ - // Type: to.Ptr(armsql.ServicePrincipalTypeSystemAssigned), - // ClientID: to.Ptr("00000011-1111-2222-2222-123456789111"), - // PrincipalID: to.Ptr("00000011-1111-2222-2222-123456789111"), - // TenantID: to.Ptr("00000011-1111-2222-2222-123456789111"), - // }, - // State: to.Ptr("Ready"), - // StorageSizeInGB: to.Ptr[int32](1024), - // SubnetID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // VCores: to.Ptr[int32](8), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("GP_Gen4"), - // Capacity: to.Ptr[int32](8), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr("GeneralPurpose"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceGetWithExpandEqualsAdministrators.json -func ExampleManagedInstancesClient_Get_getManagedInstanceWithExpandAdministratorsActivedirectory() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedInstancesClient().Get(ctx, "testrg", "testinstance", &armsql.ManagedInstancesClientGetOptions{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.ManagedInstance = armsql.ManagedInstance{ - // Name: to.Ptr("testinstance"), - // Type: to.Ptr("Microsoft.Sql/managedInstances"), - // ID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testinstance"), - // Location: to.Ptr("japaneast"), - // Tags: map[string]*string{ - // "key": to.Ptr("value"), - // }, - // Properties: &armsql.ManagedInstanceProperties{ - // AdministratorLogin: to.Ptr("dummylogin"), - // Administrators: &armsql.ManagedInstanceExternalAdministrator{ - // AzureADOnlyAuthentication: to.Ptr(true), - // Login: to.Ptr("bob@contoso.com"), - // PrincipalType: to.Ptr(armsql.PrincipalTypeUser), - // Sid: to.Ptr("00000011-1111-2222-2222-123456789111"), - // TenantID: to.Ptr("00000011-1111-2222-2222-123456789111"), - // }, - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // DNSZone: to.Ptr("1b4e2caff2530"), - // FullyQualifiedDomainName: to.Ptr("testinstance.1b4e2caff2530.database.windows.net"), - // InstancePoolID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/testrg/providers/Microsoft.Sql/instancePools/instancePool1"), - // LicenseType: to.Ptr(armsql.ManagedInstanceLicenseTypeLicenseIncluded), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_1"), - // MinimalTLSVersion: to.Ptr("1.2"), - // ProvisioningState: to.Ptr(armsql.ManagedInstancePropertiesProvisioningStateSucceeded), - // ProxyOverride: to.Ptr(armsql.ManagedInstanceProxyOverrideDefault), - // PublicDataEndpointEnabled: to.Ptr(false), - // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // State: to.Ptr("Ready"), - // StorageSizeInGB: to.Ptr[int32](1024), - // SubnetID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // VCores: to.Ptr[int32](8), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("GP_Gen4"), - // Capacity: to.Ptr[int32](8), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr("GeneralPurpose"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceCreateMax.json -func ExampleManagedInstancesClient_BeginCreateOrUpdate_createManagedInstanceWithAllProperties() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedInstancesClient().BeginCreateOrUpdate(ctx, "testrg", "testinstance", armsql.ManagedInstance{ - Location: to.Ptr("Japan East"), - Tags: map[string]*string{ - "tagKey1": to.Ptr("TagValue1"), - }, - Properties: &armsql.ManagedInstanceProperties{ - AdministratorLogin: to.Ptr("dummylogin"), - AdministratorLoginPassword: to.Ptr("PLACEHOLDER"), - Administrators: &armsql.ManagedInstanceExternalAdministrator{ - AzureADOnlyAuthentication: to.Ptr(true), - Login: to.Ptr("bob@contoso.com"), - PrincipalType: to.Ptr(armsql.PrincipalTypeUser), - Sid: to.Ptr("00000011-1111-2222-2222-123456789111"), - TenantID: to.Ptr("00000011-1111-2222-2222-123456789111"), - }, - Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - DNSZonePartner: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testinstance"), - InstancePoolID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Sql/instancePools/pool1"), - LicenseType: to.Ptr(armsql.ManagedInstanceLicenseTypeLicenseIncluded), - MaintenanceConfigurationID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_1"), - MinimalTLSVersion: to.Ptr("1.2"), - ProxyOverride: to.Ptr(armsql.ManagedInstanceProxyOverrideRedirect), - PublicDataEndpointEnabled: to.Ptr(false), - RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - ServicePrincipal: &armsql.ServicePrincipal{ - Type: to.Ptr(armsql.ServicePrincipalTypeSystemAssigned), - }, - StorageSizeInGB: to.Ptr[int32](1024), - SubnetID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - TimezoneID: to.Ptr("UTC"), - VCores: to.Ptr[int32](8), - }, - SKU: &armsql.SKU{ - Name: to.Ptr("GP_Gen5"), - Tier: to.Ptr("GeneralPurpose"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedInstance = armsql.ManagedInstance{ - // Name: to.Ptr("testinstance"), - // Type: to.Ptr("Microsoft.Sql/managedInstances"), - // ID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testinstance"), - // Location: to.Ptr("japaneast"), - // Tags: map[string]*string{ - // "tagKey1": to.Ptr("TagValue1"), - // }, - // Properties: &armsql.ManagedInstanceProperties{ - // AdministratorLogin: to.Ptr("dummylogin"), - // Administrators: &armsql.ManagedInstanceExternalAdministrator{ - // AzureADOnlyAuthentication: to.Ptr(true), - // Login: to.Ptr("bob@contoso.com"), - // PrincipalType: to.Ptr(armsql.PrincipalTypeUser), - // Sid: to.Ptr("00000011-1111-2222-2222-123456789111"), - // TenantID: to.Ptr("00000011-1111-2222-2222-123456789111"), - // }, - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // DNSZone: to.Ptr("1b4e2caff2530"), - // FullyQualifiedDomainName: to.Ptr("testinstance.1b4e2caff2530.database.windows.net"), - // InstancePoolID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/testrg/providers/Microsoft.Sql/instancePools/pool1"), - // LicenseType: to.Ptr(armsql.ManagedInstanceLicenseTypeLicenseIncluded), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_1"), - // MinimalTLSVersion: to.Ptr("1.2"), - // ProvisioningState: to.Ptr(armsql.ManagedInstancePropertiesProvisioningStateSucceeded), - // ProxyOverride: to.Ptr(armsql.ManagedInstanceProxyOverrideRedirect), - // PublicDataEndpointEnabled: to.Ptr(false), - // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // ServicePrincipal: &armsql.ServicePrincipal{ - // Type: to.Ptr(armsql.ServicePrincipalTypeSystemAssigned), - // ClientID: to.Ptr("00000011-1111-2222-2222-123456789111"), - // PrincipalID: to.Ptr("00000011-1111-2222-2222-123456789111"), - // TenantID: to.Ptr("00000011-1111-2222-2222-123456789111"), - // }, - // State: to.Ptr("Ready"), - // StorageSizeInGB: to.Ptr[int32](1024), - // SubnetID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // TimezoneID: to.Ptr("UTC"), - // VCores: to.Ptr[int32](8), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("GP_Gen5"), - // Capacity: to.Ptr[int32](8), - // Family: to.Ptr("Gen5"), - // Tier: to.Ptr("GeneralPurpose"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceCreateMin.json -func ExampleManagedInstancesClient_BeginCreateOrUpdate_createManagedInstanceWithMinimalProperties() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedInstancesClient().BeginCreateOrUpdate(ctx, "testrg", "testinstance", armsql.ManagedInstance{ - Location: to.Ptr("Japan East"), - Properties: &armsql.ManagedInstanceProperties{ - AdministratorLogin: to.Ptr("dummylogin"), - AdministratorLoginPassword: to.Ptr("PLACEHOLDER"), - LicenseType: to.Ptr(armsql.ManagedInstanceLicenseTypeLicenseIncluded), - StorageSizeInGB: to.Ptr[int32](1024), - SubnetID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - VCores: to.Ptr[int32](8), - }, - SKU: &armsql.SKU{ - Name: to.Ptr("GP_Gen4"), - Tier: to.Ptr("GeneralPurpose"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedInstance = armsql.ManagedInstance{ - // Name: to.Ptr("testinstance"), - // Type: to.Ptr("Microsoft.Sql/managedInstances"), - // ID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testinstance"), - // Location: to.Ptr("japaneast"), - // Tags: map[string]*string{ - // }, - // Properties: &armsql.ManagedInstanceProperties{ - // AdministratorLogin: to.Ptr("dummylogin"), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // DNSZone: to.Ptr("1b4e2caff2530"), - // FullyQualifiedDomainName: to.Ptr("testinstance.1b4e2caff2530.database.windows.net"), - // LicenseType: to.Ptr(armsql.ManagedInstanceLicenseTypeLicenseIncluded), - // ProvisioningState: to.Ptr(armsql.ManagedInstancePropertiesProvisioningStateSucceeded), - // ProxyOverride: to.Ptr(armsql.ManagedInstanceProxyOverrideRedirect), - // PublicDataEndpointEnabled: to.Ptr(false), - // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // State: to.Ptr("Ready"), - // StorageSizeInGB: to.Ptr[int32](1024), - // SubnetID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // VCores: to.Ptr[int32](8), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("GP_Gen4"), - // Capacity: to.Ptr[int32](8), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr("GeneralPurpose"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceDelete.json -func ExampleManagedInstancesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedInstancesClient().BeginDelete(ctx, "testrg", "testinstance", 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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceRemoveMaintenanceConfiguration.json -func ExampleManagedInstancesClient_BeginUpdate_removeMaintenancePolicyFromManagedInstanceSelectDefaultMaintenancePolicy() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedInstancesClient().BeginUpdate(ctx, "testrg", "testinstance", armsql.ManagedInstanceUpdate{ - Properties: &armsql.ManagedInstanceProperties{ - MaintenanceConfigurationID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_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.ManagedInstance = armsql.ManagedInstance{ - // Name: to.Ptr("testinstance"), - // Type: to.Ptr("Microsoft.Sql/managedInstances"), - // ID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testinstance"), - // Location: to.Ptr("japaneast"), - // Properties: &armsql.ManagedInstanceProperties{ - // AdministratorLogin: to.Ptr("dummylogin"), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // DNSZone: to.Ptr("1b4e2caff2530"), - // FullyQualifiedDomainName: to.Ptr("testinstance.1b4e2caff2530.database.windows.net"), - // InstancePoolID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/testrg/providers/Microsoft.Sql/instancePools/instancePool1"), - // LicenseType: to.Ptr(armsql.ManagedInstanceLicenseTypeLicenseIncluded), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default"), - // ProxyOverride: to.Ptr(armsql.ManagedInstanceProxyOverrideDefault), - // PublicDataEndpointEnabled: to.Ptr(false), - // State: to.Ptr("Ready"), - // StorageSizeInGB: to.Ptr[int32](1024), - // SubnetID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // VCores: to.Ptr[int32](8), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("GP_Gen4"), - // Capacity: to.Ptr[int32](8), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr("GeneralPurpose"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceUpdateMax.json -func ExampleManagedInstancesClient_BeginUpdate_updateManagedInstanceWithAllProperties() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedInstancesClient().BeginUpdate(ctx, "testrg", "testinstance", armsql.ManagedInstanceUpdate{ - Properties: &armsql.ManagedInstanceProperties{ - AdministratorLogin: to.Ptr("dummylogin"), - AdministratorLoginPassword: to.Ptr("PLACEHOLDER"), - Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - LicenseType: to.Ptr(armsql.ManagedInstanceLicenseTypeBasePrice), - MaintenanceConfigurationID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_1"), - MinimalTLSVersion: to.Ptr("1.2"), - ProxyOverride: to.Ptr(armsql.ManagedInstanceProxyOverrideRedirect), - PublicDataEndpointEnabled: to.Ptr(false), - RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - StorageSizeInGB: to.Ptr[int32](448), - VCores: to.Ptr[int32](8), - }, - SKU: &armsql.SKU{ - Name: to.Ptr("GP_Gen4"), - Capacity: to.Ptr[int32](8), - Tier: to.Ptr("GeneralPurpose"), - }, - Tags: map[string]*string{ - "tagKey1": to.Ptr("TagValue1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedInstance = armsql.ManagedInstance{ - // Name: to.Ptr("testinstance"), - // Type: to.Ptr("Microsoft.Sql/managedInstances"), - // ID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testinstance"), - // Location: to.Ptr("japaneast"), - // Tags: map[string]*string{ - // "tagKey1": to.Ptr("TagValue1"), - // }, - // Properties: &armsql.ManagedInstanceProperties{ - // AdministratorLogin: to.Ptr("dummylogin"), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // DNSZone: to.Ptr("1b4e2caff2530"), - // FullyQualifiedDomainName: to.Ptr("testinstance.1b4e2caff2530.database.windows.net"), - // InstancePoolID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/testrg/providers/Microsoft.Sql/instancePools/instancePool1"), - // LicenseType: to.Ptr(armsql.ManagedInstanceLicenseTypeBasePrice), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_1"), - // MinimalTLSVersion: to.Ptr("1.2"), - // ProxyOverride: to.Ptr(armsql.ManagedInstanceProxyOverrideRedirect), - // PublicDataEndpointEnabled: to.Ptr(false), - // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // State: to.Ptr("Ready"), - // StorageSizeInGB: to.Ptr[int32](448), - // SubnetID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // VCores: to.Ptr[int32](8), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("GP_Gen4"), - // Capacity: to.Ptr[int32](8), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr("GeneralPurpose"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceUpdateMin.json -func ExampleManagedInstancesClient_BeginUpdate_updateManagedInstanceWithMinimalProperties() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedInstancesClient().BeginUpdate(ctx, "testrg", "testinstance", armsql.ManagedInstanceUpdate{ - Tags: map[string]*string{ - "tagKey1": to.Ptr("TagValue1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedInstance = armsql.ManagedInstance{ - // Name: to.Ptr("testinstance"), - // Type: to.Ptr("Microsoft.Sql/managedInstances"), - // ID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testinstance"), - // Location: to.Ptr("japaneast"), - // Tags: map[string]*string{ - // "tagKey1": to.Ptr("TagValue1"), - // }, - // Properties: &armsql.ManagedInstanceProperties{ - // AdministratorLogin: to.Ptr("PLACEHOLDER"), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // DNSZone: to.Ptr("1b4e2caff2530"), - // FullyQualifiedDomainName: to.Ptr("testinstance.1b4e2caff2530.database.windows.net"), - // InstancePoolID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/testrg/providers/Microsoft.Sql/instancePools/instancePool1"), - // LicenseType: to.Ptr(armsql.ManagedInstanceLicenseTypeLicenseIncluded), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default"), - // ProxyOverride: to.Ptr(armsql.ManagedInstanceProxyOverrideDefault), - // PublicDataEndpointEnabled: to.Ptr(false), - // RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // State: to.Ptr("Ready"), - // StorageSizeInGB: to.Ptr[int32](1024), - // SubnetID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // VCores: to.Ptr[int32](8), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("GP_Gen4"), - // Capacity: to.Ptr[int32](8), - // Family: to.Ptr("Gen4"), - // Tier: to.Ptr("GeneralPurpose"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/FailoverManagedInstance.json -func ExampleManagedInstancesClient_BeginFailover() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedInstancesClient().BeginFailover(ctx, "group1", "instanceName", &armsql.ManagedInstancesClientBeginFailoverOptions{ReplicaType: to.Ptr(armsql.ReplicaTypePrimary)}) - 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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ListOutboundNetworkDependenciesByManagedInstance.json -func ExampleManagedInstancesClient_NewListOutboundNetworkDependenciesByManagedInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagedInstancesClient().NewListOutboundNetworkDependenciesByManagedInstancePager("sqlcrudtest-7398", "testinstance", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OutboundEnvironmentEndpointCollection = armsql.OutboundEnvironmentEndpointCollection{ - // Value: []*armsql.OutboundEnvironmentEndpoint{ - // { - // Category: to.Ptr("Azure SQL Database"), - // Endpoints: []*armsql.EndpointDependency{ - // { - // DomainName: to.Ptr("control.database.windows.net"), - // EndpointDetails: []*armsql.EndpointDetail{ - // { - // Port: to.Ptr[int32](443), - // }}, - // }, - // { - // DomainName: to.Ptr("worker.database.windows.net"), - // EndpointDetails: []*armsql.EndpointDetail{ - // { - // Port: to.Ptr[int32](443), - // }}, - // }}, - // }, - // { - // Category: to.Ptr("Azure Storage"), - // Endpoints: []*armsql.EndpointDependency{ - // { - // DomainName: to.Ptr("blob.core.windows.net"), - // EndpointDetails: []*armsql.EndpointDetail{ - // { - // Port: to.Ptr[int32](443), - // }}, - // }, - // { - // DomainName: to.Ptr("table.core.windows.net"), - // EndpointDetails: []*armsql.EndpointDetail{ - // { - // Port: to.Ptr[int32](443), - // }}, - // }}, - // }, - // { - // Category: to.Ptr("Service Bus"), - // Endpoints: []*armsql.EndpointDependency{ - // { - // DomainName: to.Ptr("servicebus.windows.net"), - // EndpointDetails: []*armsql.EndpointDetail{ - // { - // Port: to.Ptr[int32](443), - // }}, - // }}, - // }, - // { - // Category: to.Ptr("Certificate Verification"), - // Endpoints: []*armsql.EndpointDependency{ - // { - // DomainName: to.Ptr("dsms.core.windows.net"), - // EndpointDetails: []*armsql.EndpointDetail{ - // { - // Port: to.Ptr[int32](443), - // }}, - // }, - // { - // DomainName: to.Ptr("dsts.core.windows.net"), - // EndpointDetails: []*armsql.EndpointDetail{ - // { - // Port: to.Ptr[int32](443), - // }}, - // }, - // { - // DomainName: to.Ptr("login.windows.net"), - // EndpointDetails: []*armsql.EndpointDetail{ - // { - // Port: to.Ptr[int32](443), - // }}, - // }}, - // }, - // { - // Category: to.Ptr("Telemetry"), - // Endpoints: []*armsql.EndpointDependency{ - // { - // DomainName: to.Ptr("azurewatsonanalysis-prod.core.windows.net"), - // EndpointDetails: []*armsql.EndpointDetail{ - // { - // Port: to.Ptr[int32](443), - // }}, - // }, - // { - // DomainName: to.Ptr("global.metrics.nsatc.net"), - // EndpointDetails: []*armsql.EndpointDetail{ - // { - // Port: to.Ptr[int32](443), - // }}, - // }, - // { - // DomainName: to.Ptr("production.diagnostics.monitoring.core.windows.net"), - // EndpointDetails: []*armsql.EndpointDetail{ - // { - // Port: to.Ptr[int32](443), - // }}, - // }}, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/StartManagedInstance.json -func ExampleManagedInstancesClient_BeginStart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedInstancesClient().BeginStart(ctx, "startrg", "mitostart", 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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/StopManagedInstance.json -func ExampleManagedInstancesClient_BeginStop() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedInstancesClient().BeginStop(ctx, "stoprg", "mitostop", 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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceTopQueriesList.json -func ExampleManagedInstancesClient_NewListByManagedInstancePager_obtainListOfInstancesTopResourceConsumingQueries() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagedInstancesClient().NewListByManagedInstancePager("sqlcrudtest-7398", "sqlcrudtest-4645", &armsql.ManagedInstancesClientListByManagedInstanceOptions{NumberOfQueries: nil, - Databases: nil, - StartTime: nil, - EndTime: nil, - Interval: to.Ptr(armsql.QueryTimeGrainTypePT1H), - AggregationFunction: nil, - ObservationMetric: to.Ptr(armsql.MetricTypeDuration), - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.TopQueriesListResult = armsql.TopQueriesListResult{ - // Value: []*armsql.TopQueries{ - // { - // AggregationFunction: to.Ptr("sum"), - // EndTime: to.Ptr("03/05/2020 13:00:00"), - // IntervalType: to.Ptr(armsql.QueryTimeGrainTypeP1D), - // NumberOfQueries: to.Ptr[int32](5), - // ObservationMetric: to.Ptr("cpu"), - // Queries: []*armsql.QueryStatisticsProperties{ - // { - // DatabaseName: to.Ptr("db1"), - // Intervals: []*armsql.QueryMetricInterval{ - // { - // ExecutionCount: to.Ptr[int64](1), - // IntervalStartTime: to.Ptr("03/03/2020 00:00:00"), - // Metrics: []*armsql.QueryMetricProperties{ - // { - // Name: to.Ptr("cpu"), - // DisplayName: to.Ptr("Cpu"), - // Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage), - // Value: to.Ptr[float64](0.0015841714409722222), - // }, - // { - // Name: to.Ptr("io"), - // DisplayName: to.Ptr("Physical Io Reads"), - // Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage), - // Value: to.Ptr[float64](0.000004340277777777778), - // }, - // { - // Name: to.Ptr("logIo"), - // DisplayName: to.Ptr("Log Writes"), - // Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage), - // Value: to.Ptr[float64](0), - // }, - // { - // Name: to.Ptr("memory"), - // DisplayName: to.Ptr("Memory consumption"), - // Unit: to.Ptr(armsql.QueryMetricUnitTypeKB), - // Value: to.Ptr[float64](8336), - // }, - // { - // Name: to.Ptr("duration"), - // DisplayName: to.Ptr("Query duration"), - // Unit: to.Ptr(armsql.QueryMetricUnitTypeMicroseconds), - // Value: to.Ptr[float64](11306905), - // }}, - // }}, - // QueryID: to.Ptr("25"), - // }, - // { - // DatabaseName: to.Ptr("db1"), - // Intervals: []*armsql.QueryMetricInterval{ - // { - // ExecutionCount: to.Ptr[int64](1), - // IntervalStartTime: to.Ptr("03/03/2020 00:00:00"), - // Metrics: []*armsql.QueryMetricProperties{ - // { - // Name: to.Ptr("cpu"), - // DisplayName: to.Ptr("Cpu"), - // Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage), - // Value: to.Ptr[float64](0.0009521432291666667), - // }, - // { - // Name: to.Ptr("io"), - // DisplayName: to.Ptr("Physical Io Reads"), - // Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage), - // Value: to.Ptr[float64](2.3148148148148148e-7), - // }, - // { - // Name: to.Ptr("logIo"), - // DisplayName: to.Ptr("Log Writes"), - // Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage), - // Value: to.Ptr[float64](0), - // }, - // { - // Name: to.Ptr("memory"), - // DisplayName: to.Ptr("Memory consumption"), - // Unit: to.Ptr(armsql.QueryMetricUnitTypeKB), - // Value: to.Ptr[float64](1024), - // }, - // { - // Name: to.Ptr("duration"), - // DisplayName: to.Ptr("Query duration"), - // Unit: to.Ptr(armsql.QueryMetricUnitTypeMicroseconds), - // Value: to.Ptr[float64](6620020), - // }}, - // }}, - // QueryID: to.Ptr("21"), - // }, - // { - // DatabaseName: to.Ptr("db3"), - // Intervals: []*armsql.QueryMetricInterval{ - // { - // ExecutionCount: to.Ptr[int64](104), - // IntervalStartTime: to.Ptr("03/04/2020 00:00:00"), - // Metrics: []*armsql.QueryMetricProperties{ - // { - // Name: to.Ptr("cpu"), - // DisplayName: to.Ptr("Cpu"), - // Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage), - // Value: to.Ptr[float64](0.0008006611689814815), - // }, - // { - // Name: to.Ptr("io"), - // DisplayName: to.Ptr("Physical Io Reads"), - // Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage), - // Value: to.Ptr[float64](0), - // }, - // { - // Name: to.Ptr("logIo"), - // DisplayName: to.Ptr("Log Writes"), - // Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage), - // Value: to.Ptr[float64](0), - // }, - // { - // Name: to.Ptr("memory"), - // DisplayName: to.Ptr("Memory consumption"), - // Unit: to.Ptr(armsql.QueryMetricUnitTypeKB), - // Value: to.Ptr[float64](0), - // }, - // { - // Name: to.Ptr("duration"), - // DisplayName: to.Ptr("Query duration"), - // Unit: to.Ptr(armsql.QueryMetricUnitTypeMicroseconds), - // Value: to.Ptr[float64](5543088), - // }}, - // }}, - // QueryID: to.Ptr("3"), - // }, - // { - // DatabaseName: to.Ptr("db2"), - // Intervals: []*armsql.QueryMetricInterval{ - // { - // ExecutionCount: to.Ptr[int64](89), - // IntervalStartTime: to.Ptr("03/03/2020 00:00:00"), - // Metrics: []*armsql.QueryMetricProperties{ - // { - // Name: to.Ptr("cpu"), - // DisplayName: to.Ptr("Cpu"), - // Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage), - // Value: to.Ptr[float64](0.0006882543402777778), - // }, - // { - // Name: to.Ptr("io"), - // DisplayName: to.Ptr("Physical Io Reads"), - // Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage), - // Value: to.Ptr[float64](0), - // }, - // { - // Name: to.Ptr("logIo"), - // DisplayName: to.Ptr("Log Writes"), - // Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage), - // Value: to.Ptr[float64](0), - // }, - // { - // Name: to.Ptr("memory"), - // DisplayName: to.Ptr("Memory consumption"), - // Unit: to.Ptr(armsql.QueryMetricUnitTypeKB), - // Value: to.Ptr[float64](0), - // }, - // { - // Name: to.Ptr("duration"), - // DisplayName: to.Ptr("Query duration"), - // Unit: to.Ptr(armsql.QueryMetricUnitTypeMicroseconds), - // Value: to.Ptr[float64](4761877), - // }}, - // }}, - // QueryID: to.Ptr("3"), - // }, - // { - // DatabaseName: to.Ptr("db3"), - // Intervals: []*armsql.QueryMetricInterval{ - // { - // ExecutionCount: to.Ptr[int64](1), - // IntervalStartTime: to.Ptr("03/04/2020 00:00:00"), - // Metrics: []*armsql.QueryMetricProperties{ - // { - // Name: to.Ptr("cpu"), - // DisplayName: to.Ptr("Cpu"), - // Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage), - // Value: to.Ptr[float64](0.0006220661168981482), - // }, - // { - // Name: to.Ptr("io"), - // DisplayName: to.Ptr("Physical Io Reads"), - // Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage), - // Value: to.Ptr[float64](0), - // }, - // { - // Name: to.Ptr("logIo"), - // DisplayName: to.Ptr("Log Writes"), - // Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage), - // Value: to.Ptr[float64](0), - // }, - // { - // Name: to.Ptr("memory"), - // DisplayName: to.Ptr("Memory consumption"), - // Unit: to.Ptr(armsql.QueryMetricUnitTypeKB), - // Value: to.Ptr[float64](1024), - // }, - // { - // Name: to.Ptr("duration"), - // DisplayName: to.Ptr("Query duration"), - // Unit: to.Ptr(armsql.QueryMetricUnitTypeMicroseconds), - // Value: to.Ptr[float64](4454161), - // }}, - // }}, - // QueryID: to.Ptr("22"), - // }}, - // StartTime: to.Ptr("03/01/2020 00:00:00"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceTopQueriesListMax.json -func ExampleManagedInstancesClient_NewListByManagedInstancePager_obtainListOfInstancesTopResourceConsumingQueriesFullBlownRequestAndResponse() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagedInstancesClient().NewListByManagedInstancePager("sqlcrudtest-7398", "sqlcrudtest-4645", &armsql.ManagedInstancesClientListByManagedInstanceOptions{NumberOfQueries: nil, - Databases: to.Ptr("db1,db2"), - StartTime: to.Ptr("2020-03-10T12:00:00Z"), - EndTime: to.Ptr("2020-03-12T12:00:00Z"), - Interval: to.Ptr(armsql.QueryTimeGrainTypeP1D), - AggregationFunction: nil, - ObservationMetric: to.Ptr(armsql.MetricTypeCPU), - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.TopQueriesListResult = armsql.TopQueriesListResult{ - // Value: []*armsql.TopQueries{ - // { - // AggregationFunction: to.Ptr("sum"), - // EndTime: to.Ptr("03/12/2020 13:00:00"), - // IntervalType: to.Ptr(armsql.QueryTimeGrainTypeP1D), - // NumberOfQueries: to.Ptr[int32](5), - // ObservationMetric: to.Ptr("cpu"), - // Queries: []*armsql.QueryStatisticsProperties{ - // { - // DatabaseName: to.Ptr("db1"), - // Intervals: []*armsql.QueryMetricInterval{ - // { - // ExecutionCount: to.Ptr[int64](1), - // IntervalStartTime: to.Ptr("03/11/2020 00:00:00"), - // Metrics: []*armsql.QueryMetricProperties{ - // { - // Name: to.Ptr("cpu"), - // DisplayName: to.Ptr("Cpu"), - // Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage), - // Value: to.Ptr[float64](0.0015934667245370371), - // }, - // { - // Name: to.Ptr("io"), - // DisplayName: to.Ptr("Physical Io Reads"), - // Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage), - // Value: to.Ptr[float64](0.000004224537037037037), - // }, - // { - // Name: to.Ptr("logIo"), - // DisplayName: to.Ptr("Log Writes"), - // Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage), - // Value: to.Ptr[float64](0), - // }, - // { - // Name: to.Ptr("memory"), - // DisplayName: to.Ptr("Memory consumption"), - // Unit: to.Ptr(armsql.QueryMetricUnitTypeKB), - // Value: to.Ptr[float64](8336), - // }, - // { - // Name: to.Ptr("duration"), - // DisplayName: to.Ptr("Query duration"), - // Unit: to.Ptr(armsql.QueryMetricUnitTypeMicroseconds), - // Value: to.Ptr[float64](11091296), - // }}, - // }}, - // QueryID: to.Ptr("28"), - // }, - // { - // DatabaseName: to.Ptr("db1"), - // Intervals: []*armsql.QueryMetricInterval{ - // { - // ExecutionCount: to.Ptr[int64](1), - // IntervalStartTime: to.Ptr("03/11/2020 00:00:00"), - // Metrics: []*armsql.QueryMetricProperties{ - // { - // Name: to.Ptr("cpu"), - // DisplayName: to.Ptr("Cpu"), - // Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage), - // Value: to.Ptr[float64](0.0009522783564814815), - // }, - // { - // Name: to.Ptr("io"), - // DisplayName: to.Ptr("Physical Io Reads"), - // Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage), - // Value: to.Ptr[float64](1.7361111111111112e-7), - // }, - // { - // Name: to.Ptr("logIo"), - // DisplayName: to.Ptr("Log Writes"), - // Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage), - // Value: to.Ptr[float64](0), - // }, - // { - // Name: to.Ptr("memory"), - // DisplayName: to.Ptr("Memory consumption"), - // Unit: to.Ptr(armsql.QueryMetricUnitTypeKB), - // Value: to.Ptr[float64](1024), - // }, - // { - // Name: to.Ptr("duration"), - // DisplayName: to.Ptr("Query duration"), - // Unit: to.Ptr(armsql.QueryMetricUnitTypeMicroseconds), - // Value: to.Ptr[float64](6625562), - // }}, - // }}, - // QueryID: to.Ptr("24"), - // }, - // { - // DatabaseName: to.Ptr("db1"), - // Intervals: []*armsql.QueryMetricInterval{ - // { - // ExecutionCount: to.Ptr[int64](82), - // IntervalStartTime: to.Ptr("03/11/2020 00:00:00"), - // Metrics: []*armsql.QueryMetricProperties{ - // { - // Name: to.Ptr("cpu"), - // DisplayName: to.Ptr("Cpu"), - // Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage), - // Value: to.Ptr[float64](0.0007183139467592593), - // }, - // { - // Name: to.Ptr("io"), - // DisplayName: to.Ptr("Physical Io Reads"), - // Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage), - // Value: to.Ptr[float64](0), - // }, - // { - // Name: to.Ptr("logIo"), - // DisplayName: to.Ptr("Log Writes"), - // Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage), - // Value: to.Ptr[float64](0), - // }, - // { - // Name: to.Ptr("memory"), - // DisplayName: to.Ptr("Memory consumption"), - // Unit: to.Ptr(armsql.QueryMetricUnitTypeKB), - // Value: to.Ptr[float64](0), - // }, - // { - // Name: to.Ptr("duration"), - // DisplayName: to.Ptr("Query duration"), - // Unit: to.Ptr(armsql.QueryMetricUnitTypeMicroseconds), - // Value: to.Ptr[float64](4970199), - // }}, - // }}, - // QueryID: to.Ptr("3"), - // }, - // { - // DatabaseName: to.Ptr("db1"), - // Intervals: []*armsql.QueryMetricInterval{ - // { - // ExecutionCount: to.Ptr[int64](1), - // IntervalStartTime: to.Ptr("03/11/2020 00:00:00"), - // Metrics: []*armsql.QueryMetricProperties{ - // { - // Name: to.Ptr("cpu"), - // DisplayName: to.Ptr("Cpu"), - // Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage), - // Value: to.Ptr[float64](0.0006494454571759259), - // }, - // { - // Name: to.Ptr("io"), - // DisplayName: to.Ptr("Physical Io Reads"), - // Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage), - // Value: to.Ptr[float64](0.000005034722222222222), - // }, - // { - // Name: to.Ptr("logIo"), - // DisplayName: to.Ptr("Log Writes"), - // Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage), - // Value: to.Ptr[float64](0), - // }, - // { - // Name: to.Ptr("memory"), - // DisplayName: to.Ptr("Memory consumption"), - // Unit: to.Ptr(armsql.QueryMetricUnitTypeKB), - // Value: to.Ptr[float64](1024), - // }, - // { - // Name: to.Ptr("duration"), - // DisplayName: to.Ptr("Query duration"), - // Unit: to.Ptr(armsql.QueryMetricUnitTypeMicroseconds), - // Value: to.Ptr[float64](4530668), - // }}, - // }}, - // QueryID: to.Ptr("29"), - // }, - // { - // DatabaseName: to.Ptr("db2"), - // Intervals: []*armsql.QueryMetricInterval{ - // { - // ExecutionCount: to.Ptr[int64](1), - // IntervalStartTime: to.Ptr("03/11/2020 00:00:00"), - // Metrics: []*armsql.QueryMetricProperties{ - // { - // Name: to.Ptr("cpu"), - // DisplayName: to.Ptr("Cpu"), - // Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage), - // Value: to.Ptr[float64](0.0006275368923611112), - // }, - // { - // Name: to.Ptr("io"), - // DisplayName: to.Ptr("Physical Io Reads"), - // Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage), - // Value: to.Ptr[float64](0), - // }, - // { - // Name: to.Ptr("logIo"), - // DisplayName: to.Ptr("Log Writes"), - // Unit: to.Ptr(armsql.QueryMetricUnitTypePercentage), - // Value: to.Ptr[float64](0), - // }, - // { - // Name: to.Ptr("memory"), - // DisplayName: to.Ptr("Memory consumption"), - // Unit: to.Ptr(armsql.QueryMetricUnitTypeKB), - // Value: to.Ptr[float64](1024), - // }, - // { - // Name: to.Ptr("duration"), - // DisplayName: to.Ptr("Query duration"), - // Unit: to.Ptr(armsql.QueryMetricUnitTypeMicroseconds), - // Value: to.Ptr[float64](4349943), - // }}, - // }}, - // QueryID: to.Ptr("25"), - // }}, - // StartTime: to.Ptr("03/10/2020 00:00:00"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceTopQueriesListMin.json -func ExampleManagedInstancesClient_NewListByManagedInstancePager_obtainListOfInstancesTopResourceConsumingQueriesMinimalRequestAndResponse() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagedInstancesClient().NewListByManagedInstancePager("sqlcrudtest-7398", "sqlcrudtest-4645", &armsql.ManagedInstancesClientListByManagedInstanceOptions{NumberOfQueries: nil, - Databases: nil, - StartTime: nil, - EndTime: nil, - Interval: nil, - AggregationFunction: nil, - ObservationMetric: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.TopQueriesListResult = armsql.TopQueriesListResult{ - // Value: []*armsql.TopQueries{ - // { - // AggregationFunction: to.Ptr("sum"), - // EndTime: to.Ptr("03/11/2020 12:24:07"), - // IntervalType: to.Ptr(armsql.QueryTimeGrainTypePT1H), - // NumberOfQueries: to.Ptr[int32](5), - // ObservationMetric: to.Ptr("cpu"), - // Queries: []*armsql.QueryStatisticsProperties{ - // }, - // StartTime: to.Ptr("03/10/2020 12:00:00"), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/sql/armsql/managedinstancetdecertificates_client.go b/sdk/resourcemanager/sql/armsql/managedinstancetdecertificates_client.go index 2c532c17fda5..22a1913b19be 100644 --- a/sdk/resourcemanager/sql/armsql/managedinstancetdecertificates_client.go +++ b/sdk/resourcemanager/sql/armsql/managedinstancetdecertificates_client.go @@ -46,7 +46,7 @@ func NewManagedInstanceTdeCertificatesClient(subscriptionID string, credential a // BeginCreate - Creates a TDE certificate for a given server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -69,7 +69,7 @@ func (client *ManagedInstanceTdeCertificatesClient) BeginCreate(ctx context.Cont // Create - Creates a TDE certificate for a given server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview func (client *ManagedInstanceTdeCertificatesClient) create(ctx context.Context, resourceGroupName string, managedInstanceName string, parameters TdeCertificate, options *ManagedInstanceTdeCertificatesClientBeginCreateOptions) (*http.Response, error) { var err error req, err := client.createCreateRequest(ctx, resourceGroupName, managedInstanceName, parameters, options) @@ -107,7 +107,7 @@ func (client *ManagedInstanceTdeCertificatesClient) createCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err diff --git a/sdk/resourcemanager/sql/armsql/managedinstancetdecertificates_client_example_test.go b/sdk/resourcemanager/sql/armsql/managedinstancetdecertificates_client_example_test.go deleted file mode 100644 index 0046337acc72..000000000000 --- a/sdk/resourcemanager/sql/armsql/managedinstancetdecertificates_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 armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceTdeCertificate.json -func ExampleManagedInstanceTdeCertificatesClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedInstanceTdeCertificatesClient().BeginCreate(ctx, "testtdecert", "testtdecert", armsql.TdeCertificate{ - Properties: &armsql.TdeCertificateProperties{ - PrivateBlob: to.Ptr("MIIXXXXXXXX"), - }, - }, 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/sql/armsql/managedinstancevulnerabilityassessments_client.go b/sdk/resourcemanager/sql/armsql/managedinstancevulnerabilityassessments_client.go index 779b973ab7fa..a0b316936da4 100644 --- a/sdk/resourcemanager/sql/armsql/managedinstancevulnerabilityassessments_client.go +++ b/sdk/resourcemanager/sql/armsql/managedinstancevulnerabilityassessments_client.go @@ -48,7 +48,7 @@ func NewManagedInstanceVulnerabilityAssessmentsClient(subscriptionID string, cre // https://docs.microsoft.com/azure/azure-sql/database/sql-database-vulnerability-assessment-storage // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance for which the vulnerability assessment is defined. @@ -98,7 +98,7 @@ func (client *ManagedInstanceVulnerabilityAssessmentsClient) createOrUpdateCreat return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -119,7 +119,7 @@ func (client *ManagedInstanceVulnerabilityAssessmentsClient) createOrUpdateHandl // Delete - Removes the managed instance's vulnerability assessment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance for which the vulnerability assessment is defined. @@ -167,7 +167,7 @@ func (client *ManagedInstanceVulnerabilityAssessmentsClient) deleteCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -175,7 +175,7 @@ func (client *ManagedInstanceVulnerabilityAssessmentsClient) deleteCreateRequest // Get - Gets the managed instance's vulnerability assessment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance for which the vulnerability assessment is defined. @@ -224,7 +224,7 @@ func (client *ManagedInstanceVulnerabilityAssessmentsClient) getCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -241,7 +241,7 @@ func (client *ManagedInstanceVulnerabilityAssessmentsClient) getHandleResponse(r // NewListByInstancePager - Gets the managed instance's vulnerability assessment policies. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance for which the vulnerability assessments is defined. @@ -295,7 +295,7 @@ func (client *ManagedInstanceVulnerabilityAssessmentsClient) listByInstanceCreat return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/managedinstancevulnerabilityassessments_client_example_test.go b/sdk/resourcemanager/sql/armsql/managedinstancevulnerabilityassessments_client_example_test.go deleted file mode 100644 index 297f80bf44fd..000000000000 --- a/sdk/resourcemanager/sql/armsql/managedinstancevulnerabilityassessments_client_example_test.go +++ /dev/null @@ -1,235 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceVulnerabilityAssessmentGet.json -func ExampleManagedInstanceVulnerabilityAssessmentsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedInstanceVulnerabilityAssessmentsClient().Get(ctx, "vulnerabilityaseessmenttest-4799", "vulnerabilityaseessmenttest-6440", armsql.VulnerabilityAssessmentNameDefault, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedInstanceVulnerabilityAssessment = armsql.ManagedInstanceVulnerabilityAssessment{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/vulnerabilityAssessments"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/managedInstances/vulnerabilityaseessmenttest-6440/vulnerabilityAssessments/default"), - // Properties: &armsql.ManagedInstanceVulnerabilityAssessmentProperties{ - // RecurringScans: &armsql.VulnerabilityAssessmentRecurringScansProperties{ - // EmailSubscriptionAdmins: to.Ptr(true), - // Emails: []*string{ - // to.Ptr("email1@mail.com"), - // to.Ptr("email2@mail.com")}, - // IsEnabled: to.Ptr(true), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceVulnerabilityAssessmentCreateMax.json -func ExampleManagedInstanceVulnerabilityAssessmentsClient_CreateOrUpdate_createAManagedInstancesVulnerabilityAssessmentWithAllParameters() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedInstanceVulnerabilityAssessmentsClient().CreateOrUpdate(ctx, "vulnerabilityaseessmenttest-4799", "vulnerabilityaseessmenttest-6440", armsql.VulnerabilityAssessmentNameDefault, armsql.ManagedInstanceVulnerabilityAssessment{ - Properties: &armsql.ManagedInstanceVulnerabilityAssessmentProperties{ - RecurringScans: &armsql.VulnerabilityAssessmentRecurringScansProperties{ - EmailSubscriptionAdmins: to.Ptr(true), - Emails: []*string{ - to.Ptr("email1@mail.com"), - to.Ptr("email2@mail.com")}, - IsEnabled: to.Ptr(true), - }, - StorageAccountAccessKey: to.Ptr("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"), - StorageContainerPath: to.Ptr("https://myStorage.blob.core.windows.net/vulnerability-assessment/"), - StorageContainerSasKey: to.Ptr("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedInstanceVulnerabilityAssessment = armsql.ManagedInstanceVulnerabilityAssessment{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/vulnerabilityAssessments"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/managedInstances/vulnerabilityaseessmenttest-6440/vulnerabilityAssessments/default"), - // Properties: &armsql.ManagedInstanceVulnerabilityAssessmentProperties{ - // RecurringScans: &armsql.VulnerabilityAssessmentRecurringScansProperties{ - // EmailSubscriptionAdmins: to.Ptr(true), - // Emails: []*string{ - // to.Ptr("email1@mail.com"), - // to.Ptr("email2@mail.com")}, - // IsEnabled: to.Ptr(true), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceVulnerabilityAssessmentCreateStorageAccessKeyMin.json -func ExampleManagedInstanceVulnerabilityAssessmentsClient_CreateOrUpdate_createAManagedInstancesVulnerabilityAssessmentWithMinimalParametersWhenStorageAccountAccessKeyIsSpecified() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedInstanceVulnerabilityAssessmentsClient().CreateOrUpdate(ctx, "vulnerabilityaseessmenttest-4799", "vulnerabilityaseessmenttest-6440", armsql.VulnerabilityAssessmentNameDefault, armsql.ManagedInstanceVulnerabilityAssessment{ - Properties: &armsql.ManagedInstanceVulnerabilityAssessmentProperties{ - StorageAccountAccessKey: to.Ptr("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"), - StorageContainerPath: to.Ptr("https://myStorage.blob.core.windows.net/vulnerability-assessment/"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedInstanceVulnerabilityAssessment = armsql.ManagedInstanceVulnerabilityAssessment{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/vulnerabilityAssessments"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/managedInstances/vulnerabilityaseessmenttest-6440/vulnerabilityAssessments/default"), - // Properties: &armsql.ManagedInstanceVulnerabilityAssessmentProperties{ - // RecurringScans: &armsql.VulnerabilityAssessmentRecurringScansProperties{ - // EmailSubscriptionAdmins: to.Ptr(false), - // Emails: []*string{ - // }, - // IsEnabled: to.Ptr(true), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceVulnerabilityAssessmentCreateContainerSasKeyMin.json -func ExampleManagedInstanceVulnerabilityAssessmentsClient_CreateOrUpdate_createAManagedInstancesVulnerabilityAssessmentWithMinimalParametersWhenStorageContainerSasKeyIsSpecified() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedInstanceVulnerabilityAssessmentsClient().CreateOrUpdate(ctx, "vulnerabilityaseessmenttest-4799", "vulnerabilityaseessmenttest-6440", armsql.VulnerabilityAssessmentNameDefault, armsql.ManagedInstanceVulnerabilityAssessment{ - Properties: &armsql.ManagedInstanceVulnerabilityAssessmentProperties{ - StorageContainerPath: to.Ptr("https://myStorage.blob.core.windows.net/vulnerability-assessment/"), - StorageContainerSasKey: to.Ptr("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedInstanceVulnerabilityAssessment = armsql.ManagedInstanceVulnerabilityAssessment{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/vulnerabilityAssessments"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/managedInstances/vulnerabilityaseessmenttest-6440/vulnerabilityAssessments/default"), - // Properties: &armsql.ManagedInstanceVulnerabilityAssessmentProperties{ - // RecurringScans: &armsql.VulnerabilityAssessmentRecurringScansProperties{ - // EmailSubscriptionAdmins: to.Ptr(false), - // Emails: []*string{ - // }, - // IsEnabled: to.Ptr(true), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceVulnerabilityAssessmentDelete.json -func ExampleManagedInstanceVulnerabilityAssessmentsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewManagedInstanceVulnerabilityAssessmentsClient().Delete(ctx, "vulnerabilityaseessmenttest-4799", "vulnerabilityaseessmenttest-6440", armsql.VulnerabilityAssessmentNameDefault, 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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceVulnerabilityAssessmentListByInstance.json -func ExampleManagedInstanceVulnerabilityAssessmentsClient_NewListByInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagedInstanceVulnerabilityAssessmentsClient().NewListByInstancePager("vulnerabilityaseessmenttest-4799", "vulnerabilityaseessmenttest-6440", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ManagedInstanceVulnerabilityAssessmentListResult = armsql.ManagedInstanceVulnerabilityAssessmentListResult{ - // Value: []*armsql.ManagedInstanceVulnerabilityAssessment{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/vulnerabilityAssessments"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/managedInstances/vulnerabilityaseessmenttest-6440/vulnerabilityAssessments/default"), - // Properties: &armsql.ManagedInstanceVulnerabilityAssessmentProperties{ - // RecurringScans: &armsql.VulnerabilityAssessmentRecurringScansProperties{ - // EmailSubscriptionAdmins: to.Ptr(true), - // Emails: []*string{ - // to.Ptr("email1@mail.com"), - // to.Ptr("email2@mail.com")}, - // IsEnabled: to.Ptr(true), - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/sql/armsql/managedledgerdigestuploads_client.go b/sdk/resourcemanager/sql/armsql/managedledgerdigestuploads_client.go index 2cdd28889db8..493778c9867c 100644 --- a/sdk/resourcemanager/sql/armsql/managedledgerdigestuploads_client.go +++ b/sdk/resourcemanager/sql/armsql/managedledgerdigestuploads_client.go @@ -46,7 +46,7 @@ func NewManagedLedgerDigestUploadsClient(subscriptionID string, credential azcor // BeginCreateOrUpdate - Enables upload ledger digests to an Azure Storage account or an Azure Confidential Ledger instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -71,7 +71,7 @@ func (client *ManagedLedgerDigestUploadsClient) BeginCreateOrUpdate(ctx context. // CreateOrUpdate - Enables upload ledger digests to an Azure Storage account or an Azure Confidential Ledger instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview func (client *ManagedLedgerDigestUploadsClient) createOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, ledgerDigestUploads ManagedLedgerDigestUploadsName, parameters ManagedLedgerDigestUploads, options *ManagedLedgerDigestUploadsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, ledgerDigestUploads, parameters, options) @@ -117,7 +117,7 @@ func (client *ManagedLedgerDigestUploadsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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 *ManagedLedgerDigestUploadsClient) createOrUpdateCreateRequest(ctx // BeginDisable - Disables uploading ledger digests to an Azure Storage account or an Azure Confidential Ledger instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -152,7 +152,7 @@ func (client *ManagedLedgerDigestUploadsClient) BeginDisable(ctx context.Context // Disable - Disables uploading ledger digests to an Azure Storage account or an Azure Confidential Ledger instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview func (client *ManagedLedgerDigestUploadsClient) disable(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, ledgerDigestUploads ManagedLedgerDigestUploadsName, options *ManagedLedgerDigestUploadsClientBeginDisableOptions) (*http.Response, error) { var err error req, err := client.disableCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, ledgerDigestUploads, options) @@ -198,7 +198,7 @@ func (client *ManagedLedgerDigestUploadsClient) disableCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -207,7 +207,7 @@ func (client *ManagedLedgerDigestUploadsClient) disableCreateRequest(ctx context // Get - Gets the current ledger digest upload configuration for a database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -260,7 +260,7 @@ func (client *ManagedLedgerDigestUploadsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -277,7 +277,7 @@ func (client *ManagedLedgerDigestUploadsClient) getHandleResponse(resp *http.Res // NewListByDatabasePager - Gets all ledger digest upload settings on a database. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -336,7 +336,7 @@ func (client *ManagedLedgerDigestUploadsClient) listByDatabaseCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/managedledgerdigestuploads_client_example_test.go b/sdk/resourcemanager/sql/armsql/managedledgerdigestuploads_client_example_test.go deleted file mode 100644 index feefa95e1bf3..000000000000 --- a/sdk/resourcemanager/sql/armsql/managedledgerdigestuploads_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 armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedLedgerDigestUploadsList.json -func ExampleManagedLedgerDigestUploadsClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagedLedgerDigestUploadsClient().NewListByDatabasePager("ledgertestrg", "ledgertestserver", "testdb", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ManagedLedgerDigestUploadsListResult = armsql.ManagedLedgerDigestUploadsListResult{ - // Value: []*armsql.ManagedLedgerDigestUploads{ - // { - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/databases/ledgerDigestUploads"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/ledgertestrg/providers/Microsoft.Sql/managedInstances/ledgertestserver/databases/testdb/current"), - // Properties: &armsql.ManagedLedgerDigestUploadsProperties{ - // DigestStorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - // State: to.Ptr(armsql.ManagedLedgerDigestUploadsStateEnabled), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedLedgerDigestUploadsGet.json -func ExampleManagedLedgerDigestUploadsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedLedgerDigestUploadsClient().Get(ctx, "ledgertestrg", "ledgertestserver", "testdb", armsql.ManagedLedgerDigestUploadsNameCurrent, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedLedgerDigestUploads = armsql.ManagedLedgerDigestUploads{ - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/databases/ledgerDigestUploads"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/ledgertestrg/providers/Microsoft.Sql/managedInstances/ledgertestserver/databases/testdb/current"), - // Properties: &armsql.ManagedLedgerDigestUploadsProperties{ - // DigestStorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - // State: to.Ptr(armsql.ManagedLedgerDigestUploadsStateEnabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedLedgerDigestUploadsEnable.json -func ExampleManagedLedgerDigestUploadsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedLedgerDigestUploadsClient().BeginCreateOrUpdate(ctx, "ledgertestrg", "ledgertestserver", "testdb", armsql.ManagedLedgerDigestUploadsNameCurrent, armsql.ManagedLedgerDigestUploads{ - Properties: &armsql.ManagedLedgerDigestUploadsProperties{ - DigestStorageEndpoint: to.Ptr("https://MyAccount.blob.core.windows.net"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedLedgerDigestUploads = armsql.ManagedLedgerDigestUploads{ - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/databases/ledgerDigestUploads"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/ledgertestrg/providers/Microsoft.Sql/managedInstances/ledgertestserver/databases/testdb/ledgerDigestUploads/current"), - // Properties: &armsql.ManagedLedgerDigestUploadsProperties{ - // DigestStorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - // State: to.Ptr(armsql.ManagedLedgerDigestUploadsStateEnabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedLedgerDigestUploadsDisable.json -func ExampleManagedLedgerDigestUploadsClient_BeginDisable() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedLedgerDigestUploadsClient().BeginDisable(ctx, "ledgertestrg", "ledgertestserver", "testdb", armsql.ManagedLedgerDigestUploadsNameCurrent, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedLedgerDigestUploads = armsql.ManagedLedgerDigestUploads{ - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/databases/ledgerDigestUploads"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/ledgertestrg/providers/Microsoft.Sql/managedInstances/ledgertestserver/databases/testdb/ledgerDigestUploads/current/disable"), - // Properties: &armsql.ManagedLedgerDigestUploadsProperties{ - // State: to.Ptr(armsql.ManagedLedgerDigestUploadsStateDisabled), - // }, - // } -} diff --git a/sdk/resourcemanager/sql/armsql/managedrestorabledroppeddatabasebackupshorttermretentionpolicies_client.go b/sdk/resourcemanager/sql/armsql/managedrestorabledroppeddatabasebackupshorttermretentionpolicies_client.go index dc60b2586294..987ee0826c15 100644 --- a/sdk/resourcemanager/sql/armsql/managedrestorabledroppeddatabasebackupshorttermretentionpolicies_client.go +++ b/sdk/resourcemanager/sql/armsql/managedrestorabledroppeddatabasebackupshorttermretentionpolicies_client.go @@ -46,7 +46,7 @@ func NewManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient(s // BeginCreateOrUpdate - Sets a database's short term retention policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -71,7 +71,7 @@ func (client *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesCl // CreateOrUpdate - Sets a database's short term retention policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview func (client *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient) createOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, restorableDroppedDatabaseID string, policyName ManagedShortTermRetentionPolicyName, parameters ManagedBackupShortTermRetentionPolicy, options *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, restorableDroppedDatabaseID, policyName, parameters, options) @@ -117,7 +117,7 @@ func (client *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesCl return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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 *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesCl // Get - Gets a dropped database's short term retention policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -182,7 +182,7 @@ func (client *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesCl return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -199,7 +199,7 @@ func (client *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesCl // NewListByRestorableDroppedDatabasePager - Gets a dropped database's short term retention policy list. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -258,7 +258,7 @@ func (client *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesCl return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -276,7 +276,7 @@ func (client *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesCl // BeginUpdate - Sets a database's short term retention policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -300,7 +300,7 @@ func (client *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesCl // Update - Sets a database's short term retention policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview func (client *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient) update(ctx context.Context, resourceGroupName string, managedInstanceName string, restorableDroppedDatabaseID string, policyName ManagedShortTermRetentionPolicyName, parameters ManagedBackupShortTermRetentionPolicy, options *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientBeginUpdateOptions) (*http.Response, error) { var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, managedInstanceName, restorableDroppedDatabaseID, policyName, parameters, options) @@ -346,7 +346,7 @@ func (client *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesCl return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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/sql/armsql/managedrestorabledroppeddatabasebackupshorttermretentionpolicies_client_example_test.go b/sdk/resourcemanager/sql/armsql/managedrestorabledroppeddatabasebackupshorttermretentionpolicies_client_example_test.go deleted file mode 100644 index da6733439262..000000000000 --- a/sdk/resourcemanager/sql/armsql/managedrestorabledroppeddatabasebackupshorttermretentionpolicies_client_example_test.go +++ /dev/null @@ -1,127 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetManagedShortTermRetentionPolicyRestorableDropped.json -func ExampleManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient().Get(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb,131403269876900000", armsql.ManagedShortTermRetentionPolicyNameDefault, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedBackupShortTermRetentionPolicy = armsql.ManagedBackupShortTermRetentionPolicy{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/restorableDroppedDatabases/backupShortTermRetentionPolicies"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstance/testsvr/restorableDroppedDatabases/testdb,131403269876900000/backupShortTermRetentionPolicies/default"), - // Properties: &armsql.ManagedBackupShortTermRetentionPolicyProperties{ - // RetentionDays: to.Ptr[int32](14), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/UpdateManagedShortTermRetentionPolicyRestorableDropped.json -func ExampleManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient().BeginCreateOrUpdate(ctx, "resourceGroup", "testsvr", "testdb,131403269876900000", armsql.ManagedShortTermRetentionPolicyNameDefault, armsql.ManagedBackupShortTermRetentionPolicy{ - Properties: &armsql.ManagedBackupShortTermRetentionPolicyProperties{ - RetentionDays: to.Ptr[int32](14), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedBackupShortTermRetentionPolicy = armsql.ManagedBackupShortTermRetentionPolicy{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/restorableDroppedDatabases/backupShortTermRetentionPolicies"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/resourceGroup/providers/Microsoft.Sql/managedInstances/testsvr/restorableDroppedDatabases/testdb,131403269876900000/backupShortTermRetentionPolicies/default"), - // Properties: &armsql.ManagedBackupShortTermRetentionPolicyProperties{ - // RetentionDays: to.Ptr[int32](14), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetListManagedShortTermRetentionPolicyRestorableDropped.json -func ExampleManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient_NewListByRestorableDroppedDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient().NewListByRestorableDroppedDatabasePager("Default-SQL-SouthEastAsia", "testsvr", "testdb,131403269876900000", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ManagedBackupShortTermRetentionPolicyListResult = armsql.ManagedBackupShortTermRetentionPolicyListResult{ - // Value: []*armsql.ManagedBackupShortTermRetentionPolicy{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/restorableDroppedDatabases/backupShortTermRetentionPolicies"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/testsvr/restorableDroppedDatabases/testdb,131403269876900000/backupShortTermRetentionPolicies/default"), - // Properties: &armsql.ManagedBackupShortTermRetentionPolicyProperties{ - // RetentionDays: to.Ptr[int32](14), - // }, - // }, - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/restorableDroppedDatabases/backupShortTermRetentionPolicies"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/testsvr/restorableDroppedDatabases/testdb,131403269876900000/backupShortTermRetentionPolicies/default"), - // Properties: &armsql.ManagedBackupShortTermRetentionPolicyProperties{ - // RetentionDays: to.Ptr[int32](14), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/sql/armsql/managedserverdnsaliases_client.go b/sdk/resourcemanager/sql/armsql/managedserverdnsaliases_client.go index 43ee1b32ce83..e83f11300246 100644 --- a/sdk/resourcemanager/sql/armsql/managedserverdnsaliases_client.go +++ b/sdk/resourcemanager/sql/armsql/managedserverdnsaliases_client.go @@ -46,7 +46,7 @@ func NewManagedServerDNSAliasesClient(subscriptionID string, credential azcore.T // BeginAcquire - Acquires managed server DNS alias from another managed server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -68,7 +68,7 @@ func (client *ManagedServerDNSAliasesClient) BeginAcquire(ctx context.Context, r // Acquire - Acquires managed server DNS alias from another managed server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01-preview +// Generated from API version 2023-05-01-preview func (client *ManagedServerDNSAliasesClient) acquire(ctx context.Context, resourceGroupName string, managedInstanceName string, dnsAliasName string, parameters ManagedServerDNSAliasAcquisition, options *ManagedServerDNSAliasesClientBeginAcquireOptions) (*http.Response, error) { var err error req, err := client.acquireCreateRequest(ctx, resourceGroupName, managedInstanceName, dnsAliasName, parameters, options) @@ -110,7 +110,7 @@ func (client *ManagedServerDNSAliasesClient) acquireCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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 *ManagedServerDNSAliasesClient) acquireCreateRequest(ctx context.Co // BeginCreateOrUpdate - Creates a managed server DNS alias. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -144,7 +144,7 @@ func (client *ManagedServerDNSAliasesClient) BeginCreateOrUpdate(ctx context.Con // CreateOrUpdate - Creates a managed server DNS alias. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01-preview +// Generated from API version 2023-05-01-preview func (client *ManagedServerDNSAliasesClient) createOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, dnsAliasName string, parameters ManagedServerDNSAliasCreation, options *ManagedServerDNSAliasesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, dnsAliasName, parameters, options) @@ -186,7 +186,7 @@ func (client *ManagedServerDNSAliasesClient) createOrUpdateCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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 *ManagedServerDNSAliasesClient) createOrUpdateCreateRequest(ctx con // BeginDelete - Deletes the managed server DNS alias with the given name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -220,7 +220,7 @@ func (client *ManagedServerDNSAliasesClient) BeginDelete(ctx context.Context, re // Delete - Deletes the managed server DNS alias with the given name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01-preview +// Generated from API version 2023-05-01-preview func (client *ManagedServerDNSAliasesClient) deleteOperation(ctx context.Context, resourceGroupName string, managedInstanceName string, dnsAliasName string, options *ManagedServerDNSAliasesClientBeginDeleteOptions) (*http.Response, error) { var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, managedInstanceName, dnsAliasName, options) @@ -262,7 +262,7 @@ func (client *ManagedServerDNSAliasesClient) deleteCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -270,7 +270,7 @@ func (client *ManagedServerDNSAliasesClient) deleteCreateRequest(ctx context.Con // Get - Gets a server DNS alias. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -318,7 +318,7 @@ func (client *ManagedServerDNSAliasesClient) getCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -335,7 +335,7 @@ func (client *ManagedServerDNSAliasesClient) getHandleResponse(resp *http.Respon // NewListByManagedInstancePager - Gets a list of managed server DNS aliases for a managed server. // -// Generated from API version 2021-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -389,7 +389,7 @@ func (client *ManagedServerDNSAliasesClient) listByManagedInstanceCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/managedserverdnsaliases_client_example_test.go b/sdk/resourcemanager/sql/armsql/managedserverdnsaliases_client_example_test.go deleted file mode 100644 index cb76a76fa36c..000000000000 --- a/sdk/resourcemanager/sql/armsql/managedserverdnsaliases_client_example_test.go +++ /dev/null @@ -1,181 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ManagedServerDnsAliasList.json -func ExampleManagedServerDNSAliasesClient_NewListByManagedInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagedServerDNSAliasesClient().NewListByManagedInstancePager("Default", "dns-mi", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ManagedServerDNSAliasListResult = armsql.ManagedServerDNSAliasListResult{ - // Value: []*armsql.ManagedServerDNSAlias{ - // { - // Name: to.Ptr("dns-alias-mi"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/dnsAliases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/dns-mi/dnsAliases/dns-alias-mi"), - // Properties: &armsql.ManagedServerDNSAliasProperties{ - // AzureDNSRecord: to.Ptr("dns-alias-mi.abcd1234.database.windows.net"), - // PublicAzureDNSRecord: to.Ptr("dns-alias-mi.public.abcd1234.database.windows.net"), - // }, - // }, - // { - // Name: to.Ptr("dns-alias-mi-2"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/dnsAliases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/dns-mi/dnsAliases/dns-alias-mi-2"), - // Properties: &armsql.ManagedServerDNSAliasProperties{ - // AzureDNSRecord: to.Ptr("dns-alias-mi-2.abcd1234.database.windows.net"), - // PublicAzureDNSRecord: to.Ptr("dns-alias-mi-2.public.abcd1234.database.windows.net"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ManagedServerDnsAliasGet.json -func ExampleManagedServerDNSAliasesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedServerDNSAliasesClient().Get(ctx, "Default", "dns-mi", "dns-alias-mi", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedServerDNSAlias = armsql.ManagedServerDNSAlias{ - // Name: to.Ptr("dns-alias-mi"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/dnsAliases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/dns-mi/dnsAliases/dns-alias-mi"), - // Properties: &armsql.ManagedServerDNSAliasProperties{ - // AzureDNSRecord: to.Ptr("dns-alias-mi.abcd1234.database.windows.net"), - // PublicAzureDNSRecord: to.Ptr("dns-alias-mi.public.abcd1234.database.windows.net"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ManagedServerDnsAliasCreateOrUpdate.json -func ExampleManagedServerDNSAliasesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedServerDNSAliasesClient().BeginCreateOrUpdate(ctx, "Default", "dns-mi", "dns-alias-mi", armsql.ManagedServerDNSAliasCreation{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedServerDNSAlias = armsql.ManagedServerDNSAlias{ - // Name: to.Ptr("dns-alias-mi"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/dnsAliases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/dns-mi/dnsAliases/dns-alias-mi"), - // Properties: &armsql.ManagedServerDNSAliasProperties{ - // AzureDNSRecord: to.Ptr("dns-alias-mi.abcd1234.database.windows.net"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ManagedServerDnsAliasDelete.json -func ExampleManagedServerDNSAliasesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedServerDNSAliasesClient().BeginDelete(ctx, "Default", "dns-mi", "dns-alias-mi", 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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ManagedServerDnsAliasAcquire.json -func ExampleManagedServerDNSAliasesClient_BeginAcquire() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedServerDNSAliasesClient().BeginAcquire(ctx, "Default", "new-mi", "dns-alias-mi", armsql.ManagedServerDNSAliasAcquisition{ - OldManagedServerDNSAliasResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/old-mi/dnsAliases/alias1"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedServerDNSAlias = armsql.ManagedServerDNSAlias{ - // Name: to.Ptr("alias1"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/dnsAliases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/new-mi/dnsAliases/alias1"), - // Properties: &armsql.ManagedServerDNSAliasProperties{ - // AzureDNSRecord: to.Ptr("alias1.abcd1234.database.windows.net"), - // }, - // } -} diff --git a/sdk/resourcemanager/sql/armsql/managedserversecurityalertpolicies_client.go b/sdk/resourcemanager/sql/armsql/managedserversecurityalertpolicies_client.go index b3cc8f504848..b4f3445cc83d 100644 --- a/sdk/resourcemanager/sql/armsql/managedserversecurityalertpolicies_client.go +++ b/sdk/resourcemanager/sql/armsql/managedserversecurityalertpolicies_client.go @@ -46,7 +46,7 @@ func NewManagedServerSecurityAlertPoliciesClient(subscriptionID string, credenti // BeginCreateOrUpdate - Creates or updates a threat detection policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -54,7 +54,7 @@ func NewManagedServerSecurityAlertPoliciesClient(subscriptionID string, credenti // - parameters - The managed server security alert policy. // - options - ManagedServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedServerSecurityAlertPoliciesClient.BeginCreateOrUpdate // method. -func (client *ManagedServerSecurityAlertPoliciesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, securityAlertPolicyName SecurityAlertPolicyName, parameters ManagedServerSecurityAlertPolicy, options *ManagedServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions) (*runtime.Poller[ManagedServerSecurityAlertPoliciesClientCreateOrUpdateResponse], error) { +func (client *ManagedServerSecurityAlertPoliciesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, securityAlertPolicyName SecurityAlertPolicyNameAutoGenerated, parameters ManagedServerSecurityAlertPolicy, options *ManagedServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions) (*runtime.Poller[ManagedServerSecurityAlertPoliciesClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, managedInstanceName, securityAlertPolicyName, parameters, options) if err != nil { @@ -70,8 +70,8 @@ func (client *ManagedServerSecurityAlertPoliciesClient) BeginCreateOrUpdate(ctx // CreateOrUpdate - Creates or updates a threat detection policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview -func (client *ManagedServerSecurityAlertPoliciesClient) createOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, securityAlertPolicyName SecurityAlertPolicyName, parameters ManagedServerSecurityAlertPolicy, options *ManagedServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions) (*http.Response, error) { +// Generated from API version 2023-05-01-preview +func (client *ManagedServerSecurityAlertPoliciesClient) createOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, securityAlertPolicyName SecurityAlertPolicyNameAutoGenerated, parameters ManagedServerSecurityAlertPolicy, options *ManagedServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, securityAlertPolicyName, parameters, options) if err != nil { @@ -89,7 +89,7 @@ func (client *ManagedServerSecurityAlertPoliciesClient) createOrUpdate(ctx conte } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ManagedServerSecurityAlertPoliciesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, securityAlertPolicyName SecurityAlertPolicyName, parameters ManagedServerSecurityAlertPolicy, options *ManagedServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *ManagedServerSecurityAlertPoliciesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, securityAlertPolicyName SecurityAlertPolicyNameAutoGenerated, parameters ManagedServerSecurityAlertPolicy, options *ManagedServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/securityAlertPolicies/{securityAlertPolicyName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -112,7 +112,7 @@ func (client *ManagedServerSecurityAlertPoliciesClient) createOrUpdateCreateRequ return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -124,14 +124,14 @@ func (client *ManagedServerSecurityAlertPoliciesClient) createOrUpdateCreateRequ // Get - Get a managed server's threat detection policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. // - securityAlertPolicyName - The name of the security alert policy. // - options - ManagedServerSecurityAlertPoliciesClientGetOptions contains the optional parameters for the ManagedServerSecurityAlertPoliciesClient.Get // method. -func (client *ManagedServerSecurityAlertPoliciesClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, securityAlertPolicyName SecurityAlertPolicyName, options *ManagedServerSecurityAlertPoliciesClientGetOptions) (ManagedServerSecurityAlertPoliciesClientGetResponse, error) { +func (client *ManagedServerSecurityAlertPoliciesClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, securityAlertPolicyName SecurityAlertPolicyNameAutoGenerated, options *ManagedServerSecurityAlertPoliciesClientGetOptions) (ManagedServerSecurityAlertPoliciesClientGetResponse, error) { var err error req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, securityAlertPolicyName, options) if err != nil { @@ -150,7 +150,7 @@ func (client *ManagedServerSecurityAlertPoliciesClient) Get(ctx context.Context, } // getCreateRequest creates the Get request. -func (client *ManagedServerSecurityAlertPoliciesClient) getCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, securityAlertPolicyName SecurityAlertPolicyName, options *ManagedServerSecurityAlertPoliciesClientGetOptions) (*policy.Request, error) { +func (client *ManagedServerSecurityAlertPoliciesClient) getCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, securityAlertPolicyName SecurityAlertPolicyNameAutoGenerated, options *ManagedServerSecurityAlertPoliciesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/securityAlertPolicies/{securityAlertPolicyName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -173,7 +173,7 @@ func (client *ManagedServerSecurityAlertPoliciesClient) getCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -190,7 +190,7 @@ func (client *ManagedServerSecurityAlertPoliciesClient) getHandleResponse(resp * // NewListByInstancePager - Get the managed server's threat detection policies. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -244,7 +244,7 @@ func (client *ManagedServerSecurityAlertPoliciesClient) listByInstanceCreateRequ return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/managedserversecurityalertpolicies_client_example_test.go b/sdk/resourcemanager/sql/armsql/managedserversecurityalertpolicies_client_example_test.go deleted file mode 100644 index 3bb44791842c..000000000000 --- a/sdk/resourcemanager/sql/armsql/managedserversecurityalertpolicies_client_example_test.go +++ /dev/null @@ -1,231 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedServerSecurityAlertGet.json -func ExampleManagedServerSecurityAlertPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedServerSecurityAlertPoliciesClient().Get(ctx, "securityalert-4799", "securityalert-6440", armsql.SecurityAlertPolicyNameDefault, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedServerSecurityAlertPolicy = armsql.ManagedServerSecurityAlertPolicy{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/securityAlertPolicies"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/securityalert-4799/providers/Microsoft.Sql/managedInstances/securityalert-6440"), - // Properties: &armsql.SecurityAlertsPolicyProperties{ - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-03T04:41:33.937Z"); return t}()), - // DisabledAlerts: []*string{ - // to.Ptr("Access_Anomaly")}, - // EmailAccountAdmins: to.Ptr(true), - // EmailAddresses: []*string{ - // to.Ptr("test@consoto.com;user@consoto.com")}, - // RetentionDays: to.Ptr[int32](0), - // State: to.Ptr(armsql.SecurityAlertsPolicyStateDisabled), - // StorageAccountAccessKey: to.Ptr(""), - // StorageEndpoint: to.Ptr(""), - // }, - // SystemData: &armsql.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-03T04:41:33.937Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsql.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-03T04:41:33.937Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsql.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedServerSecurityAlertCreateMax.json -func ExampleManagedServerSecurityAlertPoliciesClient_BeginCreateOrUpdate_updateAManagedServersThreatDetectionPolicyWithAllParameters() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedServerSecurityAlertPoliciesClient().BeginCreateOrUpdate(ctx, "securityalert-4799", "securityalert-6440", armsql.SecurityAlertPolicyNameDefault, armsql.ManagedServerSecurityAlertPolicy{ - Properties: &armsql.SecurityAlertsPolicyProperties{ - DisabledAlerts: []*string{ - to.Ptr("Access_Anomaly"), - to.Ptr("Usage_Anomaly")}, - EmailAccountAdmins: to.Ptr(true), - EmailAddresses: []*string{ - to.Ptr("testSecurityAlert@microsoft.com")}, - RetentionDays: to.Ptr[int32](5), - State: to.Ptr(armsql.SecurityAlertsPolicyStateEnabled), - StorageAccountAccessKey: to.Ptr("sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD=="), - StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedServerSecurityAlertPolicy = armsql.ManagedServerSecurityAlertPolicy{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/securityAlertPolicies"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/securityalert-4799/providers/Microsoft.Sql/managedInstances/securityalert-6440"), - // Properties: &armsql.SecurityAlertsPolicyProperties{ - // DisabledAlerts: []*string{ - // to.Ptr("Access_Anomaly"), - // to.Ptr("Usage_Anomaly")}, - // EmailAccountAdmins: to.Ptr(true), - // EmailAddresses: []*string{ - // to.Ptr("testSecurityAlert@microsoft.com")}, - // RetentionDays: to.Ptr[int32](5), - // State: to.Ptr(armsql.SecurityAlertsPolicyStateEnabled), - // StorageAccountAccessKey: to.Ptr(""), - // StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - // }, - // SystemData: &armsql.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-03T04:41:33.937Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsql.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-03T04:41:33.937Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsql.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedServerSecurityAlertCreateMin.json -func ExampleManagedServerSecurityAlertPoliciesClient_BeginCreateOrUpdate_updateAManagedServersThreatDetectionPolicyWithMinimalParameters() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedServerSecurityAlertPoliciesClient().BeginCreateOrUpdate(ctx, "securityalert-4799", "securityalert-6440", armsql.SecurityAlertPolicyNameDefault, armsql.ManagedServerSecurityAlertPolicy{ - Properties: &armsql.SecurityAlertsPolicyProperties{ - State: to.Ptr(armsql.SecurityAlertsPolicyStateEnabled), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedServerSecurityAlertPolicy = armsql.ManagedServerSecurityAlertPolicy{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/securityAlertPolicies"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/securityalert-4799/providers/Microsoft.Sql/managedInstances/securityalert-6440"), - // Properties: &armsql.SecurityAlertsPolicyProperties{ - // DisabledAlerts: []*string{ - // }, - // EmailAccountAdmins: to.Ptr(true), - // EmailAddresses: []*string{ - // }, - // RetentionDays: to.Ptr[int32](0), - // State: to.Ptr(armsql.SecurityAlertsPolicyStateEnabled), - // StorageAccountAccessKey: to.Ptr(""), - // StorageEndpoint: to.Ptr(""), - // }, - // SystemData: &armsql.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-03T04:41:33.937Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsql.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-03T04:41:33.937Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsql.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedServerSecurityAlertListByInstance.json -func ExampleManagedServerSecurityAlertPoliciesClient_NewListByInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagedServerSecurityAlertPoliciesClient().NewListByInstancePager("securityalert-4799", "securityalert-6440", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ManagedServerSecurityAlertPolicyListResult = armsql.ManagedServerSecurityAlertPolicyListResult{ - // Value: []*armsql.ManagedServerSecurityAlertPolicy{ - // { - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/securityAlertPolicies"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/securityalert-4799/providers/Microsoft.Sql/managedInstances/securityalert-6440"), - // Properties: &armsql.SecurityAlertsPolicyProperties{ - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-03T04:41:33.937Z"); return t}()), - // DisabledAlerts: []*string{ - // to.Ptr("Access_Anomaly")}, - // EmailAccountAdmins: to.Ptr(true), - // EmailAddresses: []*string{ - // to.Ptr("test@consoto.com;user@consoto.com")}, - // RetentionDays: to.Ptr[int32](0), - // State: to.Ptr(armsql.SecurityAlertsPolicyStateDisabled), - // StorageAccountAccessKey: to.Ptr(""), - // StorageEndpoint: to.Ptr(""), - // }, - // SystemData: &armsql.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-03T04:41:33.937Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsql.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-03T04:41:33.937Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsql.CreatedByTypeUser), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/sql/armsql/models.go b/sdk/resourcemanager/sql/armsql/models.go index e099d3db4604..27b058a7f594 100644 --- a/sdk/resourcemanager/sql/armsql/models.go +++ b/sdk/resourcemanager/sql/armsql/models.go @@ -230,16 +230,16 @@ type BackupShortTermRetentionPolicyProperties struct { // BaseLongTermRetentionPolicyProperties - Properties of a long term retention policy type BaseLongTermRetentionPolicyProperties struct { - // The monthly retention policy for an LTR backup in an ISO 8601 format. + // The monthly retention policy for an LTR backup. MonthlyRetention *string - // The week of year to take the yearly backup in an ISO 8601 format. + // The week of year to take the yearly backup. WeekOfYear *int32 - // The weekly retention policy for an LTR backup in an ISO 8601 format. + // The weekly retention policy for an LTR backup. WeeklyRetention *string - // The yearly retention policy for an LTR backup in an ISO 8601 format. + // The yearly retention policy for an LTR backup. YearlyRetention *string } @@ -276,6 +276,18 @@ type BenchmarkReference struct { Reference *string } +// CertificateInfo - Certificate information +type CertificateInfo struct { + // READ-ONLY; The certificate ID + CertificateID *string + + // READ-ONLY; The certificate name + CertificateName *string + + // READ-ONLY; The certificate expiry date + ExpiryDate *time.Time +} + // CheckNameAvailabilityRequest - A request to check whether the specified name for a resource is available. type CheckNameAvailabilityRequest struct { // REQUIRED @@ -339,15 +351,33 @@ type CreateDatabaseRestorePointDefinition struct { RestorePointLabel *string } -// DataMaskingPolicy - Represents a database data masking policy. +// CreateOrUpdateProperties - Properties for creating and updating distributed availability group +type CreateOrUpdateProperties struct { + // The primary availability group name + PrimaryAvailabilityGroupName *string + + // The replication mode of a distributed availability group. Parameter will be ignored during link creation. + ReplicationMode *ReplicationModeType + + // The secondary availability group name + SecondaryAvailabilityGroupName *string + + // The source endpoint + SourceEndpoint *string + + // The name of the target database + TargetDatabase *string +} + +// DataMaskingPolicy - A database data masking policy. type DataMaskingPolicy struct { - // The properties of the data masking policy. + // Resource properties. Properties *DataMaskingPolicyProperties // READ-ONLY; Resource ID. ID *string - // READ-ONLY; The kind of data masking policy. Metadata, used for Azure portal. + // READ-ONLY; The kind of Data Masking Policy. Metadata, used for Azure portal. Kind *string // READ-ONLY; The location of the data masking policy. @@ -377,9 +407,9 @@ type DataMaskingPolicyProperties struct { MaskingLevel *string } -// DataMaskingRule - Represents a database data masking rule. +// DataMaskingRule - A database data masking rule. type DataMaskingRule struct { - // The properties of the resource. + // Resource properties. Properties *DataMaskingRuleProperties // READ-ONLY; Resource ID. @@ -398,9 +428,12 @@ type DataMaskingRule struct { Type *string } -// DataMaskingRuleListResult - The response to a list data masking rules request. +// DataMaskingRuleListResult - The list of database data masking rules. type DataMaskingRuleListResult struct { - // The list of database data masking rules. + // READ-ONLY; Link to retrieve next page of results. + NextLink *string + + // READ-ONLY; Array of results. Value []*DataMaskingRule } @@ -717,7 +750,7 @@ type DatabaseColumnProperties struct { TemporalType *TableTemporalType } -// DatabaseExtensions - An export managed database operation result resource. +// DatabaseExtensions - An Import, Export, or PolybaseImport resource. type DatabaseExtensions struct { // Resource properties. Properties *DatabaseExtensionsProperties @@ -732,19 +765,40 @@ type DatabaseExtensions struct { Type *string } -// DatabaseExtensionsProperties - Contains the database information after successful export. +// DatabaseExtensionsProperties - Contains the database information after a successful Import, Export, or PolybaseImport type DatabaseExtensionsProperties struct { - // REQUIRED; Operation Mode. + // REQUIRED; Operation mode of the operation: Import, Export, or PolybaseImport. OperationMode *OperationMode - // REQUIRED; Storage key. + // REQUIRED; Storage key for the storage account. StorageKey *string - // REQUIRED; Storage key type. + // REQUIRED; Storage key type: StorageAccessKey or SharedAccessKey. StorageKeyType *StorageKeyType - // REQUIRED; Storage Uri. + // REQUIRED; Storage Uri for the storage account. StorageURI *string + + // Administrator login name. + AdministratorLogin *string + + // Administrator login password. + AdministratorLoginPassword *string + + // Authentication type: SQL authentication or AD password. + AuthenticationType *string + + // Database edition for the newly created database in the case of an import operation. + DatabaseEdition *string + + // Database max size in bytes for the newly created database in the case of an import operation. + MaxSizeBytes *string + + // Optional resource information to enable network isolation for request. + NetworkIsolation *NetworkIsolationSettings + + // Database service level objective for the newly created database in the case of an import operation. + ServiceObjectiveName *string } // DatabaseIdentity - Azure Active Directory identity configuration for a resource. @@ -839,6 +893,9 @@ type DatabaseOperationProperties struct { // READ-ONLY; The friendly name of operation. OperationFriendlyName *string + // READ-ONLY; The operation phase details. + OperationPhaseDetails *PhaseDetails + // READ-ONLY; The percentage of the operation completed. PercentComplete *int32 @@ -893,9 +950,17 @@ type DatabaseProperties struct { // The azure key vault URI of the database if it's configured with per Database Customer Managed Keys. EncryptionProtector *string + // The flag to enable or disable auto rotation of database encryption protector AKV key. + EncryptionProtectorAutoRotation *bool + // The Client id used for cross tenant per database CMK scenario FederatedClientID *string + // Specifies the behavior when monthly free limits are exhausted for the free database. + // AutoPause: The database will be auto paused upon exhaustion of free limits for remainder of the month. + // BillForUsage: The database will continue to be online upon exhaustion of free limits and any overage will be billed. + FreeLimitExhaustionBehavior *FreeLimitExhaustionBehavior + // The number of secondary replicas associated with the database that are used to provide high availability. Not applicable // to a Hyperscale database within an elastic pool. HighAvailabilityReplicaCount *int32 @@ -988,6 +1053,9 @@ type DatabaseProperties struct { // “x-ms-authorization-auxiliary” header see https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/authenticate-multi-tenant SourceResourceID *string + // Whether or not the database uses free monthly limits. Allowed on one database in a subscription. + UseFreeLimit *bool + // Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple // availability zones. ZoneRedundant *bool @@ -1293,9 +1361,17 @@ type DatabaseUpdateProperties struct { // The azure key vault URI of the database if it's configured with per Database Customer Managed Keys. EncryptionProtector *string + // The flag to enable or disable auto rotation of database encryption protector AKV key. + EncryptionProtectorAutoRotation *bool + // The Client id used for cross tenant per database CMK scenario FederatedClientID *string + // Specifies the behavior when monthly free limits are exhausted for the free database. + // AutoPause: The database will be auto paused upon exhaustion of free limits for remainder of the month. + // BillForUsage: The database will continue to be online upon exhaustion of free limits and any overage will be billed. + FreeLimitExhaustionBehavior *FreeLimitExhaustionBehavior + // The number of secondary replicas associated with the database that are used to provide high availability. Not applicable // to a Hyperscale database within an elastic pool. HighAvailabilityReplicaCount *int32 @@ -1373,6 +1449,9 @@ type DatabaseUpdateProperties struct { // The resource identifier of the source database associated with create operation of this database. SourceDatabaseID *string + // Whether or not the database uses free monthly limits. Allowed on one database in a subscription. + UseFreeLimit *bool + // Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple // availability zones. ZoneRedundant *bool @@ -1499,7 +1578,8 @@ type DatabaseVulnerabilityAssessmentProperties struct { RecurringScans *VulnerabilityAssessmentRecurringScansProperties // Specifies the identifier key of the storage account for vulnerability assessment scan results. If 'StorageContainerSasKey' - // isn't specified, storageAccountAccessKey is required. + // isn't specified, storageAccountAccessKey is required. Applies only if the + // storage account is not behind a Vnet or a firewall StorageAccountAccessKey *string // A blob storage container path to hold the scan results (e.g. https://myStorage.blob.core.windows.net/VaScans/). It is required @@ -1508,7 +1588,7 @@ type DatabaseVulnerabilityAssessmentProperties struct { // A shared access signature (SAS Key) that has write access to the blob container specified in 'storageContainerPath' parameter. // If 'storageAccountAccessKey' isn't specified, StorageContainerSasKey is - // required. + // required. Applies only if the storage account is not behind a Vnet or a firewall StorageContainerSasKey *string } @@ -1615,37 +1695,113 @@ type DistributedAvailabilityGroup struct { Type *string } +// DistributedAvailabilityGroupDatabase - Database specific information +type DistributedAvailabilityGroupDatabase struct { + // READ-ONLY; Link connected state + ConnectedState *ReplicaConnectedState + + // READ-ONLY; The name of the database in link + DatabaseName *string + + // READ-ONLY; Redo lag when Managed Instance link side is primary + InstanceRedoReplicationLagSeconds *int32 + + // READ-ONLY; Managed instance replica id + InstanceReplicaID *string + + // READ-ONLY; Replication lag when Managed Instance link side is primary + InstanceSendReplicationLagSeconds *int32 + + // READ-ONLY; Last backup LSN + LastBackupLsn *string + + // READ-ONLY; Last backup LSN time + LastBackupTime *time.Time + + // READ-ONLY; Last commit LSN + LastCommitLsn *string + + // READ-ONLY; Last commit LSN time + LastCommitTime *time.Time + + // READ-ONLY; Last hardened LSN + LastHardenedLsn *string + + // READ-ONLY; Last hardened LSN time + LastHardenedTime *time.Time + + // READ-ONLY; Last received LSN + LastReceivedLsn *string + + // READ-ONLY; Last received LSN time + LastReceivedTime *time.Time + + // READ-ONLY; Last sent LSN + LastSentLsn *string + + // READ-ONLY; Last sent LSN time + LastSentTime *time.Time + + // READ-ONLY; The most recent link connection error description + MostRecentLinkError *string + + // READ-ONLY; SQL server certificate validity + PartnerAuthCertValidity *CertificateInfo + + // READ-ONLY; SQL server replica id + PartnerReplicaID *string + + // READ-ONLY; Current link state + ReplicaState *string + + // READ-ONLY; Link health state + SynchronizationHealth *ReplicaSynchronizationHealth +} + // DistributedAvailabilityGroupProperties - The properties of a distributed availability group. type DistributedAvailabilityGroupProperties struct { - // The primary availability group name - PrimaryAvailabilityGroupName *string + // Replication mode of the link + ReplicationMode *ReplicationModeType - // The replication mode of a distributed availability group. Parameter will be ignored during link creation. - ReplicationMode *ReplicationMode + // READ-ONLY; Databases in the distributed availability group + Databases []*DistributedAvailabilityGroupDatabase - // The secondary availability group name - SecondaryAvailabilityGroupName *string + // READ-ONLY; ID of the distributed availability group + DistributedAvailabilityGroupID *string - // The source endpoint - SourceEndpoint *string + // READ-ONLY; Name of the distributed availability group + DistributedAvailabilityGroupName *string - // The name of the target database - TargetDatabase *string + // READ-ONLY; Managed instance side availability group name + InstanceAvailabilityGroupName *string - // READ-ONLY; The distributed availability group id - DistributedAvailabilityGroupID *string + // READ-ONLY; Managed instance side link role + InstanceLinkRole *LinkRole - // READ-ONLY; The last hardened lsn - LastHardenedLsn *string + // READ-ONLY; SQL server side availability group name + PartnerAvailabilityGroupName *string + + // READ-ONLY; SQL server side endpoint - IP or DNS resolvable name + PartnerEndpoint *string + + // READ-ONLY; SQL server side link role + PartnerLinkRole *LinkRole +} - // READ-ONLY; The link state - LinkState *string +// DistributedAvailabilityGroupSetRole - Distributed availability group failover request. +type DistributedAvailabilityGroupSetRole struct { + // REQUIRED; New role of managed instance in a distributed availability group, can be Primary or Secondary. + InstanceRole *InstanceRole - // READ-ONLY; The source replica id - SourceReplicaID *string + // REQUIRED; The type of the role change, can be Planned or Forced. + RoleChangeType *RoleChangeType +} - // READ-ONLY; The target replica id - TargetReplicaID *string +// DistributedAvailabilityGroupsCreateOrUpdateRequestBody - Information for creating and updating distributed availability +// group +type DistributedAvailabilityGroupsCreateOrUpdateRequestBody struct { + // Resource properties. + Properties *CreateOrUpdateProperties } // DistributedAvailabilityGroupsListResult - A list of distributed availability groups in instance. @@ -1677,6 +1833,9 @@ type EditionCapability struct { // READ-ONLY; The list of supported storage capabilities for this edition SupportedStorageCapabilities []*StorageCapability + // READ-ONLY; Whether or not zone pinning is supported for the edition. + ZonePinning *bool + // READ-ONLY; Whether or not zone redundancy is supported for the edition. ZoneRedundant *bool } @@ -1713,165 +1872,6 @@ type ElasticPool struct { Type *string } -// ElasticPoolActivity - Represents the activity on an elastic pool. -type ElasticPoolActivity struct { - // The geo-location where the resource lives - Location *string - - // The properties representing the resource. - Properties *ElasticPoolActivityProperties - - // READ-ONLY; Resource ID. - ID *string - - // READ-ONLY; Resource name. - Name *string - - // READ-ONLY; Resource type. - Type *string -} - -// ElasticPoolActivityListResult - Represents the response to a list elastic pool activity request. -type ElasticPoolActivityListResult struct { - // REQUIRED; The list of elastic pool activities. - Value []*ElasticPoolActivity -} - -// ElasticPoolActivityProperties - Represents the properties of an elastic pool. -type ElasticPoolActivityProperties struct { - // READ-ONLY; The name of the elastic pool. - ElasticPoolName *string - - // READ-ONLY; The time the operation finished (ISO8601 format). - EndTime *time.Time - - // READ-ONLY; The error code if available. - ErrorCode *int32 - - // READ-ONLY; The error message if available. - ErrorMessage *string - - // READ-ONLY; The error severity if available. - ErrorSeverity *int32 - - // READ-ONLY; The operation name. - Operation *string - - // READ-ONLY; The unique operation ID. - OperationID *string - - // READ-ONLY; The percentage complete if available. - PercentComplete *int32 - - // READ-ONLY; The requested per database DTU cap. - RequestedDatabaseDtuCap *int32 - - // READ-ONLY; The requested per database DTU guarantee. - RequestedDatabaseDtuGuarantee *int32 - - // READ-ONLY; The requested max DTU per database if available. - RequestedDatabaseDtuMax *int32 - - // READ-ONLY; The requested min DTU per database if available. - RequestedDatabaseDtuMin *int32 - - // READ-ONLY; The requested DTU for the pool if available. - RequestedDtu *int32 - - // READ-ONLY; The requested DTU guarantee. - RequestedDtuGuarantee *int32 - - // READ-ONLY; The requested name for the elastic pool if available. - RequestedElasticPoolName *string - - // READ-ONLY; The requested storage limit for the pool in GB if available. - RequestedStorageLimitInGB *int64 - - // READ-ONLY; The requested storage limit in MB. - RequestedStorageLimitInMB *int32 - - // READ-ONLY; The name of the server the elastic pool is in. - ServerName *string - - // READ-ONLY; The time the operation started (ISO8601 format). - StartTime *time.Time - - // READ-ONLY; The current state of the operation. - State *string -} - -// ElasticPoolDatabaseActivity - Represents the activity on an elastic pool. -type ElasticPoolDatabaseActivity struct { - // The geo-location where the resource lives - Location *string - - // The properties representing the resource. - Properties *ElasticPoolDatabaseActivityProperties - - // READ-ONLY; Resource ID. - ID *string - - // READ-ONLY; Resource name. - Name *string - - // READ-ONLY; Resource type. - Type *string -} - -// ElasticPoolDatabaseActivityListResult - Represents the response to a list elastic pool database activity request. -type ElasticPoolDatabaseActivityListResult struct { - // REQUIRED; The list of elastic pool database activities. - Value []*ElasticPoolDatabaseActivity -} - -// ElasticPoolDatabaseActivityProperties - Represents the properties of an elastic pool database activity. -type ElasticPoolDatabaseActivityProperties struct { - // READ-ONLY; The name of the current elastic pool the database is in if available. - CurrentElasticPoolName *string - - // READ-ONLY; The name of the current service objective if available. - CurrentServiceObjective *string - - // READ-ONLY; The database name. - DatabaseName *string - - // READ-ONLY; The time the operation finished (ISO8601 format). - EndTime *time.Time - - // READ-ONLY; The error code if available. - ErrorCode *int32 - - // READ-ONLY; The error message if available. - ErrorMessage *string - - // READ-ONLY; The error severity if available. - ErrorSeverity *int32 - - // READ-ONLY; The operation name. - Operation *string - - // READ-ONLY; The unique operation ID. - OperationID *string - - // READ-ONLY; The percentage complete if available. - PercentComplete *int32 - - // READ-ONLY; The name for the elastic pool the database is moving into if available. - RequestedElasticPoolName *string - - // READ-ONLY; The name of the requested service objective if available. - RequestedServiceObjective *string - - // READ-ONLY; The name of the server the elastic pool is in. - ServerName *string - - // READ-ONLY; The time the operation started (ISO8601 format). - StartTime *time.Time - - // READ-ONLY; The current state of the operation. - State *string -} - // ElasticPoolEditionCapability - The elastic pool edition capability. type ElasticPoolEditionCapability struct { // The reason for the capability not being available. @@ -1886,6 +1886,9 @@ type ElasticPoolEditionCapability struct { // READ-ONLY; The list of supported elastic pool DTU levels for the edition. SupportedElasticPoolPerformanceLevels []*ElasticPoolPerformanceLevelCapability + // READ-ONLY; Whether or not zone pinning is supported for the edition. + ZonePinning *bool + // READ-ONLY; Whether or not zone redundancy is supported for the edition. ZoneRedundant *bool } @@ -2229,6 +2232,40 @@ type EndpointDetail struct { Port *int32 } +// ErrorAdditionalInfo - The resource management error additional info. +type ErrorAdditionalInfo struct { + // READ-ONLY; The additional info. + Info any + + // READ-ONLY; The additional info type. + Type *string +} + +// ErrorDetail - The error detail. +type ErrorDetail struct { + // READ-ONLY; The error additional info. + AdditionalInfo []*ErrorAdditionalInfo + + // READ-ONLY; The error code. + Code *string + + // READ-ONLY; The error details. + Details []*ErrorDetail + + // READ-ONLY; The error message. + Message *string + + // READ-ONLY; The error target. + Target *string +} + +// ErrorResponse - Common error response for all Azure Resource Manager APIs to return error details for failed operations. +// (This also follows the OData error response format.). +type ErrorResponse struct { + // The error object. + Error *ErrorDetail +} + // ExportDatabaseDefinition - Contains the information necessary to perform export database operation. type ExportDatabaseDefinition struct { // REQUIRED; Administrator login name. @@ -2525,6 +2562,9 @@ type FailoverGroupProperties struct { type FailoverGroupReadOnlyEndpoint struct { // Failover policy of the read-only endpoint for the failover group. FailoverPolicy *ReadOnlyEndpointFailoverPolicy + + // The target partner server where the read-only endpoint points to. + TargetServer *string } // FailoverGroupReadWriteEndpoint - Read-write endpoint of the failover group instance. @@ -2552,6 +2592,9 @@ type FailoverGroupUpdateProperties struct { // List of databases in the failover group. Databases []*string + // List of partner server information for the failover group. + PartnerServers []*PartnerInfo + // Read-only endpoint of the failover group instance. ReadOnlyEndpoint *FailoverGroupReadOnlyEndpoint @@ -2588,9 +2631,18 @@ type FirewallRuleListResult struct { Value []*FirewallRule } -// GeoBackupPolicy - A database geo backup policy. +// FreeLimitExhaustionBehaviorCapability - Supported free limit exhaustion behavior options +type FreeLimitExhaustionBehaviorCapability struct { + // READ-ONLY; Free limit exhaustion behavior type + ExhaustionBehaviorType *FreeLimitExhaustionBehavior + + // READ-ONLY; Free limit exhaustion behavior status + Status *CapabilityStatus +} + +// GeoBackupPolicy - A Geo backup policy. type GeoBackupPolicy struct { - // REQUIRED; The properties of the geo backup policy. + // Resource properties. Properties *GeoBackupPolicyProperties // READ-ONLY; Resource ID. @@ -2609,9 +2661,12 @@ type GeoBackupPolicy struct { Type *string } -// GeoBackupPolicyListResult - The response to a list geo backup policies request. +// GeoBackupPolicyListResult - The list of geo backup policies. type GeoBackupPolicyListResult struct { - // The list of geo backup policies. + // READ-ONLY; Link to retrieve next page of results. + NextLink *string + + // READ-ONLY; Array of results. Value []*GeoBackupPolicy } @@ -2650,7 +2705,7 @@ type IPv6FirewallRuleListResult struct { // IPv6ServerFirewallRuleProperties - The properties of an IPv6 server firewall rule. type IPv6ServerFirewallRuleProperties struct { - // The end IP address of the firewall rule. Must be IPv6 format. Must be greater than or equal to startIpv6Address. + // The end IP address of the firewall rule. Must be IPv6 format. Must be greater than or equal to startIpAddress. EndIPv6Address *string // The start IP address of the firewall rule. Must be IPv6 format. @@ -2707,6 +2762,9 @@ type ImportExportExtensionsOperationResult struct { // ImportExportExtensionsOperationResultProperties - Contains the operation result properties for import/export operation. type ImportExportExtensionsOperationResultProperties struct { + // READ-ONLY; Blob URI. + BlobURI *string + // READ-ONLY; Database name. DatabaseName *string @@ -2716,6 +2774,12 @@ type ImportExportExtensionsOperationResultProperties struct { // READ-ONLY; Last modified time. LastModifiedTime *string + // READ-ONLY; Gets the status of private endpoints associated with this request. + PrivateEndpointConnections []*PrivateEndpointConnectionRequestStatus + + // READ-ONLY; Queued time. + QueuedTime *string + // READ-ONLY; Request Id. RequestID *string @@ -2955,10 +3019,22 @@ type InstancePoolProperties struct { // REQUIRED; Count of vCores belonging to this instance pool. VCores *int32 + + // Specifies maintenance configuration id to apply to this managed instance. + MaintenanceConfigurationID *string + + // READ-ONLY; The Dns Zone that the managed instance pool is in. + DNSZone *string } // InstancePoolUpdate - An update to an Instance pool. type InstancePoolUpdate struct { + // Resource properties. + Properties *InstancePoolProperties + + // The name and tier of the SKU. + SKU *SKU + // Resource tags. Tags map[string]*string } @@ -3528,6 +3604,9 @@ type LongTermRetentionBackupOperationResult struct { // LongTermRetentionBackupProperties - Properties of a long term retention backup type LongTermRetentionBackupProperties struct { + // The setting whether the LTR backup is immutable + IsBackupImmutable *bool + // The storage redundancy type of the backup RequestedBackupStorageRedundancy *BackupStorageRedundancy @@ -3580,7 +3659,7 @@ type LongTermRetentionOperationResultProperties struct { // LongTermRetentionPolicy - A long term retention policy. type LongTermRetentionPolicy struct { // Resource properties. - Properties *BaseLongTermRetentionPolicyProperties + Properties *LongTermRetentionPolicyProperties // READ-ONLY; Resource ID. ID *string @@ -3601,6 +3680,24 @@ type LongTermRetentionPolicyListResult struct { Value []*LongTermRetentionPolicy } +// LongTermRetentionPolicyProperties - Properties of a long term retention policy +type LongTermRetentionPolicyProperties struct { + // The setting whether to make LTR backups immutable + MakeBackupsImmutable *bool + + // The monthly retention policy for an LTR backup in an ISO 8601 format. + MonthlyRetention *string + + // The week of year to take the yearly backup in an ISO 8601 format. + WeekOfYear *int32 + + // The weekly retention policy for an LTR backup in an ISO 8601 format. + WeeklyRetention *string + + // The yearly retention policy for an LTR backup in an ISO 8601 format. + YearlyRetention *string +} + // MaintenanceConfigurationCapability - The maintenance configuration capability type MaintenanceConfigurationCapability struct { // The reason for the capability not being available. @@ -4290,6 +4387,9 @@ type ManagedInstanceEditionCapability struct { // The reason for the capability not being available. Reason *string + // READ-ONLY; Whether or not this is a GPv2 variant of General Purpose edition. + IsGeneralPurposeV2 *bool + // READ-ONLY; The managed server version name. Name *string @@ -4301,9 +4401,6 @@ type ManagedInstanceEditionCapability struct { // READ-ONLY; The list of supported storage capabilities for this edition SupportedStorageCapabilities []*StorageCapability - - // READ-ONLY; Whether or not zone redundancy is supported for the edition. - ZoneRedundant *bool } // ManagedInstanceEncryptionProtector - The managed instance encryption protector. @@ -4391,6 +4488,9 @@ type ManagedInstanceFamilyCapability struct { // READ-ONLY; List of supported virtual cores values. SupportedVcoresValues []*ManagedInstanceVcoresCapability + + // READ-ONLY; Whether or not zone redundancy is supported for the family. + ZoneRedundant *bool } // ManagedInstanceKey - A managed instance key. @@ -4618,7 +4718,7 @@ type ManagedInstanceOperationSteps struct { CurrentStep *int32 // READ-ONLY; The operation steps list. - StepsList []*UpsertManagedServerOperationStep + StepsList []*UpsertManagedServerOperationStepWithEstimatesAndDuration // READ-ONLY; The total number of operation steps. TotalSteps *string @@ -4714,6 +4814,9 @@ type ManagedInstancePrivateLinkProperties struct { // READ-ONLY; The private link resource required member names. RequiredMembers []*string + + // READ-ONLY; The private link resource required zone names. + RequiredZoneNames []*string } type ManagedInstancePrivateLinkServiceConnectionStateProperty struct { @@ -4747,9 +4850,16 @@ type ManagedInstanceProperties struct { // The resource id of another managed instance whose DNS zone this managed instance will share after creation. DNSZonePartner *string + // Hybrid secondary usage. Possible values are 'Active' (default value) and 'Passive' (customer uses the secondary as Passive + // DR). + HybridSecondaryUsage *HybridSecondaryUsage + // The Id of the instance pool this managed server belongs to. InstancePoolID *string + // Whether or not this is a GPv2 variant of General Purpose edition. + IsGeneralPurposeV2 *bool + // A CMK URI of the key to use for encryption. KeyID *string @@ -4769,6 +4879,9 @@ type ManagedInstanceProperties struct { // Minimal TLS version. Allowed values: 'None', '1.0', '1.1', '1.2' MinimalTLSVersion *string + // Weather or not Managed Instance is freemium. + PricingModel *FreemiumType + // The resource id of a user assigned identity to be used by default. PrimaryUserAssignedIdentityID *string @@ -4792,10 +4905,18 @@ type ManagedInstanceProperties struct { // The resource identifier of the source managed instance associated with create operation of this instance. SourceManagedInstanceID *string + // Storage IOps. Minimum value: 120. Maximum value: 120000. Increments of 1 IOps allowed only. Maximum value depends on the + // selected hardware family and number of vCores. + StorageIOps *int32 + // Storage size in GB. Minimum value: 32. Maximum value: 16384. Increments of 32 GB allowed only. Maximum value depends on // the selected hardware family and number of vCores. StorageSizeInGB *int32 + // Storage throughput in MBps. Minimum value: 25. Maximum value: 4000. Increments of 1 MBps allowed only. Maximum value depends + // on the selected hardware family and number of vCores. + StorageThroughputMBps *int32 + // Subnet resource ID for the managed instance. SubnetID *string @@ -4813,6 +4934,9 @@ type ManagedInstanceProperties struct { // Whether or not the multi-az is enabled. ZoneRedundant *bool + // READ-ONLY; Specifies the point in time (ISO8601 format) of the Managed Instance creation. + CreateTime *time.Time + // READ-ONLY; The storage account type used to store backups for this instance. The options are Local (LocallyRedundantStorage), // Zone (ZoneRedundantStorage), Geo (GeoRedundantStorage) and // GeoZone(GeoZoneRedundantStorage) @@ -4821,17 +4945,28 @@ type ManagedInstanceProperties struct { // READ-ONLY; The Dns Zone that the managed instance is in. DNSZone *string + // READ-ONLY; Status of external governance. + ExternalGovernanceStatus *ExternalGovernanceStatus + // READ-ONLY; The fully qualified domain name of the managed instance. FullyQualifiedDomainName *string + // READ-ONLY; Hybrid secondary usage detected. Possible values are 'Active' (customer does not meet the requirements to use + // the secondary as Passive DR) and 'Passive' (customer meets the requirements to use the + // secondary as Passive DR). + HybridSecondaryUsageDetected *HybridSecondaryUsageDetected + // READ-ONLY; List of private endpoint connections on a managed instance. PrivateEndpointConnections []*ManagedInstancePecProperty - // READ-ONLY - ProvisioningState *ManagedInstancePropertiesProvisioningState + // READ-ONLY; Provisioning state of managed instance. + ProvisioningState *ProvisioningState // READ-ONLY; The state of the managed instance. State *string + + // READ-ONLY; Virtual cluster resource id for the Managed Instance. + VirtualClusterID *string } // ManagedInstanceQuery - Database query. @@ -4881,9 +5016,21 @@ type ManagedInstanceVcoresCapability struct { // READ-ONLY; Included size. IncludedMaxSize *MaxSizeCapability + // READ-ONLY; Included storage IOps. + IncludedStorageIOps *int64 + + // READ-ONLY; Included storage throughput MBps. + IncludedStorageThroughputMBps *int64 + // READ-ONLY; True if this service objective is supported for managed instances in an instance pool. InstancePoolSupported *bool + // READ-ONLY; Included IOps override factor per selected storage GB. + IopsIncludedValueOverrideFactorPerSelectedStorageGB *float64 + + // READ-ONLY; Min IOps override factor per selected storage GB. + IopsMinValueOverrideFactorPerSelectedStorageGB *float64 + // READ-ONLY; The virtual cores identifier. Name *string @@ -4896,9 +5043,21 @@ type ManagedInstanceVcoresCapability struct { // READ-ONLY; List of supported maintenance configurations SupportedMaintenanceConfigurations []*ManagedInstanceMaintenanceConfigurationCapability + // READ-ONLY; Storage IOps ranges. + SupportedStorageIOps *MaxLimitRangeCapability + // READ-ONLY; Storage size ranges. SupportedStorageSizes []*MaxSizeRangeCapability + // READ-ONLY; Storage throughput MBps ranges. + SupportedStorageThroughputMBps *MaxLimitRangeCapability + + // READ-ONLY; Included throughput MBps override factor per selected storage GB. + ThroughputMBpsIncludedValueOverrideFactorPerSelectedStorageGB *float64 + + // READ-ONLY; Min throughput MBps override factor per selected storage GB. + ThroughputMBpsMinValueOverrideFactorPerSelectedStorageGB *float64 + // READ-ONLY; The virtual cores value. Value *int32 } @@ -5099,6 +5258,24 @@ type ManagedTransparentDataEncryptionProperties struct { State *TransparentDataEncryptionState } +// MaxLimitRangeCapability - The maximum limit range capability. +type MaxLimitRangeCapability struct { + // The reason for the capability not being available. + Reason *string + + // READ-ONLY; Maximum value. + MaxValue *int64 + + // READ-ONLY; Minimum value. + MinValue *int64 + + // READ-ONLY; Scale/step size for discrete values between the minimum value and the maximum value. + ScaleSize *int64 + + // READ-ONLY; The status of the capability. + Status *CapabilityStatus +} + // MaxSizeCapability - The maximum size capability. type MaxSizeCapability struct { // READ-ONLY; The maximum size limit (see 'unit' for the units). @@ -5129,106 +5306,65 @@ type MaxSizeRangeCapability struct { Status *CapabilityStatus } -// Metric - Database metrics. -type Metric struct { - // READ-ONLY; The end time for the metric (ISO-8601 format). - EndTime *time.Time - - // READ-ONLY; The metric values for the specified time window and timestep. - MetricValues []*MetricValue - - // READ-ONLY; The name information for the metric. - Name *MetricName - - // READ-ONLY; The start time for the metric (ISO-8601 format). - StartTime *time.Time +// MinCapacityCapability - The min capacity capability +type MinCapacityCapability struct { + // The reason for the capability not being available. + Reason *string - // READ-ONLY; The time step to be used to summarize the metric values. - TimeGrain *string + // READ-ONLY; The status of the capability. + Status *CapabilityStatus - // READ-ONLY; The unit of the metric. - Unit *UnitType + // READ-ONLY; Min capacity value + Value *float64 } -// MetricAvailability - A metric availability value. -type MetricAvailability struct { - // READ-ONLY; The length of retention for the database metric. - Retention *string - - // READ-ONLY; The granularity of the database metric. - TimeGrain *string +type NSPConfigAccessRule struct { + Name *string + Properties *NSPConfigAccessRuleProperties } -// MetricDefinition - A database metric definition. -type MetricDefinition struct { - // READ-ONLY; The list of database metric availabilities for the metric. - MetricAvailabilities []*MetricAvailability - - // READ-ONLY; The name information for the metric. - Name *MetricName - - // READ-ONLY; The primary aggregation type defining how metric values are displayed. - PrimaryAggregationType *PrimaryAggregationType - - // READ-ONLY; The resource uri of the database. - ResourceURI *string - - // READ-ONLY; The unit of the metric. - Unit *UnitDefinitionType +type NSPConfigAccessRuleProperties struct { + AddressPrefixes []*string + Direction *string + FullyQualifiedDomainNames []*string + NetworkSecurityPerimeters []*NSPConfigNetworkSecurityPerimeterRule + Subscriptions []*string } -// MetricDefinitionListResult - The response to a list database metric definitions request. -type MetricDefinitionListResult struct { - // REQUIRED; The list of metric definitions for the database. - Value []*MetricDefinition +type NSPConfigAssociation struct { + AccessMode *string + Name *string } -// MetricListResult - The response to a list database metrics request. -type MetricListResult struct { - // REQUIRED; The list of metrics for the database. - Value []*Metric +type NSPConfigNetworkSecurityPerimeterRule struct { + ID *string + Location *string + PerimeterGUID *string } -// MetricName - A database metric name. -type MetricName struct { - // READ-ONLY; The friendly name of the database metric. - LocalizedValue *string - - // READ-ONLY; The name of the database metric. - Value *string +type NSPConfigPerimeter struct { + ID *string + Location *string + PerimeterGUID *string } -// MetricValue - Represents database metrics. -type MetricValue struct { - // READ-ONLY; The average value of the metric. - Average *float64 - - // READ-ONLY; The number of values for the metric. - Count *int32 - - // READ-ONLY; The max value of the metric. - Maximum *float64 - - // READ-ONLY; The min value of the metric. - Minimum *float64 - - // READ-ONLY; The metric timestamp (ISO-8601 format). - Timestamp *time.Time - - // READ-ONLY; The total value of the metric. - Total *float64 +type NSPConfigProfile struct { + AccessRules []*NSPConfigAccessRule + AccessRulesVersion *string + Name *string } -// MinCapacityCapability - The min capacity capability -type MinCapacityCapability struct { - // The reason for the capability not being available. - Reason *string - - // READ-ONLY; The status of the capability. - Status *CapabilityStatus +type NSPProvisioningIssue struct { + Name *string + Properties *NSPProvisioningIssueProperties +} - // READ-ONLY; Min capacity value - Value *float64 +type NSPProvisioningIssueProperties struct { + Description *string + IssueType *string + Severity *string + SuggestedAccessRules []*string + SuggestedResourceIDs []*string } // Name - ARM Usage Name @@ -5252,6 +5388,39 @@ type NetworkIsolationSettings struct { StorageAccountResourceID *string } +// NetworkSecurityPerimeterConfiguration - NSP Configuration for a server. +type NetworkSecurityPerimeterConfiguration struct { + // Resource properties. + Properties *NetworkSecurityPerimeterConfigurationProperties + + // READ-ONLY; Resource ID. + ID *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// NetworkSecurityPerimeterConfigurationListResult - A list of NSP configurations for a server. +type NetworkSecurityPerimeterConfigurationListResult struct { + // READ-ONLY; Link to retrieve next page of results. + NextLink *string + + // READ-ONLY; Array of results. + Value []*NetworkSecurityPerimeterConfiguration +} + +// NetworkSecurityPerimeterConfigurationProperties - The properties of an NSP config. +type NetworkSecurityPerimeterConfigurationProperties struct { + NetworkSecurityPerimeter *NSPConfigPerimeter + Profile *NSPConfigProfile + ProvisioningIssues []*NSPProvisioningIssue + ProvisioningState *string + ResourceAssociation *NSPConfigAssociation +} + // Operation - SQL REST API operation definition. type Operation struct { // READ-ONLY; The localized display information for this particular operation / action. @@ -5282,21 +5451,6 @@ type OperationDisplay struct { Resource *string } -// OperationImpact - The impact of an operation, both in absolute and relative terms. -type OperationImpact struct { - // READ-ONLY; The absolute impact to dimension. - ChangeValueAbsolute *float64 - - // READ-ONLY; The relative impact to dimension (null if not applicable) - ChangeValueRelative *float64 - - // READ-ONLY; The name of the impact dimension. - Name *string - - // READ-ONLY; The unit in which estimated impact to dimension is measured. - Unit *string -} - // OperationListResult - Result of the request to list SQL operations. type OperationListResult struct { // READ-ONLY; Link to retrieve next page of results. @@ -5385,6 +5539,15 @@ type PerformanceLevelCapability struct { Value *float64 } +// PhaseDetails - The phase details properties of a database operation. +type PhaseDetails struct { + // READ-ONLY; The operation phase. + Phase *Phase + + // READ-ONLY; The operation phase information. + PhaseInformation map[string]*string +} + // PrivateEndpointConnection - A private endpoint connection type PrivateEndpointConnection struct { // Resource properties. @@ -5919,6 +6082,21 @@ type RefreshExternalGovernanceStatusOperationResult struct { Type *string } +// RefreshExternalGovernanceStatusOperationResultMI - An RefreshExternalGovernanceStatus operation result resource. +type RefreshExternalGovernanceStatusOperationResultMI struct { + // Resource properties. + Properties *RefreshExternalGovernanceStatusOperationResultPropertiesMI + + // READ-ONLY; Resource ID. + ID *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + // RefreshExternalGovernanceStatusOperationResultProperties - Contains the operation result properties for refresh external // governance status operation. type RefreshExternalGovernanceStatusOperationResultProperties struct { @@ -5941,6 +6119,28 @@ type RefreshExternalGovernanceStatusOperationResultProperties struct { Status *string } +// RefreshExternalGovernanceStatusOperationResultPropertiesMI - Contains the operation result properties for refresh external +// governance status operation. +type RefreshExternalGovernanceStatusOperationResultPropertiesMI struct { + // READ-ONLY; Error message. + ErrorMessage *string + + // READ-ONLY; Managed instance name. + ManagedInstanceName *string + + // READ-ONLY; Queued time. + QueuedTime *string + + // READ-ONLY; Request Id. + RequestID *string + + // READ-ONLY; Request type. + RequestType *string + + // READ-ONLY; Operation status. + Status *string +} + // Remediation - SQL Vulnerability Assessment remediation Details. type Remediation struct { // READ-ONLY; SQL Vulnerability Assessment is remediation automated. @@ -5991,6 +6191,9 @@ type ReplicationLinkProperties struct { // READ-ONLY; Resource partner database. PartnerDatabase *string + // READ-ONLY; Resource partner database Id. + PartnerDatabaseID *string + // READ-ONLY; Resource partner location. PartnerLocation *string @@ -6415,6 +6618,8 @@ type SensitivityLabelListResult struct { // SensitivityLabelProperties - Properties of a sensitivity label. type SensitivityLabelProperties struct { + ClientClassificationSource *ClientClassificationSource + // The information type. InformationType *string @@ -6681,42 +6886,6 @@ type ServerBlobAuditingPolicyProperties struct { StorageEndpoint *string } -// ServerCommunicationLink - Server communication link. -type ServerCommunicationLink struct { - // The properties of resource. - Properties *ServerCommunicationLinkProperties - - // READ-ONLY; Resource ID. - ID *string - - // READ-ONLY; Communication link kind. This property is used for Azure Portal metadata. - Kind *string - - // READ-ONLY; Communication link location. - Location *string - - // READ-ONLY; Resource name. - Name *string - - // READ-ONLY; Resource type. - Type *string -} - -// ServerCommunicationLinkListResult - A list of server communication links. -type ServerCommunicationLinkListResult struct { - // The list of server communication links. - Value []*ServerCommunicationLink -} - -// ServerCommunicationLinkProperties - The properties of a server communication link. -type ServerCommunicationLinkProperties struct { - // REQUIRED; The name of the partner server. - PartnerServer *string - - // READ-ONLY; The state. - State *string -} - // ServerConfigurationOption - A server configuration option type ServerConfigurationOption struct { // Resource properties. @@ -6956,7 +7125,9 @@ type ServerKeyProperties struct { // REQUIRED; The server key type like 'ServiceManaged', 'AzureKeyVault'. ServerKeyType *ServerKeyType - // The URI of the server key. If the ServerKeyType is AzureKeyVault, then the URI is required. + // The URI of the server key. If the ServerKeyType is AzureKeyVault, then the URI is required. The AKV URI is required to + // be in this format: + // 'https://YourVaultName.vault.azure.net/keys/YourKeyName/YourKeyVersion' URI *string // READ-ONLY; Key auto rotation opt-in flag. Either true or false. @@ -7072,6 +7243,9 @@ type ServerProperties struct { // The Client id used for cross tenant CMK scenario FederatedClientID *string + // Whether or not to enable IPv6 support for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled' + IsIPv6Enabled *ServerNetworkAccessFlag + // A CMK URI of the key to use for encryption. KeyID *string @@ -7207,36 +7381,45 @@ type ServerUpdate struct { Tags map[string]*string } -// ServerUsage - Represents server metrics. +// ServerUsage - Usage metric of a server. type ServerUsage struct { - // READ-ONLY; The current value of the metric. - CurrentValue *float64 - - // READ-ONLY; The metric display name. - DisplayName *string + // Resource properties. + Properties *ServerUsageProperties - // READ-ONLY; The current limit of the metric. - Limit *float64 + // READ-ONLY; Resource ID. + ID *string - // READ-ONLY; Name of the server usage metric. + // READ-ONLY; Resource name. Name *string - // READ-ONLY; The next reset time for the metric (ISO8601 format). - NextResetTime *time.Time - - // READ-ONLY; The name of the resource. - ResourceName *string - - // READ-ONLY; The units of the metric. - Unit *string + // READ-ONLY; Resource type. + Type *string } -// ServerUsageListResult - Represents the response to a list server metrics request. +// ServerUsageListResult - A list of server usage metrics. type ServerUsageListResult struct { - // REQUIRED; The list of server metrics for the server. + // READ-ONLY; Link to retrieve next page of results. + NextLink *string + + // READ-ONLY; Array of results. Value []*ServerUsage } +// ServerUsageProperties - Properties of a server usage. +type ServerUsageProperties struct { + // READ-ONLY; Current value of the metric. + CurrentValue *float64 + + // READ-ONLY; User-readable name of the metric. + DisplayName *string + + // READ-ONLY; Boundary value of the metric. + Limit *float64 + + // READ-ONLY; Unit of the metric. + Unit *string +} + // ServerVersionCapability - The server capability type ServerVersionCapability struct { // The reason for the capability not being available. @@ -7298,21 +7481,6 @@ type ServerVulnerabilityAssessmentProperties struct { StorageContainerSasKey *string } -// ServiceObjective - Represents a database service objective. -type ServiceObjective struct { - // Represents the properties of the resource. - Properties *ServiceObjectiveProperties - - // READ-ONLY; Resource ID. - ID *string - - // READ-ONLY; Resource name. - Name *string - - // READ-ONLY; Resource type. - Type *string -} - // ServiceObjectiveCapability - The service objectives capability. type ServiceObjectiveCapability struct { // The reason for the capability not being available. @@ -7342,6 +7510,9 @@ type ServiceObjectiveCapability struct { // READ-ONLY; Supported time range for auto pause delay SupportedAutoPauseDelay *AutoPauseDelayTimeRange + // READ-ONLY; List of supported free limit exhaustion behaviors + SupportedFreeLimitExhaustionBehaviors []*FreeLimitExhaustionBehaviorCapability + // READ-ONLY; List of supported license types. SupportedLicenseTypes []*LicenseTypeCapability @@ -7354,34 +7525,13 @@ type ServiceObjectiveCapability struct { // READ-ONLY; List of supported min capacities SupportedMinCapacities []*MinCapacityCapability + // READ-ONLY; Whether or not zone pinning is supported. + ZonePinning *bool + // READ-ONLY; Whether or not zone redundancy is supported for the service objective. ZoneRedundant *bool } -// ServiceObjectiveListResult - Represents the response to a get database service objectives request. -type ServiceObjectiveListResult struct { - // REQUIRED; The list of database service objectives. - Value []*ServiceObjective -} - -// ServiceObjectiveProperties - Represents the properties of a database service objective. -type ServiceObjectiveProperties struct { - // READ-ONLY; The description for the service level objective. - Description *string - - // READ-ONLY; Gets whether the service level objective is enabled. - Enabled *bool - - // READ-ONLY; Gets whether the service level objective is the default service objective. - IsDefault *bool - - // READ-ONLY; Gets whether the service level objective is a system service objective. - IsSystem *bool - - // READ-ONLY; The name for the service objective. - ServiceObjectiveName *string -} - // ServicePrincipal - The managed instance's service principal configuration for a resource. type ServicePrincipal struct { // Service principal type. @@ -7397,18 +7547,6 @@ type ServicePrincipal struct { TenantID *string } -// SloUsageMetric - A Slo Usage Metric. -type SloUsageMetric struct { - // READ-ONLY; Gets or sets inRangeTimeRatio for SLO usage metric. - InRangeTimeRatio *float64 - - // READ-ONLY; The serviceLevelObjective for SLO usage metric. - ServiceLevelObjective *ServiceObjectiveName - - // READ-ONLY; The serviceLevelObjectiveId for SLO usage metric. - ServiceLevelObjectiveID *string -} - // StartStopManagedInstanceSchedule - Managed instance's Start/Stop schedule. type StartStopManagedInstanceSchedule struct { // Resource properties. @@ -7952,7 +8090,7 @@ type TdeCertificateProperties struct { CertPassword *string } -// TimeZone - Time Zone. +// TimeZone - Time Zone property. type TimeZone struct { // Resource properties. Properties *TimeZoneProperties @@ -8077,10 +8215,13 @@ type UpsertManagedServerOperationParameters struct { VCores *int32 } -type UpsertManagedServerOperationStep struct { - Name *string - Order *int32 - Status *UpsertManagedServerOperationStepStatus +type UpsertManagedServerOperationStepWithEstimatesAndDuration struct { + Name *string + Order *int32 + Status *Status + StepEndTime *time.Time + StepStartTime *time.Time + TimeElapsed *string } // Usage - ARM usage. diff --git a/sdk/resourcemanager/sql/armsql/models_serde.go b/sdk/resourcemanager/sql/armsql/models_serde.go index 33cb5960236c..d5c8932065c9 100644 --- a/sdk/resourcemanager/sql/armsql/models_serde.go +++ b/sdk/resourcemanager/sql/armsql/models_serde.go @@ -739,6 +739,41 @@ func (b *BenchmarkReference) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type CertificateInfo. +func (c CertificateInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "certificateId", c.CertificateID) + populate(objectMap, "certificateName", c.CertificateName) + populateTimeRFC3339(objectMap, "expiryDate", c.ExpiryDate) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CertificateInfo. +func (c *CertificateInfo) 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", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "certificateId": + err = unpopulate(val, "CertificateID", &c.CertificateID) + delete(rawMsg, key) + case "certificateName": + err = unpopulate(val, "CertificateName", &c.CertificateName) + delete(rawMsg, key) + case "expiryDate": + err = unpopulateTimeRFC3339(val, "ExpiryDate", &c.ExpiryDate) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type CheckNameAvailabilityRequest. func (c CheckNameAvailabilityRequest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -937,6 +972,49 @@ func (c *CreateDatabaseRestorePointDefinition) UnmarshalJSON(data []byte) error return nil } +// MarshalJSON implements the json.Marshaller interface for type CreateOrUpdateProperties. +func (c CreateOrUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "primaryAvailabilityGroupName", c.PrimaryAvailabilityGroupName) + populate(objectMap, "replicationMode", c.ReplicationMode) + populate(objectMap, "secondaryAvailabilityGroupName", c.SecondaryAvailabilityGroupName) + populate(objectMap, "sourceEndpoint", c.SourceEndpoint) + populate(objectMap, "targetDatabase", c.TargetDatabase) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CreateOrUpdateProperties. +func (c *CreateOrUpdateProperties) 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", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "primaryAvailabilityGroupName": + err = unpopulate(val, "PrimaryAvailabilityGroupName", &c.PrimaryAvailabilityGroupName) + delete(rawMsg, key) + case "replicationMode": + err = unpopulate(val, "ReplicationMode", &c.ReplicationMode) + delete(rawMsg, key) + case "secondaryAvailabilityGroupName": + err = unpopulate(val, "SecondaryAvailabilityGroupName", &c.SecondaryAvailabilityGroupName) + delete(rawMsg, key) + case "sourceEndpoint": + err = unpopulate(val, "SourceEndpoint", &c.SourceEndpoint) + delete(rawMsg, key) + case "targetDatabase": + err = unpopulate(val, "TargetDatabase", &c.TargetDatabase) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type DataMaskingPolicy. func (d DataMaskingPolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -1073,6 +1151,7 @@ func (d *DataMaskingRule) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DataMaskingRuleListResult. func (d DataMaskingRuleListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "nextLink", d.NextLink) populate(objectMap, "value", d.Value) return json.Marshal(objectMap) } @@ -1086,6 +1165,9 @@ func (d *DataMaskingRuleListResult) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &d.NextLink) + delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &d.Value) delete(rawMsg, key) @@ -1764,7 +1846,14 @@ func (d *DatabaseExtensions) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DatabaseExtensionsProperties. func (d DatabaseExtensionsProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "administratorLogin", d.AdministratorLogin) + populate(objectMap, "administratorLoginPassword", d.AdministratorLoginPassword) + populate(objectMap, "authenticationType", d.AuthenticationType) + populate(objectMap, "databaseEdition", d.DatabaseEdition) + populate(objectMap, "maxSizeBytes", d.MaxSizeBytes) + populate(objectMap, "networkIsolation", d.NetworkIsolation) populate(objectMap, "operationMode", d.OperationMode) + populate(objectMap, "serviceObjectiveName", d.ServiceObjectiveName) populate(objectMap, "storageKey", d.StorageKey) populate(objectMap, "storageKeyType", d.StorageKeyType) populate(objectMap, "storageUri", d.StorageURI) @@ -1780,9 +1869,30 @@ func (d *DatabaseExtensionsProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "administratorLogin": + err = unpopulate(val, "AdministratorLogin", &d.AdministratorLogin) + delete(rawMsg, key) + case "administratorLoginPassword": + err = unpopulate(val, "AdministratorLoginPassword", &d.AdministratorLoginPassword) + delete(rawMsg, key) + case "authenticationType": + err = unpopulate(val, "AuthenticationType", &d.AuthenticationType) + delete(rawMsg, key) + case "databaseEdition": + err = unpopulate(val, "DatabaseEdition", &d.DatabaseEdition) + delete(rawMsg, key) + case "maxSizeBytes": + err = unpopulate(val, "MaxSizeBytes", &d.MaxSizeBytes) + delete(rawMsg, key) + case "networkIsolation": + err = unpopulate(val, "NetworkIsolation", &d.NetworkIsolation) + delete(rawMsg, key) case "operationMode": err = unpopulate(val, "OperationMode", &d.OperationMode) delete(rawMsg, key) + case "serviceObjectiveName": + err = unpopulate(val, "ServiceObjectiveName", &d.ServiceObjectiveName) + delete(rawMsg, key) case "storageKey": err = unpopulate(val, "StorageKey", &d.StorageKey) delete(rawMsg, key) @@ -1988,6 +2098,7 @@ func (d DatabaseOperationProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "isUserError", d.IsUserError) populate(objectMap, "operation", d.Operation) populate(objectMap, "operationFriendlyName", d.OperationFriendlyName) + populate(objectMap, "operationPhaseDetails", d.OperationPhaseDetails) populate(objectMap, "percentComplete", d.PercentComplete) populate(objectMap, "serverName", d.ServerName) populateTimeRFC3339(objectMap, "startTime", d.StartTime) @@ -2034,6 +2145,9 @@ func (d *DatabaseOperationProperties) UnmarshalJSON(data []byte) error { case "operationFriendlyName": err = unpopulate(val, "OperationFriendlyName", &d.OperationFriendlyName) delete(rawMsg, key) + case "operationPhaseDetails": + err = unpopulate(val, "OperationPhaseDetails", &d.OperationPhaseDetails) + delete(rawMsg, key) case "percentComplete": err = unpopulate(val, "PercentComplete", &d.PercentComplete) delete(rawMsg, key) @@ -2071,8 +2185,10 @@ func (d DatabaseProperties) MarshalJSON() ([]byte, error) { populateTimeRFC3339(objectMap, "earliestRestoreDate", d.EarliestRestoreDate) populate(objectMap, "elasticPoolId", d.ElasticPoolID) populate(objectMap, "encryptionProtector", d.EncryptionProtector) + populate(objectMap, "encryptionProtectorAutoRotation", d.EncryptionProtectorAutoRotation) populate(objectMap, "failoverGroupId", d.FailoverGroupID) populate(objectMap, "federatedClientId", d.FederatedClientID) + populate(objectMap, "freeLimitExhaustionBehavior", d.FreeLimitExhaustionBehavior) populate(objectMap, "highAvailabilityReplicaCount", d.HighAvailabilityReplicaCount) populate(objectMap, "isInfraEncryptionEnabled", d.IsInfraEncryptionEnabled) populate(objectMap, "isLedgerOn", d.IsLedgerOn) @@ -2101,6 +2217,7 @@ func (d DatabaseProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "sourceDatabaseId", d.SourceDatabaseID) populate(objectMap, "sourceResourceId", d.SourceResourceID) populate(objectMap, "status", d.Status) + populate(objectMap, "useFreeLimit", d.UseFreeLimit) populate(objectMap, "zoneRedundant", d.ZoneRedundant) return json.Marshal(objectMap) } @@ -2156,12 +2273,18 @@ func (d *DatabaseProperties) UnmarshalJSON(data []byte) error { case "encryptionProtector": err = unpopulate(val, "EncryptionProtector", &d.EncryptionProtector) delete(rawMsg, key) + case "encryptionProtectorAutoRotation": + err = unpopulate(val, "EncryptionProtectorAutoRotation", &d.EncryptionProtectorAutoRotation) + delete(rawMsg, key) case "failoverGroupId": err = unpopulate(val, "FailoverGroupID", &d.FailoverGroupID) delete(rawMsg, key) case "federatedClientId": err = unpopulate(val, "FederatedClientID", &d.FederatedClientID) delete(rawMsg, key) + case "freeLimitExhaustionBehavior": + err = unpopulate(val, "FreeLimitExhaustionBehavior", &d.FreeLimitExhaustionBehavior) + delete(rawMsg, key) case "highAvailabilityReplicaCount": err = unpopulate(val, "HighAvailabilityReplicaCount", &d.HighAvailabilityReplicaCount) delete(rawMsg, key) @@ -2246,6 +2369,9 @@ func (d *DatabaseProperties) UnmarshalJSON(data []byte) error { case "status": err = unpopulate(val, "Status", &d.Status) delete(rawMsg, key) + case "useFreeLimit": + err = unpopulate(val, "UseFreeLimit", &d.UseFreeLimit) + delete(rawMsg, key) case "zoneRedundant": err = unpopulate(val, "ZoneRedundant", &d.ZoneRedundant) delete(rawMsg, key) @@ -2903,8 +3029,10 @@ func (d DatabaseUpdateProperties) MarshalJSON() ([]byte, error) { populateTimeRFC3339(objectMap, "earliestRestoreDate", d.EarliestRestoreDate) populate(objectMap, "elasticPoolId", d.ElasticPoolID) populate(objectMap, "encryptionProtector", d.EncryptionProtector) + populate(objectMap, "encryptionProtectorAutoRotation", d.EncryptionProtectorAutoRotation) populate(objectMap, "failoverGroupId", d.FailoverGroupID) populate(objectMap, "federatedClientId", d.FederatedClientID) + populate(objectMap, "freeLimitExhaustionBehavior", d.FreeLimitExhaustionBehavior) populate(objectMap, "highAvailabilityReplicaCount", d.HighAvailabilityReplicaCount) populate(objectMap, "isInfraEncryptionEnabled", d.IsInfraEncryptionEnabled) populate(objectMap, "isLedgerOn", d.IsLedgerOn) @@ -2932,6 +3060,7 @@ func (d DatabaseUpdateProperties) MarshalJSON() ([]byte, error) { populateTimeRFC3339(objectMap, "sourceDatabaseDeletionDate", d.SourceDatabaseDeletionDate) populate(objectMap, "sourceDatabaseId", d.SourceDatabaseID) populate(objectMap, "status", d.Status) + populate(objectMap, "useFreeLimit", d.UseFreeLimit) populate(objectMap, "zoneRedundant", d.ZoneRedundant) return json.Marshal(objectMap) } @@ -2984,12 +3113,18 @@ func (d *DatabaseUpdateProperties) UnmarshalJSON(data []byte) error { case "encryptionProtector": err = unpopulate(val, "EncryptionProtector", &d.EncryptionProtector) delete(rawMsg, key) + case "encryptionProtectorAutoRotation": + err = unpopulate(val, "EncryptionProtectorAutoRotation", &d.EncryptionProtectorAutoRotation) + delete(rawMsg, key) case "failoverGroupId": err = unpopulate(val, "FailoverGroupID", &d.FailoverGroupID) delete(rawMsg, key) case "federatedClientId": err = unpopulate(val, "FederatedClientID", &d.FederatedClientID) delete(rawMsg, key) + case "freeLimitExhaustionBehavior": + err = unpopulate(val, "FreeLimitExhaustionBehavior", &d.FreeLimitExhaustionBehavior) + delete(rawMsg, key) case "highAvailabilityReplicaCount": err = unpopulate(val, "HighAvailabilityReplicaCount", &d.HighAvailabilityReplicaCount) delete(rawMsg, key) @@ -3071,6 +3206,9 @@ func (d *DatabaseUpdateProperties) UnmarshalJSON(data []byte) error { case "status": err = unpopulate(val, "Status", &d.Status) delete(rawMsg, key) + case "useFreeLimit": + err = unpopulate(val, "UseFreeLimit", &d.UseFreeLimit) + delete(rawMsg, key) case "zoneRedundant": err = unpopulate(val, "ZoneRedundant", &d.ZoneRedundant) delete(rawMsg, key) @@ -3638,19 +3776,121 @@ func (d *DistributedAvailabilityGroup) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type DistributedAvailabilityGroupDatabase. +func (d DistributedAvailabilityGroupDatabase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "connectedState", d.ConnectedState) + populate(objectMap, "databaseName", d.DatabaseName) + populate(objectMap, "instanceRedoReplicationLagSeconds", d.InstanceRedoReplicationLagSeconds) + populate(objectMap, "instanceReplicaId", d.InstanceReplicaID) + populate(objectMap, "instanceSendReplicationLagSeconds", d.InstanceSendReplicationLagSeconds) + populate(objectMap, "lastBackupLsn", d.LastBackupLsn) + populateTimeRFC3339(objectMap, "lastBackupTime", d.LastBackupTime) + populate(objectMap, "lastCommitLsn", d.LastCommitLsn) + populateTimeRFC3339(objectMap, "lastCommitTime", d.LastCommitTime) + populate(objectMap, "lastHardenedLsn", d.LastHardenedLsn) + populateTimeRFC3339(objectMap, "lastHardenedTime", d.LastHardenedTime) + populate(objectMap, "lastReceivedLsn", d.LastReceivedLsn) + populateTimeRFC3339(objectMap, "lastReceivedTime", d.LastReceivedTime) + populate(objectMap, "lastSentLsn", d.LastSentLsn) + populateTimeRFC3339(objectMap, "lastSentTime", d.LastSentTime) + populate(objectMap, "mostRecentLinkError", d.MostRecentLinkError) + populate(objectMap, "partnerAuthCertValidity", d.PartnerAuthCertValidity) + populate(objectMap, "partnerReplicaId", d.PartnerReplicaID) + populate(objectMap, "replicaState", d.ReplicaState) + populate(objectMap, "synchronizationHealth", d.SynchronizationHealth) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DistributedAvailabilityGroupDatabase. +func (d *DistributedAvailabilityGroupDatabase) 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "connectedState": + err = unpopulate(val, "ConnectedState", &d.ConnectedState) + delete(rawMsg, key) + case "databaseName": + err = unpopulate(val, "DatabaseName", &d.DatabaseName) + delete(rawMsg, key) + case "instanceRedoReplicationLagSeconds": + err = unpopulate(val, "InstanceRedoReplicationLagSeconds", &d.InstanceRedoReplicationLagSeconds) + delete(rawMsg, key) + case "instanceReplicaId": + err = unpopulate(val, "InstanceReplicaID", &d.InstanceReplicaID) + delete(rawMsg, key) + case "instanceSendReplicationLagSeconds": + err = unpopulate(val, "InstanceSendReplicationLagSeconds", &d.InstanceSendReplicationLagSeconds) + delete(rawMsg, key) + case "lastBackupLsn": + err = unpopulate(val, "LastBackupLsn", &d.LastBackupLsn) + delete(rawMsg, key) + case "lastBackupTime": + err = unpopulateTimeRFC3339(val, "LastBackupTime", &d.LastBackupTime) + delete(rawMsg, key) + case "lastCommitLsn": + err = unpopulate(val, "LastCommitLsn", &d.LastCommitLsn) + delete(rawMsg, key) + case "lastCommitTime": + err = unpopulateTimeRFC3339(val, "LastCommitTime", &d.LastCommitTime) + delete(rawMsg, key) + case "lastHardenedLsn": + err = unpopulate(val, "LastHardenedLsn", &d.LastHardenedLsn) + delete(rawMsg, key) + case "lastHardenedTime": + err = unpopulateTimeRFC3339(val, "LastHardenedTime", &d.LastHardenedTime) + delete(rawMsg, key) + case "lastReceivedLsn": + err = unpopulate(val, "LastReceivedLsn", &d.LastReceivedLsn) + delete(rawMsg, key) + case "lastReceivedTime": + err = unpopulateTimeRFC3339(val, "LastReceivedTime", &d.LastReceivedTime) + delete(rawMsg, key) + case "lastSentLsn": + err = unpopulate(val, "LastSentLsn", &d.LastSentLsn) + delete(rawMsg, key) + case "lastSentTime": + err = unpopulateTimeRFC3339(val, "LastSentTime", &d.LastSentTime) + delete(rawMsg, key) + case "mostRecentLinkError": + err = unpopulate(val, "MostRecentLinkError", &d.MostRecentLinkError) + delete(rawMsg, key) + case "partnerAuthCertValidity": + err = unpopulate(val, "PartnerAuthCertValidity", &d.PartnerAuthCertValidity) + delete(rawMsg, key) + case "partnerReplicaId": + err = unpopulate(val, "PartnerReplicaID", &d.PartnerReplicaID) + delete(rawMsg, key) + case "replicaState": + err = unpopulate(val, "ReplicaState", &d.ReplicaState) + delete(rawMsg, key) + case "synchronizationHealth": + err = unpopulate(val, "SynchronizationHealth", &d.SynchronizationHealth) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type DistributedAvailabilityGroupProperties. func (d DistributedAvailabilityGroupProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "databases", d.Databases) populate(objectMap, "distributedAvailabilityGroupId", d.DistributedAvailabilityGroupID) - populate(objectMap, "lastHardenedLsn", d.LastHardenedLsn) - populate(objectMap, "linkState", d.LinkState) - populate(objectMap, "primaryAvailabilityGroupName", d.PrimaryAvailabilityGroupName) + populate(objectMap, "distributedAvailabilityGroupName", d.DistributedAvailabilityGroupName) + populate(objectMap, "instanceAvailabilityGroupName", d.InstanceAvailabilityGroupName) + populate(objectMap, "instanceLinkRole", d.InstanceLinkRole) + populate(objectMap, "partnerAvailabilityGroupName", d.PartnerAvailabilityGroupName) + populate(objectMap, "partnerEndpoint", d.PartnerEndpoint) + populate(objectMap, "partnerLinkRole", d.PartnerLinkRole) populate(objectMap, "replicationMode", d.ReplicationMode) - populate(objectMap, "secondaryAvailabilityGroupName", d.SecondaryAvailabilityGroupName) - populate(objectMap, "sourceEndpoint", d.SourceEndpoint) - populate(objectMap, "sourceReplicaId", d.SourceReplicaID) - populate(objectMap, "targetDatabase", d.TargetDatabase) - populate(objectMap, "targetReplicaId", d.TargetReplicaID) return json.Marshal(objectMap) } @@ -3663,35 +3903,90 @@ func (d *DistributedAvailabilityGroupProperties) UnmarshalJSON(data []byte) erro for key, val := range rawMsg { var err error switch key { + case "databases": + err = unpopulate(val, "Databases", &d.Databases) + delete(rawMsg, key) case "distributedAvailabilityGroupId": err = unpopulate(val, "DistributedAvailabilityGroupID", &d.DistributedAvailabilityGroupID) delete(rawMsg, key) - case "lastHardenedLsn": - err = unpopulate(val, "LastHardenedLsn", &d.LastHardenedLsn) + case "distributedAvailabilityGroupName": + err = unpopulate(val, "DistributedAvailabilityGroupName", &d.DistributedAvailabilityGroupName) delete(rawMsg, key) - case "linkState": - err = unpopulate(val, "LinkState", &d.LinkState) + case "instanceAvailabilityGroupName": + err = unpopulate(val, "InstanceAvailabilityGroupName", &d.InstanceAvailabilityGroupName) delete(rawMsg, key) - case "primaryAvailabilityGroupName": - err = unpopulate(val, "PrimaryAvailabilityGroupName", &d.PrimaryAvailabilityGroupName) + case "instanceLinkRole": + err = unpopulate(val, "InstanceLinkRole", &d.InstanceLinkRole) delete(rawMsg, key) - case "replicationMode": - err = unpopulate(val, "ReplicationMode", &d.ReplicationMode) + case "partnerAvailabilityGroupName": + err = unpopulate(val, "PartnerAvailabilityGroupName", &d.PartnerAvailabilityGroupName) delete(rawMsg, key) - case "secondaryAvailabilityGroupName": - err = unpopulate(val, "SecondaryAvailabilityGroupName", &d.SecondaryAvailabilityGroupName) + case "partnerEndpoint": + err = unpopulate(val, "PartnerEndpoint", &d.PartnerEndpoint) delete(rawMsg, key) - case "sourceEndpoint": - err = unpopulate(val, "SourceEndpoint", &d.SourceEndpoint) + case "partnerLinkRole": + err = unpopulate(val, "PartnerLinkRole", &d.PartnerLinkRole) delete(rawMsg, key) - case "sourceReplicaId": - err = unpopulate(val, "SourceReplicaID", &d.SourceReplicaID) + case "replicationMode": + err = unpopulate(val, "ReplicationMode", &d.ReplicationMode) delete(rawMsg, key) - case "targetDatabase": - err = unpopulate(val, "TargetDatabase", &d.TargetDatabase) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DistributedAvailabilityGroupSetRole. +func (d DistributedAvailabilityGroupSetRole) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "instanceRole", d.InstanceRole) + populate(objectMap, "roleChangeType", d.RoleChangeType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DistributedAvailabilityGroupSetRole. +func (d *DistributedAvailabilityGroupSetRole) 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "instanceRole": + err = unpopulate(val, "InstanceRole", &d.InstanceRole) + delete(rawMsg, key) + case "roleChangeType": + err = unpopulate(val, "RoleChangeType", &d.RoleChangeType) delete(rawMsg, key) - case "targetReplicaId": - err = unpopulate(val, "TargetReplicaID", &d.TargetReplicaID) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DistributedAvailabilityGroupsCreateOrUpdateRequestBody. +func (d DistributedAvailabilityGroupsCreateOrUpdateRequestBody) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", d.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DistributedAvailabilityGroupsCreateOrUpdateRequestBody. +func (d *DistributedAvailabilityGroupsCreateOrUpdateRequestBody) 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &d.Properties) delete(rawMsg, key) } if err != nil { @@ -3741,6 +4036,7 @@ func (e EditionCapability) MarshalJSON() ([]byte, error) { populate(objectMap, "status", e.Status) populate(objectMap, "supportedServiceLevelObjectives", e.SupportedServiceLevelObjectives) populate(objectMap, "supportedStorageCapabilities", e.SupportedStorageCapabilities) + populate(objectMap, "zonePinning", e.ZonePinning) populate(objectMap, "zoneRedundant", e.ZoneRedundant) return json.Marshal(objectMap) } @@ -3772,6 +4068,9 @@ func (e *EditionCapability) UnmarshalJSON(data []byte) error { case "supportedStorageCapabilities": err = unpopulate(val, "SupportedStorageCapabilities", &e.SupportedStorageCapabilities) delete(rawMsg, key) + case "zonePinning": + err = unpopulate(val, "ZonePinning", &e.ZonePinning) + delete(rawMsg, key) case "zoneRedundant": err = unpopulate(val, "ZoneRedundant", &e.ZoneRedundant) delete(rawMsg, key) @@ -3838,19 +4137,20 @@ func (e *ElasticPool) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ElasticPoolActivity. -func (e ElasticPoolActivity) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ElasticPoolEditionCapability. +func (e ElasticPoolEditionCapability) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", e.ID) - populate(objectMap, "location", e.Location) populate(objectMap, "name", e.Name) - populate(objectMap, "properties", e.Properties) - populate(objectMap, "type", e.Type) + populate(objectMap, "reason", e.Reason) + populate(objectMap, "status", e.Status) + populate(objectMap, "supportedElasticPoolPerformanceLevels", e.SupportedElasticPoolPerformanceLevels) + populate(objectMap, "zonePinning", e.ZonePinning) + populate(objectMap, "zoneRedundant", e.ZoneRedundant) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticPoolActivity. -func (e *ElasticPoolActivity) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticPoolEditionCapability. +func (e *ElasticPoolEditionCapability) 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", e, err) @@ -3858,20 +4158,23 @@ func (e *ElasticPoolActivity) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &e.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &e.Location) - delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &e.Name) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &e.Properties) + case "reason": + err = unpopulate(val, "Reason", &e.Reason) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &e.Type) + case "status": + err = unpopulate(val, "Status", &e.Status) + delete(rawMsg, key) + case "supportedElasticPoolPerformanceLevels": + err = unpopulate(val, "SupportedElasticPoolPerformanceLevels", &e.SupportedElasticPoolPerformanceLevels) + delete(rawMsg, key) + case "zonePinning": + err = unpopulate(val, "ZonePinning", &e.ZonePinning) + delete(rawMsg, key) + case "zoneRedundant": + err = unpopulate(val, "ZoneRedundant", &e.ZoneRedundant) delete(rawMsg, key) } if err != nil { @@ -3881,15 +4184,16 @@ func (e *ElasticPoolActivity) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ElasticPoolActivityListResult. -func (e ElasticPoolActivityListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ElasticPoolListResult. +func (e ElasticPoolListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "nextLink", e.NextLink) populate(objectMap, "value", e.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticPoolActivityListResult. -func (e *ElasticPoolActivityListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticPoolListResult. +func (e *ElasticPoolListResult) 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", e, err) @@ -3897,6 +4201,9 @@ func (e *ElasticPoolActivityListResult) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &e.NextLink) + delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &e.Value) delete(rawMsg, key) @@ -3908,34 +4215,18 @@ func (e *ElasticPoolActivityListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ElasticPoolActivityProperties. -func (e ElasticPoolActivityProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ElasticPoolOperation. +func (e ElasticPoolOperation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "elasticPoolName", e.ElasticPoolName) - populateTimeRFC3339(objectMap, "endTime", e.EndTime) - populate(objectMap, "errorCode", e.ErrorCode) - populate(objectMap, "errorMessage", e.ErrorMessage) - populate(objectMap, "errorSeverity", e.ErrorSeverity) - populate(objectMap, "operation", e.Operation) - populate(objectMap, "operationId", e.OperationID) - populate(objectMap, "percentComplete", e.PercentComplete) - populate(objectMap, "requestedDatabaseDtuCap", e.RequestedDatabaseDtuCap) - populate(objectMap, "requestedDatabaseDtuGuarantee", e.RequestedDatabaseDtuGuarantee) - populate(objectMap, "requestedDatabaseDtuMax", e.RequestedDatabaseDtuMax) - populate(objectMap, "requestedDatabaseDtuMin", e.RequestedDatabaseDtuMin) - populate(objectMap, "requestedDtu", e.RequestedDtu) - populate(objectMap, "requestedDtuGuarantee", e.RequestedDtuGuarantee) - populate(objectMap, "requestedElasticPoolName", e.RequestedElasticPoolName) - populate(objectMap, "requestedStorageLimitInGB", e.RequestedStorageLimitInGB) - populate(objectMap, "requestedStorageLimitInMB", e.RequestedStorageLimitInMB) - populate(objectMap, "serverName", e.ServerName) - populateTimeRFC3339(objectMap, "startTime", e.StartTime) - populate(objectMap, "state", e.State) + populate(objectMap, "id", e.ID) + populate(objectMap, "name", e.Name) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "type", e.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticPoolActivityProperties. -func (e *ElasticPoolActivityProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticPoolOperation. +func (e *ElasticPoolOperation) 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", e, err) @@ -3943,331 +4234,17 @@ func (e *ElasticPoolActivityProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "elasticPoolName": - err = unpopulate(val, "ElasticPoolName", &e.ElasticPoolName) - delete(rawMsg, key) - case "endTime": - err = unpopulateTimeRFC3339(val, "EndTime", &e.EndTime) - delete(rawMsg, key) - case "errorCode": - err = unpopulate(val, "ErrorCode", &e.ErrorCode) + case "id": + err = unpopulate(val, "ID", &e.ID) delete(rawMsg, key) - case "errorMessage": - err = unpopulate(val, "ErrorMessage", &e.ErrorMessage) + case "name": + err = unpopulate(val, "Name", &e.Name) delete(rawMsg, key) - case "errorSeverity": - err = unpopulate(val, "ErrorSeverity", &e.ErrorSeverity) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) delete(rawMsg, key) - case "operation": - err = unpopulate(val, "Operation", &e.Operation) - delete(rawMsg, key) - case "operationId": - err = unpopulate(val, "OperationID", &e.OperationID) - delete(rawMsg, key) - case "percentComplete": - err = unpopulate(val, "PercentComplete", &e.PercentComplete) - delete(rawMsg, key) - case "requestedDatabaseDtuCap": - err = unpopulate(val, "RequestedDatabaseDtuCap", &e.RequestedDatabaseDtuCap) - delete(rawMsg, key) - case "requestedDatabaseDtuGuarantee": - err = unpopulate(val, "RequestedDatabaseDtuGuarantee", &e.RequestedDatabaseDtuGuarantee) - delete(rawMsg, key) - case "requestedDatabaseDtuMax": - err = unpopulate(val, "RequestedDatabaseDtuMax", &e.RequestedDatabaseDtuMax) - delete(rawMsg, key) - case "requestedDatabaseDtuMin": - err = unpopulate(val, "RequestedDatabaseDtuMin", &e.RequestedDatabaseDtuMin) - delete(rawMsg, key) - case "requestedDtu": - err = unpopulate(val, "RequestedDtu", &e.RequestedDtu) - delete(rawMsg, key) - case "requestedDtuGuarantee": - err = unpopulate(val, "RequestedDtuGuarantee", &e.RequestedDtuGuarantee) - delete(rawMsg, key) - case "requestedElasticPoolName": - err = unpopulate(val, "RequestedElasticPoolName", &e.RequestedElasticPoolName) - delete(rawMsg, key) - case "requestedStorageLimitInGB": - err = unpopulate(val, "RequestedStorageLimitInGB", &e.RequestedStorageLimitInGB) - delete(rawMsg, key) - case "requestedStorageLimitInMB": - err = unpopulate(val, "RequestedStorageLimitInMB", &e.RequestedStorageLimitInMB) - delete(rawMsg, key) - case "serverName": - err = unpopulate(val, "ServerName", &e.ServerName) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &e.StartTime) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &e.State) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ElasticPoolDatabaseActivity. -func (e ElasticPoolDatabaseActivity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", e.ID) - populate(objectMap, "location", e.Location) - populate(objectMap, "name", e.Name) - populate(objectMap, "properties", e.Properties) - populate(objectMap, "type", e.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticPoolDatabaseActivity. -func (e *ElasticPoolDatabaseActivity) 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", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &e.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &e.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &e.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &e.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &e.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ElasticPoolDatabaseActivityListResult. -func (e ElasticPoolDatabaseActivityListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "value", e.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticPoolDatabaseActivityListResult. -func (e *ElasticPoolDatabaseActivityListResult) 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", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "value": - err = unpopulate(val, "Value", &e.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ElasticPoolDatabaseActivityProperties. -func (e ElasticPoolDatabaseActivityProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "currentElasticPoolName", e.CurrentElasticPoolName) - populate(objectMap, "currentServiceObjective", e.CurrentServiceObjective) - populate(objectMap, "databaseName", e.DatabaseName) - populateTimeRFC3339(objectMap, "endTime", e.EndTime) - populate(objectMap, "errorCode", e.ErrorCode) - populate(objectMap, "errorMessage", e.ErrorMessage) - populate(objectMap, "errorSeverity", e.ErrorSeverity) - populate(objectMap, "operation", e.Operation) - populate(objectMap, "operationId", e.OperationID) - populate(objectMap, "percentComplete", e.PercentComplete) - populate(objectMap, "requestedElasticPoolName", e.RequestedElasticPoolName) - populate(objectMap, "requestedServiceObjective", e.RequestedServiceObjective) - populate(objectMap, "serverName", e.ServerName) - populateTimeRFC3339(objectMap, "startTime", e.StartTime) - populate(objectMap, "state", e.State) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticPoolDatabaseActivityProperties. -func (e *ElasticPoolDatabaseActivityProperties) 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", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "currentElasticPoolName": - err = unpopulate(val, "CurrentElasticPoolName", &e.CurrentElasticPoolName) - delete(rawMsg, key) - case "currentServiceObjective": - err = unpopulate(val, "CurrentServiceObjective", &e.CurrentServiceObjective) - delete(rawMsg, key) - case "databaseName": - err = unpopulate(val, "DatabaseName", &e.DatabaseName) - delete(rawMsg, key) - case "endTime": - err = unpopulateTimeRFC3339(val, "EndTime", &e.EndTime) - delete(rawMsg, key) - case "errorCode": - err = unpopulate(val, "ErrorCode", &e.ErrorCode) - delete(rawMsg, key) - case "errorMessage": - err = unpopulate(val, "ErrorMessage", &e.ErrorMessage) - delete(rawMsg, key) - case "errorSeverity": - err = unpopulate(val, "ErrorSeverity", &e.ErrorSeverity) - delete(rawMsg, key) - case "operation": - err = unpopulate(val, "Operation", &e.Operation) - delete(rawMsg, key) - case "operationId": - err = unpopulate(val, "OperationID", &e.OperationID) - delete(rawMsg, key) - case "percentComplete": - err = unpopulate(val, "PercentComplete", &e.PercentComplete) - delete(rawMsg, key) - case "requestedElasticPoolName": - err = unpopulate(val, "RequestedElasticPoolName", &e.RequestedElasticPoolName) - delete(rawMsg, key) - case "requestedServiceObjective": - err = unpopulate(val, "RequestedServiceObjective", &e.RequestedServiceObjective) - delete(rawMsg, key) - case "serverName": - err = unpopulate(val, "ServerName", &e.ServerName) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &e.StartTime) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &e.State) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ElasticPoolEditionCapability. -func (e ElasticPoolEditionCapability) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", e.Name) - populate(objectMap, "reason", e.Reason) - populate(objectMap, "status", e.Status) - populate(objectMap, "supportedElasticPoolPerformanceLevels", e.SupportedElasticPoolPerformanceLevels) - populate(objectMap, "zoneRedundant", e.ZoneRedundant) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticPoolEditionCapability. -func (e *ElasticPoolEditionCapability) 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", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &e.Name) - delete(rawMsg, key) - case "reason": - err = unpopulate(val, "Reason", &e.Reason) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &e.Status) - delete(rawMsg, key) - case "supportedElasticPoolPerformanceLevels": - err = unpopulate(val, "SupportedElasticPoolPerformanceLevels", &e.SupportedElasticPoolPerformanceLevels) - delete(rawMsg, key) - case "zoneRedundant": - err = unpopulate(val, "ZoneRedundant", &e.ZoneRedundant) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ElasticPoolListResult. -func (e ElasticPoolListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", e.NextLink) - populate(objectMap, "value", e.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticPoolListResult. -func (e *ElasticPoolListResult) 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", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &e.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &e.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ElasticPoolOperation. -func (e ElasticPoolOperation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", e.ID) - populate(objectMap, "name", e.Name) - populate(objectMap, "properties", e.Properties) - populate(objectMap, "type", e.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticPoolOperation. -func (e *ElasticPoolOperation) 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", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &e.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &e.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &e.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &e.Type) + case "type": + err = unpopulate(val, "Type", &e.Type) delete(rawMsg, key) } if err != nil { @@ -5012,7 +4989,108 @@ func (e *EndpointDetail) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ExportDatabaseDefinition. +// MarshalJSON implements the json.Marshaller interface for type ErrorAdditionalInfo. +func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateAny(objectMap, "info", e.Info) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorAdditionalInfo. +func (e *ErrorAdditionalInfo) 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", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "info": + err = unpopulate(val, "Info", &e.Info) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ErrorDetail. +func (e ErrorDetail) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "additionalInfo", e.AdditionalInfo) + populate(objectMap, "code", e.Code) + populate(objectMap, "details", e.Details) + populate(objectMap, "message", e.Message) + populate(objectMap, "target", e.Target) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetail. +func (e *ErrorDetail) 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", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "additionalInfo": + err = unpopulate(val, "AdditionalInfo", &e.AdditionalInfo) + delete(rawMsg, key) + case "code": + err = unpopulate(val, "Code", &e.Code) + delete(rawMsg, key) + case "details": + err = unpopulate(val, "Details", &e.Details) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &e.Message) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &e.Target) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ErrorResponse. +func (e ErrorResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "error", e.Error) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse. +func (e *ErrorResponse) 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", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "error": + err = unpopulate(val, "Error", &e.Error) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ExportDatabaseDefinition. func (e ExportDatabaseDefinition) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "administratorLogin", e.AdministratorLogin) @@ -5470,6 +5548,7 @@ func (f *FailoverGroupProperties) UnmarshalJSON(data []byte) error { func (f FailoverGroupReadOnlyEndpoint) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "failoverPolicy", f.FailoverPolicy) + populate(objectMap, "targetServer", f.TargetServer) return json.Marshal(objectMap) } @@ -5485,6 +5564,9 @@ func (f *FailoverGroupReadOnlyEndpoint) UnmarshalJSON(data []byte) error { case "failoverPolicy": err = unpopulate(val, "FailoverPolicy", &f.FailoverPolicy) delete(rawMsg, key) + case "targetServer": + err = unpopulate(val, "TargetServer", &f.TargetServer) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", f, err) @@ -5559,6 +5641,7 @@ func (f *FailoverGroupUpdate) UnmarshalJSON(data []byte) error { func (f FailoverGroupUpdateProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "databases", f.Databases) + populate(objectMap, "partnerServers", f.PartnerServers) populate(objectMap, "readOnlyEndpoint", f.ReadOnlyEndpoint) populate(objectMap, "readWriteEndpoint", f.ReadWriteEndpoint) return json.Marshal(objectMap) @@ -5576,6 +5659,9 @@ func (f *FailoverGroupUpdateProperties) UnmarshalJSON(data []byte) error { case "databases": err = unpopulate(val, "Databases", &f.Databases) delete(rawMsg, key) + case "partnerServers": + err = unpopulate(val, "PartnerServers", &f.PartnerServers) + delete(rawMsg, key) case "readOnlyEndpoint": err = unpopulate(val, "ReadOnlyEndpoint", &f.ReadOnlyEndpoint) delete(rawMsg, key) @@ -5687,6 +5773,37 @@ func (f *FirewallRuleListResult) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type FreeLimitExhaustionBehaviorCapability. +func (f FreeLimitExhaustionBehaviorCapability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "exhaustionBehaviorType", f.ExhaustionBehaviorType) + populate(objectMap, "status", f.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FreeLimitExhaustionBehaviorCapability. +func (f *FreeLimitExhaustionBehaviorCapability) 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", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "exhaustionBehaviorType": + err = unpopulate(val, "ExhaustionBehaviorType", &f.ExhaustionBehaviorType) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &f.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type GeoBackupPolicy. func (g GeoBackupPolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -5737,6 +5854,7 @@ func (g *GeoBackupPolicy) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type GeoBackupPolicyListResult. func (g GeoBackupPolicyListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "nextLink", g.NextLink) populate(objectMap, "value", g.Value) return json.Marshal(objectMap) } @@ -5750,6 +5868,9 @@ func (g *GeoBackupPolicyListResult) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &g.NextLink) + delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &g.Value) delete(rawMsg, key) @@ -6017,9 +6138,12 @@ func (i *ImportExportExtensionsOperationResult) UnmarshalJSON(data []byte) error // MarshalJSON implements the json.Marshaller interface for type ImportExportExtensionsOperationResultProperties. func (i ImportExportExtensionsOperationResultProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "blobUri", i.BlobURI) populate(objectMap, "databaseName", i.DatabaseName) populate(objectMap, "errorMessage", i.ErrorMessage) populate(objectMap, "lastModifiedTime", i.LastModifiedTime) + populate(objectMap, "privateEndpointConnections", i.PrivateEndpointConnections) + populate(objectMap, "queuedTime", i.QueuedTime) populate(objectMap, "requestId", i.RequestID) populate(objectMap, "requestType", i.RequestType) populate(objectMap, "serverName", i.ServerName) @@ -6036,6 +6160,9 @@ func (i *ImportExportExtensionsOperationResultProperties) UnmarshalJSON(data []b for key, val := range rawMsg { var err error switch key { + case "blobUri": + err = unpopulate(val, "BlobURI", &i.BlobURI) + delete(rawMsg, key) case "databaseName": err = unpopulate(val, "DatabaseName", &i.DatabaseName) delete(rawMsg, key) @@ -6045,6 +6172,12 @@ func (i *ImportExportExtensionsOperationResultProperties) UnmarshalJSON(data []b case "lastModifiedTime": err = unpopulate(val, "LastModifiedTime", &i.LastModifiedTime) delete(rawMsg, key) + case "privateEndpointConnections": + err = unpopulate(val, "PrivateEndpointConnections", &i.PrivateEndpointConnections) + delete(rawMsg, key) + case "queuedTime": + err = unpopulate(val, "QueuedTime", &i.QueuedTime) + delete(rawMsg, key) case "requestId": err = unpopulate(val, "RequestID", &i.RequestID) delete(rawMsg, key) @@ -6580,7 +6713,9 @@ func (i *InstancePoolListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type InstancePoolProperties. func (i InstancePoolProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "dnsZone", i.DNSZone) populate(objectMap, "licenseType", i.LicenseType) + populate(objectMap, "maintenanceConfigurationId", i.MaintenanceConfigurationID) populate(objectMap, "subnetId", i.SubnetID) populate(objectMap, "vCores", i.VCores) return json.Marshal(objectMap) @@ -6595,9 +6730,15 @@ func (i *InstancePoolProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "dnsZone": + err = unpopulate(val, "DNSZone", &i.DNSZone) + delete(rawMsg, key) case "licenseType": err = unpopulate(val, "LicenseType", &i.LicenseType) delete(rawMsg, key) + case "maintenanceConfigurationId": + err = unpopulate(val, "MaintenanceConfigurationID", &i.MaintenanceConfigurationID) + delete(rawMsg, key) case "subnetId": err = unpopulate(val, "SubnetID", &i.SubnetID) delete(rawMsg, key) @@ -6615,6 +6756,8 @@ func (i *InstancePoolProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type InstancePoolUpdate. func (i InstancePoolUpdate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "properties", i.Properties) + populate(objectMap, "sku", i.SKU) populate(objectMap, "tags", i.Tags) return json.Marshal(objectMap) } @@ -6628,6 +6771,12 @@ func (i *InstancePoolUpdate) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "properties": + err = unpopulate(val, "Properties", &i.Properties) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &i.SKU) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &i.Tags) delete(rawMsg, key) @@ -8174,6 +8323,7 @@ func (l LongTermRetentionBackupProperties) MarshalJSON() ([]byte, error) { populateTimeRFC3339(objectMap, "backupTime", l.BackupTime) populateTimeRFC3339(objectMap, "databaseDeletionTime", l.DatabaseDeletionTime) populate(objectMap, "databaseName", l.DatabaseName) + populate(objectMap, "isBackupImmutable", l.IsBackupImmutable) populate(objectMap, "requestedBackupStorageRedundancy", l.RequestedBackupStorageRedundancy) populateTimeRFC3339(objectMap, "serverCreateTime", l.ServerCreateTime) populate(objectMap, "serverName", l.ServerName) @@ -8204,6 +8354,9 @@ func (l *LongTermRetentionBackupProperties) UnmarshalJSON(data []byte) error { case "databaseName": err = unpopulate(val, "DatabaseName", &l.DatabaseName) delete(rawMsg, key) + case "isBackupImmutable": + err = unpopulate(val, "IsBackupImmutable", &l.IsBackupImmutable) + delete(rawMsg, key) case "requestedBackupStorageRedundancy": err = unpopulate(val, "RequestedBackupStorageRedundancy", &l.RequestedBackupStorageRedundancy) delete(rawMsg, key) @@ -8342,6 +8495,49 @@ func (l *LongTermRetentionPolicyListResult) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type LongTermRetentionPolicyProperties. +func (l LongTermRetentionPolicyProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "makeBackupsImmutable", l.MakeBackupsImmutable) + populate(objectMap, "monthlyRetention", l.MonthlyRetention) + populate(objectMap, "weekOfYear", l.WeekOfYear) + populate(objectMap, "weeklyRetention", l.WeeklyRetention) + populate(objectMap, "yearlyRetention", l.YearlyRetention) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LongTermRetentionPolicyProperties. +func (l *LongTermRetentionPolicyProperties) 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", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "makeBackupsImmutable": + err = unpopulate(val, "MakeBackupsImmutable", &l.MakeBackupsImmutable) + delete(rawMsg, key) + case "monthlyRetention": + err = unpopulate(val, "MonthlyRetention", &l.MonthlyRetention) + delete(rawMsg, key) + case "weekOfYear": + err = unpopulate(val, "WeekOfYear", &l.WeekOfYear) + delete(rawMsg, key) + case "weeklyRetention": + err = unpopulate(val, "WeeklyRetention", &l.WeeklyRetention) + delete(rawMsg, key) + case "yearlyRetention": + err = unpopulate(val, "YearlyRetention", &l.YearlyRetention) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type MaintenanceConfigurationCapability. func (m MaintenanceConfigurationCapability) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -10001,12 +10197,12 @@ func (m *ManagedInstanceDtcTransactionManagerCommunicationSettings) UnmarshalJSO // MarshalJSON implements the json.Marshaller interface for type ManagedInstanceEditionCapability. func (m ManagedInstanceEditionCapability) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "isGeneralPurposeV2", m.IsGeneralPurposeV2) populate(objectMap, "name", m.Name) populate(objectMap, "reason", m.Reason) populate(objectMap, "status", m.Status) populate(objectMap, "supportedFamilies", m.SupportedFamilies) populate(objectMap, "supportedStorageCapabilities", m.SupportedStorageCapabilities) - populate(objectMap, "zoneRedundant", m.ZoneRedundant) return json.Marshal(objectMap) } @@ -10019,6 +10215,9 @@ func (m *ManagedInstanceEditionCapability) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "isGeneralPurposeV2": + err = unpopulate(val, "IsGeneralPurposeV2", &m.IsGeneralPurposeV2) + delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &m.Name) delete(rawMsg, key) @@ -10034,9 +10233,6 @@ func (m *ManagedInstanceEditionCapability) UnmarshalJSON(data []byte) error { case "supportedStorageCapabilities": err = unpopulate(val, "SupportedStorageCapabilities", &m.SupportedStorageCapabilities) delete(rawMsg, key) - case "zoneRedundant": - err = unpopulate(val, "ZoneRedundant", &m.ZoneRedundant) - delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -10218,6 +10414,7 @@ func (m ManagedInstanceFamilyCapability) MarshalJSON() ([]byte, error) { populate(objectMap, "status", m.Status) populate(objectMap, "supportedLicenseTypes", m.SupportedLicenseTypes) populate(objectMap, "supportedVcoresValues", m.SupportedVcoresValues) + populate(objectMap, "zoneRedundant", m.ZoneRedundant) return json.Marshal(objectMap) } @@ -10248,6 +10445,9 @@ func (m *ManagedInstanceFamilyCapability) UnmarshalJSON(data []byte) error { case "supportedVcoresValues": err = unpopulate(val, "SupportedVcoresValues", &m.SupportedVcoresValues) delete(rawMsg, key) + case "zoneRedundant": + err = unpopulate(val, "ZoneRedundant", &m.ZoneRedundant) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -11118,6 +11318,7 @@ func (m ManagedInstancePrivateLinkProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "groupId", m.GroupID) populate(objectMap, "requiredMembers", m.RequiredMembers) + populate(objectMap, "requiredZoneNames", m.RequiredZoneNames) return json.Marshal(objectMap) } @@ -11136,6 +11337,9 @@ func (m *ManagedInstancePrivateLinkProperties) UnmarshalJSON(data []byte) error case "requiredMembers": err = unpopulate(val, "RequiredMembers", &m.RequiredMembers) delete(rawMsg, key) + case "requiredZoneNames": + err = unpopulate(val, "RequiredZoneNames", &m.RequiredZoneNames) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -11186,16 +11390,22 @@ func (m ManagedInstanceProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "administratorLoginPassword", m.AdministratorLoginPassword) populate(objectMap, "administrators", m.Administrators) populate(objectMap, "collation", m.Collation) + populateTimeRFC3339(objectMap, "createTime", m.CreateTime) populate(objectMap, "currentBackupStorageRedundancy", m.CurrentBackupStorageRedundancy) populate(objectMap, "dnsZone", m.DNSZone) populate(objectMap, "dnsZonePartner", m.DNSZonePartner) + populate(objectMap, "externalGovernanceStatus", m.ExternalGovernanceStatus) populate(objectMap, "fullyQualifiedDomainName", m.FullyQualifiedDomainName) + populate(objectMap, "hybridSecondaryUsage", m.HybridSecondaryUsage) + populate(objectMap, "hybridSecondaryUsageDetected", m.HybridSecondaryUsageDetected) populate(objectMap, "instancePoolId", m.InstancePoolID) + populate(objectMap, "isGeneralPurposeV2", m.IsGeneralPurposeV2) populate(objectMap, "keyId", m.KeyID) populate(objectMap, "licenseType", m.LicenseType) populate(objectMap, "maintenanceConfigurationId", m.MaintenanceConfigurationID) populate(objectMap, "managedInstanceCreateMode", m.ManagedInstanceCreateMode) populate(objectMap, "minimalTlsVersion", m.MinimalTLSVersion) + populate(objectMap, "pricingModel", m.PricingModel) populate(objectMap, "primaryUserAssignedIdentityId", m.PrimaryUserAssignedIdentityID) populate(objectMap, "privateEndpointConnections", m.PrivateEndpointConnections) populate(objectMap, "provisioningState", m.ProvisioningState) @@ -11206,10 +11416,13 @@ func (m ManagedInstanceProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "servicePrincipal", m.ServicePrincipal) populate(objectMap, "sourceManagedInstanceId", m.SourceManagedInstanceID) populate(objectMap, "state", m.State) + populate(objectMap, "storageIOps", m.StorageIOps) populate(objectMap, "storageSizeInGB", m.StorageSizeInGB) + populate(objectMap, "storageThroughputMBps", m.StorageThroughputMBps) populate(objectMap, "subnetId", m.SubnetID) populate(objectMap, "timezoneId", m.TimezoneID) populate(objectMap, "vCores", m.VCores) + populate(objectMap, "virtualClusterId", m.VirtualClusterID) populate(objectMap, "zoneRedundant", m.ZoneRedundant) return json.Marshal(objectMap) } @@ -11235,6 +11448,9 @@ func (m *ManagedInstanceProperties) UnmarshalJSON(data []byte) error { case "collation": err = unpopulate(val, "Collation", &m.Collation) delete(rawMsg, key) + case "createTime": + err = unpopulateTimeRFC3339(val, "CreateTime", &m.CreateTime) + delete(rawMsg, key) case "currentBackupStorageRedundancy": err = unpopulate(val, "CurrentBackupStorageRedundancy", &m.CurrentBackupStorageRedundancy) delete(rawMsg, key) @@ -11244,12 +11460,24 @@ func (m *ManagedInstanceProperties) UnmarshalJSON(data []byte) error { case "dnsZonePartner": err = unpopulate(val, "DNSZonePartner", &m.DNSZonePartner) delete(rawMsg, key) + case "externalGovernanceStatus": + err = unpopulate(val, "ExternalGovernanceStatus", &m.ExternalGovernanceStatus) + delete(rawMsg, key) case "fullyQualifiedDomainName": err = unpopulate(val, "FullyQualifiedDomainName", &m.FullyQualifiedDomainName) delete(rawMsg, key) + case "hybridSecondaryUsage": + err = unpopulate(val, "HybridSecondaryUsage", &m.HybridSecondaryUsage) + delete(rawMsg, key) + case "hybridSecondaryUsageDetected": + err = unpopulate(val, "HybridSecondaryUsageDetected", &m.HybridSecondaryUsageDetected) + delete(rawMsg, key) case "instancePoolId": err = unpopulate(val, "InstancePoolID", &m.InstancePoolID) delete(rawMsg, key) + case "isGeneralPurposeV2": + err = unpopulate(val, "IsGeneralPurposeV2", &m.IsGeneralPurposeV2) + delete(rawMsg, key) case "keyId": err = unpopulate(val, "KeyID", &m.KeyID) delete(rawMsg, key) @@ -11265,6 +11493,9 @@ func (m *ManagedInstanceProperties) UnmarshalJSON(data []byte) error { case "minimalTlsVersion": err = unpopulate(val, "MinimalTLSVersion", &m.MinimalTLSVersion) delete(rawMsg, key) + case "pricingModel": + err = unpopulate(val, "PricingModel", &m.PricingModel) + delete(rawMsg, key) case "primaryUserAssignedIdentityId": err = unpopulate(val, "PrimaryUserAssignedIdentityID", &m.PrimaryUserAssignedIdentityID) delete(rawMsg, key) @@ -11295,9 +11526,15 @@ func (m *ManagedInstanceProperties) UnmarshalJSON(data []byte) error { case "state": err = unpopulate(val, "State", &m.State) delete(rawMsg, key) + case "storageIOps": + err = unpopulate(val, "StorageIOps", &m.StorageIOps) + delete(rawMsg, key) case "storageSizeInGB": err = unpopulate(val, "StorageSizeInGB", &m.StorageSizeInGB) delete(rawMsg, key) + case "storageThroughputMBps": + err = unpopulate(val, "StorageThroughputMBps", &m.StorageThroughputMBps) + delete(rawMsg, key) case "subnetId": err = unpopulate(val, "SubnetID", &m.SubnetID) delete(rawMsg, key) @@ -11307,6 +11544,9 @@ func (m *ManagedInstanceProperties) UnmarshalJSON(data []byte) error { case "vCores": err = unpopulate(val, "VCores", &m.VCores) delete(rawMsg, key) + case "virtualClusterId": + err = unpopulate(val, "VirtualClusterID", &m.VirtualClusterID) + delete(rawMsg, key) case "zoneRedundant": err = unpopulate(val, "ZoneRedundant", &m.ZoneRedundant) delete(rawMsg, key) @@ -11431,13 +11671,21 @@ func (m *ManagedInstanceUpdate) UnmarshalJSON(data []byte) error { func (m ManagedInstanceVcoresCapability) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "includedMaxSize", m.IncludedMaxSize) + populate(objectMap, "includedStorageIOps", m.IncludedStorageIOps) + populate(objectMap, "includedStorageThroughputMBps", m.IncludedStorageThroughputMBps) populate(objectMap, "instancePoolSupported", m.InstancePoolSupported) + populate(objectMap, "iopsIncludedValueOverrideFactorPerSelectedStorageGB", m.IopsIncludedValueOverrideFactorPerSelectedStorageGB) + populate(objectMap, "iopsMinValueOverrideFactorPerSelectedStorageGB", m.IopsMinValueOverrideFactorPerSelectedStorageGB) populate(objectMap, "name", m.Name) populate(objectMap, "reason", m.Reason) populate(objectMap, "standaloneSupported", m.StandaloneSupported) populate(objectMap, "status", m.Status) populate(objectMap, "supportedMaintenanceConfigurations", m.SupportedMaintenanceConfigurations) + populate(objectMap, "supportedStorageIOps", m.SupportedStorageIOps) populate(objectMap, "supportedStorageSizes", m.SupportedStorageSizes) + populate(objectMap, "supportedStorageThroughputMBps", m.SupportedStorageThroughputMBps) + populate(objectMap, "throughputMBpsIncludedValueOverrideFactorPerSelectedStorageGB", m.ThroughputMBpsIncludedValueOverrideFactorPerSelectedStorageGB) + populate(objectMap, "throughputMBpsMinValueOverrideFactorPerSelectedStorageGB", m.ThroughputMBpsMinValueOverrideFactorPerSelectedStorageGB) populate(objectMap, "value", m.Value) return json.Marshal(objectMap) } @@ -11454,9 +11702,21 @@ func (m *ManagedInstanceVcoresCapability) UnmarshalJSON(data []byte) error { case "includedMaxSize": err = unpopulate(val, "IncludedMaxSize", &m.IncludedMaxSize) delete(rawMsg, key) + case "includedStorageIOps": + err = unpopulate(val, "IncludedStorageIOps", &m.IncludedStorageIOps) + delete(rawMsg, key) + case "includedStorageThroughputMBps": + err = unpopulate(val, "IncludedStorageThroughputMBps", &m.IncludedStorageThroughputMBps) + delete(rawMsg, key) case "instancePoolSupported": err = unpopulate(val, "InstancePoolSupported", &m.InstancePoolSupported) delete(rawMsg, key) + case "iopsIncludedValueOverrideFactorPerSelectedStorageGB": + err = unpopulate(val, "IopsIncludedValueOverrideFactorPerSelectedStorageGB", &m.IopsIncludedValueOverrideFactorPerSelectedStorageGB) + delete(rawMsg, key) + case "iopsMinValueOverrideFactorPerSelectedStorageGB": + err = unpopulate(val, "IopsMinValueOverrideFactorPerSelectedStorageGB", &m.IopsMinValueOverrideFactorPerSelectedStorageGB) + delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &m.Name) delete(rawMsg, key) @@ -11472,9 +11732,21 @@ func (m *ManagedInstanceVcoresCapability) UnmarshalJSON(data []byte) error { case "supportedMaintenanceConfigurations": err = unpopulate(val, "SupportedMaintenanceConfigurations", &m.SupportedMaintenanceConfigurations) delete(rawMsg, key) + case "supportedStorageIOps": + err = unpopulate(val, "SupportedStorageIOps", &m.SupportedStorageIOps) + delete(rawMsg, key) case "supportedStorageSizes": err = unpopulate(val, "SupportedStorageSizes", &m.SupportedStorageSizes) delete(rawMsg, key) + case "supportedStorageThroughputMBps": + err = unpopulate(val, "SupportedStorageThroughputMBps", &m.SupportedStorageThroughputMBps) + delete(rawMsg, key) + case "throughputMBpsIncludedValueOverrideFactorPerSelectedStorageGB": + err = unpopulate(val, "ThroughputMBpsIncludedValueOverrideFactorPerSelectedStorageGB", &m.ThroughputMBpsIncludedValueOverrideFactorPerSelectedStorageGB) + delete(rawMsg, key) + case "throughputMBpsMinValueOverrideFactorPerSelectedStorageGB": + err = unpopulate(val, "ThroughputMBpsMinValueOverrideFactorPerSelectedStorageGB", &m.ThroughputMBpsMinValueOverrideFactorPerSelectedStorageGB) + delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &m.Value) delete(rawMsg, key) @@ -12065,6 +12337,49 @@ func (m *ManagedTransparentDataEncryptionProperties) UnmarshalJSON(data []byte) return nil } +// MarshalJSON implements the json.Marshaller interface for type MaxLimitRangeCapability. +func (m MaxLimitRangeCapability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "maxValue", m.MaxValue) + populate(objectMap, "minValue", m.MinValue) + populate(objectMap, "reason", m.Reason) + populate(objectMap, "scaleSize", m.ScaleSize) + populate(objectMap, "status", m.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MaxLimitRangeCapability. +func (m *MaxLimitRangeCapability) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "maxValue": + err = unpopulate(val, "MaxValue", &m.MaxValue) + delete(rawMsg, key) + case "minValue": + err = unpopulate(val, "MinValue", &m.MinValue) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &m.Reason) + delete(rawMsg, key) + case "scaleSize": + err = unpopulate(val, "ScaleSize", &m.ScaleSize) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &m.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type MaxSizeCapability. func (m MaxSizeCapability) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -12143,20 +12458,17 @@ func (m *MaxSizeRangeCapability) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type Metric. -func (m Metric) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MinCapacityCapability. +func (m MinCapacityCapability) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateTimeRFC3339(objectMap, "endTime", m.EndTime) - populate(objectMap, "metricValues", m.MetricValues) - populate(objectMap, "name", m.Name) - populateTimeRFC3339(objectMap, "startTime", m.StartTime) - populate(objectMap, "timeGrain", m.TimeGrain) - populate(objectMap, "unit", m.Unit) + populate(objectMap, "reason", m.Reason) + populate(objectMap, "status", m.Status) + populate(objectMap, "value", m.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Metric. -func (m *Metric) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MinCapacityCapability. +func (m *MinCapacityCapability) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -12164,23 +12476,14 @@ func (m *Metric) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "endTime": - err = unpopulateTimeRFC3339(val, "EndTime", &m.EndTime) - delete(rawMsg, key) - case "metricValues": - err = unpopulate(val, "MetricValues", &m.MetricValues) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &m.Name) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &m.StartTime) + case "reason": + err = unpopulate(val, "Reason", &m.Reason) delete(rawMsg, key) - case "timeGrain": - err = unpopulate(val, "TimeGrain", &m.TimeGrain) + case "status": + err = unpopulate(val, "Status", &m.Status) delete(rawMsg, key) - case "unit": - err = unpopulate(val, "Unit", &m.Unit) + case "value": + err = unpopulate(val, "Value", &m.Value) delete(rawMsg, key) } if err != nil { @@ -12190,242 +12493,285 @@ func (m *Metric) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type MetricAvailability. -func (m MetricAvailability) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NSPConfigAccessRule. +func (n NSPConfigAccessRule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "retention", m.Retention) - populate(objectMap, "timeGrain", m.TimeGrain) + populate(objectMap, "name", n.Name) + populate(objectMap, "properties", n.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MetricAvailability. -func (m *MetricAvailability) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NSPConfigAccessRule. +func (n *NSPConfigAccessRule) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { - case "retention": - err = unpopulate(val, "Retention", &m.Retention) + case "name": + err = unpopulate(val, "Name", &n.Name) delete(rawMsg, key) - case "timeGrain": - err = unpopulate(val, "TimeGrain", &m.TimeGrain) + case "properties": + err = unpopulate(val, "Properties", &n.Properties) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MetricDefinition. -func (m MetricDefinition) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NSPConfigAccessRuleProperties. +func (n NSPConfigAccessRuleProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "metricAvailabilities", m.MetricAvailabilities) - populate(objectMap, "name", m.Name) - populate(objectMap, "primaryAggregationType", m.PrimaryAggregationType) - populate(objectMap, "resourceUri", m.ResourceURI) - populate(objectMap, "unit", m.Unit) + populate(objectMap, "addressPrefixes", n.AddressPrefixes) + populate(objectMap, "direction", n.Direction) + populate(objectMap, "fullyQualifiedDomainNames", n.FullyQualifiedDomainNames) + populate(objectMap, "networkSecurityPerimeters", n.NetworkSecurityPerimeters) + populate(objectMap, "subscriptions", n.Subscriptions) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MetricDefinition. -func (m *MetricDefinition) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NSPConfigAccessRuleProperties. +func (n *NSPConfigAccessRuleProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { - case "metricAvailabilities": - err = unpopulate(val, "MetricAvailabilities", &m.MetricAvailabilities) + case "addressPrefixes": + err = unpopulate(val, "AddressPrefixes", &n.AddressPrefixes) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &m.Name) + case "direction": + err = unpopulate(val, "Direction", &n.Direction) delete(rawMsg, key) - case "primaryAggregationType": - err = unpopulate(val, "PrimaryAggregationType", &m.PrimaryAggregationType) + case "fullyQualifiedDomainNames": + err = unpopulate(val, "FullyQualifiedDomainNames", &n.FullyQualifiedDomainNames) delete(rawMsg, key) - case "resourceUri": - err = unpopulate(val, "ResourceURI", &m.ResourceURI) + case "networkSecurityPerimeters": + err = unpopulate(val, "NetworkSecurityPerimeters", &n.NetworkSecurityPerimeters) delete(rawMsg, key) - case "unit": - err = unpopulate(val, "Unit", &m.Unit) + case "subscriptions": + err = unpopulate(val, "Subscriptions", &n.Subscriptions) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MetricDefinitionListResult. -func (m MetricDefinitionListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NSPConfigAssociation. +func (n NSPConfigAssociation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "value", m.Value) + populate(objectMap, "accessMode", n.AccessMode) + populate(objectMap, "name", n.Name) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MetricDefinitionListResult. -func (m *MetricDefinitionListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NSPConfigAssociation. +func (n *NSPConfigAssociation) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { - case "value": - err = unpopulate(val, "Value", &m.Value) + case "accessMode": + err = unpopulate(val, "AccessMode", &n.AccessMode) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &n.Name) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MetricListResult. -func (m MetricListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NSPConfigNetworkSecurityPerimeterRule. +func (n NSPConfigNetworkSecurityPerimeterRule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "value", m.Value) + populate(objectMap, "id", n.ID) + populate(objectMap, "location", n.Location) + populate(objectMap, "perimeterGuid", n.PerimeterGUID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MetricListResult. -func (m *MetricListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NSPConfigNetworkSecurityPerimeterRule. +func (n *NSPConfigNetworkSecurityPerimeterRule) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { - case "value": - err = unpopulate(val, "Value", &m.Value) + case "id": + err = unpopulate(val, "ID", &n.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &n.Location) + delete(rawMsg, key) + case "perimeterGuid": + err = unpopulate(val, "PerimeterGUID", &n.PerimeterGUID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MetricName. -func (m MetricName) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NSPConfigPerimeter. +func (n NSPConfigPerimeter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "localizedValue", m.LocalizedValue) - populate(objectMap, "value", m.Value) + populate(objectMap, "id", n.ID) + populate(objectMap, "location", n.Location) + populate(objectMap, "perimeterGuid", n.PerimeterGUID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MetricName. -func (m *MetricName) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NSPConfigPerimeter. +func (n *NSPConfigPerimeter) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { - case "localizedValue": - err = unpopulate(val, "LocalizedValue", &m.LocalizedValue) + case "id": + err = unpopulate(val, "ID", &n.ID) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &m.Value) + case "location": + err = unpopulate(val, "Location", &n.Location) + delete(rawMsg, key) + case "perimeterGuid": + err = unpopulate(val, "PerimeterGUID", &n.PerimeterGUID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MetricValue. -func (m MetricValue) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NSPConfigProfile. +func (n NSPConfigProfile) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "average", m.Average) - populate(objectMap, "count", m.Count) - populate(objectMap, "maximum", m.Maximum) - populate(objectMap, "minimum", m.Minimum) - populateTimeRFC3339(objectMap, "timestamp", m.Timestamp) - populate(objectMap, "total", m.Total) + populate(objectMap, "accessRules", n.AccessRules) + populate(objectMap, "accessRulesVersion", n.AccessRulesVersion) + populate(objectMap, "name", n.Name) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MetricValue. -func (m *MetricValue) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NSPConfigProfile. +func (n *NSPConfigProfile) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { - case "average": - err = unpopulate(val, "Average", &m.Average) - delete(rawMsg, key) - case "count": - err = unpopulate(val, "Count", &m.Count) + case "accessRules": + err = unpopulate(val, "AccessRules", &n.AccessRules) delete(rawMsg, key) - case "maximum": - err = unpopulate(val, "Maximum", &m.Maximum) + case "accessRulesVersion": + err = unpopulate(val, "AccessRulesVersion", &n.AccessRulesVersion) delete(rawMsg, key) - case "minimum": - err = unpopulate(val, "Minimum", &m.Minimum) + case "name": + err = unpopulate(val, "Name", &n.Name) delete(rawMsg, key) - case "timestamp": - err = unpopulateTimeRFC3339(val, "Timestamp", &m.Timestamp) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NSPProvisioningIssue. +func (n NSPProvisioningIssue) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", n.Name) + populate(objectMap, "properties", n.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NSPProvisioningIssue. +func (n *NSPProvisioningIssue) 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", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &n.Name) delete(rawMsg, key) - case "total": - err = unpopulate(val, "Total", &m.Total) + case "properties": + err = unpopulate(val, "Properties", &n.Properties) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MinCapacityCapability. -func (m MinCapacityCapability) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NSPProvisioningIssueProperties. +func (n NSPProvisioningIssueProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "reason", m.Reason) - populate(objectMap, "status", m.Status) - populate(objectMap, "value", m.Value) + populate(objectMap, "description", n.Description) + populate(objectMap, "issueType", n.IssueType) + populate(objectMap, "severity", n.Severity) + populate(objectMap, "suggestedAccessRules", n.SuggestedAccessRules) + populate(objectMap, "suggestedResourceIds", n.SuggestedResourceIDs) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MinCapacityCapability. -func (m *MinCapacityCapability) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NSPProvisioningIssueProperties. +func (n *NSPProvisioningIssueProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { - case "reason": - err = unpopulate(val, "Reason", &m.Reason) + case "description": + err = unpopulate(val, "Description", &n.Description) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &m.Status) + case "issueType": + err = unpopulate(val, "IssueType", &n.IssueType) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &m.Value) + case "severity": + err = unpopulate(val, "Severity", &n.Severity) + delete(rawMsg, key) + case "suggestedAccessRules": + err = unpopulate(val, "SuggestedAccessRules", &n.SuggestedAccessRules) + delete(rawMsg, key) + case "suggestedResourceIds": + err = unpopulate(val, "SuggestedResourceIDs", &n.SuggestedResourceIDs) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } } return nil @@ -12493,57 +12839,131 @@ func (n *NetworkIsolationSettings) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type Operation. -func (o Operation) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NetworkSecurityPerimeterConfiguration. +func (n NetworkSecurityPerimeterConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "display", o.Display) - populate(objectMap, "name", o.Name) - populate(objectMap, "origin", o.Origin) - populate(objectMap, "properties", o.Properties) + populate(objectMap, "id", n.ID) + populate(objectMap, "name", n.Name) + populate(objectMap, "properties", n.Properties) + populate(objectMap, "type", n.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Operation. -func (o *Operation) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityPerimeterConfiguration. +func (n *NetworkSecurityPerimeterConfiguration) 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", o, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { - case "display": - err = unpopulate(val, "Display", &o.Display) + case "id": + err = unpopulate(val, "ID", &n.ID) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &o.Name) - delete(rawMsg, key) - case "origin": - err = unpopulate(val, "Origin", &o.Origin) + err = unpopulate(val, "Name", &n.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &o.Properties) + err = unpopulate(val, "Properties", &n.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &n.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OperationDisplay. -func (o OperationDisplay) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NetworkSecurityPerimeterConfigurationListResult. +func (n NetworkSecurityPerimeterConfigurationListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", o.Description) - populate(objectMap, "operation", o.Operation) - populate(objectMap, "provider", o.Provider) - populate(objectMap, "resource", o.Resource) + populate(objectMap, "nextLink", n.NextLink) + populate(objectMap, "value", n.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay. -func (o *OperationDisplay) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityPerimeterConfigurationListResult. +func (n *NetworkSecurityPerimeterConfigurationListResult) 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", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &n.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &n.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkSecurityPerimeterConfigurationProperties. +func (n NetworkSecurityPerimeterConfigurationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "networkSecurityPerimeter", n.NetworkSecurityPerimeter) + populate(objectMap, "profile", n.Profile) + populate(objectMap, "provisioningIssues", n.ProvisioningIssues) + populate(objectMap, "provisioningState", n.ProvisioningState) + populate(objectMap, "resourceAssociation", n.ResourceAssociation) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityPerimeterConfigurationProperties. +func (n *NetworkSecurityPerimeterConfigurationProperties) 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", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "networkSecurityPerimeter": + err = unpopulate(val, "NetworkSecurityPerimeter", &n.NetworkSecurityPerimeter) + delete(rawMsg, key) + case "profile": + err = unpopulate(val, "Profile", &n.Profile) + delete(rawMsg, key) + case "provisioningIssues": + err = unpopulate(val, "ProvisioningIssues", &n.ProvisioningIssues) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &n.ProvisioningState) + delete(rawMsg, key) + case "resourceAssociation": + err = unpopulate(val, "ResourceAssociation", &n.ResourceAssociation) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Operation. +func (o Operation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "display", o.Display) + populate(objectMap, "name", o.Name) + populate(objectMap, "origin", o.Origin) + populate(objectMap, "properties", o.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Operation. +func (o *Operation) 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", o, err) @@ -12551,17 +12971,17 @@ func (o *OperationDisplay) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "description": - err = unpopulate(val, "Description", &o.Description) + case "display": + err = unpopulate(val, "Display", &o.Display) delete(rawMsg, key) - case "operation": - err = unpopulate(val, "Operation", &o.Operation) + case "name": + err = unpopulate(val, "Name", &o.Name) delete(rawMsg, key) - case "provider": - err = unpopulate(val, "Provider", &o.Provider) + case "origin": + err = unpopulate(val, "Origin", &o.Origin) delete(rawMsg, key) - case "resource": - err = unpopulate(val, "Resource", &o.Resource) + case "properties": + err = unpopulate(val, "Properties", &o.Properties) delete(rawMsg, key) } if err != nil { @@ -12571,18 +12991,18 @@ func (o *OperationDisplay) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type OperationImpact. -func (o OperationImpact) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OperationDisplay. +func (o OperationDisplay) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "changeValueAbsolute", o.ChangeValueAbsolute) - populate(objectMap, "changeValueRelative", o.ChangeValueRelative) - populate(objectMap, "name", o.Name) - populate(objectMap, "unit", o.Unit) + populate(objectMap, "description", o.Description) + populate(objectMap, "operation", o.Operation) + populate(objectMap, "provider", o.Provider) + populate(objectMap, "resource", o.Resource) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationImpact. -func (o *OperationImpact) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay. +func (o *OperationDisplay) 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", o, err) @@ -12590,17 +13010,17 @@ func (o *OperationImpact) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "changeValueAbsolute": - err = unpopulate(val, "ChangeValueAbsolute", &o.ChangeValueAbsolute) + case "description": + err = unpopulate(val, "Description", &o.Description) delete(rawMsg, key) - case "changeValueRelative": - err = unpopulate(val, "ChangeValueRelative", &o.ChangeValueRelative) + case "operation": + err = unpopulate(val, "Operation", &o.Operation) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &o.Name) + case "provider": + err = unpopulate(val, "Provider", &o.Provider) delete(rawMsg, key) - case "unit": - err = unpopulate(val, "Unit", &o.Unit) + case "resource": + err = unpopulate(val, "Resource", &o.Resource) delete(rawMsg, key) } if err != nil { @@ -12897,6 +13317,37 @@ func (p *PerformanceLevelCapability) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type PhaseDetails. +func (p PhaseDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "phase", p.Phase) + populate(objectMap, "phaseInformation", p.PhaseInformation) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PhaseDetails. +func (p *PhaseDetails) 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", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "phase": + err = unpopulate(val, "Phase", &p.Phase) + delete(rawMsg, key) + case "phaseInformation": + err = unpopulate(val, "PhaseInformation", &p.PhaseInformation) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnection. func (p PrivateEndpointConnection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -14254,6 +14705,45 @@ func (r *RefreshExternalGovernanceStatusOperationResult) UnmarshalJSON(data []by return nil } +// MarshalJSON implements the json.Marshaller interface for type RefreshExternalGovernanceStatusOperationResultMI. +func (r RefreshExternalGovernanceStatusOperationResultMI) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RefreshExternalGovernanceStatusOperationResultMI. +func (r *RefreshExternalGovernanceStatusOperationResultMI) 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &r.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type RefreshExternalGovernanceStatusOperationResultProperties. func (r RefreshExternalGovernanceStatusOperationResultProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -14301,6 +14791,53 @@ func (r *RefreshExternalGovernanceStatusOperationResultProperties) UnmarshalJSON return nil } +// MarshalJSON implements the json.Marshaller interface for type RefreshExternalGovernanceStatusOperationResultPropertiesMI. +func (r RefreshExternalGovernanceStatusOperationResultPropertiesMI) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "errorMessage", r.ErrorMessage) + populate(objectMap, "managedInstanceName", r.ManagedInstanceName) + populate(objectMap, "queuedTime", r.QueuedTime) + populate(objectMap, "requestId", r.RequestID) + populate(objectMap, "requestType", r.RequestType) + populate(objectMap, "status", r.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RefreshExternalGovernanceStatusOperationResultPropertiesMI. +func (r *RefreshExternalGovernanceStatusOperationResultPropertiesMI) 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "errorMessage": + err = unpopulate(val, "ErrorMessage", &r.ErrorMessage) + delete(rawMsg, key) + case "managedInstanceName": + err = unpopulate(val, "ManagedInstanceName", &r.ManagedInstanceName) + delete(rawMsg, key) + case "queuedTime": + err = unpopulate(val, "QueuedTime", &r.QueuedTime) + delete(rawMsg, key) + case "requestId": + err = unpopulate(val, "RequestID", &r.RequestID) + delete(rawMsg, key) + case "requestType": + err = unpopulate(val, "RequestType", &r.RequestType) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &r.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type Remediation. func (r Remediation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -14416,6 +14953,7 @@ func (r ReplicationLinkProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "isTerminationAllowed", r.IsTerminationAllowed) populate(objectMap, "linkType", r.LinkType) populate(objectMap, "partnerDatabase", r.PartnerDatabase) + populate(objectMap, "partnerDatabaseId", r.PartnerDatabaseID) populate(objectMap, "partnerLocation", r.PartnerLocation) populate(objectMap, "partnerRole", r.PartnerRole) populate(objectMap, "partnerServer", r.PartnerServer) @@ -14445,6 +14983,9 @@ func (r *ReplicationLinkProperties) UnmarshalJSON(data []byte) error { case "partnerDatabase": err = unpopulate(val, "PartnerDatabase", &r.PartnerDatabase) delete(rawMsg, key) + case "partnerDatabaseId": + err = unpopulate(val, "PartnerDatabaseID", &r.PartnerDatabaseID) + delete(rawMsg, key) case "partnerLocation": err = unpopulate(val, "PartnerLocation", &r.PartnerLocation) delete(rawMsg, key) @@ -15456,6 +15997,7 @@ func (s *SensitivityLabelListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SensitivityLabelProperties. func (s SensitivityLabelProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "clientClassificationSource", s.ClientClassificationSource) populate(objectMap, "columnName", s.ColumnName) populate(objectMap, "informationType", s.InformationType) populate(objectMap, "informationTypeId", s.InformationTypeID) @@ -15477,6 +16019,9 @@ func (s *SensitivityLabelProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "clientClassificationSource": + err = unpopulate(val, "ClientClassificationSource", &s.ClientClassificationSource) + delete(rawMsg, key) case "columnName": err = unpopulate(val, "ColumnName", &s.ColumnName) delete(rawMsg, key) @@ -15823,147 +16368,10 @@ func (s *ServerAzureADOnlyAuthentication) UnmarshalJSON(data []byte) error { err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &s.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ServerBlobAuditingPolicy. -func (s ServerBlobAuditingPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", s.ID) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerBlobAuditingPolicy. -func (s *ServerBlobAuditingPolicy) 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", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &s.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &s.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ServerBlobAuditingPolicyListResult. -func (s ServerBlobAuditingPolicyListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerBlobAuditingPolicyListResult. -func (s *ServerBlobAuditingPolicyListResult) 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", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &s.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &s.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ServerBlobAuditingPolicyProperties. -func (s ServerBlobAuditingPolicyProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "auditActionsAndGroups", s.AuditActionsAndGroups) - populate(objectMap, "isAzureMonitorTargetEnabled", s.IsAzureMonitorTargetEnabled) - populate(objectMap, "isDevopsAuditEnabled", s.IsDevopsAuditEnabled) - populate(objectMap, "isManagedIdentityInUse", s.IsManagedIdentityInUse) - populate(objectMap, "isStorageSecondaryKeyInUse", s.IsStorageSecondaryKeyInUse) - populate(objectMap, "queueDelayMs", s.QueueDelayMs) - populate(objectMap, "retentionDays", s.RetentionDays) - populate(objectMap, "state", s.State) - populate(objectMap, "storageAccountAccessKey", s.StorageAccountAccessKey) - populate(objectMap, "storageAccountSubscriptionId", s.StorageAccountSubscriptionID) - populate(objectMap, "storageEndpoint", s.StorageEndpoint) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerBlobAuditingPolicyProperties. -func (s *ServerBlobAuditingPolicyProperties) 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", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "auditActionsAndGroups": - err = unpopulate(val, "AuditActionsAndGroups", &s.AuditActionsAndGroups) - delete(rawMsg, key) - case "isAzureMonitorTargetEnabled": - err = unpopulate(val, "IsAzureMonitorTargetEnabled", &s.IsAzureMonitorTargetEnabled) - delete(rawMsg, key) - case "isDevopsAuditEnabled": - err = unpopulate(val, "IsDevopsAuditEnabled", &s.IsDevopsAuditEnabled) - delete(rawMsg, key) - case "isManagedIdentityInUse": - err = unpopulate(val, "IsManagedIdentityInUse", &s.IsManagedIdentityInUse) - delete(rawMsg, key) - case "isStorageSecondaryKeyInUse": - err = unpopulate(val, "IsStorageSecondaryKeyInUse", &s.IsStorageSecondaryKeyInUse) - delete(rawMsg, key) - case "queueDelayMs": - err = unpopulate(val, "QueueDelayMs", &s.QueueDelayMs) - delete(rawMsg, key) - case "retentionDays": - err = unpopulate(val, "RetentionDays", &s.RetentionDays) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &s.State) - delete(rawMsg, key) - case "storageAccountAccessKey": - err = unpopulate(val, "StorageAccountAccessKey", &s.StorageAccountAccessKey) - delete(rawMsg, key) - case "storageAccountSubscriptionId": - err = unpopulate(val, "StorageAccountSubscriptionID", &s.StorageAccountSubscriptionID) + err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) - case "storageEndpoint": - err = unpopulate(val, "StorageEndpoint", &s.StorageEndpoint) + case "type": + err = unpopulate(val, "Type", &s.Type) delete(rawMsg, key) } if err != nil { @@ -15973,20 +16381,18 @@ func (s *ServerBlobAuditingPolicyProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerCommunicationLink. -func (s ServerCommunicationLink) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerBlobAuditingPolicy. +func (s ServerBlobAuditingPolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", s.ID) - populate(objectMap, "kind", s.Kind) - populate(objectMap, "location", s.Location) populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) populate(objectMap, "type", s.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerCommunicationLink. -func (s *ServerCommunicationLink) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerBlobAuditingPolicy. +func (s *ServerBlobAuditingPolicy) 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", s, err) @@ -15997,12 +16403,6 @@ func (s *ServerCommunicationLink) UnmarshalJSON(data []byte) error { case "id": err = unpopulate(val, "ID", &s.ID) delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &s.Kind) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &s.Location) - delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) @@ -16020,15 +16420,16 @@ func (s *ServerCommunicationLink) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerCommunicationLinkListResult. -func (s ServerCommunicationLinkListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerBlobAuditingPolicyListResult. +func (s ServerBlobAuditingPolicyListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "nextLink", s.NextLink) populate(objectMap, "value", s.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerCommunicationLinkListResult. -func (s *ServerCommunicationLinkListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerBlobAuditingPolicyListResult. +func (s *ServerBlobAuditingPolicyListResult) 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", s, err) @@ -16036,6 +16437,9 @@ func (s *ServerCommunicationLinkListResult) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &s.Value) delete(rawMsg, key) @@ -16047,16 +16451,25 @@ func (s *ServerCommunicationLinkListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServerCommunicationLinkProperties. -func (s ServerCommunicationLinkProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerBlobAuditingPolicyProperties. +func (s ServerBlobAuditingPolicyProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "partnerServer", s.PartnerServer) + populate(objectMap, "auditActionsAndGroups", s.AuditActionsAndGroups) + populate(objectMap, "isAzureMonitorTargetEnabled", s.IsAzureMonitorTargetEnabled) + populate(objectMap, "isDevopsAuditEnabled", s.IsDevopsAuditEnabled) + populate(objectMap, "isManagedIdentityInUse", s.IsManagedIdentityInUse) + populate(objectMap, "isStorageSecondaryKeyInUse", s.IsStorageSecondaryKeyInUse) + populate(objectMap, "queueDelayMs", s.QueueDelayMs) + populate(objectMap, "retentionDays", s.RetentionDays) populate(objectMap, "state", s.State) + populate(objectMap, "storageAccountAccessKey", s.StorageAccountAccessKey) + populate(objectMap, "storageAccountSubscriptionId", s.StorageAccountSubscriptionID) + populate(objectMap, "storageEndpoint", s.StorageEndpoint) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerCommunicationLinkProperties. -func (s *ServerCommunicationLinkProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerBlobAuditingPolicyProperties. +func (s *ServerBlobAuditingPolicyProperties) 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", s, err) @@ -16064,12 +16477,39 @@ func (s *ServerCommunicationLinkProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "partnerServer": - err = unpopulate(val, "PartnerServer", &s.PartnerServer) + case "auditActionsAndGroups": + err = unpopulate(val, "AuditActionsAndGroups", &s.AuditActionsAndGroups) + delete(rawMsg, key) + case "isAzureMonitorTargetEnabled": + err = unpopulate(val, "IsAzureMonitorTargetEnabled", &s.IsAzureMonitorTargetEnabled) + delete(rawMsg, key) + case "isDevopsAuditEnabled": + err = unpopulate(val, "IsDevopsAuditEnabled", &s.IsDevopsAuditEnabled) + delete(rawMsg, key) + case "isManagedIdentityInUse": + err = unpopulate(val, "IsManagedIdentityInUse", &s.IsManagedIdentityInUse) + delete(rawMsg, key) + case "isStorageSecondaryKeyInUse": + err = unpopulate(val, "IsStorageSecondaryKeyInUse", &s.IsStorageSecondaryKeyInUse) + delete(rawMsg, key) + case "queueDelayMs": + err = unpopulate(val, "QueueDelayMs", &s.QueueDelayMs) + delete(rawMsg, key) + case "retentionDays": + err = unpopulate(val, "RetentionDays", &s.RetentionDays) delete(rawMsg, key) case "state": err = unpopulate(val, "State", &s.State) delete(rawMsg, key) + case "storageAccountAccessKey": + err = unpopulate(val, "StorageAccountAccessKey", &s.StorageAccountAccessKey) + delete(rawMsg, key) + case "storageAccountSubscriptionId": + err = unpopulate(val, "StorageAccountSubscriptionID", &s.StorageAccountSubscriptionID) + delete(rawMsg, key) + case "storageEndpoint": + err = unpopulate(val, "StorageEndpoint", &s.StorageEndpoint) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -16975,6 +17415,7 @@ func (s ServerProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "externalGovernanceStatus", s.ExternalGovernanceStatus) populate(objectMap, "federatedClientId", s.FederatedClientID) populate(objectMap, "fullyQualifiedDomainName", s.FullyQualifiedDomainName) + populate(objectMap, "isIPv6Enabled", s.IsIPv6Enabled) populate(objectMap, "keyId", s.KeyID) populate(objectMap, "minimalTlsVersion", s.MinimalTLSVersion) populate(objectMap, "primaryUserAssignedIdentityId", s.PrimaryUserAssignedIdentityID) @@ -17014,6 +17455,9 @@ func (s *ServerProperties) UnmarshalJSON(data []byte) error { case "fullyQualifiedDomainName": err = unpopulate(val, "FullyQualifiedDomainName", &s.FullyQualifiedDomainName) delete(rawMsg, key) + case "isIPv6Enabled": + err = unpopulate(val, "IsIPv6Enabled", &s.IsIPv6Enabled) + delete(rawMsg, key) case "keyId": err = unpopulate(val, "KeyID", &s.KeyID) delete(rawMsg, key) @@ -17336,13 +17780,10 @@ func (s *ServerUpdate) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ServerUsage. func (s ServerUsage) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "currentValue", s.CurrentValue) - populate(objectMap, "displayName", s.DisplayName) - populate(objectMap, "limit", s.Limit) + populate(objectMap, "id", s.ID) populate(objectMap, "name", s.Name) - populateTimeRFC3339(objectMap, "nextResetTime", s.NextResetTime) - populate(objectMap, "resourceName", s.ResourceName) - populate(objectMap, "unit", s.Unit) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "type", s.Type) return json.Marshal(objectMap) } @@ -17355,26 +17796,17 @@ func (s *ServerUsage) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "currentValue": - err = unpopulate(val, "CurrentValue", &s.CurrentValue) - delete(rawMsg, key) - case "displayName": - err = unpopulate(val, "DisplayName", &s.DisplayName) - delete(rawMsg, key) - case "limit": - err = unpopulate(val, "Limit", &s.Limit) + case "id": + err = unpopulate(val, "ID", &s.ID) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) - case "nextResetTime": - err = unpopulateTimeRFC3339(val, "NextResetTime", &s.NextResetTime) - delete(rawMsg, key) - case "resourceName": - err = unpopulate(val, "ResourceName", &s.ResourceName) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) - case "unit": - err = unpopulate(val, "Unit", &s.Unit) + case "type": + err = unpopulate(val, "Type", &s.Type) delete(rawMsg, key) } if err != nil { @@ -17387,6 +17819,7 @@ func (s *ServerUsage) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ServerUsageListResult. func (s ServerUsageListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "nextLink", s.NextLink) populate(objectMap, "value", s.Value) return json.Marshal(objectMap) } @@ -17400,6 +17833,9 @@ func (s *ServerUsageListResult) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &s.Value) delete(rawMsg, key) @@ -17411,6 +17847,45 @@ func (s *ServerUsageListResult) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ServerUsageProperties. +func (s ServerUsageProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "currentValue", s.CurrentValue) + populate(objectMap, "displayName", s.DisplayName) + populate(objectMap, "limit", s.Limit) + populate(objectMap, "unit", s.Unit) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerUsageProperties. +func (s *ServerUsageProperties) 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "currentValue": + err = unpopulate(val, "CurrentValue", &s.CurrentValue) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &s.DisplayName) + delete(rawMsg, key) + case "limit": + err = unpopulate(val, "Limit", &s.Limit) + delete(rawMsg, key) + case "unit": + err = unpopulate(val, "Unit", &s.Unit) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ServerVersionCapability. func (s ServerVersionCapability) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -17563,45 +18038,6 @@ func (s *ServerVulnerabilityAssessmentProperties) UnmarshalJSON(data []byte) err return nil } -// MarshalJSON implements the json.Marshaller interface for type ServiceObjective. -func (s ServiceObjective) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", s.ID) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceObjective. -func (s *ServiceObjective) 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", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &s.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &s.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type ServiceObjectiveCapability. func (s ServiceObjectiveCapability) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -17614,10 +18050,12 @@ func (s ServiceObjectiveCapability) MarshalJSON() ([]byte, error) { populate(objectMap, "sku", s.SKU) populate(objectMap, "status", s.Status) populate(objectMap, "supportedAutoPauseDelay", s.SupportedAutoPauseDelay) + populate(objectMap, "supportedFreeLimitExhaustionBehaviors", s.SupportedFreeLimitExhaustionBehaviors) populate(objectMap, "supportedLicenseTypes", s.SupportedLicenseTypes) populate(objectMap, "supportedMaintenanceConfigurations", s.SupportedMaintenanceConfigurations) populate(objectMap, "supportedMaxSizes", s.SupportedMaxSizes) populate(objectMap, "supportedMinCapacities", s.SupportedMinCapacities) + populate(objectMap, "zonePinning", s.ZonePinning) populate(objectMap, "zoneRedundant", s.ZoneRedundant) return json.Marshal(objectMap) } @@ -17658,6 +18096,9 @@ func (s *ServiceObjectiveCapability) UnmarshalJSON(data []byte) error { case "supportedAutoPauseDelay": err = unpopulate(val, "SupportedAutoPauseDelay", &s.SupportedAutoPauseDelay) delete(rawMsg, key) + case "supportedFreeLimitExhaustionBehaviors": + err = unpopulate(val, "SupportedFreeLimitExhaustionBehaviors", &s.SupportedFreeLimitExhaustionBehaviors) + delete(rawMsg, key) case "supportedLicenseTypes": err = unpopulate(val, "SupportedLicenseTypes", &s.SupportedLicenseTypes) delete(rawMsg, key) @@ -17670,6 +18111,9 @@ func (s *ServiceObjectiveCapability) UnmarshalJSON(data []byte) error { case "supportedMinCapacities": err = unpopulate(val, "SupportedMinCapacities", &s.SupportedMinCapacities) delete(rawMsg, key) + case "zonePinning": + err = unpopulate(val, "ZonePinning", &s.ZonePinning) + delete(rawMsg, key) case "zoneRedundant": err = unpopulate(val, "ZoneRedundant", &s.ZoneRedundant) delete(rawMsg, key) @@ -17681,76 +18125,6 @@ func (s *ServiceObjectiveCapability) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServiceObjectiveListResult. -func (s ServiceObjectiveListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "value", s.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceObjectiveListResult. -func (s *ServiceObjectiveListResult) 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", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "value": - err = unpopulate(val, "Value", &s.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ServiceObjectiveProperties. -func (s ServiceObjectiveProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "description", s.Description) - populate(objectMap, "enabled", s.Enabled) - populate(objectMap, "isDefault", s.IsDefault) - populate(objectMap, "isSystem", s.IsSystem) - populate(objectMap, "serviceObjectiveName", s.ServiceObjectiveName) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceObjectiveProperties. -func (s *ServiceObjectiveProperties) 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", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "description": - err = unpopulate(val, "Description", &s.Description) - delete(rawMsg, key) - case "enabled": - err = unpopulate(val, "Enabled", &s.Enabled) - delete(rawMsg, key) - case "isDefault": - err = unpopulate(val, "IsDefault", &s.IsDefault) - delete(rawMsg, key) - case "isSystem": - err = unpopulate(val, "IsSystem", &s.IsSystem) - delete(rawMsg, key) - case "serviceObjectiveName": - err = unpopulate(val, "ServiceObjectiveName", &s.ServiceObjectiveName) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type ServicePrincipal. func (s ServicePrincipal) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -17790,41 +18164,6 @@ func (s *ServicePrincipal) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SloUsageMetric. -func (s SloUsageMetric) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "inRangeTimeRatio", s.InRangeTimeRatio) - populate(objectMap, "serviceLevelObjective", s.ServiceLevelObjective) - populate(objectMap, "serviceLevelObjectiveId", s.ServiceLevelObjectiveID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SloUsageMetric. -func (s *SloUsageMetric) 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", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "inRangeTimeRatio": - err = unpopulate(val, "InRangeTimeRatio", &s.InRangeTimeRatio) - delete(rawMsg, key) - case "serviceLevelObjective": - err = unpopulate(val, "ServiceLevelObjective", &s.ServiceLevelObjective) - delete(rawMsg, key) - case "serviceLevelObjectiveId": - err = unpopulate(val, "ServiceLevelObjectiveID", &s.ServiceLevelObjectiveID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type StartStopManagedInstanceSchedule. func (s StartStopManagedInstanceSchedule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -19656,17 +19995,20 @@ func (u *UpsertManagedServerOperationParameters) UnmarshalJSON(data []byte) erro return nil } -// MarshalJSON implements the json.Marshaller interface for type UpsertManagedServerOperationStep. -func (u UpsertManagedServerOperationStep) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type UpsertManagedServerOperationStepWithEstimatesAndDuration. +func (u UpsertManagedServerOperationStepWithEstimatesAndDuration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "name", u.Name) populate(objectMap, "order", u.Order) populate(objectMap, "status", u.Status) + populateTimeRFC3339(objectMap, "stepEndTime", u.StepEndTime) + populateTimeRFC3339(objectMap, "stepStartTime", u.StepStartTime) + populate(objectMap, "timeElapsed", u.TimeElapsed) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type UpsertManagedServerOperationStep. -func (u *UpsertManagedServerOperationStep) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type UpsertManagedServerOperationStepWithEstimatesAndDuration. +func (u *UpsertManagedServerOperationStepWithEstimatesAndDuration) 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", u, err) @@ -19683,6 +20025,15 @@ func (u *UpsertManagedServerOperationStep) UnmarshalJSON(data []byte) error { case "status": err = unpopulate(val, "Status", &u.Status) delete(rawMsg, key) + case "stepEndTime": + err = unpopulateTimeRFC3339(val, "StepEndTime", &u.StepEndTime) + delete(rawMsg, key) + case "stepStartTime": + err = unpopulateTimeRFC3339(val, "StepStartTime", &u.StepStartTime) + delete(rawMsg, key) + case "timeElapsed": + err = unpopulate(val, "TimeElapsed", &u.TimeElapsed) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", u, err) @@ -21000,6 +21351,16 @@ func populate(m map[string]any, k string, v any) { } } +func populateAny(m map[string]any, k string, v any) { + if v == nil { + return + } else if azcore.IsNullValue(v) { + m[k] = nil + } else { + m[k] = v + } +} + func unpopulate(data json.RawMessage, fn string, v any) error { if data == nil { return nil diff --git a/sdk/resourcemanager/sql/armsql/networksecurityperimeterconfigurations_client.go b/sdk/resourcemanager/sql/armsql/networksecurityperimeterconfigurations_client.go new file mode 100644 index 000000000000..642a28bbcefa --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/networksecurityperimeterconfigurations_client.go @@ -0,0 +1,256 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armsql + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// NetworkSecurityPerimeterConfigurationsClient contains the methods for the NetworkSecurityPerimeterConfigurations group. +// Don't use this type directly, use NewNetworkSecurityPerimeterConfigurationsClient() instead. +type NetworkSecurityPerimeterConfigurationsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewNetworkSecurityPerimeterConfigurationsClient creates a new instance of NetworkSecurityPerimeterConfigurationsClient with the specified values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewNetworkSecurityPerimeterConfigurationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NetworkSecurityPerimeterConfigurationsClient, error) { + cl, err := arm.NewClient(moduleName+".NetworkSecurityPerimeterConfigurationsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &NetworkSecurityPerimeterConfigurationsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Get - Gets a network security perimeter configuration. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - options - NetworkSecurityPerimeterConfigurationsClientGetOptions contains the optional parameters for the NetworkSecurityPerimeterConfigurationsClient.Get +// method. +func (client *NetworkSecurityPerimeterConfigurationsClient) Get(ctx context.Context, resourceGroupName string, serverName string, nspConfigName string, options *NetworkSecurityPerimeterConfigurationsClientGetOptions) (NetworkSecurityPerimeterConfigurationsClientGetResponse, error) { + var err error + req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, nspConfigName, options) + if err != nil { + return NetworkSecurityPerimeterConfigurationsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NetworkSecurityPerimeterConfigurationsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return NetworkSecurityPerimeterConfigurationsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *NetworkSecurityPerimeterConfigurationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, nspConfigName string, options *NetworkSecurityPerimeterConfigurationsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/networkSecurityPerimeterConfigurations/{nspConfigName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if nspConfigName == "" { + return nil, errors.New("parameter nspConfigName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{nspConfigName}", url.PathEscape(nspConfigName)) + 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.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *NetworkSecurityPerimeterConfigurationsClient) getHandleResponse(resp *http.Response) (NetworkSecurityPerimeterConfigurationsClientGetResponse, error) { + result := NetworkSecurityPerimeterConfigurationsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NetworkSecurityPerimeterConfiguration); err != nil { + return NetworkSecurityPerimeterConfigurationsClientGetResponse{}, err + } + return result, nil +} + +// NewListByServerPager - Gets a list of NSP configurations for a server. +// +// Generated from API version 2023-05-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - options - NetworkSecurityPerimeterConfigurationsClientListByServerOptions contains the optional parameters for the NetworkSecurityPerimeterConfigurationsClient.NewListByServerPager +// method. +func (client *NetworkSecurityPerimeterConfigurationsClient) NewListByServerPager(resourceGroupName string, serverName string, options *NetworkSecurityPerimeterConfigurationsClientListByServerOptions) *runtime.Pager[NetworkSecurityPerimeterConfigurationsClientListByServerResponse] { + return runtime.NewPager(runtime.PagingHandler[NetworkSecurityPerimeterConfigurationsClientListByServerResponse]{ + More: func(page NetworkSecurityPerimeterConfigurationsClientListByServerResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *NetworkSecurityPerimeterConfigurationsClientListByServerResponse) (NetworkSecurityPerimeterConfigurationsClientListByServerResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByServerCreateRequest(ctx, resourceGroupName, serverName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return NetworkSecurityPerimeterConfigurationsClientListByServerResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NetworkSecurityPerimeterConfigurationsClientListByServerResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return NetworkSecurityPerimeterConfigurationsClientListByServerResponse{}, runtime.NewResponseError(resp) + } + return client.listByServerHandleResponse(resp) + }, + }) +} + +// listByServerCreateRequest creates the ListByServer request. +func (client *NetworkSecurityPerimeterConfigurationsClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *NetworkSecurityPerimeterConfigurationsClientListByServerOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/networkSecurityPerimeterConfigurations" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + 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.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByServerHandleResponse handles the ListByServer response. +func (client *NetworkSecurityPerimeterConfigurationsClient) listByServerHandleResponse(resp *http.Response) (NetworkSecurityPerimeterConfigurationsClientListByServerResponse, error) { + result := NetworkSecurityPerimeterConfigurationsClientListByServerResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NetworkSecurityPerimeterConfigurationListResult); err != nil { + return NetworkSecurityPerimeterConfigurationsClientListByServerResponse{}, err + } + return result, nil +} + +// BeginReconcile - Reconcile network security perimeter configuration for SQL Resource Provider +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - options - NetworkSecurityPerimeterConfigurationsClientBeginReconcileOptions contains the optional parameters for the NetworkSecurityPerimeterConfigurationsClient.BeginReconcile +// method. +func (client *NetworkSecurityPerimeterConfigurationsClient) BeginReconcile(ctx context.Context, resourceGroupName string, serverName string, nspConfigName string, options *NetworkSecurityPerimeterConfigurationsClientBeginReconcileOptions) (*runtime.Poller[NetworkSecurityPerimeterConfigurationsClientReconcileResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.reconcile(ctx, resourceGroupName, serverName, nspConfigName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkSecurityPerimeterConfigurationsClientReconcileResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[NetworkSecurityPerimeterConfigurationsClientReconcileResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Reconcile - Reconcile network security perimeter configuration for SQL Resource Provider +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01-preview +func (client *NetworkSecurityPerimeterConfigurationsClient) reconcile(ctx context.Context, resourceGroupName string, serverName string, nspConfigName string, options *NetworkSecurityPerimeterConfigurationsClientBeginReconcileOptions) (*http.Response, error) { + var err error + req, err := client.reconcileCreateRequest(ctx, resourceGroupName, serverName, nspConfigName, 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 +} + +// reconcileCreateRequest creates the Reconcile request. +func (client *NetworkSecurityPerimeterConfigurationsClient) reconcileCreateRequest(ctx context.Context, resourceGroupName string, serverName string, nspConfigName string, options *NetworkSecurityPerimeterConfigurationsClientBeginReconcileOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/networkSecurityPerimeterConfigurations/{nspConfigName}/reconcile" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if nspConfigName == "" { + return nil, errors.New("parameter nspConfigName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{nspConfigName}", url.PathEscape(nspConfigName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} diff --git a/sdk/resourcemanager/sql/armsql/operations_client.go b/sdk/resourcemanager/sql/armsql/operations_client.go index 4a77e239fc18..1dc146e99a2d 100644 --- a/sdk/resourcemanager/sql/armsql/operations_client.go +++ b/sdk/resourcemanager/sql/armsql/operations_client.go @@ -39,7 +39,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Lists all of the available SQL Rest API operations. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - 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]{ @@ -77,7 +77,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/options.go b/sdk/resourcemanager/sql/armsql/options.go index 6856976468c2..ed8057e86f0f 100644 --- a/sdk/resourcemanager/sql/armsql/options.go +++ b/sdk/resourcemanager/sql/armsql/options.go @@ -521,17 +521,6 @@ type DatabasesClientListInaccessibleByServerOptions struct { // placeholder for future optional parameters } -// DatabasesClientListMetricDefinitionsOptions contains the optional parameters for the DatabasesClient.NewListMetricDefinitionsPager -// method. -type DatabasesClientListMetricDefinitionsOptions struct { - // placeholder for future optional parameters -} - -// DatabasesClientListMetricsOptions contains the optional parameters for the DatabasesClient.NewListMetricsPager method. -type DatabasesClientListMetricsOptions struct { - // placeholder for future optional parameters -} - // DatabasesClientRenameOptions contains the optional parameters for the DatabasesClient.Rename method. type DatabasesClientRenameOptions struct { // placeholder for future optional parameters @@ -573,6 +562,13 @@ type DistributedAvailabilityGroupsClientBeginDeleteOptions struct { ResumeToken string } +// DistributedAvailabilityGroupsClientBeginSetRoleOptions contains the optional parameters for the DistributedAvailabilityGroupsClient.BeginSetRole +// method. +type DistributedAvailabilityGroupsClientBeginSetRoleOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // DistributedAvailabilityGroupsClientBeginUpdateOptions contains the optional parameters for the DistributedAvailabilityGroupsClient.BeginUpdate // method. type DistributedAvailabilityGroupsClientBeginUpdateOptions struct { @@ -592,18 +588,6 @@ type DistributedAvailabilityGroupsClientListByInstanceOptions struct { // placeholder for future optional parameters } -// ElasticPoolActivitiesClientListByElasticPoolOptions contains the optional parameters for the ElasticPoolActivitiesClient.NewListByElasticPoolPager -// method. -type ElasticPoolActivitiesClientListByElasticPoolOptions struct { - // placeholder for future optional parameters -} - -// ElasticPoolDatabaseActivitiesClientListByElasticPoolOptions contains the optional parameters for the ElasticPoolDatabaseActivitiesClient.NewListByElasticPoolPager -// method. -type ElasticPoolDatabaseActivitiesClientListByElasticPoolOptions struct { - // placeholder for future optional parameters -} - // ElasticPoolOperationsClientCancelOptions contains the optional parameters for the ElasticPoolOperationsClient.Cancel method. type ElasticPoolOperationsClientCancelOptions struct { // placeholder for future optional parameters @@ -652,17 +636,6 @@ type ElasticPoolsClientListByServerOptions struct { Skip *int64 } -// ElasticPoolsClientListMetricDefinitionsOptions contains the optional parameters for the ElasticPoolsClient.NewListMetricDefinitionsPager -// method. -type ElasticPoolsClientListMetricDefinitionsOptions struct { - // placeholder for future optional parameters -} - -// ElasticPoolsClientListMetricsOptions contains the optional parameters for the ElasticPoolsClient.NewListMetricsPager method. -type ElasticPoolsClientListMetricsOptions struct { - // placeholder for future optional parameters -} - // EncryptionProtectorsClientBeginCreateOrUpdateOptions contains the optional parameters for the EncryptionProtectorsClient.BeginCreateOrUpdate // method. type EncryptionProtectorsClientBeginCreateOrUpdateOptions struct { @@ -823,9 +796,8 @@ type GeoBackupPoliciesClientGetOptions struct { // placeholder for future optional parameters } -// GeoBackupPoliciesClientListByDatabaseOptions contains the optional parameters for the GeoBackupPoliciesClient.NewListByDatabasePager -// method. -type GeoBackupPoliciesClientListByDatabaseOptions struct { +// GeoBackupPoliciesClientListOptions contains the optional parameters for the GeoBackupPoliciesClient.NewListPager method. +type GeoBackupPoliciesClientListOptions struct { // placeholder for future optional parameters } @@ -1018,10 +990,10 @@ type JobExecutionsClientListByAgentOptions struct { IsActive *bool // The number of elements in the collection to skip. - Skip *int32 + Skip *int64 // The number of elements to return from the collection. - Top *int32 + Top *int64 } // JobExecutionsClientListByJobOptions contains the optional parameters for the JobExecutionsClient.NewListByJobPager method. @@ -1042,10 +1014,10 @@ type JobExecutionsClientListByJobOptions struct { IsActive *bool // The number of elements in the collection to skip. - Skip *int32 + Skip *int64 // The number of elements to return from the collection. - Top *int32 + Top *int64 } // JobStepExecutionsClientGetOptions contains the optional parameters for the JobStepExecutionsClient.Get method. @@ -1072,10 +1044,10 @@ type JobStepExecutionsClientListByJobExecutionOptions struct { IsActive *bool // The number of elements in the collection to skip. - Skip *int32 + Skip *int64 // The number of elements to return from the collection. - Top *int32 + Top *int64 } // JobStepsClientCreateOrUpdateOptions contains the optional parameters for the JobStepsClient.CreateOrUpdate method. @@ -1132,10 +1104,10 @@ type JobTargetExecutionsClientListByJobExecutionOptions struct { IsActive *bool // The number of elements in the collection to skip. - Skip *int32 + Skip *int64 // The number of elements to return from the collection. - Top *int32 + Top *int64 } // JobTargetExecutionsClientListByStepOptions contains the optional parameters for the JobTargetExecutionsClient.NewListByStepPager @@ -1157,10 +1129,10 @@ type JobTargetExecutionsClientListByStepOptions struct { IsActive *bool // The number of elements in the collection to skip. - Skip *int32 + Skip *int64 // The number of elements to return from the collection. - Top *int32 + Top *int64 } // JobTargetGroupsClientCreateOrUpdateOptions contains the optional parameters for the JobTargetGroupsClient.CreateOrUpdate @@ -1625,13 +1597,13 @@ type ManagedDatabaseSecurityEventsClientListByDatabaseOptions struct { Filter *string // The number of elements in the collection to skip. - Skip *int32 + Skip *int64 // An opaque token that identifies a starting point in the collection. Skiptoken *string // The number of elements to return from the collection. - Top *int32 + Top *int64 } // ManagedDatabaseSensitivityLabelsClientCreateOrUpdateOptions contains the optional parameters for the ManagedDatabaseSensitivityLabelsClient.CreateOrUpdate @@ -1664,6 +1636,13 @@ type ManagedDatabaseSensitivityLabelsClientGetOptions struct { // placeholder for future optional parameters } +// ManagedDatabaseSensitivityLabelsClientListByDatabaseOptions contains the optional parameters for the ManagedDatabaseSensitivityLabelsClient.NewListByDatabasePager +// method. +type ManagedDatabaseSensitivityLabelsClientListByDatabaseOptions struct { + // An OData filter expression that filters elements in the collection. + Filter *string +} + // ManagedDatabaseSensitivityLabelsClientListCurrentByDatabaseOptions contains the optional parameters for the ManagedDatabaseSensitivityLabelsClient.NewListCurrentByDatabasePager // method. type ManagedDatabaseSensitivityLabelsClientListCurrentByDatabaseOptions struct { @@ -2000,6 +1979,13 @@ type ManagedInstanceLongTermRetentionPoliciesClientBeginCreateOrUpdateOptions st ResumeToken string } +// ManagedInstanceLongTermRetentionPoliciesClientBeginDeleteOptions contains the optional parameters for the ManagedInstanceLongTermRetentionPoliciesClient.BeginDelete +// method. +type ManagedInstanceLongTermRetentionPoliciesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // ManagedInstanceLongTermRetentionPoliciesClientGetOptions contains the optional parameters for the ManagedInstanceLongTermRetentionPoliciesClient.Get // method. type ManagedInstanceLongTermRetentionPoliciesClientGetOptions struct { @@ -2122,6 +2108,13 @@ type ManagedInstancesClientBeginFailoverOptions struct { ResumeToken string } +// ManagedInstancesClientBeginRefreshStatusOptions contains the optional parameters for the ManagedInstancesClient.BeginRefreshStatus +// method. +type ManagedInstancesClientBeginRefreshStatusOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // ManagedInstancesClientBeginStartOptions contains the optional parameters for the ManagedInstancesClient.BeginStart method. type ManagedInstancesClientBeginStartOptions struct { // Resumes the LRO from the provided token. @@ -2301,6 +2294,25 @@ type ManagedServerSecurityAlertPoliciesClientListByInstanceOptions struct { // placeholder for future optional parameters } +// NetworkSecurityPerimeterConfigurationsClientBeginReconcileOptions contains the optional parameters for the NetworkSecurityPerimeterConfigurationsClient.BeginReconcile +// method. +type NetworkSecurityPerimeterConfigurationsClientBeginReconcileOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkSecurityPerimeterConfigurationsClientGetOptions contains the optional parameters for the NetworkSecurityPerimeterConfigurationsClient.Get +// method. +type NetworkSecurityPerimeterConfigurationsClientGetOptions struct { + // placeholder for future optional parameters +} + +// NetworkSecurityPerimeterConfigurationsClientListByServerOptions contains the optional parameters for the NetworkSecurityPerimeterConfigurationsClient.NewListByServerPager +// method. +type NetworkSecurityPerimeterConfigurationsClientListByServerOptions struct { + // placeholder for future optional parameters +} + // OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. type OperationsClientListOptions struct { // placeholder for future optional parameters @@ -2516,6 +2528,13 @@ type SensitivityLabelsClientGetOptions struct { // placeholder for future optional parameters } +// SensitivityLabelsClientListByDatabaseOptions contains the optional parameters for the SensitivityLabelsClient.NewListByDatabasePager +// method. +type SensitivityLabelsClientListByDatabaseOptions struct { + // An OData filter expression that filters elements in the collection. + Filter *string +} + // SensitivityLabelsClientListCurrentByDatabaseOptions contains the optional parameters for the SensitivityLabelsClient.NewListCurrentByDatabasePager // method. type SensitivityLabelsClientListCurrentByDatabaseOptions struct { @@ -2658,30 +2677,6 @@ type ServerBlobAuditingPoliciesClientListByServerOptions struct { // placeholder for future optional parameters } -// ServerCommunicationLinksClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerCommunicationLinksClient.BeginCreateOrUpdate -// method. -type ServerCommunicationLinksClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ServerCommunicationLinksClientDeleteOptions contains the optional parameters for the ServerCommunicationLinksClient.Delete -// method. -type ServerCommunicationLinksClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// ServerCommunicationLinksClientGetOptions contains the optional parameters for the ServerCommunicationLinksClient.Get method. -type ServerCommunicationLinksClientGetOptions struct { - // placeholder for future optional parameters -} - -// ServerCommunicationLinksClientListByServerOptions contains the optional parameters for the ServerCommunicationLinksClient.NewListByServerPager -// method. -type ServerCommunicationLinksClientListByServerOptions struct { - // placeholder for future optional parameters -} - // ServerConfigurationOptionsClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerConfigurationOptionsClient.BeginCreateOrUpdate // method. type ServerConfigurationOptionsClientBeginCreateOrUpdateOptions struct { @@ -2958,17 +2953,6 @@ type ServersClientListOptions struct { Expand *string } -// ServiceObjectivesClientGetOptions contains the optional parameters for the ServiceObjectivesClient.Get method. -type ServiceObjectivesClientGetOptions struct { - // placeholder for future optional parameters -} - -// ServiceObjectivesClientListByServerOptions contains the optional parameters for the ServiceObjectivesClient.NewListByServerPager -// method. -type ServiceObjectivesClientListByServerOptions struct { - // placeholder for future optional parameters -} - // StartStopManagedInstanceSchedulesClientCreateOrUpdateOptions contains the optional parameters for the StartStopManagedInstanceSchedulesClient.CreateOrUpdate // method. type StartStopManagedInstanceSchedulesClientCreateOrUpdateOptions struct { diff --git a/sdk/resourcemanager/sql/armsql/outboundfirewallrules_client.go b/sdk/resourcemanager/sql/armsql/outboundfirewallrules_client.go index 467f3a163d93..773b25de33de 100644 --- a/sdk/resourcemanager/sql/armsql/outboundfirewallrules_client.go +++ b/sdk/resourcemanager/sql/armsql/outboundfirewallrules_client.go @@ -46,15 +46,15 @@ func NewOutboundFirewallRulesClient(subscriptionID string, credential azcore.Tok // BeginCreateOrUpdate - Create a outbound firewall rule with a given name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-02-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. // - options - OutboundFirewallRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the OutboundFirewallRulesClient.BeginCreateOrUpdate // method. -func (client *OutboundFirewallRulesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, outboundRuleFqdn string, parameters OutboundFirewallRule, options *OutboundFirewallRulesClientBeginCreateOrUpdateOptions) (*runtime.Poller[OutboundFirewallRulesClientCreateOrUpdateResponse], error) { +func (client *OutboundFirewallRulesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, outboundRuleFqdn string, options *OutboundFirewallRulesClientBeginCreateOrUpdateOptions) (*runtime.Poller[OutboundFirewallRulesClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, serverName, outboundRuleFqdn, parameters, options) + resp, err := client.createOrUpdate(ctx, resourceGroupName, serverName, outboundRuleFqdn, options) if err != nil { return nil, err } @@ -68,10 +68,10 @@ func (client *OutboundFirewallRulesClient) BeginCreateOrUpdate(ctx context.Conte // CreateOrUpdate - Create a outbound firewall rule with a given name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-02-01-preview -func (client *OutboundFirewallRulesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, outboundRuleFqdn string, parameters OutboundFirewallRule, options *OutboundFirewallRulesClientBeginCreateOrUpdateOptions) (*http.Response, error) { +// Generated from API version 2023-05-01-preview +func (client *OutboundFirewallRulesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, outboundRuleFqdn string, options *OutboundFirewallRulesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, outboundRuleFqdn, parameters, options) + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, outboundRuleFqdn, options) if err != nil { return nil, err } @@ -87,7 +87,7 @@ func (client *OutboundFirewallRulesClient) createOrUpdate(ctx context.Context, r } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *OutboundFirewallRulesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, outboundRuleFqdn string, parameters OutboundFirewallRule, options *OutboundFirewallRulesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *OutboundFirewallRulesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, outboundRuleFqdn string, options *OutboundFirewallRulesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/outboundFirewallRules/{outboundRuleFqdn}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -110,19 +110,16 @@ func (client *OutboundFirewallRulesClient) createOrUpdateCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-02-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } return req, nil } // BeginDelete - Deletes a outbound firewall rule with a given name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-02-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -144,7 +141,7 @@ func (client *OutboundFirewallRulesClient) BeginDelete(ctx context.Context, reso // Delete - Deletes a outbound firewall rule with a given name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-02-01-preview +// Generated from API version 2023-05-01-preview func (client *OutboundFirewallRulesClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, outboundRuleFqdn string, options *OutboundFirewallRulesClientBeginDeleteOptions) (*http.Response, error) { var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, outboundRuleFqdn, options) @@ -186,7 +183,7 @@ func (client *OutboundFirewallRulesClient) deleteCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-02-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -194,7 +191,7 @@ func (client *OutboundFirewallRulesClient) deleteCreateRequest(ctx context.Conte // Get - Gets an outbound firewall rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-02-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -242,7 +239,7 @@ func (client *OutboundFirewallRulesClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-02-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -259,7 +256,7 @@ func (client *OutboundFirewallRulesClient) getHandleResponse(resp *http.Response // NewListByServerPager - Gets all outbound firewall rules on a server. // -// Generated from API version 2021-02-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -313,7 +310,7 @@ func (client *OutboundFirewallRulesClient) listByServerCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-02-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/outboundfirewallrules_client_example_test.go b/sdk/resourcemanager/sql/armsql/outboundfirewallrules_client_example_test.go deleted file mode 100644 index 850c96fe2d42..000000000000 --- a/sdk/resourcemanager/sql/armsql/outboundfirewallrules_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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/OutboundFirewallRuleGet.json -func ExampleOutboundFirewallRulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOutboundFirewallRulesClient().Get(ctx, "sqlcrudtest-7398", "sqlcrudtest-4645", "server.database.windows.net", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OutboundFirewallRule = armsql.OutboundFirewallRule{ - // Name: to.Ptr("server.database.windows.net"), - // Type: to.Ptr("Microsoft.Sql/servers/outboundFirewallRules"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645/outboundFirewallRules/server.datbase.windows.net"), - // Properties: &armsql.OutboundFirewallRuleProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/OutboundFirewallRuleCreate.json -func ExampleOutboundFirewallRulesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewOutboundFirewallRulesClient().BeginCreateOrUpdate(ctx, "sqlcrudtest-7398", "sqlcrudtest-4645", "server.database.windows.net", armsql.OutboundFirewallRule{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OutboundFirewallRule = armsql.OutboundFirewallRule{ - // Name: to.Ptr("server.database.windows.net"), - // Type: to.Ptr("Microsoft.Sql/servers/outboundFirewallRules"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645/outboundFirewallRules/server.datbase.windows.net"), - // Properties: &armsql.OutboundFirewallRuleProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/OutboundFirewallRuleDelete.json -func ExampleOutboundFirewallRulesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewOutboundFirewallRulesClient().BeginDelete(ctx, "sqlcrudtest-7398", "sqlcrudtest-6661", "server.database.windows.net", 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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/OutboundFirewallRuleList.json -func ExampleOutboundFirewallRulesClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOutboundFirewallRulesClient().NewListByServerPager("sqlcrudtest-7398", "sqlcrudtest-4645", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OutboundFirewallRuleListResult = armsql.OutboundFirewallRuleListResult{ - // Value: []*armsql.OutboundFirewallRule{ - // { - // Name: to.Ptr("server.database.windows.net"), - // Type: to.Ptr("Microsoft.Sql/servers/outboundFirewallRules"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645/outboundFirewallRules/server.datbase.windows.net"), - // Properties: &armsql.OutboundFirewallRuleProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // }, - // { - // Name: to.Ptr("storage.blob.windows.net"), - // Type: to.Ptr("Microsoft.Sql/servers/outboundFirewallRules"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645/outboundFirewallRules/storage.blob.windows.net"), - // Properties: &armsql.OutboundFirewallRuleProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/sql/armsql/privateendpointconnections_client.go b/sdk/resourcemanager/sql/armsql/privateendpointconnections_client.go index 58a77d3e8bbe..6eb5c475460c 100644 --- a/sdk/resourcemanager/sql/armsql/privateendpointconnections_client.go +++ b/sdk/resourcemanager/sql/armsql/privateendpointconnections_client.go @@ -46,7 +46,7 @@ func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcor // BeginCreateOrUpdate - Approve or reject a private endpoint connection with a given name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -68,7 +68,7 @@ func (client *PrivateEndpointConnectionsClient) BeginCreateOrUpdate(ctx context. // CreateOrUpdate - Approve or reject a private endpoint connection with a given name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview func (client *PrivateEndpointConnectionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection, options *PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, privateEndpointConnectionName, parameters, options) @@ -110,7 +110,7 @@ func (client *PrivateEndpointConnectionsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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 *PrivateEndpointConnectionsClient) createOrUpdateCreateRequest(ctx // BeginDelete - Deletes a private endpoint connection with a given name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -144,7 +144,7 @@ func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, // Delete - Deletes a private endpoint connection with a given name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview func (client *PrivateEndpointConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*http.Response, error) { var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, privateEndpointConnectionName, options) @@ -186,7 +186,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -194,7 +194,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. // Get - Gets a private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -243,7 +243,7 @@ func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -260,7 +260,7 @@ func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Res // NewListByServerPager - Gets all private endpoint connections on a server. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -314,7 +314,7 @@ func (client *PrivateEndpointConnectionsClient) listByServerCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/privateendpointconnections_client_example_test.go b/sdk/resourcemanager/sql/armsql/privateendpointconnections_client_example_test.go deleted file mode 100644 index b3918c578e5a..000000000000 --- a/sdk/resourcemanager/sql/armsql/privateendpointconnections_client_example_test.go +++ /dev/null @@ -1,183 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/PrivateEndpointConnectionList.json -func ExamplePrivateEndpointConnectionsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrivateEndpointConnectionsClient().NewListByServerPager("Default", "test-svr", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your 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 = armsql.PrivateEndpointConnectionListResult{ - // Value: []*armsql.PrivateEndpointConnection{ - // { - // Name: to.Ptr("private-endpoint-connection-name"), - // Type: to.Ptr("Microsoft.Sql/servers/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/test-svr/privateEndpointConnections/private-endpoint-connection-name-2"), - // Properties: &armsql.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armsql.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armsql.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr(armsql.PrivateLinkServiceConnectionStateActionsRequireNone), - // Status: to.Ptr(armsql.PrivateLinkServiceConnectionStateStatusApproved), - // }, - // ProvisioningState: to.Ptr(armsql.PrivateEndpointProvisioningState("Succeeded")), - // }, - // }, - // { - // Name: to.Ptr("private-endpoint-connection-name-2"), - // Type: to.Ptr("Microsoft.Sql/servers/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/test-svr/privateEndpointConnections/private-endpoint-connection-name-2"), - // Properties: &armsql.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armsql.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name-2"), - // }, - // PrivateLinkServiceConnectionState: &armsql.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr(armsql.PrivateLinkServiceConnectionStateActionsRequireNone), - // Status: to.Ptr(armsql.PrivateLinkServiceConnectionStateStatusApproved), - // }, - // ProvisioningState: to.Ptr(armsql.PrivateEndpointProvisioningState("Succeeded")), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/PrivateEndpointConnectionGet.json -func ExamplePrivateEndpointConnectionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateEndpointConnectionsClient().Get(ctx, "Default", "test-svr", "private-endpoint-connection-name", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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 = armsql.PrivateEndpointConnection{ - // Name: to.Ptr("private-endpoint-connection-name"), - // Type: to.Ptr("Microsoft.Sql/servers/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/test-svr/privateEndpointConnections/private-endpoint-connection-name"), - // Properties: &armsql.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armsql.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armsql.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr(armsql.PrivateLinkServiceConnectionStateActionsRequireNone), - // Status: to.Ptr(armsql.PrivateLinkServiceConnectionStateStatusApproved), - // }, - // ProvisioningState: to.Ptr(armsql.PrivateEndpointProvisioningState("Succeeded")), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/PrivateEndpointConnectionUpdate.json -func ExamplePrivateEndpointConnectionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginCreateOrUpdate(ctx, "Default", "test-svr", "private-endpoint-connection-name", armsql.PrivateEndpointConnection{ - Properties: &armsql.PrivateEndpointConnectionProperties{ - PrivateLinkServiceConnectionState: &armsql.PrivateLinkServiceConnectionStateProperty{ - Description: to.Ptr("Approved by johndoe@contoso.com"), - Status: to.Ptr(armsql.PrivateLinkServiceConnectionStateStatusApproved), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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 = armsql.PrivateEndpointConnection{ - // Name: to.Ptr("private-endpoint-connection-name"), - // Type: to.Ptr("Microsoft.Sql/servers/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/test-svr/privateEndpointConnections/private-endpoint-connection-name"), - // Properties: &armsql.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armsql.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armsql.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Approved by johndoe@contoso.com"), - // ActionsRequired: to.Ptr(armsql.PrivateLinkServiceConnectionStateActionsRequireNone), - // Status: to.Ptr(armsql.PrivateLinkServiceConnectionStateStatusApproved), - // }, - // ProvisioningState: to.Ptr(armsql.PrivateEndpointProvisioningState("Succeeded")), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/PrivateEndpointConnectionDelete.json -func ExamplePrivateEndpointConnectionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginDelete(ctx, "Default", "test-svr", "private-endpoint-connection-name", 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/sql/armsql/privatelinkresources_client.go b/sdk/resourcemanager/sql/armsql/privatelinkresources_client.go index 0d7c2e60b07b..d7a1c99038d4 100644 --- a/sdk/resourcemanager/sql/armsql/privatelinkresources_client.go +++ b/sdk/resourcemanager/sql/armsql/privatelinkresources_client.go @@ -46,7 +46,7 @@ func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.Toke // Get - Gets a private link resource for SQL server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -95,7 +95,7 @@ func (client *PrivateLinkResourcesClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -112,7 +112,7 @@ func (client *PrivateLinkResourcesClient) getHandleResponse(resp *http.Response) // NewListByServerPager - Gets the private link resources for SQL server. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -166,7 +166,7 @@ func (client *PrivateLinkResourcesClient) listByServerCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/privatelinkresources_client_example_test.go b/sdk/resourcemanager/sql/armsql/privatelinkresources_client_example_test.go deleted file mode 100644 index c463756321c9..000000000000 --- a/sdk/resourcemanager/sql/armsql/privatelinkresources_client_example_test.go +++ /dev/null @@ -1,86 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/PrivateLinkResourcesList.json -func ExamplePrivateLinkResourcesClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrivateLinkResourcesClient().NewListByServerPager("Default", "test-svr", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PrivateLinkResourceListResult = armsql.PrivateLinkResourceListResult{ - // Value: []*armsql.PrivateLinkResource{ - // { - // Name: to.Ptr("plr"), - // Type: to.Ptr("Microsoft.Sql/servers/privateLinkResources"), - // ID: to.Ptr("subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/test-svr/privateLinkResources/plr"), - // Properties: &armsql.PrivateLinkResourceProperties{ - // GroupID: to.Ptr("sqlServer"), - // RequiredMembers: []*string{ - // to.Ptr("sqlServer")}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/PrivateLinkResourcesGet.json -func ExamplePrivateLinkResourcesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateLinkResourcesClient().Get(ctx, "Default", "test-svr", "plr", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateLinkResource = armsql.PrivateLinkResource{ - // Name: to.Ptr("plr"), - // Type: to.Ptr("Microsoft.Sql/servers/privateLinkResources"), - // ID: to.Ptr("subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/test-svr/privateLinkResources/plr"), - // Properties: &armsql.PrivateLinkResourceProperties{ - // GroupID: to.Ptr("sqlServer"), - // RequiredMembers: []*string{ - // to.Ptr("sqlServer")}, - // }, - // } -} diff --git a/sdk/resourcemanager/sql/armsql/recommendedsensitivitylabels_client.go b/sdk/resourcemanager/sql/armsql/recommendedsensitivitylabels_client.go index f68d0c02fd23..985b81ed26bd 100644 --- a/sdk/resourcemanager/sql/armsql/recommendedsensitivitylabels_client.go +++ b/sdk/resourcemanager/sql/armsql/recommendedsensitivitylabels_client.go @@ -46,7 +46,7 @@ func NewRecommendedSensitivityLabelsClient(subscriptionID string, credential azc // Update - Update recommended sensitivity labels states of a given database using an operations batch. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -94,7 +94,7 @@ func (client *RecommendedSensitivityLabelsClient) updateCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err diff --git a/sdk/resourcemanager/sql/armsql/recommendedsensitivitylabels_client_example_test.go b/sdk/resourcemanager/sql/armsql/recommendedsensitivitylabels_client_example_test.go deleted file mode 100644 index 4a5573326ac5..000000000000 --- a/sdk/resourcemanager/sql/armsql/recommendedsensitivitylabels_client_example_test.go +++ /dev/null @@ -1,62 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SensitivityLabelsRecommendedUpdate.json -func ExampleRecommendedSensitivityLabelsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewRecommendedSensitivityLabelsClient().Update(ctx, "myRG", "myServer", "myDatabase", armsql.RecommendedSensitivityLabelUpdateList{ - Operations: []*armsql.RecommendedSensitivityLabelUpdate{ - { - Properties: &armsql.RecommendedSensitivityLabelUpdateProperties{ - Schema: to.Ptr("dbo"), - Column: to.Ptr("column1"), - Op: to.Ptr(armsql.RecommendedSensitivityLabelUpdateKindEnable), - Table: to.Ptr("table1"), - }, - }, - { - Properties: &armsql.RecommendedSensitivityLabelUpdateProperties{ - Schema: to.Ptr("dbo"), - Column: to.Ptr("column2"), - Op: to.Ptr(armsql.RecommendedSensitivityLabelUpdateKindEnable), - Table: to.Ptr("table2"), - }, - }, - { - Properties: &armsql.RecommendedSensitivityLabelUpdateProperties{ - Schema: to.Ptr("dbo"), - Column: to.Ptr("column3"), - Op: to.Ptr(armsql.RecommendedSensitivityLabelUpdateKindDisable), - Table: to.Ptr("table1"), - }, - }}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/sql/armsql/recoverabledatabases_client.go b/sdk/resourcemanager/sql/armsql/recoverabledatabases_client.go index c5fe69e8d732..7cb4f0eee5f5 100644 --- a/sdk/resourcemanager/sql/armsql/recoverabledatabases_client.go +++ b/sdk/resourcemanager/sql/armsql/recoverabledatabases_client.go @@ -46,7 +46,7 @@ func NewRecoverableDatabasesClient(subscriptionID string, credential azcore.Toke // Get - Gets a recoverable database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -101,7 +101,7 @@ func (client *RecoverableDatabasesClient) getCreateRequest(ctx context.Context, if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -118,7 +118,7 @@ func (client *RecoverableDatabasesClient) getHandleResponse(resp *http.Response) // NewListByServerPager - Gets a list of recoverable databases. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -172,7 +172,7 @@ func (client *RecoverableDatabasesClient) listByServerCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/recoverabledatabases_client_example_test.go b/sdk/resourcemanager/sql/armsql/recoverabledatabases_client_example_test.go deleted file mode 100644 index 6277a7e699fa..000000000000 --- a/sdk/resourcemanager/sql/armsql/recoverabledatabases_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 armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/RecoverableDatabaseList.json -func ExampleRecoverableDatabasesClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRecoverableDatabasesClient().NewListByServerPager("recoverabledatabasetest-1234", "recoverabledatabasetest-7177", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.RecoverableDatabaseListResult = armsql.RecoverableDatabaseListResult{ - // Value: []*armsql.RecoverableDatabase{ - // { - // Name: to.Ptr("recoverabledatabasetest-1235"), - // Type: to.Ptr("Microsoft.Sql/servers/recoverableDatabases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/recoverabledatabasetest-1234/providers/Microsoft.Sql/servers/recoverabledatabasetest-7177/recoverableDatabases/recoverabledatabasetest-1235"), - // Properties: &armsql.RecoverableDatabaseProperties{ - // Edition: to.Ptr("Standard"), - // LastAvailableBackupDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-26T01:06:29.78Z"); return t}()), - // ServiceLevelObjective: to.Ptr("S0"), - // }, - // }, - // { - // Name: to.Ptr("recoverabledatabasetest-9231"), - // Type: to.Ptr("Microsoft.Sql/servers/recoverableDatabases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/recoverabledatabasetest-1234/providers/Microsoft.Sql/servers/recoverabledatabasetest-7177/recoverableDatabases/recoverabledatabasetest-9231"), - // Properties: &armsql.RecoverableDatabaseProperties{ - // Edition: to.Ptr("Premium"), - // LastAvailableBackupDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-26T03:20:31.78Z"); return t}()), - // ServiceLevelObjective: to.Ptr("P1"), - // }, - // }, - // { - // Name: to.Ptr("recoverabledatabasetest-0342"), - // Type: to.Ptr("Microsoft.Sql/servers/recoverabledatabases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/recoverabledatabasetest-1234/providers/Microsoft.Sql/servers/recoverabledatabasetest-7177/recoverabledatabases/recoverabledatabasetest-0342"), - // Properties: &armsql.RecoverableDatabaseProperties{ - // Edition: to.Ptr("Basic"), - // LastAvailableBackupDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-24T02:06:18.78Z"); return t}()), - // ServiceLevelObjective: to.Ptr("Basic"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/RecoverableDatabaseGet.json -func ExampleRecoverableDatabasesClient_Get_getARecoverableDatabase() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRecoverableDatabasesClient().Get(ctx, "recoverabledatabasetest-6852", "recoverabledatabasetest-2080", "recoverabledatabasetest-9187", &armsql.RecoverableDatabasesClientGetOptions{Expand: nil, - 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.RecoverableDatabase = armsql.RecoverableDatabase{ - // Name: to.Ptr("recoverabledatabasetest-9187"), - // Type: to.Ptr("Microsoft.Sql/servers/recoverableDatabases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/recoverabledatabasetest-6852/providers/Microsoft.Sql/servers/recoverabledatabasetest-2080/recoverableDatabases/recoverabledatabasetest-9187"), - // Properties: &armsql.RecoverableDatabaseProperties{ - // Edition: to.Ptr("Basic"), - // LastAvailableBackupDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-26T01:06:29.78Z"); return t}()), - // ServiceLevelObjective: to.Ptr("Basic"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/RecoverableDatabaseGetWithExpandEqualsKeys.json -func ExampleRecoverableDatabasesClient_Get_getsARecoverableDatabaseWithExpandEqualsKeys() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRecoverableDatabasesClient().Get(ctx, "recoverabledatabasetest-6852", "recoverabledatabasetest-2080", "recoverabledatabasetest-9187", &armsql.RecoverableDatabasesClientGetOptions{Expand: to.Ptr("keys"), - 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.RecoverableDatabase = armsql.RecoverableDatabase{ - // Name: to.Ptr("recoverabledatabasetest-9187"), - // Type: to.Ptr("Microsoft.Sql/servers/recoverableDatabases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/recoverabledatabasetest-6852/providers/Microsoft.Sql/servers/recoverabledatabasetest-2080/recoverableDatabases/recoverabledatabasetest-9187"), - // Properties: &armsql.RecoverableDatabaseProperties{ - // Edition: to.Ptr("Basic"), - // Keys: map[string]*armsql.DatabaseKey{ - // "https://your-key-vault-name.vault.azure.net/yourKey/yourKeyVersion": &armsql.DatabaseKey{ - // }, - // "https://your-key-vault-name.vault.azure.net/yourKey2/yourKey2Version": &armsql.DatabaseKey{ - // }, - // }, - // LastAvailableBackupDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-26T01:06:29.78Z"); return t}()), - // ServiceLevelObjective: to.Ptr("Basic"), - // }, - // } -} diff --git a/sdk/resourcemanager/sql/armsql/recoverablemanageddatabases_client.go b/sdk/resourcemanager/sql/armsql/recoverablemanageddatabases_client.go index 30dca34514c3..110104e8fdd9 100644 --- a/sdk/resourcemanager/sql/armsql/recoverablemanageddatabases_client.go +++ b/sdk/resourcemanager/sql/armsql/recoverablemanageddatabases_client.go @@ -46,7 +46,7 @@ func NewRecoverableManagedDatabasesClient(subscriptionID string, credential azco // Get - Gets a recoverable managed database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -94,7 +94,7 @@ func (client *RecoverableManagedDatabasesClient) getCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -111,7 +111,7 @@ func (client *RecoverableManagedDatabasesClient) getHandleResponse(resp *http.Re // NewListByInstancePager - Gets a list of recoverable managed databases. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -165,7 +165,7 @@ func (client *RecoverableManagedDatabasesClient) listByInstanceCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/recoverablemanageddatabases_client_example_test.go b/sdk/resourcemanager/sql/armsql/recoverablemanageddatabases_client_example_test.go deleted file mode 100644 index 720a823cdcc0..000000000000 --- a/sdk/resourcemanager/sql/armsql/recoverablemanageddatabases_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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListRecoverableManagedDatabasesByServer.json -func ExampleRecoverableManagedDatabasesClient_NewListByInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRecoverableManagedDatabasesClient().NewListByInstancePager("Test1", "managedInstance", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.RecoverableManagedDatabaseListResult = armsql.RecoverableManagedDatabaseListResult{ - // Value: []*armsql.RecoverableManagedDatabase{ - // { - // Name: to.Ptr("testdb"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/recoverableDaatabases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/testsvr/recoverableDaatabases/testdb"), - // Properties: &armsql.RecoverableManagedDatabaseProperties{ - // LastAvailableBackupDate: to.Ptr("2017-05-26T01:06:29.78Z"), - // }, - // }, - // { - // Name: to.Ptr("testdb2"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/recoverableDaatabases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/testsvr/recoverableDaatabases/testdb2"), - // Properties: &armsql.RecoverableManagedDatabaseProperties{ - // LastAvailableBackupDate: to.Ptr("2018-04-26T02:17:23.44Z"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetRecoverableManagedDatabase.json -func ExampleRecoverableManagedDatabasesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRecoverableManagedDatabasesClient().Get(ctx, "Test1", "managedInstance", "testdb", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RecoverableManagedDatabase = armsql.RecoverableManagedDatabase{ - // Name: to.Ptr("testdb"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/recoverableDatabases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/testsvr/recoverableDatabases/testdb"), - // Properties: &armsql.RecoverableManagedDatabaseProperties{ - // LastAvailableBackupDate: to.Ptr("2017-05-26T01:06:29.78Z"), - // }, - // } -} diff --git a/sdk/resourcemanager/sql/armsql/replicationlinks_client.go b/sdk/resourcemanager/sql/armsql/replicationlinks_client.go index 1d3fcd6a5643..8b25f2ba85b3 100644 --- a/sdk/resourcemanager/sql/armsql/replicationlinks_client.go +++ b/sdk/resourcemanager/sql/armsql/replicationlinks_client.go @@ -46,7 +46,7 @@ func NewReplicationLinksClient(subscriptionID string, credential azcore.TokenCre // BeginDelete - Deletes the replication link. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-02-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -69,7 +69,7 @@ func (client *ReplicationLinksClient) BeginDelete(ctx context.Context, resourceG // Delete - Deletes the replication link. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-02-01-preview +// Generated from API version 2023-05-01-preview func (client *ReplicationLinksClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string, options *ReplicationLinksClientBeginDeleteOptions) (*http.Response, error) { var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, databaseName, linkID, options) @@ -115,7 +115,7 @@ func (client *ReplicationLinksClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -123,7 +123,7 @@ func (client *ReplicationLinksClient) deleteCreateRequest(ctx context.Context, r // BeginFailover - Fails over from the current primary server to this server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-02-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -147,7 +147,7 @@ func (client *ReplicationLinksClient) BeginFailover(ctx context.Context, resourc // Failover - Fails over from the current primary server to this server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-02-01-preview +// Generated from API version 2023-05-01-preview func (client *ReplicationLinksClient) failover(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string, options *ReplicationLinksClientBeginFailoverOptions) (*http.Response, error) { var err error req, err := client.failoverCreateRequest(ctx, resourceGroupName, serverName, databaseName, linkID, options) @@ -193,7 +193,7 @@ func (client *ReplicationLinksClient) failoverCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -202,7 +202,7 @@ func (client *ReplicationLinksClient) failoverCreateRequest(ctx context.Context, // BeginFailoverAllowDataLoss - Fails over from the current primary server to this server allowing data loss. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-02-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -226,7 +226,7 @@ func (client *ReplicationLinksClient) BeginFailoverAllowDataLoss(ctx context.Con // FailoverAllowDataLoss - Fails over from the current primary server to this server allowing data loss. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-02-01-preview +// Generated from API version 2023-05-01-preview func (client *ReplicationLinksClient) failoverAllowDataLoss(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string, options *ReplicationLinksClientBeginFailoverAllowDataLossOptions) (*http.Response, error) { var err error req, err := client.failoverAllowDataLossCreateRequest(ctx, resourceGroupName, serverName, databaseName, linkID, options) @@ -272,7 +272,7 @@ func (client *ReplicationLinksClient) failoverAllowDataLossCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -281,7 +281,7 @@ func (client *ReplicationLinksClient) failoverAllowDataLossCreateRequest(ctx con // Get - Gets a replication link. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-02-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -334,7 +334,7 @@ func (client *ReplicationLinksClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -351,7 +351,7 @@ func (client *ReplicationLinksClient) getHandleResponse(resp *http.Response) (Re // NewListByDatabasePager - Gets a list of replication links on database. // -// Generated from API version 2022-02-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -410,7 +410,7 @@ func (client *ReplicationLinksClient) listByDatabaseCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -427,7 +427,7 @@ func (client *ReplicationLinksClient) listByDatabaseHandleResponse(resp *http.Re // NewListByServerPager - Gets a list of replication links. // -// Generated from API version 2022-02-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -481,7 +481,7 @@ func (client *ReplicationLinksClient) listByServerCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/replicationlinks_client_example_test.go b/sdk/resourcemanager/sql/armsql/replicationlinks_client_example_test.go deleted file mode 100644 index 3374f0ad8700..000000000000 --- a/sdk/resourcemanager/sql/armsql/replicationlinks_client_example_test.go +++ /dev/null @@ -1,299 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ReplicationLinkListByDatabase.json -func ExampleReplicationLinksClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewReplicationLinksClient().NewListByDatabasePager("Default", "sourcesvr", "tetha-db", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ReplicationLinkListResult = armsql.ReplicationLinkListResult{ - // Value: []*armsql.ReplicationLink{ - // { - // Name: to.Ptr("fb92de60-eb87-4a58-b250-3362d0cfdf26"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/sourcesvr/databases/tetha-db/replicationLinks/fb92de60-eb87-4a58-b250-3362d0cfdf26"), - // Properties: &armsql.ReplicationLinkProperties{ - // IsTerminationAllowed: to.Ptr(true), - // LinkType: to.Ptr(armsql.ReplicationLinkTypeGEO), - // PartnerDatabase: to.Ptr("tetha-db"), - // PartnerLocation: to.Ptr("Japan East"), - // PartnerRole: to.Ptr(armsql.ReplicationRoleSecondary), - // PartnerServer: to.Ptr("testsvr"), - // PercentComplete: to.Ptr[int32](100), - // ReplicationMode: to.Ptr("ASYNC"), - // ReplicationState: to.Ptr(armsql.ReplicationStateCATCHUP), - // Role: to.Ptr(armsql.ReplicationRolePrimary), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-21T08:11:46.907Z"); return t}()), - // }, - // }, - // { - // Name: to.Ptr("6ad1eefc-18a2-4fcb-94f3-4b654ba788d7"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/sourcesvr/databases/tetha-db/replicationLinks/6ad1eefc-18a2-4fcb-94f3-4b654ba788d7"), - // Properties: &armsql.ReplicationLinkProperties{ - // IsTerminationAllowed: to.Ptr(true), - // LinkType: to.Ptr(armsql.ReplicationLinkTypeGEO), - // PartnerDatabase: to.Ptr("tetha-db"), - // PartnerLocation: to.Ptr("Japan East"), - // PartnerRole: to.Ptr(armsql.ReplicationRoleSecondary), - // PartnerServer: to.Ptr("targetsvr"), - // PercentComplete: to.Ptr[int32](100), - // ReplicationMode: to.Ptr("ASYNC"), - // ReplicationState: to.Ptr(armsql.ReplicationStateCATCHUP), - // Role: to.Ptr(armsql.ReplicationRolePrimary), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-21T08:11:34.423Z"); return t}()), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ReplicationLinkGet.json -func ExampleReplicationLinksClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewReplicationLinksClient().Get(ctx, "Default", "sourcesvr", "gamma-db", "4891ca10-ebd0-47d7-9182-c722651780fb", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ReplicationLink = armsql.ReplicationLink{ - // Name: to.Ptr("4891ca10-ebd0-47d7-9182-c722651780fb"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/sourcesvr/databases/gamma-db/replicationLinks/4891ca10-ebd0-47d7-9182-c722651780fb"), - // Properties: &armsql.ReplicationLinkProperties{ - // IsTerminationAllowed: to.Ptr(true), - // LinkType: to.Ptr(armsql.ReplicationLinkTypeGEO), - // PartnerDatabase: to.Ptr("gamma-db"), - // PartnerLocation: to.Ptr("Japan East"), - // PartnerRole: to.Ptr(armsql.ReplicationRoleSecondary), - // PartnerServer: to.Ptr("testsvr"), - // PercentComplete: to.Ptr[int32](100), - // ReplicationMode: to.Ptr("ASYNC"), - // ReplicationState: to.Ptr(armsql.ReplicationStateCATCHUP), - // Role: to.Ptr(armsql.ReplicationRolePrimary), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-21T08:12:43.783Z"); return t}()), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ReplicationLinkDelete.json -func ExampleReplicationLinksClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationLinksClient().BeginDelete(ctx, "Default", "sourcesvr", "gamma-db", "4891ca10-ebd0-47d7-9182-c722651780fb", 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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ReplicationLinkFailover.json -func ExampleReplicationLinksClient_BeginFailover() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationLinksClient().BeginFailover(ctx, "Default", "sourcesvr", "gamma-db", "4891ca10-ebd0-47d7-9182-c722651780fb", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ReplicationLink = armsql.ReplicationLink{ - // Name: to.Ptr("4891ca10-ebd0-47d7-9182-c722651780fb"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/sourcesvr/databases/gamma-db/replicationLinks/4891ca10-ebd0-47d7-9182-c722651780fb"), - // Properties: &armsql.ReplicationLinkProperties{ - // IsTerminationAllowed: to.Ptr(true), - // LinkType: to.Ptr(armsql.ReplicationLinkTypeGEO), - // PartnerDatabase: to.Ptr("gamma-db"), - // PartnerLocation: to.Ptr("Japan East"), - // PartnerRole: to.Ptr(armsql.ReplicationRoleSecondary), - // PartnerServer: to.Ptr("testsvr"), - // PercentComplete: to.Ptr[int32](100), - // ReplicationMode: to.Ptr("ASYNC"), - // ReplicationState: to.Ptr(armsql.ReplicationStateCATCHUP), - // Role: to.Ptr(armsql.ReplicationRolePrimary), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-21T08:12:43.783Z"); return t}()), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ReplicationLinkFailoverAllowDataLoss.json -func ExampleReplicationLinksClient_BeginFailoverAllowDataLoss() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationLinksClient().BeginFailoverAllowDataLoss(ctx, "Default", "sourcesvr", "gamma-db", "4891ca10-ebd0-47d7-9182-c722651780fb", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ReplicationLink = armsql.ReplicationLink{ - // Name: to.Ptr("4891ca10-ebd0-47d7-9182-c722651780fb"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/sourcesvr/databases/gamma-db/replicationLinks/4891ca10-ebd0-47d7-9182-c722651780fb"), - // Properties: &armsql.ReplicationLinkProperties{ - // IsTerminationAllowed: to.Ptr(true), - // LinkType: to.Ptr(armsql.ReplicationLinkTypeGEO), - // PartnerDatabase: to.Ptr("gamma-db"), - // PartnerLocation: to.Ptr("Japan East"), - // PartnerRole: to.Ptr(armsql.ReplicationRoleSecondary), - // PartnerServer: to.Ptr("testsvr"), - // PercentComplete: to.Ptr[int32](100), - // ReplicationMode: to.Ptr("ASYNC"), - // ReplicationState: to.Ptr(armsql.ReplicationStateCATCHUP), - // Role: to.Ptr(armsql.ReplicationRolePrimary), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-21T08:12:43.783Z"); return t}()), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ReplicationLinkListByServer.json -func ExampleReplicationLinksClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewReplicationLinksClient().NewListByServerPager("Default", "sourcesvr", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ReplicationLinkListResult = armsql.ReplicationLinkListResult{ - // Value: []*armsql.ReplicationLink{ - // { - // Name: to.Ptr("fb92de60-eb87-4a58-b250-3362d0cfdf26"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-Onebox/providers/Microsoft.Sql/servers/sourcesvr/databases/tetha-db/replicationLinks/fb92de60-eb87-4a58-b250-3362d0cfdf26"), - // Properties: &armsql.ReplicationLinkProperties{ - // IsTerminationAllowed: to.Ptr(true), - // LinkType: to.Ptr(armsql.ReplicationLinkTypeGEO), - // PartnerDatabase: to.Ptr("tetha-db"), - // PartnerLocation: to.Ptr("Japan East"), - // PartnerRole: to.Ptr(armsql.ReplicationRoleSecondary), - // PartnerServer: to.Ptr("testsvr"), - // PercentComplete: to.Ptr[int32](100), - // ReplicationMode: to.Ptr("ASYNC"), - // ReplicationState: to.Ptr(armsql.ReplicationStateCATCHUP), - // Role: to.Ptr(armsql.ReplicationRolePrimary), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-21T08:11:46.907Z"); return t}()), - // }, - // }, - // { - // Name: to.Ptr("6ad1eefc-18a2-4fcb-94f3-4b654ba788d7"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-Onebox/providers/Microsoft.Sql/servers/sourcesvr/databases/tetha-db/replicationLinks/6ad1eefc-18a2-4fcb-94f3-4b654ba788d7"), - // Properties: &armsql.ReplicationLinkProperties{ - // IsTerminationAllowed: to.Ptr(true), - // LinkType: to.Ptr(armsql.ReplicationLinkTypeGEO), - // PartnerDatabase: to.Ptr("tetha-db"), - // PartnerLocation: to.Ptr("Japan East"), - // PartnerRole: to.Ptr(armsql.ReplicationRoleSecondary), - // PartnerServer: to.Ptr("targetsvr"), - // PercentComplete: to.Ptr[int32](100), - // ReplicationMode: to.Ptr("ASYNC"), - // ReplicationState: to.Ptr(armsql.ReplicationStateCATCHUP), - // Role: to.Ptr(armsql.ReplicationRolePrimary), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-21T08:11:34.423Z"); return t}()), - // }, - // }, - // { - // Name: to.Ptr("4891ca10-ebd0-47d7-9182-c722651780fb"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-Onebox/providers/Microsoft.Sql/servers/sourcesvr/databases/gamma-db/replicationLinks/4891ca10-ebd0-47d7-9182-c722651780fb"), - // Properties: &armsql.ReplicationLinkProperties{ - // IsTerminationAllowed: to.Ptr(true), - // LinkType: to.Ptr(armsql.ReplicationLinkTypeGEO), - // PartnerDatabase: to.Ptr("gamma-db"), - // PartnerLocation: to.Ptr("Japan East"), - // PartnerRole: to.Ptr(armsql.ReplicationRoleSecondary), - // PartnerServer: to.Ptr("testsvr"), - // PercentComplete: to.Ptr[int32](100), - // ReplicationMode: to.Ptr("ASYNC"), - // ReplicationState: to.Ptr(armsql.ReplicationStateCATCHUP), - // Role: to.Ptr(armsql.ReplicationRolePrimary), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-21T08:12:43.783Z"); return t}()), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/sql/armsql/response_types.go b/sdk/resourcemanager/sql/armsql/response_types.go index 091b5ae7f5c7..8ddfe0fe12e0 100644 --- a/sdk/resourcemanager/sql/armsql/response_types.go +++ b/sdk/resourcemanager/sql/armsql/response_types.go @@ -52,25 +52,25 @@ type CapabilitiesClientListByLocationResponse struct { // DataMaskingPoliciesClientCreateOrUpdateResponse contains the response from method DataMaskingPoliciesClient.CreateOrUpdate. type DataMaskingPoliciesClientCreateOrUpdateResponse struct { - // Represents a database data masking policy. + // A database data masking policy. DataMaskingPolicy } // DataMaskingPoliciesClientGetResponse contains the response from method DataMaskingPoliciesClient.Get. type DataMaskingPoliciesClientGetResponse struct { - // Represents a database data masking policy. + // A database data masking policy. DataMaskingPolicy } // DataMaskingRulesClientCreateOrUpdateResponse contains the response from method DataMaskingRulesClient.CreateOrUpdate. type DataMaskingRulesClientCreateOrUpdateResponse struct { - // Represents a database data masking rule. + // A database data masking rule. DataMaskingRule } // DataMaskingRulesClientListByDatabaseResponse contains the response from method DataMaskingRulesClient.NewListByDatabasePager. type DataMaskingRulesClientListByDatabaseResponse struct { - // The response to a list data masking rules request. + // The list of database data masking rules. DataMaskingRuleListResult } @@ -472,18 +472,6 @@ type DatabasesClientListInaccessibleByServerResponse struct { DatabaseListResult } -// DatabasesClientListMetricDefinitionsResponse contains the response from method DatabasesClient.NewListMetricDefinitionsPager. -type DatabasesClientListMetricDefinitionsResponse struct { - // The response to a list database metric definitions request. - MetricDefinitionListResult -} - -// DatabasesClientListMetricsResponse contains the response from method DatabasesClient.NewListMetricsPager. -type DatabasesClientListMetricsResponse struct { - // The response to a list database metrics request. - MetricListResult -} - // DatabasesClientPauseResponse contains the response from method DatabasesClient.BeginPause. type DatabasesClientPauseResponse struct { // A database resource. @@ -559,22 +547,16 @@ type DistributedAvailabilityGroupsClientListByInstanceResponse struct { DistributedAvailabilityGroupsListResult } -// DistributedAvailabilityGroupsClientUpdateResponse contains the response from method DistributedAvailabilityGroupsClient.BeginUpdate. -type DistributedAvailabilityGroupsClientUpdateResponse struct { +// DistributedAvailabilityGroupsClientSetRoleResponse contains the response from method DistributedAvailabilityGroupsClient.BeginSetRole. +type DistributedAvailabilityGroupsClientSetRoleResponse struct { // Distributed availability group between box and Sql Managed Instance. DistributedAvailabilityGroup } -// ElasticPoolActivitiesClientListByElasticPoolResponse contains the response from method ElasticPoolActivitiesClient.NewListByElasticPoolPager. -type ElasticPoolActivitiesClientListByElasticPoolResponse struct { - // Represents the response to a list elastic pool activity request. - ElasticPoolActivityListResult -} - -// ElasticPoolDatabaseActivitiesClientListByElasticPoolResponse contains the response from method ElasticPoolDatabaseActivitiesClient.NewListByElasticPoolPager. -type ElasticPoolDatabaseActivitiesClientListByElasticPoolResponse struct { - // Represents the response to a list elastic pool database activity request. - ElasticPoolDatabaseActivityListResult +// DistributedAvailabilityGroupsClientUpdateResponse contains the response from method DistributedAvailabilityGroupsClient.BeginUpdate. +type DistributedAvailabilityGroupsClientUpdateResponse struct { + // Distributed availability group between box and Sql Managed Instance. + DistributedAvailabilityGroup } // ElasticPoolOperationsClientCancelResponse contains the response from method ElasticPoolOperationsClient.Cancel. @@ -616,18 +598,6 @@ type ElasticPoolsClientListByServerResponse struct { ElasticPoolListResult } -// ElasticPoolsClientListMetricDefinitionsResponse contains the response from method ElasticPoolsClient.NewListMetricDefinitionsPager. -type ElasticPoolsClientListMetricDefinitionsResponse struct { - // The response to a list database metric definitions request. - MetricDefinitionListResult -} - -// ElasticPoolsClientListMetricsResponse contains the response from method ElasticPoolsClient.NewListMetricsPager. -type ElasticPoolsClientListMetricsResponse struct { - // The response to a list database metrics request. - MetricListResult -} - // ElasticPoolsClientUpdateResponse contains the response from method ElasticPoolsClient.BeginUpdate. type ElasticPoolsClientUpdateResponse struct { // An elastic pool. @@ -783,19 +753,19 @@ type FirewallRulesClientReplaceResponse struct { // GeoBackupPoliciesClientCreateOrUpdateResponse contains the response from method GeoBackupPoliciesClient.CreateOrUpdate. type GeoBackupPoliciesClientCreateOrUpdateResponse struct { - // A database geo backup policy. + // A Geo backup policy. GeoBackupPolicy } // GeoBackupPoliciesClientGetResponse contains the response from method GeoBackupPoliciesClient.Get. type GeoBackupPoliciesClientGetResponse struct { - // A database geo backup policy. + // A Geo backup policy. GeoBackupPolicy } -// GeoBackupPoliciesClientListByDatabaseResponse contains the response from method GeoBackupPoliciesClient.NewListByDatabasePager. -type GeoBackupPoliciesClientListByDatabaseResponse struct { - // The response to a list geo backup policies request. +// GeoBackupPoliciesClientListResponse contains the response from method GeoBackupPoliciesClient.NewListPager. +type GeoBackupPoliciesClientListResponse struct { + // The list of geo backup policies. GeoBackupPolicyListResult } @@ -1459,6 +1429,12 @@ type ManagedDatabaseSensitivityLabelsClientGetResponse struct { SensitivityLabel } +// ManagedDatabaseSensitivityLabelsClientListByDatabaseResponse contains the response from method ManagedDatabaseSensitivityLabelsClient.NewListByDatabasePager. +type ManagedDatabaseSensitivityLabelsClientListByDatabaseResponse struct { + // A list of sensitivity labels. + SensitivityLabelListResult +} + // ManagedDatabaseSensitivityLabelsClientListCurrentByDatabaseResponse contains the response from method ManagedDatabaseSensitivityLabelsClient.NewListCurrentByDatabasePager. type ManagedDatabaseSensitivityLabelsClientListCurrentByDatabaseResponse struct { // A list of sensitivity labels. @@ -1758,6 +1734,12 @@ type ManagedInstanceLongTermRetentionPoliciesClientCreateOrUpdateResponse struct ManagedInstanceLongTermRetentionPolicy } +// ManagedInstanceLongTermRetentionPoliciesClientDeleteResponse contains the response from method ManagedInstanceLongTermRetentionPoliciesClient.BeginDelete. +type ManagedInstanceLongTermRetentionPoliciesClientDeleteResponse struct { + // A long term retention policy. + ManagedInstanceLongTermRetentionPolicy +} + // ManagedInstanceLongTermRetentionPoliciesClientGetResponse contains the response from method ManagedInstanceLongTermRetentionPoliciesClient.Get. type ManagedInstanceLongTermRetentionPoliciesClientGetResponse struct { // A long term retention policy. @@ -1902,14 +1884,22 @@ type ManagedInstancesClientListResponse struct { ManagedInstanceListResult } +// ManagedInstancesClientRefreshStatusResponse contains the response from method ManagedInstancesClient.BeginRefreshStatus. +type ManagedInstancesClientRefreshStatusResponse struct { + // An RefreshExternalGovernanceStatus operation result resource. + RefreshExternalGovernanceStatusOperationResultMI +} + // ManagedInstancesClientStartResponse contains the response from method ManagedInstancesClient.BeginStart. type ManagedInstancesClientStartResponse struct { - // placeholder for future response values + // An Azure SQL managed instance. + ManagedInstance } // ManagedInstancesClientStopResponse contains the response from method ManagedInstancesClient.BeginStop. type ManagedInstancesClientStopResponse struct { - // placeholder for future response values + // An Azure SQL managed instance. + ManagedInstance } // ManagedInstancesClientUpdateResponse contains the response from method ManagedInstancesClient.BeginUpdate. @@ -2016,6 +2006,24 @@ type ManagedServerSecurityAlertPoliciesClientListByInstanceResponse struct { ManagedServerSecurityAlertPolicyListResult } +// NetworkSecurityPerimeterConfigurationsClientGetResponse contains the response from method NetworkSecurityPerimeterConfigurationsClient.Get. +type NetworkSecurityPerimeterConfigurationsClientGetResponse struct { + // NSP Configuration for a server. + NetworkSecurityPerimeterConfiguration +} + +// NetworkSecurityPerimeterConfigurationsClientListByServerResponse contains the response from method NetworkSecurityPerimeterConfigurationsClient.NewListByServerPager. +type NetworkSecurityPerimeterConfigurationsClientListByServerResponse struct { + // A list of NSP configurations for a server. + NetworkSecurityPerimeterConfigurationListResult +} + +// NetworkSecurityPerimeterConfigurationsClientReconcileResponse contains the response from method NetworkSecurityPerimeterConfigurationsClient.BeginReconcile. +type NetworkSecurityPerimeterConfigurationsClientReconcileResponse struct { + // NSP Configuration for a server. + NetworkSecurityPerimeterConfiguration +} + // OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { // Result of the request to list SQL operations. @@ -2218,6 +2226,12 @@ type SensitivityLabelsClientGetResponse struct { SensitivityLabel } +// SensitivityLabelsClientListByDatabaseResponse contains the response from method SensitivityLabelsClient.NewListByDatabasePager. +type SensitivityLabelsClientListByDatabaseResponse struct { + // A list of sensitivity labels. + SensitivityLabelListResult +} + // SensitivityLabelsClientListCurrentByDatabaseResponse contains the response from method SensitivityLabelsClient.NewListCurrentByDatabasePager. type SensitivityLabelsClientListCurrentByDatabaseResponse struct { // A list of sensitivity labels. @@ -2347,29 +2361,6 @@ type ServerBlobAuditingPoliciesClientListByServerResponse struct { ServerBlobAuditingPolicyListResult } -// ServerCommunicationLinksClientCreateOrUpdateResponse contains the response from method ServerCommunicationLinksClient.BeginCreateOrUpdate. -type ServerCommunicationLinksClientCreateOrUpdateResponse struct { - // Server communication link. - ServerCommunicationLink -} - -// ServerCommunicationLinksClientDeleteResponse contains the response from method ServerCommunicationLinksClient.Delete. -type ServerCommunicationLinksClientDeleteResponse struct { - // placeholder for future response values -} - -// ServerCommunicationLinksClientGetResponse contains the response from method ServerCommunicationLinksClient.Get. -type ServerCommunicationLinksClientGetResponse struct { - // Server communication link. - ServerCommunicationLink -} - -// ServerCommunicationLinksClientListByServerResponse contains the response from method ServerCommunicationLinksClient.NewListByServerPager. -type ServerCommunicationLinksClientListByServerResponse struct { - // A list of server communication links. - ServerCommunicationLinkListResult -} - // ServerConfigurationOptionsClientCreateOrUpdateResponse contains the response from method ServerConfigurationOptionsClient.BeginCreateOrUpdate. type ServerConfigurationOptionsClientCreateOrUpdateResponse struct { // A server configuration option @@ -2554,7 +2545,7 @@ type ServerTrustGroupsClientListByLocationResponse struct { // ServerUsagesClientListByServerResponse contains the response from method ServerUsagesClient.NewListByServerPager. type ServerUsagesClientListByServerResponse struct { - // Represents the response to a list server metrics request. + // A list of server usage metrics. ServerUsageListResult } @@ -2634,18 +2625,6 @@ type ServersClientUpdateResponse struct { Server } -// ServiceObjectivesClientGetResponse contains the response from method ServiceObjectivesClient.Get. -type ServiceObjectivesClientGetResponse struct { - // Represents a database service objective. - ServiceObjective -} - -// ServiceObjectivesClientListByServerResponse contains the response from method ServiceObjectivesClient.NewListByServerPager. -type ServiceObjectivesClientListByServerResponse struct { - // Represents the response to a get database service objectives request. - ServiceObjectiveListResult -} - // StartStopManagedInstanceSchedulesClientCreateOrUpdateResponse contains the response from method StartStopManagedInstanceSchedulesClient.CreateOrUpdate. type StartStopManagedInstanceSchedulesClientCreateOrUpdateResponse struct { // Managed instance's Start/Stop schedule. @@ -2831,7 +2810,7 @@ type TdeCertificatesClientCreateResponse struct { // TimeZonesClientGetResponse contains the response from method TimeZonesClient.Get. type TimeZonesClientGetResponse struct { - // Time Zone. + // Time Zone property. TimeZone } diff --git a/sdk/resourcemanager/sql/armsql/restorabledroppeddatabases_client.go b/sdk/resourcemanager/sql/armsql/restorabledroppeddatabases_client.go index ef665e206cbe..0aa9bc1dec6b 100644 --- a/sdk/resourcemanager/sql/armsql/restorabledroppeddatabases_client.go +++ b/sdk/resourcemanager/sql/armsql/restorabledroppeddatabases_client.go @@ -46,7 +46,7 @@ func NewRestorableDroppedDatabasesClient(subscriptionID string, credential azcor // Get - Gets a restorable dropped database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -100,7 +100,7 @@ func (client *RestorableDroppedDatabasesClient) getCreateRequest(ctx context.Con if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -117,7 +117,7 @@ func (client *RestorableDroppedDatabasesClient) getHandleResponse(resp *http.Res // NewListByServerPager - Gets a list of restorable dropped databases. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -171,7 +171,7 @@ func (client *RestorableDroppedDatabasesClient) listByServerCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/restorabledroppeddatabases_client_example_test.go b/sdk/resourcemanager/sql/armsql/restorabledroppeddatabases_client_example_test.go deleted file mode 100644 index 9b2e228ba808..000000000000 --- a/sdk/resourcemanager/sql/armsql/restorabledroppeddatabases_client_example_test.go +++ /dev/null @@ -1,165 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ListRestorableDroppedDatabasesByServer.json -func ExampleRestorableDroppedDatabasesClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRestorableDroppedDatabasesClient().NewListByServerPager("Default-SQL-SouthEastAsia", "testsvr", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.RestorableDroppedDatabaseListResult = armsql.RestorableDroppedDatabaseListResult{ - // Value: []*armsql.RestorableDroppedDatabase{ - // { - // Name: to.Ptr("testdb,131403269876900000"), - // Type: to.Ptr("Microsoft.Sql/servers/restorableDroppedDatabases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/restorableDroppedDatabases/testdb"), - // Location: to.Ptr("southeastasia"), - // Properties: &armsql.RestorableDroppedDatabaseProperties{ - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), - // DatabaseName: to.Ptr("testdb"), - // DeletionDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-27T02:49:47.69Z"); return t}()), - // MaxSizeBytes: to.Ptr[int64](268435456000), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("BC_Gen4_2"), - // Tier: to.Ptr("BusinessCritical"), - // }, - // }, - // { - // Name: to.Ptr("testdb2,131403269876900000"), - // Type: to.Ptr("Microsoft.Sql/servers/restorableDroppedDatabases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/restorableDroppedDatabases/testdb2"), - // Location: to.Ptr("southeastasia"), - // Properties: &armsql.RestorableDroppedDatabaseProperties{ - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T04:41:33.937Z"); return t}()), - // DatabaseName: to.Ptr("testdb2"), - // DeletionDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-27T02:49:47.69Z"); return t}()), - // MaxSizeBytes: to.Ptr[int64](268435456000), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("GP_Gen4_2"), - // Tier: to.Ptr("GeneralPurpose"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/GetRestorableDroppedDatabaseWithExpandEqualsKeys.json -func ExampleRestorableDroppedDatabasesClient_Get_getsARestorableDroppedDatabaseWithExpandEqualsKeys() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRestorableDroppedDatabasesClient().Get(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb,131403269876900000", &armsql.RestorableDroppedDatabasesClientGetOptions{Expand: to.Ptr("keys"), - 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.RestorableDroppedDatabase = armsql.RestorableDroppedDatabase{ - // Name: to.Ptr("testdb,131403269876900000"), - // Type: to.Ptr("Microsoft.Sql/servers/restorableDroppedDatabases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/restorableDroppedDatabases/testdb"), - // Location: to.Ptr("southeastasia"), - // Properties: &armsql.RestorableDroppedDatabaseProperties{ - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-07T04:41:33.937Z"); return t}()), - // DatabaseName: to.Ptr("testdb"), - // DeletionDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-27T02:49:47.69Z"); return t}()), - // Keys: map[string]*armsql.DatabaseKey{ - // "https://your-key-vault-name.vault.azure.net/yourKey/yourKeyVersion": &armsql.DatabaseKey{ - // }, - // "https://your-key-vault-name.vault.azure.net/yourKey2/yourKey2Version": &armsql.DatabaseKey{ - // }, - // }, - // MaxSizeBytes: to.Ptr[int64](268435456000), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("BC_Gen4_2"), - // Tier: to.Ptr("BusinessCritical"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/GetRestorableDroppedDatabase.json -func ExampleRestorableDroppedDatabasesClient_Get_getsARestorableDroppedDatabase() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRestorableDroppedDatabasesClient().Get(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb,131403269876900000", &armsql.RestorableDroppedDatabasesClientGetOptions{Expand: nil, - 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.RestorableDroppedDatabase = armsql.RestorableDroppedDatabase{ - // Name: to.Ptr("testdb,131403269876900000"), - // Type: to.Ptr("Microsoft.Sql/servers/restorableDroppedDatabases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/restorableDroppedDatabases/testdb"), - // Location: to.Ptr("southeastasia"), - // Properties: &armsql.RestorableDroppedDatabaseProperties{ - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-07T04:41:33.937Z"); return t}()), - // DatabaseName: to.Ptr("testdb"), - // DeletionDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-27T02:49:47.69Z"); return t}()), - // MaxSizeBytes: to.Ptr[int64](268435456000), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("BC_Gen4_2"), - // Tier: to.Ptr("BusinessCritical"), - // }, - // } -} diff --git a/sdk/resourcemanager/sql/armsql/restorabledroppedmanageddatabases_client.go b/sdk/resourcemanager/sql/armsql/restorabledroppedmanageddatabases_client.go index 04d17e91154e..a4429971e286 100644 --- a/sdk/resourcemanager/sql/armsql/restorabledroppedmanageddatabases_client.go +++ b/sdk/resourcemanager/sql/armsql/restorabledroppedmanageddatabases_client.go @@ -46,7 +46,7 @@ func NewRestorableDroppedManagedDatabasesClient(subscriptionID string, credentia // Get - Gets a restorable dropped managed database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-05-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -94,7 +94,7 @@ func (client *RestorableDroppedManagedDatabasesClient) getCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -111,7 +111,7 @@ func (client *RestorableDroppedManagedDatabasesClient) getHandleResponse(resp *h // NewListByInstancePager - Gets a list of restorable dropped managed databases. // -// Generated from API version 2021-05-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -165,7 +165,7 @@ func (client *RestorableDroppedManagedDatabasesClient) listByInstanceCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/restorabledroppedmanageddatabases_client_example_test.go b/sdk/resourcemanager/sql/armsql/restorabledroppedmanageddatabases_client_example_test.go deleted file mode 100644 index c0c6fcba7330..000000000000 --- a/sdk/resourcemanager/sql/armsql/restorabledroppedmanageddatabases_client_example_test.go +++ /dev/null @@ -1,99 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/RestorableDroppedManagedDatabaseListByManagedInstance.json -func ExampleRestorableDroppedManagedDatabasesClient_NewListByInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRestorableDroppedManagedDatabasesClient().NewListByInstancePager("Test1", "managedInstance", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.RestorableDroppedManagedDatabaseListResult = armsql.RestorableDroppedManagedDatabaseListResult{ - // Value: []*armsql.RestorableDroppedManagedDatabase{ - // { - // Name: to.Ptr("testdb,131403269876900000"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/restorableDroppedDatabases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/testsvr/restorableDroppedDatabases/testdb,131403269876900000"), - // Location: to.Ptr("southeastasia"), - // Properties: &armsql.RestorableDroppedManagedDatabaseProperties{ - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-07T04:41:33.937Z"); return t}()), - // DatabaseName: to.Ptr("testdb"), - // DeletionDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-27T02:49:47.69Z"); return t}()), - // }, - // }, - // { - // Name: to.Ptr("testdb2,131403269876900000"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/restorableDroppedDatabases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/testsvr/restorableDroppedDatabases/testdb2,131403269876900000"), - // Location: to.Ptr("southeastasia"), - // Properties: &armsql.RestorableDroppedManagedDatabaseProperties{ - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-07T04:41:33.937Z"); return t}()), - // DatabaseName: to.Ptr("testdb2"), - // DeletionDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-27T02:49:47.69Z"); return t}()), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/GetRestorableDroppedManagedDatabase.json -func ExampleRestorableDroppedManagedDatabasesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRestorableDroppedManagedDatabasesClient().Get(ctx, "Test1", "managedInstance", "testdb,131403269876900000", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RestorableDroppedManagedDatabase = armsql.RestorableDroppedManagedDatabase{ - // Name: to.Ptr("testdb,131403269876900000"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/restorableDroppedDatabases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/testsvr/restorableDroppedDatabases/testdb,131403269876900000"), - // Location: to.Ptr("southeastasia"), - // Properties: &armsql.RestorableDroppedManagedDatabaseProperties{ - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-07T04:41:33.937Z"); return t}()), - // DatabaseName: to.Ptr("testdb"), - // DeletionDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-27T02:49:47.69Z"); return t}()), - // }, - // } -} diff --git a/sdk/resourcemanager/sql/armsql/restorepoints_client.go b/sdk/resourcemanager/sql/armsql/restorepoints_client.go index 289728de0900..7f5afc8131fe 100644 --- a/sdk/resourcemanager/sql/armsql/restorepoints_client.go +++ b/sdk/resourcemanager/sql/armsql/restorepoints_client.go @@ -46,7 +46,7 @@ func NewRestorePointsClient(subscriptionID string, credential azcore.TokenCreden // BeginCreate - Creates a restore point for a data warehouse. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -70,7 +70,7 @@ func (client *RestorePointsClient) BeginCreate(ctx context.Context, resourceGrou // Create - Creates a restore point for a data warehouse. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview func (client *RestorePointsClient) create(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters CreateDatabaseRestorePointDefinition, options *RestorePointsClientBeginCreateOptions) (*http.Response, error) { var err error req, err := client.createCreateRequest(ctx, resourceGroupName, serverName, databaseName, parameters, options) @@ -112,7 +112,7 @@ func (client *RestorePointsClient) createCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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 *RestorePointsClient) createCreateRequest(ctx context.Context, reso // Delete - Deletes a restore point. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -176,7 +176,7 @@ func (client *RestorePointsClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -184,7 +184,7 @@ func (client *RestorePointsClient) deleteCreateRequest(ctx context.Context, reso // Get - Gets a restore point. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -237,7 +237,7 @@ func (client *RestorePointsClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -254,7 +254,7 @@ func (client *RestorePointsClient) getHandleResponse(resp *http.Response) (Resto // NewListByDatabasePager - Gets a list of database restore points. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -313,7 +313,7 @@ func (client *RestorePointsClient) listByDatabaseCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/restorepoints_client_example_test.go b/sdk/resourcemanager/sql/armsql/restorepoints_client_example_test.go deleted file mode 100644 index 1f19e7418cb5..000000000000 --- a/sdk/resourcemanager/sql/armsql/restorepoints_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 armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRestorePointsListByDatabase.json -func ExampleRestorePointsClient_NewListByDatabasePager_listDatabaseRestorePoints() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRestorePointsClient().NewListByDatabasePager("sqlcrudtest-6730", "sqlcrudtest-9007", "3481", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.RestorePointListResult = armsql.RestorePointListResult{ - // Value: []*armsql.RestorePoint{ - // { - // Name: to.Ptr("ContinuousRestorePoint"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/restorePoints"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-6730/providers/Microsoft.Sql/servers/sqlcrudtest-9007/databases/3481/restorepoints/ContinuousRestorePoint"), - // Location: to.Ptr("West US"), - // Properties: &armsql.RestorePointProperties{ - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-12T00:00:00Z"); return t}()), - // RestorePointType: to.Ptr(armsql.RestorePointTypeCONTINUOUS), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DataWarehouseRestorePointsListByDatabase.json -func ExampleRestorePointsClient_NewListByDatabasePager_listDatawarehouseDatabaseRestorePoints() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRestorePointsClient().NewListByDatabasePager("Default-SQL-SouthEastAsia", "testserver", "testDatabase", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.RestorePointListResult = armsql.RestorePointListResult{ - // Value: []*armsql.RestorePoint{ - // { - // Name: to.Ptr("131546477590000000"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/restorePoints"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/servers/testserver/databases/testDatabase/restorePoints/131546477590000000"), - // Location: to.Ptr("japaneast"), - // Properties: &armsql.RestorePointProperties{ - // RestorePointCreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00Z"); return t}()), - // RestorePointLabel: to.Ptr("mylabel1"), - // RestorePointType: to.Ptr(armsql.RestorePointTypeDISCRETE), - // }, - // }, - // { - // Name: to.Ptr("131553636140000000"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/restorePoints"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/servers/testserver/databases/testDatabase/restorePoints/131553636140000000"), - // Location: to.Ptr("japaneast"), - // Properties: &armsql.RestorePointProperties{ - // RestorePointCreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-17T03:40:14Z"); return t}()), - // RestorePointLabel: to.Ptr("mylabel2"), - // RestorePointType: to.Ptr(armsql.RestorePointTypeDISCRETE), - // }, - // }, - // { - // Name: to.Ptr("131553619750000000"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/restorePoints"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/servers/testserver/databases/testDatabase/restorePoints/131553619750000000"), - // Location: to.Ptr("japaneast"), - // Properties: &armsql.RestorePointProperties{ - // RestorePointCreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-17T03:12:55Z"); return t}()), - // RestorePointType: to.Ptr(armsql.RestorePointTypeDISCRETE), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRestorePointsPost.json -func ExampleRestorePointsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRestorePointsClient().BeginCreate(ctx, "Default-SQL-SouthEastAsia", "testserver", "testDatabase", armsql.CreateDatabaseRestorePointDefinition{ - RestorePointLabel: to.Ptr("mylabel"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RestorePoint = armsql.RestorePoint{ - // Name: to.Ptr("131546477590000000"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/restorePoints"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/servers/testserver/databases/testDatabase/restorePoints/131546477590000000"), - // Location: to.Ptr("japaneast"), - // Properties: &armsql.RestorePointProperties{ - // RestorePointCreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00Z"); return t}()), - // RestorePointLabel: to.Ptr("mylabel"), - // RestorePointType: to.Ptr(armsql.RestorePointTypeDISCRETE), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRestorePointsGet.json -func ExampleRestorePointsClient_Get_getsADatabaseRestorePoint() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRestorePointsClient().Get(ctx, "Default-SQL-SouthEastAsia", "testserver", "testDatabase", "131546477590000000", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RestorePoint = armsql.RestorePoint{ - // Name: to.Ptr("ContinuousRestorePoint"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/restorePoints"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/servers/testserver/databases/testDatabase/restorePoints/ContinuousRestorePoint"), - // Location: to.Ptr("japaneast"), - // Properties: &armsql.RestorePointProperties{ - // EarliestRestoreDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00Z"); return t}()), - // RestorePointType: to.Ptr(armsql.RestorePointTypeCONTINUOUS), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DataWarehouseRestorePointsGet.json -func ExampleRestorePointsClient_Get_getsADatawarehouseDatabaseRestorePoint() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRestorePointsClient().Get(ctx, "Default-SQL-SouthEastAsia", "testserver", "testDatabase", "131546477590000000", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RestorePoint = armsql.RestorePoint{ - // Name: to.Ptr("131546477590000000"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/restorePoints"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/servers/testserver/databases/testDatabase/restorePoints/131546477590000000"), - // Location: to.Ptr("japaneast"), - // Properties: &armsql.RestorePointProperties{ - // RestorePointCreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00Z"); return t}()), - // RestorePointLabel: to.Ptr("mylabel"), - // RestorePointType: to.Ptr(armsql.RestorePointTypeDISCRETE), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRestorePointsDelete.json -func ExampleRestorePointsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewRestorePointsClient().Delete(ctx, "Default-SQL-SouthEastAsia", "testserver", "testDatabase", "131546477590000000", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/sql/armsql/sensitivitylabels_client.go b/sdk/resourcemanager/sql/armsql/sensitivitylabels_client.go index 64e863f5b020..c11ec7a758fe 100644 --- a/sdk/resourcemanager/sql/armsql/sensitivitylabels_client.go +++ b/sdk/resourcemanager/sql/armsql/sensitivitylabels_client.go @@ -47,7 +47,7 @@ func NewSensitivityLabelsClient(subscriptionID string, credential azcore.TokenCr // CreateOrUpdate - Creates or updates the sensitivity label of a given column // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -113,7 +113,7 @@ func (client *SensitivityLabelsClient) createOrUpdateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -134,7 +134,7 @@ func (client *SensitivityLabelsClient) createOrUpdateHandleResponse(resp *http.R // Delete - Deletes the sensitivity label of a given column // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -198,7 +198,7 @@ func (client *SensitivityLabelsClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -206,7 +206,7 @@ func (client *SensitivityLabelsClient) deleteCreateRequest(ctx context.Context, // DisableRecommendation - Disables sensitivity recommendations on a given column // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -270,7 +270,7 @@ func (client *SensitivityLabelsClient) disableRecommendationCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -279,7 +279,7 @@ func (client *SensitivityLabelsClient) disableRecommendationCreateRequest(ctx co // all columns) // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -343,7 +343,7 @@ func (client *SensitivityLabelsClient) enableRecommendationCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -351,7 +351,7 @@ func (client *SensitivityLabelsClient) enableRecommendationCreateRequest(ctx con // Get - Gets the sensitivity label of a given column // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -419,7 +419,7 @@ func (client *SensitivityLabelsClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -434,9 +434,88 @@ func (client *SensitivityLabelsClient) getHandleResponse(resp *http.Response) (S return result, nil } +// NewListByDatabasePager - Gets the sensitivity labels of a given database +// +// Generated from API version 2023-05-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - options - SensitivityLabelsClientListByDatabaseOptions contains the optional parameters for the SensitivityLabelsClient.NewListByDatabasePager +// method. +func (client *SensitivityLabelsClient) NewListByDatabasePager(resourceGroupName string, serverName string, databaseName string, options *SensitivityLabelsClientListByDatabaseOptions) *runtime.Pager[SensitivityLabelsClientListByDatabaseResponse] { + return runtime.NewPager(runtime.PagingHandler[SensitivityLabelsClientListByDatabaseResponse]{ + More: func(page SensitivityLabelsClientListByDatabaseResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *SensitivityLabelsClientListByDatabaseResponse) (SensitivityLabelsClientListByDatabaseResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByDatabaseCreateRequest(ctx, resourceGroupName, serverName, databaseName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return SensitivityLabelsClientListByDatabaseResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SensitivityLabelsClientListByDatabaseResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SensitivityLabelsClientListByDatabaseResponse{}, runtime.NewResponseError(resp) + } + return client.listByDatabaseHandleResponse(resp) + }, + }) +} + +// listByDatabaseCreateRequest creates the ListByDatabase request. +func (client *SensitivityLabelsClient) listByDatabaseCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *SensitivityLabelsClientListByDatabaseOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sensitivityLabels" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if databaseName == "" { + return nil, errors.New("parameter databaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + 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.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + reqQP.Set("api-version", "2023-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByDatabaseHandleResponse handles the ListByDatabase response. +func (client *SensitivityLabelsClient) listByDatabaseHandleResponse(resp *http.Response) (SensitivityLabelsClientListByDatabaseResponse, error) { + result := SensitivityLabelsClientListByDatabaseResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SensitivityLabelListResult); err != nil { + return SensitivityLabelsClientListByDatabaseResponse{}, err + } + return result, nil +} + // NewListCurrentByDatabasePager - Gets the sensitivity labels of a given database // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -504,7 +583,7 @@ func (client *SensitivityLabelsClient) listCurrentByDatabaseCreateRequest(ctx co if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -521,7 +600,7 @@ func (client *SensitivityLabelsClient) listCurrentByDatabaseHandleResponse(resp // NewListRecommendedByDatabasePager - Gets the sensitivity labels of a given database // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -589,7 +668,7 @@ func (client *SensitivityLabelsClient) listRecommendedByDatabaseCreateRequest(ct if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -607,7 +686,7 @@ func (client *SensitivityLabelsClient) listRecommendedByDatabaseHandleResponse(r // Update - Update sensitivity labels of a given database using an operations batch. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -655,7 +734,7 @@ func (client *SensitivityLabelsClient) updateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err diff --git a/sdk/resourcemanager/sql/armsql/sensitivitylabels_client_example_test.go b/sdk/resourcemanager/sql/armsql/sensitivitylabels_client_example_test.go deleted file mode 100644 index ec0b8d169f17..000000000000 --- a/sdk/resourcemanager/sql/armsql/sensitivitylabels_client_example_test.go +++ /dev/null @@ -1,329 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SensitivityLabelsListByDatabaseWithSourceCurrent.json -func ExampleSensitivityLabelsClient_NewListCurrentByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSensitivityLabelsClient().NewListCurrentByDatabasePager("myRG", "myServer", "myDatabase", &armsql.SensitivityLabelsClientListCurrentByDatabaseOptions{SkipToken: nil, - Count: nil, - 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.SensitivityLabelListResult = armsql.SensitivityLabelListResult{ - // Value: []*armsql.SensitivityLabel{ - // { - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/schemas/tables/columns/sensitivityLabels"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myRG/providers/Microsoft.Sql/servers/myServer/databases/myDatabase/schemas/dbo/tables/myTable/columns/myColumn3/sensitivityLabels/current"), - // Properties: &armsql.SensitivityLabelProperties{ - // ColumnName: to.Ptr("myColumn3"), - // InformationType: to.Ptr("Financial"), - // InformationTypeID: to.Ptr("d22fa6e9-5ee4-3bde-4c2b-a409604c4646"), - // LabelID: to.Ptr("05e6eaa1-075a-4fb4-a732-a92215a2444a"), - // LabelName: to.Ptr("Sensitive"), - // Rank: to.Ptr(armsql.SensitivityLabelRankLow), - // SchemaName: to.Ptr("dbo"), - // TableName: to.Ptr("myTable"), - // }, - // }, - // { - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/schemas/tables/columns/sensitivityLabels"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myRG/providers/Microsoft.Sql/servers/myServer/databases/myDatabase/schemas/dbo/tables/myTable/columns/myColumn4/sensitivityLabels/current"), - // Properties: &armsql.SensitivityLabelProperties{ - // ColumnName: to.Ptr("myColumn4"), - // InformationType: to.Ptr("Email"), - // InformationTypeID: to.Ptr("d22fa6e9-5ee4-3bde-4c2b-a409604c4646"), - // LabelID: to.Ptr("bf91e08c-f4f0-478a-b016-25164b2a65ff"), - // LabelName: to.Ptr("PII"), - // Rank: to.Ptr(armsql.SensitivityLabelRankNone), - // SchemaName: to.Ptr("dbo"), - // TableName: to.Ptr("myTable"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SensitivityLabelsCurrentUpdate.json -func ExampleSensitivityLabelsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewSensitivityLabelsClient().Update(ctx, "myRG", "myServer", "myDatabase", armsql.SensitivityLabelUpdateList{ - Operations: []*armsql.SensitivityLabelUpdate{ - { - Properties: &armsql.SensitivityLabelUpdateProperties{ - Schema: to.Ptr("dbo"), - Column: to.Ptr("column1"), - Op: to.Ptr(armsql.SensitivityLabelUpdateKindSet), - SensitivityLabel: &armsql.SensitivityLabel{ - Properties: &armsql.SensitivityLabelProperties{ - InformationType: to.Ptr("Financial"), - InformationTypeID: to.Ptr("1D3652D6-422C-4115-82F1-65DAEBC665C8"), - LabelID: to.Ptr("3A477B16-9423-432B-AA97-6069B481CEC3"), - LabelName: to.Ptr("Highly Confidential"), - Rank: to.Ptr(armsql.SensitivityLabelRankLow), - }, - }, - Table: to.Ptr("table1"), - }, - }, - { - Properties: &armsql.SensitivityLabelUpdateProperties{ - Schema: to.Ptr("dbo"), - Column: to.Ptr("column2"), - Op: to.Ptr(armsql.SensitivityLabelUpdateKindSet), - SensitivityLabel: &armsql.SensitivityLabel{ - Properties: &armsql.SensitivityLabelProperties{ - InformationType: to.Ptr("PhoneNumber"), - InformationTypeID: to.Ptr("d22fa6e9-5ee4-3bde-4c2b-a409604c4646"), - LabelID: to.Ptr("bf91e08c-f4f0-478a-b016-25164b2a65ff"), - LabelName: to.Ptr("PII"), - Rank: to.Ptr(armsql.SensitivityLabelRankCritical), - }, - }, - Table: to.Ptr("table2"), - }, - }, - { - Properties: &armsql.SensitivityLabelUpdateProperties{ - Schema: to.Ptr("dbo"), - Column: to.Ptr("Column3"), - Op: to.Ptr(armsql.SensitivityLabelUpdateKindRemove), - Table: to.Ptr("Table1"), - }, - }}, - }, 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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SensitivityLabelsListByDatabaseWithSourceRecommended.json -func ExampleSensitivityLabelsClient_NewListRecommendedByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSensitivityLabelsClient().NewListRecommendedByDatabasePager("myRG", "myServer", "myDatabase", &armsql.SensitivityLabelsClientListRecommendedByDatabaseOptions{SkipToken: nil, - IncludeDisabledRecommendations: nil, - 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.SensitivityLabelListResult = armsql.SensitivityLabelListResult{ - // Value: []*armsql.SensitivityLabel{ - // { - // Name: to.Ptr("recommended"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/schemas/tables/columns/sensitivityLabels"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myRG/providers/Microsoft.Sql/servers/myServer/databases/myDatabase/schemas/dbo/tables/myTable/columns/myColumn/sensitivityLabels/recommended"), - // Properties: &armsql.SensitivityLabelProperties{ - // ColumnName: to.Ptr("myColumn"), - // InformationType: to.Ptr("Financial"), - // InformationTypeID: to.Ptr("d22fa6e9-5ee4-3bde-4c2b-a409604c4646"), - // LabelID: to.Ptr("05e6eaa1-075a-4fb4-a732-a92215a2444a"), - // LabelName: to.Ptr("Sensitive"), - // SchemaName: to.Ptr("dbo"), - // TableName: to.Ptr("myTable"), - // }, - // }, - // { - // Name: to.Ptr("recommended"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/schemas/tables/columns/sensitivityLabels"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myRG/providers/Microsoft.Sql/servers/myServer/databases/myDatabase/schemas/dbo/tables/myTable/columns/myColumn2/sensitivityLabels/recommended"), - // Properties: &armsql.SensitivityLabelProperties{ - // ColumnName: to.Ptr("myColumn2"), - // InformationType: to.Ptr("Email"), - // InformationTypeID: to.Ptr("d22fa6e9-5ee4-3bde-4c2b-a409604c4646"), - // LabelID: to.Ptr("bf91e08c-f4f0-478a-b016-25164b2a65ff"), - // LabelName: to.Ptr("PII"), - // SchemaName: to.Ptr("dbo"), - // TableName: to.Ptr("myTable"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/RecommendedColumnSensitivityLabelEnable.json -func ExampleSensitivityLabelsClient_EnableRecommendation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewSensitivityLabelsClient().EnableRecommendation(ctx, "myRG", "myServer", "myDatabase", "dbo", "myTable", "myColumn", 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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/RecommendedColumnSensitivityLabelDisable.json -func ExampleSensitivityLabelsClient_DisableRecommendation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewSensitivityLabelsClient().DisableRecommendation(ctx, "myRG", "myServer", "myDatabase", "dbo", "myTable", "myColumn", 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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ColumnSensitivityLabelGet.json -func ExampleSensitivityLabelsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSensitivityLabelsClient().Get(ctx, "myRG", "myServer", "myDatabase", "dbo", "myTable", "myColumn", armsql.SensitivityLabelSourceCurrent, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SensitivityLabel = armsql.SensitivityLabel{ - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/schemas/tables/columns/sensitivityLabels"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myRG/providers/Microsoft.Sql/servers/myServer/databases/myDatabase/schemas/dbo/tables/myTable/columns/myColumn/sensitivityLabels/current"), - // Properties: &armsql.SensitivityLabelProperties{ - // ColumnName: to.Ptr("myColumn"), - // InformationType: to.Ptr("PhoneNumber"), - // InformationTypeID: to.Ptr("d22fa6e9-5ee4-3bde-4c2b-a409604c4646"), - // LabelID: to.Ptr("bf91e08c-f4f0-478a-b016-25164b2a65ff"), - // LabelName: to.Ptr("PII"), - // Rank: to.Ptr(armsql.SensitivityLabelRankHigh), - // SchemaName: to.Ptr("dbo"), - // TableName: to.Ptr("myTable"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ColumnSensitivityLabelCreateMax.json -func ExampleSensitivityLabelsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSensitivityLabelsClient().CreateOrUpdate(ctx, "myRG", "myServer", "myDatabase", "dbo", "myTable", "myColumn", armsql.SensitivityLabel{ - Properties: &armsql.SensitivityLabelProperties{ - InformationType: to.Ptr("PhoneNumber"), - InformationTypeID: to.Ptr("d22fa6e9-5ee4-3bde-4c2b-a409604c4646"), - LabelID: to.Ptr("bf91e08c-f4f0-478a-b016-25164b2a65ff"), - LabelName: to.Ptr("PII"), - Rank: to.Ptr(armsql.SensitivityLabelRankLow), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SensitivityLabel = armsql.SensitivityLabel{ - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/schemas/tables/columns/sensitivityLabels"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myRG/providers/Microsoft.Sql/servers/myServer/databases/myDatabase/schemas/dbo/tables/myTable/columns/myColumn/sensitivityLabels/current"), - // Properties: &armsql.SensitivityLabelProperties{ - // ColumnName: to.Ptr("myColumn"), - // InformationType: to.Ptr("PhoneNumber"), - // InformationTypeID: to.Ptr("d22fa6e9-5ee4-3bde-4c2b-a409604c4646"), - // LabelID: to.Ptr("bf91e08c-f4f0-478a-b016-25164b2a65ff"), - // LabelName: to.Ptr("PII"), - // Rank: to.Ptr(armsql.SensitivityLabelRankMedium), - // SchemaName: to.Ptr("dbo"), - // TableName: to.Ptr("myTable"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ColumnSensitivityLabelDelete.json -func ExampleSensitivityLabelsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewSensitivityLabelsClient().Delete(ctx, "myRG", "myServer", "myDatabase", "dbo", "myTable", "myColumn", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/sql/armsql/serveradvancedthreatprotectionsettings_client.go b/sdk/resourcemanager/sql/armsql/serveradvancedthreatprotectionsettings_client.go index 3f97bea5b7dd..a2d53f2b690c 100644 --- a/sdk/resourcemanager/sql/armsql/serveradvancedthreatprotectionsettings_client.go +++ b/sdk/resourcemanager/sql/armsql/serveradvancedthreatprotectionsettings_client.go @@ -46,7 +46,7 @@ func NewServerAdvancedThreatProtectionSettingsClient(subscriptionID string, cred // BeginCreateOrUpdate - Creates or updates an Advanced Threat Protection state. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -70,7 +70,7 @@ func (client *ServerAdvancedThreatProtectionSettingsClient) BeginCreateOrUpdate( // CreateOrUpdate - Creates or updates an Advanced Threat Protection state. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01-preview +// Generated from API version 2023-05-01-preview func (client *ServerAdvancedThreatProtectionSettingsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, advancedThreatProtectionName AdvancedThreatProtectionName, parameters ServerAdvancedThreatProtection, options *ServerAdvancedThreatProtectionSettingsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, advancedThreatProtectionName, parameters, options) @@ -112,7 +112,7 @@ func (client *ServerAdvancedThreatProtectionSettingsClient) createOrUpdateCreate return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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 *ServerAdvancedThreatProtectionSettingsClient) createOrUpdateCreate // Get - Get a server's Advanced Threat Protection state. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -173,7 +173,7 @@ func (client *ServerAdvancedThreatProtectionSettingsClient) getCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -190,7 +190,7 @@ func (client *ServerAdvancedThreatProtectionSettingsClient) getHandleResponse(re // NewListByServerPager - Get a list of the server's Advanced Threat Protection states. // -// Generated from API version 2021-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -244,7 +244,7 @@ func (client *ServerAdvancedThreatProtectionSettingsClient) listByServerCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/serveradvancedthreatprotectionsettings_client_example_test.go b/sdk/resourcemanager/sql/armsql/serveradvancedthreatprotectionsettings_client_example_test.go deleted file mode 100644 index fac20a1fed06..000000000000 --- a/sdk/resourcemanager/sql/armsql/serveradvancedthreatprotectionsettings_client_example_test.go +++ /dev/null @@ -1,191 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerAdvancedThreatProtectionSettingsListByServer.json -func ExampleServerAdvancedThreatProtectionSettingsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServerAdvancedThreatProtectionSettingsClient().NewListByServerPager("threatprotection-4799", "threatprotection-6440", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.LogicalServerAdvancedThreatProtectionListResult = armsql.LogicalServerAdvancedThreatProtectionListResult{ - // Value: []*armsql.ServerAdvancedThreatProtection{ - // { - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.Sql/servers/advancedThreatProtectionSettings"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/threatprotection-4799/providers/Microsoft.Sql/servers/threatprotection-6440/advancedThreatProtectionSettings"), - // Properties: &armsql.AdvancedThreatProtectionProperties{ - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // State: to.Ptr(armsql.AdvancedThreatProtectionStateDisabled), - // }, - // SystemData: &armsql.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsql.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsql.CreatedByTypeUser), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerAdvancedThreatProtectionSettingsGet.json -func ExampleServerAdvancedThreatProtectionSettingsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServerAdvancedThreatProtectionSettingsClient().Get(ctx, "threatprotection-4799", "threatprotection-6440", armsql.AdvancedThreatProtectionNameDefault, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServerAdvancedThreatProtection = armsql.ServerAdvancedThreatProtection{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.Sql/servers/advancedThreatProtectionSettings"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/threatprotection-4799/providers/Microsoft.Sql/servers/threatprotection-6440/advancedThreatProtectionSettings/Default"), - // Properties: &armsql.AdvancedThreatProtectionProperties{ - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // State: to.Ptr(armsql.AdvancedThreatProtectionStateDisabled), - // }, - // SystemData: &armsql.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsql.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsql.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerAdvancedThreatProtectionSettingsCreateMax.json -func ExampleServerAdvancedThreatProtectionSettingsClient_BeginCreateOrUpdate_updateAServersAdvancedThreatProtectionSettingsWithAllParameters() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServerAdvancedThreatProtectionSettingsClient().BeginCreateOrUpdate(ctx, "threatprotection-4799", "threatprotection-6440", armsql.AdvancedThreatProtectionNameDefault, armsql.ServerAdvancedThreatProtection{ - Properties: &armsql.AdvancedThreatProtectionProperties{ - State: to.Ptr(armsql.AdvancedThreatProtectionStateEnabled), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServerAdvancedThreatProtection = armsql.ServerAdvancedThreatProtection{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.Sql/servers/advancedThreatProtectionSettings"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/threatprotection-4799/providers/Microsoft.Sql/servers/threatprotection-6440/advancedThreatProtectionSettings/Default"), - // Properties: &armsql.AdvancedThreatProtectionProperties{ - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // State: to.Ptr(armsql.AdvancedThreatProtectionStateEnabled), - // }, - // SystemData: &armsql.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsql.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsql.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerAdvancedThreatProtectionSettingsCreateMin.json -func ExampleServerAdvancedThreatProtectionSettingsClient_BeginCreateOrUpdate_updateAServersAdvancedThreatProtectionSettingsWithMinimalParameters() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServerAdvancedThreatProtectionSettingsClient().BeginCreateOrUpdate(ctx, "threatprotection-4799", "threatprotection-6440", armsql.AdvancedThreatProtectionNameDefault, armsql.ServerAdvancedThreatProtection{ - Properties: &armsql.AdvancedThreatProtectionProperties{ - State: to.Ptr(armsql.AdvancedThreatProtectionStateDisabled), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServerAdvancedThreatProtection = armsql.ServerAdvancedThreatProtection{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.Sql/servers/advancedThreatProtectionSettings"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/threatprotection-4799/providers/Microsoft.Sql/servers/threatprotection-6440/advancedThreatProtectionSettings/Default"), - // Properties: &armsql.AdvancedThreatProtectionProperties{ - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // State: to.Ptr(armsql.AdvancedThreatProtectionStateDisabled), - // }, - // SystemData: &armsql.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsql.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-03T04:41:33.937Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsql.CreatedByTypeUser), - // }, - // } -} diff --git a/sdk/resourcemanager/sql/armsql/serveradvisors_client.go b/sdk/resourcemanager/sql/armsql/serveradvisors_client.go index 847a224b8476..f6cd6a69595d 100644 --- a/sdk/resourcemanager/sql/armsql/serveradvisors_client.go +++ b/sdk/resourcemanager/sql/armsql/serveradvisors_client.go @@ -46,7 +46,7 @@ func NewServerAdvisorsClient(subscriptionID string, credential azcore.TokenCrede // Get - Gets a server advisor. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -94,7 +94,7 @@ func (client *ServerAdvisorsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -112,7 +112,7 @@ func (client *ServerAdvisorsClient) getHandleResponse(resp *http.Response) (Serv // ListByServer - Gets a list of server advisors. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -159,7 +159,7 @@ func (client *ServerAdvisorsClient) listByServerCreateRequest(ctx context.Contex if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -177,7 +177,7 @@ func (client *ServerAdvisorsClient) listByServerHandleResponse(resp *http.Respon // Update - Updates a server advisor. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -226,7 +226,7 @@ func (client *ServerAdvisorsClient) updateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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/sql/armsql/serveradvisors_client_example_test.go b/sdk/resourcemanager/sql/armsql/serveradvisors_client_example_test.go deleted file mode 100644 index 20bbbdb9f810..000000000000 --- a/sdk/resourcemanager/sql/armsql/serveradvisors_client_example_test.go +++ /dev/null @@ -1,812 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerAdvisorList.json -func ExampleServerAdvisorsClient_ListByServer_listOfServerAdvisors() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServerAdvisorsClient().ListByServer(ctx, "workloadinsight-demos", "misosisvr", &armsql.ServerAdvisorsClientListByServerOptions{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.AdvisorArray = []*armsql.Advisor{ - // { - // Name: to.Ptr("CreateIndex"), - // Type: to.Ptr("Microsoft.Sql/servers/advisors"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workloadinsight-demos/providers/Microsoft.Sql/servers/misosisvr/advisors/CreateIndex"), - // Kind: to.Ptr(""), - // Location: to.Ptr("East Asia"), - // Properties: &armsql.AdvisorProperties{ - // AdvisorStatus: to.Ptr(armsql.AdvisorStatusGA), - // AutoExecuteStatus: to.Ptr(armsql.AutoExecuteStatusDisabled), - // AutoExecuteStatusInheritedFrom: to.Ptr(armsql.AutoExecuteStatusInheritedFromDefault), - // }, - // }, - // { - // Name: to.Ptr("DropIndex"), - // Type: to.Ptr("Microsoft.Sql/servers/advisors"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workloadinsight-demos/providers/Microsoft.Sql/servers/misosisvr/advisors/DropIndex"), - // Kind: to.Ptr(""), - // Location: to.Ptr("East Asia"), - // Properties: &armsql.AdvisorProperties{ - // AdvisorStatus: to.Ptr(armsql.AdvisorStatusGA), - // AutoExecuteStatus: to.Ptr(armsql.AutoExecuteStatusDisabled), - // AutoExecuteStatusInheritedFrom: to.Ptr(armsql.AutoExecuteStatusInheritedFromDefault), - // }, - // }, - // { - // Name: to.Ptr("DbParameterization"), - // Type: to.Ptr("Microsoft.Sql/servers/advisors"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workloadinsight-demos/providers/Microsoft.Sql/servers/misosisvr/advisors/DbParameterization"), - // Kind: to.Ptr(""), - // Location: to.Ptr("East Asia"), - // Properties: &armsql.AdvisorProperties{ - // AdvisorStatus: to.Ptr(armsql.AdvisorStatusGA), - // AutoExecuteStatus: to.Ptr(armsql.AutoExecuteStatusDisabled), - // AutoExecuteStatusInheritedFrom: to.Ptr(armsql.AutoExecuteStatusInheritedFromDefault), - // }, - // }, - // { - // Name: to.Ptr("SchemaIssue"), - // Type: to.Ptr("Microsoft.Sql/servers/advisors"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workloadinsight-demos/providers/Microsoft.Sql/servers/misosisvr/advisors/SchemaIssue"), - // Kind: to.Ptr(""), - // Location: to.Ptr("East Asia"), - // Properties: &armsql.AdvisorProperties{ - // AdvisorStatus: to.Ptr(armsql.AdvisorStatusPublicPreview), - // AutoExecuteStatus: to.Ptr(armsql.AutoExecuteStatusDisabled), - // AutoExecuteStatusInheritedFrom: to.Ptr(armsql.AutoExecuteStatusInheritedFromDefault), - // }, - // }, - // { - // Name: to.Ptr("ForceLastGoodPlan"), - // Type: to.Ptr("Microsoft.Sql/servers/advisors"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workloadinsight-demos/providers/Microsoft.Sql/servers/misosisvr/advisors/ForceLastGoodPlan"), - // Kind: to.Ptr(""), - // Location: to.Ptr("East Asia"), - // Properties: &armsql.AdvisorProperties{ - // AdvisorStatus: to.Ptr(armsql.AdvisorStatusPrivatePreview), - // AutoExecuteStatus: to.Ptr(armsql.AutoExecuteStatusDisabled), - // AutoExecuteStatusInheritedFrom: to.Ptr(armsql.AutoExecuteStatusInheritedFromDefault), - // }, - // }} -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerRecommendedActionListExpand.json -func ExampleServerAdvisorsClient_ListByServer_listOfServerRecommendedActionsForAllAdvisors() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServerAdvisorsClient().ListByServer(ctx, "workloadinsight-demos", "misosisvr", &armsql.ServerAdvisorsClientListByServerOptions{Expand: to.Ptr("recommendedActions")}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AdvisorArray = []*armsql.Advisor{ - // { - // Name: to.Ptr("CreateIndex"), - // Type: to.Ptr("Microsoft.Sql/servers/advisors"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workloadinsight-demos/providers/Microsoft.Sql/servers/misosisvr/advisors/CreateIndex"), - // Kind: to.Ptr(""), - // Location: to.Ptr("East Asia"), - // Properties: &armsql.AdvisorProperties{ - // AdvisorStatus: to.Ptr(armsql.AdvisorStatusGA), - // AutoExecuteStatus: to.Ptr(armsql.AutoExecuteStatusDisabled), - // AutoExecuteStatusInheritedFrom: to.Ptr(armsql.AutoExecuteStatusInheritedFromServer), - // RecommendedActions: []*armsql.RecommendedAction{ - // { - // Name: to.Ptr("IR_[CRM]_[DataPoints]_4821CD2F9510D98184BB"), - // Type: to.Ptr("Microsoft.Sql/servers/advisors/recommendedActions"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workloadinsight-demos/providers/Microsoft.Sql/servers/misosisvr/advisors/CreateIndex/recommendedActions/IR_[CRM]_[DataPoints]_4821CD2F9510D98184BB"), - // Kind: to.Ptr(""), - // Location: to.Ptr("East Asia"), - // Properties: &armsql.RecommendedActionProperties{ - // ErrorDetails: &armsql.RecommendedActionErrorInfo{ - // }, - // EstimatedImpact: []*armsql.RecommendedActionImpactRecord{ - // { - // AbsoluteValue: to.Ptr[float64](1440), - // DimensionName: to.Ptr("ActionDuration"), - // Unit: to.Ptr("Seconds"), - // }, - // { - // AbsoluteValue: to.Ptr[float64](209.3125), - // DimensionName: to.Ptr("SpaceChange"), - // Unit: to.Ptr("Megabytes"), - // }}, - // ImplementationDetails: &armsql.RecommendedActionImplementationInfo{ - // Method: to.Ptr(armsql.ImplementationMethodTSQL), - // Script: to.Ptr("CREATE NONCLUSTERED INDEX [nci_wi_DataPoints_B892614093BAC56295EF6018BD4CB51B] ON [CRM].[DataPoints] ([Name],[Money],[Power]) INCLUDE ([Hour], [System], [LastChanged]) WITH (ONLINE = ON)"), - // }, - // IsArchivedAction: to.Ptr(false), - // IsExecutableAction: to.Ptr(true), - // IsRevertableAction: to.Ptr(true), - // LastRefresh: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:04Z"); return t}()), - // ObservedImpact: []*armsql.RecommendedActionImpactRecord{ - // }, - // RecommendationReason: to.Ptr(""), - // Score: to.Ptr[int32](1), - // State: &armsql.RecommendedActionStateInfo{ - // CurrentValue: to.Ptr(armsql.RecommendedActionCurrentStateActive), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-20T15:15:40Z"); return t}()), - // }, - // TimeSeries: []*armsql.RecommendedActionMetricInfo{ - // }, - // ValidSince: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:04Z"); return t}()), - // Details: map[string]any{ - // "schema": "[CRM]", - // "databaseName": "IndexAdvisor_test_3", - // "includedColumns": "[Hour], [System], [LastChanged]", - // "indexColumns": "[Name],[Money],[Power]", - // "indexName": "nci_wi_DataPoints_B892614093BAC56295EF6018BD4CB51B", - // "indexType": "NONCLUSTERED", - // "table": "[DataPoints]", - // }, - // }, - // }, - // { - // Name: to.Ptr("IR_[dbo]_[Employees]_560E15A98D14CA09BDFB"), - // Type: to.Ptr("Microsoft.Sql/servers/advisors/recommendedActions"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workloadinsight-demos/providers/Microsoft.Sql/servers/misosisvr/advisors/CreateIndex/recommendedActions/IR_[dbo]_[Employees]_560E15A98D14CA09BDFB"), - // Kind: to.Ptr(""), - // Location: to.Ptr("East Asia"), - // Properties: &armsql.RecommendedActionProperties{ - // ErrorDetails: &armsql.RecommendedActionErrorInfo{ - // }, - // EstimatedImpact: []*armsql.RecommendedActionImpactRecord{ - // { - // AbsoluteValue: to.Ptr[float64](17), - // DimensionName: to.Ptr("ActionDuration"), - // Unit: to.Ptr("Seconds"), - // }, - // { - // AbsoluteValue: to.Ptr[float64](128), - // DimensionName: to.Ptr("SpaceChange"), - // Unit: to.Ptr("Megabytes"), - // }}, - // ImplementationDetails: &armsql.RecommendedActionImplementationInfo{ - // Method: to.Ptr(armsql.ImplementationMethodTSQL), - // Script: to.Ptr("CREATE NONCLUSTERED INDEX [nci_wi_Employees_8C18C2AF4267DC77793040782641CCDE] ON [dbo].[Employees] ([City], [State]) INCLUDE ([Postal]) WITH (ONLINE = ON)"), - // }, - // IsArchivedAction: to.Ptr(false), - // IsExecutableAction: to.Ptr(true), - // IsRevertableAction: to.Ptr(true), - // LastRefresh: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05Z"); return t}()), - // ObservedImpact: []*armsql.RecommendedActionImpactRecord{ - // }, - // RecommendationReason: to.Ptr(""), - // Score: to.Ptr[int32](3), - // State: &armsql.RecommendedActionStateInfo{ - // CurrentValue: to.Ptr(armsql.RecommendedActionCurrentStateActive), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05Z"); return t}()), - // }, - // TimeSeries: []*armsql.RecommendedActionMetricInfo{ - // }, - // ValidSince: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05Z"); return t}()), - // Details: map[string]any{ - // "schema": "[dbo]", - // "databaseName": "IndexAdvisor_test_3", - // "includedColumns": "[Postal]", - // "indexColumns": "[City], [State]", - // "indexName": "nci_wi_Employees_8C18C2AF4267DC77793040782641CCDE", - // "indexType": "NONCLUSTERED", - // "table": "[Employees]", - // }, - // }, - // }, - // { - // Name: to.Ptr("IR_[dbo]_[DataPoints]_F5D2F347AA22DB46E4CC"), - // Type: to.Ptr("Microsoft.Sql/servers/advisors/recommendedActions"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workloadinsight-demos/providers/Microsoft.Sql/servers/misosisvr/advisors/CreateIndex/recommendedActions/IR_[dbo]_[DataPoints]_F5D2F347AA22DB46E4CC"), - // Kind: to.Ptr(""), - // Location: to.Ptr("East Asia"), - // Properties: &armsql.RecommendedActionProperties{ - // ErrorDetails: &armsql.RecommendedActionErrorInfo{ - // }, - // EstimatedImpact: []*armsql.RecommendedActionImpactRecord{ - // { - // AbsoluteValue: to.Ptr[float64](5040), - // DimensionName: to.Ptr("ActionDuration"), - // Unit: to.Ptr("Seconds"), - // }, - // { - // AbsoluteValue: to.Ptr[float64](120), - // DimensionName: to.Ptr("SpaceChange"), - // Unit: to.Ptr("Megabytes"), - // }}, - // ExecuteActionDuration: to.Ptr("PT1M"), - // ExecuteActionInitiatedBy: to.Ptr(armsql.RecommendedActionInitiatedByUser), - // ExecuteActionInitiatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05Z"); return t}()), - // ExecuteActionStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05Z"); return t}()), - // ImplementationDetails: &armsql.RecommendedActionImplementationInfo{ - // Method: to.Ptr(armsql.ImplementationMethodTSQL), - // Script: to.Ptr("DROP INDEX [nci_wi_DataPoints_609E4B7D6A3813990ED44B28B340C8FC] ON [dbo].[DataPoints]"), - // }, - // IsArchivedAction: to.Ptr(false), - // IsExecutableAction: to.Ptr(true), - // IsRevertableAction: to.Ptr(true), - // LastRefresh: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05Z"); return t}()), - // ObservedImpact: []*armsql.RecommendedActionImpactRecord{ - // { - // ChangeValueAbsolute: to.Ptr[float64](-12.7), - // ChangeValueRelative: to.Ptr[float64](-0.9), - // DimensionName: to.Ptr("AffectedQueriesCpuUtilization"), - // Unit: to.Ptr("CpuCores"), - // }, - // { - // ChangeValueAbsolute: to.Ptr[float64](-12.7), - // ChangeValueRelative: to.Ptr[float64](-0.3175), - // DimensionName: to.Ptr("CpuUtilization"), - // Unit: to.Ptr("CpuCores"), - // }, - // { - // AbsoluteValue: to.Ptr[float64](12), - // DimensionName: to.Ptr("QueriesWithImprovedPerformance"), - // Unit: to.Ptr("Count"), - // }, - // { - // AbsoluteValue: to.Ptr[float64](1), - // DimensionName: to.Ptr("QueriesWithRegressedPerformance"), - // Unit: to.Ptr("Count"), - // }, - // { - // AbsoluteValue: to.Ptr[float64](130.742187), - // DimensionName: to.Ptr("SpaceChange"), - // Unit: to.Ptr("Megabytes"), - // }, - // { - // AbsoluteValue: to.Ptr[float64](0), - // DimensionName: to.Ptr("VerificationProgress"), - // Unit: to.Ptr("Percent"), - // }}, - // RecommendationReason: to.Ptr(""), - // Score: to.Ptr[int32](3), - // State: &armsql.RecommendedActionStateInfo{ - // ActionInitiatedBy: to.Ptr(armsql.RecommendedActionInitiatedByUser), - // CurrentValue: to.Ptr(armsql.RecommendedActionCurrentStateSuccess), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05Z"); return t}()), - // }, - // TimeSeries: []*armsql.RecommendedActionMetricInfo{ - // }, - // ValidSince: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05Z"); return t}()), - // Details: map[string]any{ - // "schema": "[dbo]", - // "databaseName": "IndexAdvisor_test_3", - // "includedColumns": "[Power],[Pineapple]", - // "indexActionDuration": "00:01:00", - // "indexActionStartTime": "2017-03-01T14:38:05.337", - // "indexColumns": "[Name],[Money]", - // "indexName": "nci_wi_DataPoints_609E4B7D6A3813990ED44B28B340C8FC", - // "indexType": "NONCLUSTERED", - // "table": "[DataPoints]", - // }, - // }, - // }}, - // }, - // }, - // { - // Name: to.Ptr("DropIndex"), - // Type: to.Ptr("Microsoft.Sql/servers/advisors"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workloadinsight-demos/providers/Microsoft.Sql/servers/misosisvr/advisors/DropIndex"), - // Kind: to.Ptr(""), - // Location: to.Ptr("East Asia"), - // Properties: &armsql.AdvisorProperties{ - // AdvisorStatus: to.Ptr(armsql.AdvisorStatusGA), - // AutoExecuteStatus: to.Ptr(armsql.AutoExecuteStatusDisabled), - // AutoExecuteStatusInheritedFrom: to.Ptr(armsql.AutoExecuteStatusInheritedFromDefault), - // RecommendedActions: []*armsql.RecommendedAction{ - // { - // Name: to.Ptr("IR_[CRM]_[DataPoints1]_29AEA82685D24704DE1A"), - // Type: to.Ptr("Microsoft.Sql/servers/advisors/recommendedActions"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workloadinsight-demos/providers/Microsoft.Sql/servers/misosisvr/advisors/DropIndex/recommendedActions/IR_[CRM]_[DataPoints1]_29AEA82685D24704DE1A"), - // Kind: to.Ptr(""), - // Location: to.Ptr("East Asia"), - // Properties: &armsql.RecommendedActionProperties{ - // ErrorDetails: &armsql.RecommendedActionErrorInfo{ - // }, - // EstimatedImpact: []*armsql.RecommendedActionImpactRecord{ - // { - // AbsoluteValue: to.Ptr[float64](803), - // DimensionName: to.Ptr("ActionDuration"), - // Unit: to.Ptr("Seconds"), - // }, - // { - // AbsoluteValue: to.Ptr[float64](144.6875), - // DimensionName: to.Ptr("SpaceChange"), - // Unit: to.Ptr("Megabytes"), - // }}, - // ExecuteActionInitiatedBy: to.Ptr(armsql.RecommendedActionInitiatedBySystem), - // ExecuteActionInitiatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05Z"); return t}()), - // ImplementationDetails: &armsql.RecommendedActionImplementationInfo{ - // Method: to.Ptr(armsql.ImplementationMethodTSQL), - // Script: to.Ptr("DROP INDEX [MyIndex123] ON [CRM].[DataPoints1]"), - // }, - // IsArchivedAction: to.Ptr(false), - // IsExecutableAction: to.Ptr(true), - // IsRevertableAction: to.Ptr(true), - // LastRefresh: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05Z"); return t}()), - // ObservedImpact: []*armsql.RecommendedActionImpactRecord{ - // }, - // RecommendationReason: to.Ptr("Duplicate"), - // Score: to.Ptr[int32](1), - // State: &armsql.RecommendedActionStateInfo{ - // ActionInitiatedBy: to.Ptr(armsql.RecommendedActionInitiatedBySystem), - // CurrentValue: to.Ptr(armsql.RecommendedActionCurrentStatePending), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05Z"); return t}()), - // }, - // TimeSeries: []*armsql.RecommendedActionMetricInfo{ - // }, - // ValidSince: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05Z"); return t}()), - // Details: map[string]any{ - // "schema": "[CRM]", - // "databaseName": "IndexAdvisor_test_3", - // "includedColumns": "[Apple]", - // "indexColumns": "[Cookies],[SessionId]", - // "indexName": "MyIndex123", - // "indexType": "NONCLUSTERED", - // "originalIndexName": "IX_COM_SKU_SKUDepartmentID", - // "table": "[DataPoints1]", - // }, - // }, - // }, - // { - // Name: to.Ptr("IR_[CRM]_[DataPoints2]_E4B21F229379807E531A"), - // Type: to.Ptr("Microsoft.Sql/servers/advisors/recommendedActions"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workloadinsight-demos/providers/Microsoft.Sql/servers/misosisvr/advisors/DropIndex/recommendedActions/IR_[CRM]_[DataPoints2]_E4B21F229379807E531A"), - // Kind: to.Ptr(""), - // Location: to.Ptr("East Asia"), - // Properties: &armsql.RecommendedActionProperties{ - // ErrorDetails: &armsql.RecommendedActionErrorInfo{ - // }, - // EstimatedImpact: []*armsql.RecommendedActionImpactRecord{ - // { - // AbsoluteValue: to.Ptr[float64](705), - // DimensionName: to.Ptr("ActionDuration"), - // Unit: to.Ptr("Seconds"), - // }, - // { - // AbsoluteValue: to.Ptr[float64](342), - // DimensionName: to.Ptr("SpaceChange"), - // Unit: to.Ptr("Megabytes"), - // }}, - // ExecuteActionDuration: to.Ptr("PT1M"), - // ExecuteActionInitiatedBy: to.Ptr(armsql.RecommendedActionInitiatedByUser), - // ExecuteActionInitiatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05Z"); return t}()), - // ExecuteActionStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05Z"); return t}()), - // ImplementationDetails: &armsql.RecommendedActionImplementationInfo{ - // Method: to.Ptr(armsql.ImplementationMethodTSQL), - // Script: to.Ptr("CREATE NONCLUSTERED INDEX [MyIndex321] ON [CRM].[DataPoints2] ([Cookies],[SessionId],[Protocol]) INCLUDE ([Apple]) WITH (ONLINE = ON)"), - // }, - // IsArchivedAction: to.Ptr(false), - // IsExecutableAction: to.Ptr(true), - // IsRevertableAction: to.Ptr(true), - // LastRefresh: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05Z"); return t}()), - // ObservedImpact: []*armsql.RecommendedActionImpactRecord{ - // { - // ChangeValueAbsolute: to.Ptr[float64](0), - // ChangeValueRelative: to.Ptr[float64](0), - // DimensionName: to.Ptr("AffectedQueriesCpuUtilization"), - // Unit: to.Ptr("CpuCores"), - // }, - // { - // ChangeValueAbsolute: to.Ptr[float64](0), - // ChangeValueRelative: to.Ptr[float64](0), - // DimensionName: to.Ptr("CpuUtilization"), - // Unit: to.Ptr("CpuCores"), - // }, - // { - // AbsoluteValue: to.Ptr[float64](0), - // DimensionName: to.Ptr("QueriesWithImprovedPerformance"), - // Unit: to.Ptr("Count"), - // }, - // { - // AbsoluteValue: to.Ptr[float64](0), - // DimensionName: to.Ptr("QueriesWithRegressedPerformance"), - // Unit: to.Ptr("Count"), - // }, - // { - // AbsoluteValue: to.Ptr[float64](-342), - // DimensionName: to.Ptr("SpaceChange"), - // Unit: to.Ptr("Megabytes"), - // }, - // { - // AbsoluteValue: to.Ptr[float64](0), - // DimensionName: to.Ptr("VerificationProgress"), - // Unit: to.Ptr("Percent"), - // }}, - // RecommendationReason: to.Ptr("Duplicate"), - // Score: to.Ptr[int32](1), - // State: &armsql.RecommendedActionStateInfo{ - // ActionInitiatedBy: to.Ptr(armsql.RecommendedActionInitiatedByUser), - // CurrentValue: to.Ptr(armsql.RecommendedActionCurrentStateSuccess), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05Z"); return t}()), - // }, - // TimeSeries: []*armsql.RecommendedActionMetricInfo{ - // }, - // ValidSince: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05Z"); return t}()), - // Details: map[string]any{ - // "schema": "[CRM]", - // "databaseName": "IndexAdvisor_test_3", - // "includedColumns": "[Apple]", - // "indexActionDuration": "00:01:00", - // "indexActionStartTime": "2017-03-01T14:38:05.697", - // "indexColumns": "[Cookies],[SessionId],[Protocol]", - // "indexName": "MyIndex321", - // "indexType": "NONCLUSTERED", - // "originalIndexName": "IX_COM_SKU_SKUDepartmentID", - // "table": "[DataPoints2]", - // }, - // }, - // }, - // { - // Name: to.Ptr("IR_[dbo]_[FactFinance]_13ADA5F354E9E14A983B"), - // Type: to.Ptr("Microsoft.Sql/servers/advisors/recommendedActions"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workloadinsight-demos/providers/Microsoft.Sql/servers/misosisvr/advisors/DropIndex/recommendedActions/IR_[dbo]_[FactFinance]_13ADA5F354E9E14A983B"), - // Kind: to.Ptr(""), - // Location: to.Ptr("East Asia"), - // Properties: &armsql.RecommendedActionProperties{ - // ErrorDetails: &armsql.RecommendedActionErrorInfo{ - // }, - // EstimatedImpact: []*armsql.RecommendedActionImpactRecord{ - // { - // AbsoluteValue: to.Ptr[float64](705), - // DimensionName: to.Ptr("ActionDuration"), - // Unit: to.Ptr("Seconds"), - // }, - // { - // AbsoluteValue: to.Ptr[float64](342), - // DimensionName: to.Ptr("SpaceChange"), - // Unit: to.Ptr("Megabytes"), - // }}, - // ExecuteActionDuration: to.Ptr("PT1M"), - // ExecuteActionInitiatedBy: to.Ptr(armsql.RecommendedActionInitiatedBySystem), - // ExecuteActionInitiatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05Z"); return t}()), - // ExecuteActionStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05Z"); return t}()), - // ImplementationDetails: &armsql.RecommendedActionImplementationInfo{ - // Method: to.Ptr(armsql.ImplementationMethodTSQL), - // Script: to.Ptr("CREATE NONCLUSTERED INDEX [IX_FF] ON [dbo].[FactFinance] ([FinanceKey],[DateKey]) INCLUDE ([OrganizationKey]) WITH (ONLINE = ON)"), - // }, - // IsArchivedAction: to.Ptr(false), - // IsExecutableAction: to.Ptr(true), - // IsRevertableAction: to.Ptr(true), - // LastRefresh: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05Z"); return t}()), - // ObservedImpact: []*armsql.RecommendedActionImpactRecord{ - // { - // ChangeValueAbsolute: to.Ptr[float64](0), - // ChangeValueRelative: to.Ptr[float64](0), - // DimensionName: to.Ptr("AffectedQueriesCpuUtilization"), - // Unit: to.Ptr("CpuCores"), - // }, - // { - // ChangeValueAbsolute: to.Ptr[float64](0), - // ChangeValueRelative: to.Ptr[float64](0), - // DimensionName: to.Ptr("CpuUtilization"), - // Unit: to.Ptr("CpuCores"), - // }, - // { - // AbsoluteValue: to.Ptr[float64](0), - // DimensionName: to.Ptr("QueriesWithImprovedPerformance"), - // Unit: to.Ptr("Count"), - // }, - // { - // AbsoluteValue: to.Ptr[float64](0), - // DimensionName: to.Ptr("QueriesWithRegressedPerformance"), - // Unit: to.Ptr("Count"), - // }, - // { - // AbsoluteValue: to.Ptr[float64](-342), - // DimensionName: to.Ptr("SpaceChange"), - // Unit: to.Ptr("Megabytes"), - // }, - // { - // AbsoluteValue: to.Ptr[float64](0), - // DimensionName: to.Ptr("VerificationProgress"), - // Unit: to.Ptr("Percent"), - // }}, - // RecommendationReason: to.Ptr("Duplicate"), - // Score: to.Ptr[int32](1), - // State: &armsql.RecommendedActionStateInfo{ - // ActionInitiatedBy: to.Ptr(armsql.RecommendedActionInitiatedBySystem), - // CurrentValue: to.Ptr(armsql.RecommendedActionCurrentStateSuccess), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-28T14:38:05Z"); return t}()), - // }, - // TimeSeries: []*armsql.RecommendedActionMetricInfo{ - // }, - // ValidSince: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05Z"); return t}()), - // Details: map[string]any{ - // "schema": "[dbo]", - // "databaseName": "IndexAdvisor_test_3", - // "includedColumns": "[OrganizationKey]", - // "indexActionDuration": "00:01:00", - // "indexActionStartTime": "2017-03-01T14:38:05.837", - // "indexColumns": "[FinanceKey],[DateKey]", - // "indexName": "IX_FF", - // "indexType": "NONCLUSTERED", - // "originalIndexName": "IX_COM_SKU_SKUDepartmentID", - // "table": "[FactFinance]", - // }, - // }, - // }, - // { - // Name: to.Ptr("IR_[CRM]_[DataPoints1]_13ADA5F354E9E14A983B"), - // Type: to.Ptr("Microsoft.Sql/servers/advisors/recommendedActions"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workloadinsight-demos/providers/Microsoft.Sql/servers/misosisvr/advisors/DropIndex/recommendedActions/IR_[CRM]_[DataPoints1]_13ADA5F354E9E14A983B"), - // Kind: to.Ptr(""), - // Location: to.Ptr("East Asia"), - // Properties: &armsql.RecommendedActionProperties{ - // ErrorDetails: &armsql.RecommendedActionErrorInfo{ - // }, - // EstimatedImpact: []*armsql.RecommendedActionImpactRecord{ - // { - // AbsoluteValue: to.Ptr[float64](645), - // DimensionName: to.Ptr("ActionDuration"), - // Unit: to.Ptr("Seconds"), - // }, - // { - // AbsoluteValue: to.Ptr[float64](342), - // DimensionName: to.Ptr("SpaceChange"), - // Unit: to.Ptr("Megabytes"), - // }}, - // ExecuteActionInitiatedBy: to.Ptr(armsql.RecommendedActionInitiatedBySystem), - // ExecuteActionInitiatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-23T14:14:35Z"); return t}()), - // ImplementationDetails: &armsql.RecommendedActionImplementationInfo{ - // Method: to.Ptr(armsql.ImplementationMethodTSQL), - // Script: to.Ptr("DROP INDEX [IX_FF] ON [CRM].[DataPoints1]"), - // }, - // IsArchivedAction: to.Ptr(false), - // IsExecutableAction: to.Ptr(true), - // IsRevertableAction: to.Ptr(true), - // LastRefresh: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05Z"); return t}()), - // ObservedImpact: []*armsql.RecommendedActionImpactRecord{ - // }, - // RecommendationReason: to.Ptr("Unused"), - // Score: to.Ptr[int32](1), - // State: &armsql.RecommendedActionStateInfo{ - // ActionInitiatedBy: to.Ptr(armsql.RecommendedActionInitiatedBySystem), - // CurrentValue: to.Ptr(armsql.RecommendedActionCurrentStatePending), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-23T14:14:35Z"); return t}()), - // }, - // TimeSeries: []*armsql.RecommendedActionMetricInfo{ - // }, - // ValidSince: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05Z"); return t}()), - // Details: map[string]any{ - // "schema": "[CRM]", - // "databaseName": "IndexAdvisor_test_3", - // "includedColumns": "[Apple]", - // "indexColumns": "[Protocol],[SessionId]", - // "indexName": "IX_FF", - // "indexType": "NONCLUSTERED", - // "originalIndexName": "IX_COM_SKU_SKUDepartmentID", - // "table": "[DataPoints1]", - // }, - // }, - // }}, - // }, - // }, - // { - // Name: to.Ptr("DbParameterization"), - // Type: to.Ptr("Microsoft.Sql/servers/advisors"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workloadinsight-demos/providers/Microsoft.Sql/servers/misosisvr/advisors/DbParameterization"), - // Kind: to.Ptr(""), - // Location: to.Ptr("East Asia"), - // Properties: &armsql.AdvisorProperties{ - // AdvisorStatus: to.Ptr(armsql.AdvisorStatusGA), - // AutoExecuteStatus: to.Ptr(armsql.AutoExecuteStatusDisabled), - // AutoExecuteStatusInheritedFrom: to.Ptr(armsql.AutoExecuteStatusInheritedFromDefault), - // RecommendedActions: []*armsql.RecommendedAction{ - // { - // Name: to.Ptr("ForceDbParameterization"), - // Type: to.Ptr("Microsoft.Sql/servers/advisors/recommendedActions"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workloadinsight-demos/providers/Microsoft.Sql/servers/misosisvr/advisors/DbParameterization/recommendedActions/ForceDbParameterization"), - // Kind: to.Ptr(""), - // Location: to.Ptr("East Asia"), - // Properties: &armsql.RecommendedActionProperties{ - // ErrorDetails: &armsql.RecommendedActionErrorInfo{ - // }, - // EstimatedImpact: []*armsql.RecommendedActionImpactRecord{ - // { - // ChangeValueAbsolute: to.Ptr[float64](22.5613696939135), - // DimensionName: to.Ptr("CpuSavings"), - // Unit: to.Ptr("Percent"), - // }, - // { - // ChangeValueAbsolute: to.Ptr[float64](0.701823681806341), - // DimensionName: to.Ptr("QueryDurationDecrease"), - // Unit: to.Ptr("secs"), - // }}, - // ExecuteActionInitiatedBy: to.Ptr(armsql.RecommendedActionInitiatedBySystem), - // ExecuteActionInitiatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-11T15:08:31Z"); return t}()), - // ImplementationDetails: &armsql.RecommendedActionImplementationInfo{ - // Method: to.Ptr(armsql.ImplementationMethodTSQL), - // Script: to.Ptr("ALTER DATABASE [IndexAdvisor_test_3] SET PARAMETERIZATION FORCED"), - // }, - // IsArchivedAction: to.Ptr(false), - // IsExecutableAction: to.Ptr(true), - // IsRevertableAction: to.Ptr(true), - // LastRefresh: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:37:44Z"); return t}()), - // ObservedImpact: []*armsql.RecommendedActionImpactRecord{ - // }, - // RecommendationReason: to.Ptr(""), - // Score: to.Ptr[int32](3), - // State: &armsql.RecommendedActionStateInfo{ - // ActionInitiatedBy: to.Ptr(armsql.RecommendedActionInitiatedBySystem), - // CurrentValue: to.Ptr(armsql.RecommendedActionCurrentStatePending), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-11T15:08:31Z"); return t}()), - // }, - // TimeSeries: []*armsql.RecommendedActionMetricInfo{ - // }, - // ValidSince: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:37:44Z"); return t}()), - // Details: map[string]any{ - // "databaseName": "IndexAdvisor_test_3", - // }, - // }, - // }}, - // }, - // }, - // { - // Name: to.Ptr("SchemaIssue"), - // Type: to.Ptr("Microsoft.Sql/servers/advisors"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workloadinsight-demos/providers/Microsoft.Sql/servers/misosisvr/advisors/SchemaIssue"), - // Kind: to.Ptr(""), - // Location: to.Ptr("East Asia"), - // Properties: &armsql.AdvisorProperties{ - // AdvisorStatus: to.Ptr(armsql.AdvisorStatusPublicPreview), - // AutoExecuteStatus: to.Ptr(armsql.AutoExecuteStatusDisabled), - // AutoExecuteStatusInheritedFrom: to.Ptr(armsql.AutoExecuteStatusInheritedFromDefault), - // RecommendedActions: []*armsql.RecommendedAction{ - // { - // Name: to.Ptr("SchemaProblem_1A258C5714A7410C9D23"), - // Type: to.Ptr("Microsoft.Sql/servers/advisors/recommendedActions"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workloadinsight-demos/providers/Microsoft.Sql/servers/misosisvr/advisors/SchemaIssue/recommendedActions/SchemaProblem_1A258C5714A7410C9D23"), - // Kind: to.Ptr(""), - // Location: to.Ptr("East Asia"), - // Properties: &armsql.RecommendedActionProperties{ - // ErrorDetails: &armsql.RecommendedActionErrorInfo{ - // }, - // EstimatedImpact: []*armsql.RecommendedActionImpactRecord{ - // }, - // ImplementationDetails: &armsql.RecommendedActionImplementationInfo{ - // }, - // IsArchivedAction: to.Ptr(false), - // IsExecutableAction: to.Ptr(false), - // IsRevertableAction: to.Ptr(false), - // LastRefresh: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-07T22:19:53Z"); return t}()), - // ObservedImpact: []*armsql.RecommendedActionImpactRecord{ - // }, - // RecommendationReason: to.Ptr("SchemaProblem"), - // Score: to.Ptr[int32](3), - // State: &armsql.RecommendedActionStateInfo{ - // CurrentValue: to.Ptr(armsql.RecommendedActionCurrentStateActive), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:37:48Z"); return t}()), - // }, - // TimeSeries: []*armsql.RecommendedActionMetricInfo{ - // }, - // ValidSince: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:37:48Z"); return t}()), - // Details: map[string]any{ - // "databaseName": "IndexAdvisor_test_3", - // "sqlErrorCount": float64(342482), - // "sqlErrorMessage": "Invalid object name 'dbo.Companies'.", - // "sqlErrorNumber": float64(208), - // }, - // }, - // }}, - // }, - // }, - // { - // Name: to.Ptr("ForceLastGoodPlan"), - // Type: to.Ptr("Microsoft.Sql/servers/advisors"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workloadinsight-demos/providers/Microsoft.Sql/servers/misosisvr/advisors/ForceLastGoodPlan"), - // Kind: to.Ptr(""), - // Location: to.Ptr("East Asia"), - // Properties: &armsql.AdvisorProperties{ - // AdvisorStatus: to.Ptr(armsql.AdvisorStatusPrivatePreview), - // AutoExecuteStatus: to.Ptr(armsql.AutoExecuteStatusDisabled), - // AutoExecuteStatusInheritedFrom: to.Ptr(armsql.AutoExecuteStatusInheritedFromDefault), - // RecommendedActions: []*armsql.RecommendedAction{ - // }, - // }, - // }} -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerAdvisorGet.json -func ExampleServerAdvisorsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServerAdvisorsClient().Get(ctx, "workloadinsight-demos", "misosisvr", "CreateIndex", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Advisor = armsql.Advisor{ - // Name: to.Ptr("CreateIndex"), - // Type: to.Ptr("Microsoft.Sql/servers/advisors"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workloadinsight-demos/providers/Microsoft.Sql/servers/misosisvr/advisors/CreateIndex"), - // Kind: to.Ptr(""), - // Location: to.Ptr("East Asia"), - // Properties: &armsql.AdvisorProperties{ - // AdvisorStatus: to.Ptr(armsql.AdvisorStatusGA), - // AutoExecuteStatus: to.Ptr(armsql.AutoExecuteStatusDisabled), - // AutoExecuteStatusInheritedFrom: to.Ptr(armsql.AutoExecuteStatusInheritedFromDefault), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerAdvisorUpdate.json -func ExampleServerAdvisorsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServerAdvisorsClient().Update(ctx, "workloadinsight-demos", "misosisvr", "CreateIndex", armsql.Advisor{ - Properties: &armsql.AdvisorProperties{ - AutoExecuteStatus: to.Ptr(armsql.AutoExecuteStatusDisabled), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Advisor = armsql.Advisor{ - // Name: to.Ptr("CreateIndex"), - // Type: to.Ptr("Microsoft.Sql/servers/advisors"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workloadinsight-demos/providers/Microsoft.Sql/servers/misosisvr/advisors/CreateIndex"), - // Kind: to.Ptr(""), - // Location: to.Ptr("East Asia"), - // Properties: &armsql.AdvisorProperties{ - // AdvisorStatus: to.Ptr(armsql.AdvisorStatusGA), - // AutoExecuteStatus: to.Ptr(armsql.AutoExecuteStatusDisabled), - // AutoExecuteStatusInheritedFrom: to.Ptr(armsql.AutoExecuteStatusInheritedFromServer), - // }, - // } -} diff --git a/sdk/resourcemanager/sql/armsql/serverautomatictuning_client.go b/sdk/resourcemanager/sql/armsql/serverautomatictuning_client.go index fd512bd4f3fe..b8d38f72199e 100644 --- a/sdk/resourcemanager/sql/armsql/serverautomatictuning_client.go +++ b/sdk/resourcemanager/sql/armsql/serverautomatictuning_client.go @@ -46,7 +46,7 @@ func NewServerAutomaticTuningClient(subscriptionID string, credential azcore.Tok // Get - Retrieves server automatic tuning options. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -90,7 +90,7 @@ func (client *ServerAutomaticTuningClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -108,7 +108,7 @@ func (client *ServerAutomaticTuningClient) getHandleResponse(resp *http.Response // Update - Update automatic tuning options on server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -153,7 +153,7 @@ func (client *ServerAutomaticTuningClient) updateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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/sql/armsql/serverautomatictuning_client_example_test.go b/sdk/resourcemanager/sql/armsql/serverautomatictuning_client_example_test.go deleted file mode 100644 index 88111f7e999d..000000000000 --- a/sdk/resourcemanager/sql/armsql/serverautomatictuning_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 armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerAutomaticTuningGet.json -func ExampleServerAutomaticTuningClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServerAutomaticTuningClient().Get(ctx, "default-sql-onebox", "testsvr11", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServerAutomaticTuning = armsql.ServerAutomaticTuning{ - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.Sql/servers/automaticTuning"), - // ID: to.Ptr("/subscriptions/c3aa9078-0000-0000-0000-e36f151182d7/resourceGroups/default-sql-onebox/providers/Microsoft.Sql/servers/testsvr11/automaticTuning/current"), - // Properties: &armsql.AutomaticTuningServerProperties{ - // ActualState: to.Ptr(armsql.AutomaticTuningServerModeAuto), - // DesiredState: to.Ptr(armsql.AutomaticTuningServerModeAuto), - // Options: map[string]*armsql.AutomaticTuningServerOptions{ - // "createIndex": &armsql.AutomaticTuningServerOptions{ - // ActualState: to.Ptr(armsql.AutomaticTuningOptionModeActualOn), - // DesiredState: to.Ptr(armsql.AutomaticTuningOptionModeDesiredDefault), - // ReasonCode: to.Ptr[int32](2), - // ReasonDesc: to.Ptr(armsql.AutomaticTuningServerReasonAutoConfigured), - // }, - // "dropIndex": &armsql.AutomaticTuningServerOptions{ - // ActualState: to.Ptr(armsql.AutomaticTuningOptionModeActualOff), - // DesiredState: to.Ptr(armsql.AutomaticTuningOptionModeDesiredDefault), - // ReasonCode: to.Ptr[int32](2), - // ReasonDesc: to.Ptr(armsql.AutomaticTuningServerReasonAutoConfigured), - // }, - // "forceLastGoodPlan": &armsql.AutomaticTuningServerOptions{ - // ActualState: to.Ptr(armsql.AutomaticTuningOptionModeActualOn), - // DesiredState: to.Ptr(armsql.AutomaticTuningOptionModeDesiredDefault), - // ReasonCode: to.Ptr[int32](2), - // ReasonDesc: to.Ptr(armsql.AutomaticTuningServerReasonAutoConfigured), - // }, - // "maintainIndex": &armsql.AutomaticTuningServerOptions{ - // ActualState: to.Ptr(armsql.AutomaticTuningOptionModeActualOff), - // DesiredState: to.Ptr(armsql.AutomaticTuningOptionModeDesiredDefault), - // ReasonCode: to.Ptr[int32](2), - // ReasonDesc: to.Ptr(armsql.AutomaticTuningServerReasonAutoConfigured), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerAutomaticTuningUpdateMax.json -func ExampleServerAutomaticTuningClient_Update_updatesServerAutomaticTuningSettingsWithAllProperties() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServerAutomaticTuningClient().Update(ctx, "default-sql-onebox", "testsvr11", armsql.ServerAutomaticTuning{ - Properties: &armsql.AutomaticTuningServerProperties{ - DesiredState: to.Ptr(armsql.AutomaticTuningServerModeAuto), - Options: map[string]*armsql.AutomaticTuningServerOptions{ - "createIndex": { - DesiredState: to.Ptr(armsql.AutomaticTuningOptionModeDesiredOff), - }, - "dropIndex": { - DesiredState: to.Ptr(armsql.AutomaticTuningOptionModeDesiredOn), - }, - "forceLastGoodPlan": { - DesiredState: to.Ptr(armsql.AutomaticTuningOptionModeDesiredDefault), - }, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServerAutomaticTuning = armsql.ServerAutomaticTuning{ - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.Sql/servers/automaticTuning"), - // ID: to.Ptr("/subscriptions/c3aa9078-0000-0000-0000-e36f151182d7/resourceGroups/default-sql-onebox/providers/Microsoft.Sql/servers/testsvr11/automaticTuning/current"), - // Properties: &armsql.AutomaticTuningServerProperties{ - // ActualState: to.Ptr(armsql.AutomaticTuningServerModeAuto), - // DesiredState: to.Ptr(armsql.AutomaticTuningServerModeAuto), - // Options: map[string]*armsql.AutomaticTuningServerOptions{ - // "createIndex": &armsql.AutomaticTuningServerOptions{ - // ActualState: to.Ptr(armsql.AutomaticTuningOptionModeActualOff), - // DesiredState: to.Ptr(armsql.AutomaticTuningOptionModeDesiredOff), - // }, - // "dropIndex": &armsql.AutomaticTuningServerOptions{ - // ActualState: to.Ptr(armsql.AutomaticTuningOptionModeActualOn), - // DesiredState: to.Ptr(armsql.AutomaticTuningOptionModeDesiredOn), - // }, - // "forceLastGoodPlan": &armsql.AutomaticTuningServerOptions{ - // ActualState: to.Ptr(armsql.AutomaticTuningOptionModeActualOn), - // DesiredState: to.Ptr(armsql.AutomaticTuningOptionModeDesiredDefault), - // ReasonCode: to.Ptr[int32](2), - // ReasonDesc: to.Ptr(armsql.AutomaticTuningServerReasonAutoConfigured), - // }, - // "maintainIndex": &armsql.AutomaticTuningServerOptions{ - // ActualState: to.Ptr(armsql.AutomaticTuningOptionModeActualOff), - // DesiredState: to.Ptr(armsql.AutomaticTuningOptionModeDesiredDefault), - // ReasonCode: to.Ptr[int32](2), - // ReasonDesc: to.Ptr(armsql.AutomaticTuningServerReasonAutoConfigured), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerAutomaticTuningUpdateMin.json -func ExampleServerAutomaticTuningClient_Update_updatesServerAutomaticTuningSettingsWithMinimalProperties() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServerAutomaticTuningClient().Update(ctx, "default-sql-onebox", "testsvr11", armsql.ServerAutomaticTuning{ - Properties: &armsql.AutomaticTuningServerProperties{ - DesiredState: to.Ptr(armsql.AutomaticTuningServerModeAuto), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServerAutomaticTuning = armsql.ServerAutomaticTuning{ - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.Sql/servers/automaticTuning"), - // ID: to.Ptr("/subscriptions/c3aa9078-0000-0000-0000-e36f151182d7/resourceGroups/default-sql-onebox/providers/Microsoft.Sql/servers/testsvr11/automaticTuning/current"), - // Properties: &armsql.AutomaticTuningServerProperties{ - // ActualState: to.Ptr(armsql.AutomaticTuningServerModeAuto), - // DesiredState: to.Ptr(armsql.AutomaticTuningServerModeAuto), - // Options: map[string]*armsql.AutomaticTuningServerOptions{ - // "createIndex": &armsql.AutomaticTuningServerOptions{ - // ActualState: to.Ptr(armsql.AutomaticTuningOptionModeActualOn), - // DesiredState: to.Ptr(armsql.AutomaticTuningOptionModeDesiredDefault), - // ReasonCode: to.Ptr[int32](2), - // ReasonDesc: to.Ptr(armsql.AutomaticTuningServerReasonAutoConfigured), - // }, - // "dropIndex": &armsql.AutomaticTuningServerOptions{ - // ActualState: to.Ptr(armsql.AutomaticTuningOptionModeActualOff), - // DesiredState: to.Ptr(armsql.AutomaticTuningOptionModeDesiredDefault), - // ReasonCode: to.Ptr[int32](2), - // ReasonDesc: to.Ptr(armsql.AutomaticTuningServerReasonAutoConfigured), - // }, - // "forceLastGoodPlan": &armsql.AutomaticTuningServerOptions{ - // ActualState: to.Ptr(armsql.AutomaticTuningOptionModeActualOn), - // DesiredState: to.Ptr(armsql.AutomaticTuningOptionModeDesiredDefault), - // ReasonCode: to.Ptr[int32](2), - // ReasonDesc: to.Ptr(armsql.AutomaticTuningServerReasonAutoConfigured), - // }, - // "maintainIndex": &armsql.AutomaticTuningServerOptions{ - // ActualState: to.Ptr(armsql.AutomaticTuningOptionModeActualOff), - // DesiredState: to.Ptr(armsql.AutomaticTuningOptionModeDesiredDefault), - // ReasonCode: to.Ptr[int32](2), - // ReasonDesc: to.Ptr(armsql.AutomaticTuningServerReasonAutoConfigured), - // }, - // }, - // }, - // } -} diff --git a/sdk/resourcemanager/sql/armsql/serverazureadadministrators_client.go b/sdk/resourcemanager/sql/armsql/serverazureadadministrators_client.go index c31b92cbab74..3f06f5b7e994 100644 --- a/sdk/resourcemanager/sql/armsql/serverazureadadministrators_client.go +++ b/sdk/resourcemanager/sql/armsql/serverazureadadministrators_client.go @@ -46,7 +46,7 @@ func NewServerAzureADAdministratorsClient(subscriptionID string, credential azco // BeginCreateOrUpdate - Creates or updates an existing Azure Active Directory administrator. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -70,7 +70,7 @@ func (client *ServerAzureADAdministratorsClient) BeginCreateOrUpdate(ctx context // CreateOrUpdate - Creates or updates an existing Azure Active Directory administrator. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview func (client *ServerAzureADAdministratorsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, administratorName AdministratorName, parameters ServerAzureADAdministrator, options *ServerAzureADAdministratorsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, administratorName, parameters, options) @@ -112,7 +112,7 @@ func (client *ServerAzureADAdministratorsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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 *ServerAzureADAdministratorsClient) createOrUpdateCreateRequest(ctx // BeginDelete - Deletes the Azure Active Directory administrator with the given name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -147,7 +147,7 @@ func (client *ServerAzureADAdministratorsClient) BeginDelete(ctx context.Context // Delete - Deletes the Azure Active Directory administrator with the given name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview func (client *ServerAzureADAdministratorsClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, administratorName AdministratorName, options *ServerAzureADAdministratorsClientBeginDeleteOptions) (*http.Response, error) { var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, administratorName, options) @@ -189,7 +189,7 @@ func (client *ServerAzureADAdministratorsClient) deleteCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -197,7 +197,7 @@ func (client *ServerAzureADAdministratorsClient) deleteCreateRequest(ctx context // Get - Gets a Azure Active Directory administrator. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -246,7 +246,7 @@ func (client *ServerAzureADAdministratorsClient) getCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -263,7 +263,7 @@ func (client *ServerAzureADAdministratorsClient) getHandleResponse(resp *http.Re // NewListByServerPager - Gets a list of Azure Active Directory administrators in a server. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -317,7 +317,7 @@ func (client *ServerAzureADAdministratorsClient) listByServerCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/serverazureadadministrators_client_example_test.go b/sdk/resourcemanager/sql/armsql/serverazureadadministrators_client_example_test.go deleted file mode 100644 index 41d44705629c..000000000000 --- a/sdk/resourcemanager/sql/armsql/serverazureadadministrators_client_example_test.go +++ /dev/null @@ -1,155 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/AdministratorGet.json -func ExampleServerAzureADAdministratorsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServerAzureADAdministratorsClient().Get(ctx, "sqlcrudtest-4799", "sqlcrudtest-6440", armsql.AdministratorNameActiveDirectory, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServerAzureADAdministrator = armsql.ServerAzureADAdministrator{ - // Name: to.Ptr("ActiveDirectory"), - // Type: to.Ptr("Microsoft.Sql/servers/administrators"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-4799/providers/Microsoft.Sql/servers/sqlcrudtest-6440/administrators/ActiveDirectory"), - // Properties: &armsql.AdministratorProperties{ - // AdministratorType: to.Ptr(armsql.AdministratorTypeActiveDirectory), - // AzureADOnlyAuthentication: to.Ptr(true), - // Login: to.Ptr("bob@contoso.com"), - // Sid: to.Ptr("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c"), - // TenantID: to.Ptr("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/AdministratorCreateOrUpdate.json -func ExampleServerAzureADAdministratorsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServerAzureADAdministratorsClient().BeginCreateOrUpdate(ctx, "sqlcrudtest-4799", "sqlcrudtest-6440", armsql.AdministratorNameActiveDirectory, armsql.ServerAzureADAdministrator{ - Properties: &armsql.AdministratorProperties{ - AdministratorType: to.Ptr(armsql.AdministratorTypeActiveDirectory), - Login: to.Ptr("bob@contoso.com"), - Sid: to.Ptr("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c"), - TenantID: to.Ptr("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServerAzureADAdministrator = armsql.ServerAzureADAdministrator{ - // Name: to.Ptr("ActiveDirectory"), - // Type: to.Ptr("Microsoft.Sql/servers/administrators"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-4799/providers/Microsoft.Sql/servers/sqlcrudtest-6440/administrators/ActiveDirectory"), - // Properties: &armsql.AdministratorProperties{ - // AdministratorType: to.Ptr(armsql.AdministratorTypeActiveDirectory), - // AzureADOnlyAuthentication: to.Ptr(true), - // Login: to.Ptr("bob@contoso.com"), - // Sid: to.Ptr("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c"), - // TenantID: to.Ptr("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/AdministratorDelete.json -func ExampleServerAzureADAdministratorsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServerAzureADAdministratorsClient().BeginDelete(ctx, "sqlcrudtest-4799", "sqlcrudtest-6440", armsql.AdministratorNameActiveDirectory, 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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/AdministratorList.json -func ExampleServerAzureADAdministratorsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServerAzureADAdministratorsClient().NewListByServerPager("sqlcrudtest-4799", "sqlcrudtest-6440", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AdministratorListResult = armsql.AdministratorListResult{ - // Value: []*armsql.ServerAzureADAdministrator{ - // { - // Name: to.Ptr("ActiveDirectory"), - // Type: to.Ptr("Microsoft.Sql/servers/administrators"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-4799/providers/Microsoft.Sql/servers/sqlcrudtest-6440/administrators/ActiveDirectory"), - // Properties: &armsql.AdministratorProperties{ - // AdministratorType: to.Ptr(armsql.AdministratorTypeActiveDirectory), - // AzureADOnlyAuthentication: to.Ptr(true), - // Login: to.Ptr("bob@contoso.com"), - // Sid: to.Ptr("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c"), - // TenantID: to.Ptr("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/sql/armsql/serverazureadonlyauthentications_client.go b/sdk/resourcemanager/sql/armsql/serverazureadonlyauthentications_client.go index 820073aab600..6343dee7df1a 100644 --- a/sdk/resourcemanager/sql/armsql/serverazureadonlyauthentications_client.go +++ b/sdk/resourcemanager/sql/armsql/serverazureadonlyauthentications_client.go @@ -47,7 +47,7 @@ func NewServerAzureADOnlyAuthenticationsClient(subscriptionID string, credential // only authentication property. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -72,7 +72,7 @@ func (client *ServerAzureADOnlyAuthenticationsClient) BeginCreateOrUpdate(ctx co // only authentication property. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview func (client *ServerAzureADOnlyAuthenticationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, authenticationName AuthenticationName, parameters ServerAzureADOnlyAuthentication, options *ServerAzureADOnlyAuthenticationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, authenticationName, parameters, options) @@ -114,7 +114,7 @@ func (client *ServerAzureADOnlyAuthenticationsClient) createOrUpdateCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -126,7 +126,7 @@ func (client *ServerAzureADOnlyAuthenticationsClient) createOrUpdateCreateReques // BeginDelete - Deletes an existing server Active Directory only authentication property. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -149,7 +149,7 @@ func (client *ServerAzureADOnlyAuthenticationsClient) BeginDelete(ctx context.Co // Delete - Deletes an existing server Active Directory only authentication property. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview func (client *ServerAzureADOnlyAuthenticationsClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, authenticationName AuthenticationName, options *ServerAzureADOnlyAuthenticationsClientBeginDeleteOptions) (*http.Response, error) { var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, authenticationName, options) @@ -191,7 +191,7 @@ func (client *ServerAzureADOnlyAuthenticationsClient) deleteCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -199,7 +199,7 @@ func (client *ServerAzureADOnlyAuthenticationsClient) deleteCreateRequest(ctx co // Get - Gets a specific Azure Active Directory only authentication property. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -248,7 +248,7 @@ func (client *ServerAzureADOnlyAuthenticationsClient) getCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -265,7 +265,7 @@ func (client *ServerAzureADOnlyAuthenticationsClient) getHandleResponse(resp *ht // NewListByServerPager - Gets a list of server Azure Active Directory only authentications. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -319,7 +319,7 @@ func (client *ServerAzureADOnlyAuthenticationsClient) listByServerCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/serverazureadonlyauthentications_client_example_test.go b/sdk/resourcemanager/sql/armsql/serverazureadonlyauthentications_client_example_test.go deleted file mode 100644 index 202ae3d06acf..000000000000 --- a/sdk/resourcemanager/sql/armsql/serverazureadonlyauthentications_client_example_test.go +++ /dev/null @@ -1,140 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/AzureADOnlyAuthGet.json -func ExampleServerAzureADOnlyAuthenticationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServerAzureADOnlyAuthenticationsClient().Get(ctx, "sqlcrudtest-4799", "sqlcrudtest-6440", armsql.AuthenticationNameDefault, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServerAzureADOnlyAuthentication = armsql.ServerAzureADOnlyAuthentication{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.Sql/servers/azureadonlyauthentications"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-4799/providers/Microsoft.Sql/servers/sqlcrudtest-6440/azureadonlyauthentications/default"), - // Properties: &armsql.AzureADOnlyAuthProperties{ - // AzureADOnlyAuthentication: to.Ptr(true), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/AzureADOnlyAuthCreateOrUpdate.json -func ExampleServerAzureADOnlyAuthenticationsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServerAzureADOnlyAuthenticationsClient().BeginCreateOrUpdate(ctx, "sqlcrudtest-4799", "sqlcrudtest-6440", armsql.AuthenticationNameDefault, armsql.ServerAzureADOnlyAuthentication{ - Properties: &armsql.AzureADOnlyAuthProperties{ - AzureADOnlyAuthentication: 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.ServerAzureADOnlyAuthentication = armsql.ServerAzureADOnlyAuthentication{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.Sql/servers/azureadonlyauthentications"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-4799/providers/Microsoft.Sql/servers/sqlcrudtest-6440/azureadonlyauthentications/default"), - // Properties: &armsql.AzureADOnlyAuthProperties{ - // AzureADOnlyAuthentication: to.Ptr(false), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/AzureADOnlyAuthDelete.json -func ExampleServerAzureADOnlyAuthenticationsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServerAzureADOnlyAuthenticationsClient().BeginDelete(ctx, "sqlcrudtest-4799", "sqlcrudtest-6440", armsql.AuthenticationNameDefault, 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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/AzureADOnlyAuthList.json -func ExampleServerAzureADOnlyAuthenticationsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServerAzureADOnlyAuthenticationsClient().NewListByServerPager("sqlcrudtest-4799", "sqlcrudtest-6440", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AzureADOnlyAuthListResult = armsql.AzureADOnlyAuthListResult{ - // Value: []*armsql.ServerAzureADOnlyAuthentication{ - // { - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.Sql/servers/azureadonlyauthentications"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-4799/providers/Microsoft.Sql/servers/sqlcrudtest-6440/azureadonlyauthentications/default"), - // Properties: &armsql.AzureADOnlyAuthProperties{ - // AzureADOnlyAuthentication: to.Ptr(true), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/sql/armsql/serverblobauditingpolicies_client.go b/sdk/resourcemanager/sql/armsql/serverblobauditingpolicies_client.go index 9adc2a977bde..fa7137462bf3 100644 --- a/sdk/resourcemanager/sql/armsql/serverblobauditingpolicies_client.go +++ b/sdk/resourcemanager/sql/armsql/serverblobauditingpolicies_client.go @@ -46,7 +46,7 @@ func NewServerBlobAuditingPoliciesClient(subscriptionID string, credential azcor // BeginCreateOrUpdate - Creates or updates a server's blob auditing policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -69,7 +69,7 @@ func (client *ServerBlobAuditingPoliciesClient) BeginCreateOrUpdate(ctx context. // CreateOrUpdate - Creates or updates a server's blob auditing policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01-preview +// Generated from API version 2023-05-01-preview func (client *ServerBlobAuditingPoliciesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters ServerBlobAuditingPolicy, options *ServerBlobAuditingPoliciesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, parameters, options) @@ -108,7 +108,7 @@ func (client *ServerBlobAuditingPoliciesClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -120,7 +120,7 @@ func (client *ServerBlobAuditingPoliciesClient) createOrUpdateCreateRequest(ctx // Get - Gets a server's blob auditing policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -165,7 +165,7 @@ func (client *ServerBlobAuditingPoliciesClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -182,7 +182,7 @@ func (client *ServerBlobAuditingPoliciesClient) getHandleResponse(resp *http.Res // NewListByServerPager - Lists auditing settings of a server. // -// Generated from API version 2021-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -236,7 +236,7 @@ func (client *ServerBlobAuditingPoliciesClient) listByServerCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/serverblobauditingpolicies_client_example_test.go b/sdk/resourcemanager/sql/armsql/serverblobauditingpolicies_client_example_test.go deleted file mode 100644 index c5c100a4fda7..000000000000 --- a/sdk/resourcemanager/sql/armsql/serverblobauditingpolicies_client_example_test.go +++ /dev/null @@ -1,202 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerAuditingSettingsList.json -func ExampleServerBlobAuditingPoliciesClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServerBlobAuditingPoliciesClient().NewListByServerPager("blobauditingtest-4799", "blobauditingtest-6440", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ServerBlobAuditingPolicyListResult = armsql.ServerBlobAuditingPolicyListResult{ - // Value: []*armsql.ServerBlobAuditingPolicy{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/servers/auditingSettings"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/blobauditingtest-6852/providers/Microsoft.Sql/servers/blobauditingtest-2080/auditingSettings/default"), - // Properties: &armsql.ServerBlobAuditingPolicyProperties{ - // AuditActionsAndGroups: []*string{ - // }, - // IsAzureMonitorTargetEnabled: to.Ptr(false), - // IsManagedIdentityInUse: to.Ptr(false), - // IsStorageSecondaryKeyInUse: to.Ptr(false), - // RetentionDays: to.Ptr[int32](0), - // State: to.Ptr(armsql.BlobAuditingPolicyStateDisabled), - // StorageAccountSubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // StorageEndpoint: to.Ptr(""), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerBlobAuditingGet.json -func ExampleServerBlobAuditingPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServerBlobAuditingPoliciesClient().Get(ctx, "blobauditingtest-4799", "blobauditingtest-6440", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServerBlobAuditingPolicy = armsql.ServerBlobAuditingPolicy{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/servers/auditingSettings"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/blobauditingtest-6852/providers/Microsoft.Sql/servers/blobauditingtest-2080/auditingSettings/default"), - // Properties: &armsql.ServerBlobAuditingPolicyProperties{ - // AuditActionsAndGroups: []*string{ - // }, - // IsAzureMonitorTargetEnabled: to.Ptr(false), - // IsManagedIdentityInUse: to.Ptr(false), - // IsStorageSecondaryKeyInUse: to.Ptr(false), - // RetentionDays: to.Ptr[int32](0), - // State: to.Ptr(armsql.BlobAuditingPolicyStateDisabled), - // StorageAccountSubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // StorageEndpoint: to.Ptr(""), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerBlobAuditingCreateMax.json -func ExampleServerBlobAuditingPoliciesClient_BeginCreateOrUpdate_updateAServersBlobAuditingPolicyWithAllParameters() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServerBlobAuditingPoliciesClient().BeginCreateOrUpdate(ctx, "blobauditingtest-4799", "blobauditingtest-6440", armsql.ServerBlobAuditingPolicy{ - Properties: &armsql.ServerBlobAuditingPolicyProperties{ - AuditActionsAndGroups: []*string{ - to.Ptr("SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP"), - to.Ptr("FAILED_DATABASE_AUTHENTICATION_GROUP"), - to.Ptr("BATCH_COMPLETED_GROUP")}, - IsAzureMonitorTargetEnabled: to.Ptr(true), - IsStorageSecondaryKeyInUse: to.Ptr(false), - QueueDelayMs: to.Ptr[int32](4000), - RetentionDays: to.Ptr[int32](6), - State: to.Ptr(armsql.BlobAuditingPolicyStateEnabled), - StorageAccountAccessKey: to.Ptr("sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD=="), - StorageAccountSubscriptionID: to.Ptr("00000000-1234-0000-5678-000000000000"), - StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServerBlobAuditingPolicy = armsql.ServerBlobAuditingPolicy{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/servers/auditingSettings"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/blobauditingtest-4799/providers/Microsoft.Sql/servers/blobauditingtest-6440/auditingSettings/default"), - // Properties: &armsql.ServerBlobAuditingPolicyProperties{ - // AuditActionsAndGroups: []*string{ - // to.Ptr("SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP"), - // to.Ptr("FAILED_DATABASE_AUTHENTICATION_GROUP"), - // to.Ptr("BATCH_COMPLETED_GROUP")}, - // IsAzureMonitorTargetEnabled: to.Ptr(true), - // IsStorageSecondaryKeyInUse: to.Ptr(false), - // QueueDelayMs: to.Ptr[int32](4000), - // RetentionDays: to.Ptr[int32](6), - // State: to.Ptr(armsql.BlobAuditingPolicyStateEnabled), - // StorageAccountSubscriptionID: to.Ptr("00000000-1234-0000-5678-000000000000"), - // StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerBlobAuditingCreateMin.json -func ExampleServerBlobAuditingPoliciesClient_BeginCreateOrUpdate_updateAServersBlobAuditingPolicyWithMinimalParameters() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServerBlobAuditingPoliciesClient().BeginCreateOrUpdate(ctx, "blobauditingtest-4799", "blobauditingtest-6440", armsql.ServerBlobAuditingPolicy{ - Properties: &armsql.ServerBlobAuditingPolicyProperties{ - State: to.Ptr(armsql.BlobAuditingPolicyStateEnabled), - StorageAccountAccessKey: to.Ptr("sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD=="), - StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServerBlobAuditingPolicy = armsql.ServerBlobAuditingPolicy{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/servers/auditingSettings"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/blobauditingtest-4799/providers/Microsoft.Sql/servers/blobauditingtest-6440/auditingSettings/default"), - // Properties: &armsql.ServerBlobAuditingPolicyProperties{ - // AuditActionsAndGroups: []*string{ - // to.Ptr("SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP"), - // to.Ptr("FAILED_DATABASE_AUTHENTICATION_GROUP"), - // to.Ptr("BATCH_COMPLETED_GROUP")}, - // IsStorageSecondaryKeyInUse: to.Ptr(false), - // RetentionDays: to.Ptr[int32](6), - // State: to.Ptr(armsql.BlobAuditingPolicyStateEnabled), - // StorageAccountSubscriptionID: to.Ptr("00000000-1234-0000-5678-000000000000"), - // StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - // }, - // } -} diff --git a/sdk/resourcemanager/sql/armsql/servercommunicationlinks_client.go b/sdk/resourcemanager/sql/armsql/servercommunicationlinks_client.go deleted file mode 100644 index 5d4dd36ca9bb..000000000000 --- a/sdk/resourcemanager/sql/armsql/servercommunicationlinks_client.go +++ /dev/null @@ -1,310 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsql - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// ServerCommunicationLinksClient contains the methods for the ServerCommunicationLinks group. -// Don't use this type directly, use NewServerCommunicationLinksClient() instead. -type ServerCommunicationLinksClient struct { - internal *arm.Client - subscriptionID string -} - -// NewServerCommunicationLinksClient creates a new instance of ServerCommunicationLinksClient with the specified values. -// - subscriptionID - The subscription ID that identifies an Azure subscription. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewServerCommunicationLinksClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServerCommunicationLinksClient, error) { - cl, err := arm.NewClient(moduleName+".ServerCommunicationLinksClient", moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &ServerCommunicationLinksClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates a server communication link. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2014-04-01 -// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// - serverName - The name of the server. -// - communicationLinkName - The name of the server communication link. -// - parameters - The required parameters for creating a server communication link. -// - options - ServerCommunicationLinksClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerCommunicationLinksClient.BeginCreateOrUpdate -// method. -func (client *ServerCommunicationLinksClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, communicationLinkName string, parameters ServerCommunicationLink, options *ServerCommunicationLinksClientBeginCreateOrUpdateOptions) (*runtime.Poller[ServerCommunicationLinksClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, serverName, communicationLinkName, parameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller[ServerCommunicationLinksClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) - return poller, err - } else { - return runtime.NewPollerFromResumeToken[ServerCommunicationLinksClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) - } -} - -// CreateOrUpdate - Creates a server communication link. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2014-04-01 -func (client *ServerCommunicationLinksClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, communicationLinkName string, parameters ServerCommunicationLink, options *ServerCommunicationLinksClientBeginCreateOrUpdateOptions) (*http.Response, error) { - var err error - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, communicationLinkName, parameters, 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.StatusCreated, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ServerCommunicationLinksClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, communicationLinkName string, parameters ServerCommunicationLink, options *ServerCommunicationLinksClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/communicationLinks/{communicationLinkName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if serverName == "" { - return nil, errors.New("parameter serverName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) - if communicationLinkName == "" { - return nil, errors.New("parameter communicationLinkName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{communicationLinkName}", url.PathEscape(communicationLinkName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2014-04-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// Delete - Deletes a server communication link. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2014-04-01 -// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// - serverName - The name of the server. -// - communicationLinkName - The name of the server communication link. -// - options - ServerCommunicationLinksClientDeleteOptions contains the optional parameters for the ServerCommunicationLinksClient.Delete -// method. -func (client *ServerCommunicationLinksClient) Delete(ctx context.Context, resourceGroupName string, serverName string, communicationLinkName string, options *ServerCommunicationLinksClientDeleteOptions) (ServerCommunicationLinksClientDeleteResponse, error) { - var err error - req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, communicationLinkName, options) - if err != nil { - return ServerCommunicationLinksClientDeleteResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return ServerCommunicationLinksClientDeleteResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return ServerCommunicationLinksClientDeleteResponse{}, err - } - return ServerCommunicationLinksClientDeleteResponse{}, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *ServerCommunicationLinksClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serverName string, communicationLinkName string, options *ServerCommunicationLinksClientDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/communicationLinks/{communicationLinkName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if serverName == "" { - return nil, errors.New("parameter serverName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) - if communicationLinkName == "" { - return nil, errors.New("parameter communicationLinkName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{communicationLinkName}", url.PathEscape(communicationLinkName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2014-04-01") - req.Raw().URL.RawQuery = reqQP.Encode() - return req, nil -} - -// Get - Returns a server communication link. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2014-04-01 -// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// - serverName - The name of the server. -// - communicationLinkName - The name of the server communication link. -// - options - ServerCommunicationLinksClientGetOptions contains the optional parameters for the ServerCommunicationLinksClient.Get -// method. -func (client *ServerCommunicationLinksClient) Get(ctx context.Context, resourceGroupName string, serverName string, communicationLinkName string, options *ServerCommunicationLinksClientGetOptions) (ServerCommunicationLinksClientGetResponse, error) { - var err error - req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, communicationLinkName, options) - if err != nil { - return ServerCommunicationLinksClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return ServerCommunicationLinksClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return ServerCommunicationLinksClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *ServerCommunicationLinksClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, communicationLinkName string, options *ServerCommunicationLinksClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/communicationLinks/{communicationLinkName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if serverName == "" { - return nil, errors.New("parameter serverName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) - if communicationLinkName == "" { - return nil, errors.New("parameter communicationLinkName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{communicationLinkName}", url.PathEscape(communicationLinkName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2014-04-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *ServerCommunicationLinksClient) getHandleResponse(resp *http.Response) (ServerCommunicationLinksClientGetResponse, error) { - result := ServerCommunicationLinksClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ServerCommunicationLink); err != nil { - return ServerCommunicationLinksClientGetResponse{}, err - } - return result, nil -} - -// NewListByServerPager - Gets a list of server communication links. -// -// Generated from API version 2014-04-01 -// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// - serverName - The name of the server. -// - options - ServerCommunicationLinksClientListByServerOptions contains the optional parameters for the ServerCommunicationLinksClient.NewListByServerPager -// method. -func (client *ServerCommunicationLinksClient) NewListByServerPager(resourceGroupName string, serverName string, options *ServerCommunicationLinksClientListByServerOptions) *runtime.Pager[ServerCommunicationLinksClientListByServerResponse] { - return runtime.NewPager(runtime.PagingHandler[ServerCommunicationLinksClientListByServerResponse]{ - More: func(page ServerCommunicationLinksClientListByServerResponse) bool { - return false - }, - Fetcher: func(ctx context.Context, page *ServerCommunicationLinksClientListByServerResponse) (ServerCommunicationLinksClientListByServerResponse, error) { - req, err := client.listByServerCreateRequest(ctx, resourceGroupName, serverName, options) - if err != nil { - return ServerCommunicationLinksClientListByServerResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return ServerCommunicationLinksClientListByServerResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServerCommunicationLinksClientListByServerResponse{}, runtime.NewResponseError(resp) - } - return client.listByServerHandleResponse(resp) - }, - }) -} - -// listByServerCreateRequest creates the ListByServer request. -func (client *ServerCommunicationLinksClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *ServerCommunicationLinksClientListByServerOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/communicationLinks" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if serverName == "" { - return nil, errors.New("parameter serverName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2014-04-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByServerHandleResponse handles the ListByServer response. -func (client *ServerCommunicationLinksClient) listByServerHandleResponse(resp *http.Response) (ServerCommunicationLinksClientListByServerResponse, error) { - result := ServerCommunicationLinksClientListByServerResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ServerCommunicationLinkListResult); err != nil { - return ServerCommunicationLinksClientListByServerResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/sql/armsql/servercommunicationlinks_client_example_test.go b/sdk/resourcemanager/sql/armsql/servercommunicationlinks_client_example_test.go deleted file mode 100644 index 2115e8194b1a..000000000000 --- a/sdk/resourcemanager/sql/armsql/servercommunicationlinks_client_example_test.go +++ /dev/null @@ -1,129 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ServerCommunicationLinkDelete.json -func ExampleServerCommunicationLinksClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewServerCommunicationLinksClient().Delete(ctx, "sqlcrudtest-7398", "sqlcrudtest-4645", "link1", 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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ServerCommunicationLinkGet.json -func ExampleServerCommunicationLinksClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServerCommunicationLinksClient().Get(ctx, "sqlcrudtest-7398", "sqlcrudtest-4645", "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.ServerCommunicationLink = armsql.ServerCommunicationLink{ - // Name: to.Ptr("link1"), - // Type: to.Ptr("Microsoft.Sql/servers/communicationLinks"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645/communicationLinks/link1"), - // Location: to.Ptr("Central US"), - // Properties: &armsql.ServerCommunicationLinkProperties{ - // PartnerServer: to.Ptr("sqlcrudtest-test"), - // State: to.Ptr("Ready"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ServerCommunicationLinkCreateOrUpdate.json -func ExampleServerCommunicationLinksClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServerCommunicationLinksClient().BeginCreateOrUpdate(ctx, "sqlcrudtest-7398", "sqlcrudtest-4645", "link1", armsql.ServerCommunicationLink{ - Properties: &armsql.ServerCommunicationLinkProperties{ - PartnerServer: to.Ptr("sqldcrudtest-test"), - }, - }, 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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ServerCommunicationLinkList.json -func ExampleServerCommunicationLinksClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServerCommunicationLinksClient().NewListByServerPager("sqlcrudtest-7398", "sqlcrudtest-4645", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ServerCommunicationLinkListResult = armsql.ServerCommunicationLinkListResult{ - // Value: []*armsql.ServerCommunicationLink{ - // { - // Name: to.Ptr("link1"), - // Type: to.Ptr("Microsoft.Sql/servers/communicationLinks"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645/communicationLinks/link1"), - // Location: to.Ptr("Central US"), - // Properties: &armsql.ServerCommunicationLinkProperties{ - // PartnerServer: to.Ptr("sqlcrudtest-test"), - // State: to.Ptr("Ready"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/sql/armsql/serverconfigurationoptions_client.go b/sdk/resourcemanager/sql/armsql/serverconfigurationoptions_client.go index c24f0b858558..b713400f7201 100644 --- a/sdk/resourcemanager/sql/armsql/serverconfigurationoptions_client.go +++ b/sdk/resourcemanager/sql/armsql/serverconfigurationoptions_client.go @@ -46,7 +46,7 @@ func NewServerConfigurationOptionsClient(subscriptionID string, credential azcor // BeginCreateOrUpdate - Updates managed instance server configuration option. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -70,7 +70,7 @@ func (client *ServerConfigurationOptionsClient) BeginCreateOrUpdate(ctx context. // CreateOrUpdate - Updates managed instance server configuration option. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview func (client *ServerConfigurationOptionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, serverConfigurationOptionName ServerConfigurationOptionName, parameters ServerConfigurationOption, options *ServerConfigurationOptionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, serverConfigurationOptionName, parameters, options) @@ -112,7 +112,7 @@ func (client *ServerConfigurationOptionsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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 *ServerConfigurationOptionsClient) createOrUpdateCreateRequest(ctx // Get - Gets managed instance server configuration option. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -173,7 +173,7 @@ func (client *ServerConfigurationOptionsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -190,7 +190,7 @@ func (client *ServerConfigurationOptionsClient) getHandleResponse(resp *http.Res // NewListByManagedInstancePager - Gets a list of managed instance server configuration options. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -244,7 +244,7 @@ func (client *ServerConfigurationOptionsClient) listByManagedInstanceCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/serverconfigurationoptions_client_example_test.go b/sdk/resourcemanager/sql/armsql/serverconfigurationoptions_client_example_test.go deleted file mode 100644 index daf317ccbc11..000000000000 --- a/sdk/resourcemanager/sql/armsql/serverconfigurationoptions_client_example_test.go +++ /dev/null @@ -1,122 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ServerConfigurationOptionList.json -func ExampleServerConfigurationOptionsClient_NewListByManagedInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServerConfigurationOptionsClient().NewListByManagedInstancePager("testrg", "testinstance", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ServerConfigurationOptionListResult = armsql.ServerConfigurationOptionListResult{ - // Value: []*armsql.ServerConfigurationOption{ - // { - // Name: to.Ptr("allowPolybaseExport"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/serverConfigurationOptions"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testinstance/serverConfigurationOptions/allowPolybaseExport"), - // Properties: &armsql.ServerConfigurationOptionProperties{ - // ProvisioningState: to.Ptr(armsql.ProvisioningStateSucceeded), - // ServerConfigurationOptionValue: to.Ptr[int32](1), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ServerConfigurationOptionGet.json -func ExampleServerConfigurationOptionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServerConfigurationOptionsClient().Get(ctx, "testrg", "testinstance", armsql.ServerConfigurationOptionNameAllowPolybaseExport, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServerConfigurationOption = armsql.ServerConfigurationOption{ - // Name: to.Ptr("allowPolybaseExport"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/serverConfigurationOptions"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testinstance/serverConfigurationOptions/allowPolybaseExport"), - // Properties: &armsql.ServerConfigurationOptionProperties{ - // ProvisioningState: to.Ptr(armsql.ProvisioningStateSucceeded), - // ServerConfigurationOptionValue: to.Ptr[int32](1), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ServerConfigurationOptionUpdate.json -func ExampleServerConfigurationOptionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServerConfigurationOptionsClient().BeginCreateOrUpdate(ctx, "testrg", "testinstance", armsql.ServerConfigurationOptionNameAllowPolybaseExport, armsql.ServerConfigurationOption{ - Properties: &armsql.ServerConfigurationOptionProperties{ - ServerConfigurationOptionValue: to.Ptr[int32](1), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServerConfigurationOption = armsql.ServerConfigurationOption{ - // Name: to.Ptr("allowPolybaseExport"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/serverConfigurationOptions"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testinstance/serverConfigurationOptions/allowPolybaseExport"), - // Properties: &armsql.ServerConfigurationOptionProperties{ - // ProvisioningState: to.Ptr(armsql.ProvisioningStateSucceeded), - // ServerConfigurationOptionValue: to.Ptr[int32](1), - // }, - // } -} diff --git a/sdk/resourcemanager/sql/armsql/serverconnectionpolicies_client.go b/sdk/resourcemanager/sql/armsql/serverconnectionpolicies_client.go index 32ac2e1f3539..d8b2158a6d0a 100644 --- a/sdk/resourcemanager/sql/armsql/serverconnectionpolicies_client.go +++ b/sdk/resourcemanager/sql/armsql/serverconnectionpolicies_client.go @@ -46,7 +46,7 @@ func NewServerConnectionPoliciesClient(subscriptionID string, credential azcore. // BeginCreateOrUpdate - Updates a server connection policy // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-05-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -70,7 +70,7 @@ func (client *ServerConnectionPoliciesClient) BeginCreateOrUpdate(ctx context.Co // CreateOrUpdate - Updates a server connection policy // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-05-01-preview +// Generated from API version 2023-05-01-preview func (client *ServerConnectionPoliciesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, connectionPolicyName ConnectionPolicyName, parameters ServerConnectionPolicy, options *ServerConnectionPoliciesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, connectionPolicyName, parameters, options) @@ -112,7 +112,7 @@ func (client *ServerConnectionPoliciesClient) createOrUpdateCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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 *ServerConnectionPoliciesClient) createOrUpdateCreateRequest(ctx co // Get - Gets a server connection policy // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-05-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -173,7 +173,7 @@ func (client *ServerConnectionPoliciesClient) getCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -190,7 +190,7 @@ func (client *ServerConnectionPoliciesClient) getHandleResponse(resp *http.Respo // NewListByServerPager - Lists connection policy // -// Generated from API version 2021-05-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -244,7 +244,7 @@ func (client *ServerConnectionPoliciesClient) listByServerCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/serverconnectionpolicies_client_example_test.go b/sdk/resourcemanager/sql/armsql/serverconnectionpolicies_client_example_test.go deleted file mode 100644 index e4e42091d420..000000000000 --- a/sdk/resourcemanager/sql/armsql/serverconnectionpolicies_client_example_test.go +++ /dev/null @@ -1,122 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ServerConnectionPoliciesGet.json -func ExampleServerConnectionPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServerConnectionPoliciesClient().Get(ctx, "rgtest-12", "servertest-6285", armsql.ConnectionPolicyNameDefault, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServerConnectionPolicy = armsql.ServerConnectionPolicy{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/servers/connectionPolicies"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rgtest-12/providers/Microsoft.Sql/servers/servertest-6285/connectionPolicies/default"), - // Location: to.Ptr("eastus"), - // Properties: &armsql.ServerConnectionPolicyProperties{ - // ConnectionType: to.Ptr(armsql.ServerConnectionTypeRedirect), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ServerConnectionPoliciesUpdate.json -func ExampleServerConnectionPoliciesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServerConnectionPoliciesClient().BeginCreateOrUpdate(ctx, "testrg", "testserver", armsql.ConnectionPolicyNameDefault, armsql.ServerConnectionPolicy{ - Properties: &armsql.ServerConnectionPolicyProperties{ - ConnectionType: to.Ptr(armsql.ServerConnectionTypeRedirect), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServerConnectionPolicy = armsql.ServerConnectionPolicy{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/servers/connectionPolicies"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/servers/testserver/connectionPolicies/default"), - // Location: to.Ptr("eastus"), - // Properties: &armsql.ServerConnectionPolicyProperties{ - // ConnectionType: to.Ptr(armsql.ServerConnectionTypeRedirect), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ServerConnectionPoliciesList.json -func ExampleServerConnectionPoliciesClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServerConnectionPoliciesClient().NewListByServerPager("rgtest-12", "servertest-6285", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ServerConnectionPolicyListResult = armsql.ServerConnectionPolicyListResult{ - // Value: []*armsql.ServerConnectionPolicy{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/servers/connectionPolicies"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rgtest-12/providers/Microsoft.Sql/servers/servertest-6285/connectionPolicies/default"), - // Location: to.Ptr("eastus"), - // Properties: &armsql.ServerConnectionPolicyProperties{ - // ConnectionType: to.Ptr(armsql.ServerConnectionTypeRedirect), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/sql/armsql/serverdevopsauditsettings_client.go b/sdk/resourcemanager/sql/armsql/serverdevopsauditsettings_client.go index 0ec4d04ab733..5eda5e61ecab 100644 --- a/sdk/resourcemanager/sql/armsql/serverdevopsauditsettings_client.go +++ b/sdk/resourcemanager/sql/armsql/serverdevopsauditsettings_client.go @@ -46,7 +46,7 @@ func NewServerDevOpsAuditSettingsClient(subscriptionID string, credential azcore // BeginCreateOrUpdate - Creates or updates a server's DevOps audit settings. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-02-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -71,7 +71,7 @@ func (client *ServerDevOpsAuditSettingsClient) BeginCreateOrUpdate(ctx context.C // CreateOrUpdate - Creates or updates a server's DevOps audit settings. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-02-01-preview +// Generated from API version 2023-05-01-preview func (client *ServerDevOpsAuditSettingsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, devOpsAuditingSettingsName DevOpsAuditingSettingsName, parameters ServerDevOpsAuditingSettings, options *ServerDevOpsAuditSettingsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, devOpsAuditingSettingsName, parameters, options) @@ -113,7 +113,7 @@ func (client *ServerDevOpsAuditSettingsClient) createOrUpdateCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -125,7 +125,7 @@ func (client *ServerDevOpsAuditSettingsClient) createOrUpdateCreateRequest(ctx c // Get - Gets a server's DevOps audit settings. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-02-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -173,7 +173,7 @@ func (client *ServerDevOpsAuditSettingsClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -190,7 +190,7 @@ func (client *ServerDevOpsAuditSettingsClient) getHandleResponse(resp *http.Resp // NewListByServerPager - Lists DevOps audit settings of a server. // -// Generated from API version 2022-02-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -244,7 +244,7 @@ func (client *ServerDevOpsAuditSettingsClient) listByServerCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/serverdevopsauditsettings_client_example_test.go b/sdk/resourcemanager/sql/armsql/serverdevopsauditsettings_client_example_test.go deleted file mode 100644 index d3ea2e1b4cb5..000000000000 --- a/sdk/resourcemanager/sql/armsql/serverdevopsauditsettings_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 armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ServerDevOpsAuditList.json -func ExampleServerDevOpsAuditSettingsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServerDevOpsAuditSettingsClient().NewListByServerPager("devAuditTestRG", "devOpsAuditTestSvr", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ServerDevOpsAuditSettingsListResult = armsql.ServerDevOpsAuditSettingsListResult{ - // Value: []*armsql.ServerDevOpsAuditingSettings{ - // { - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.Sql/servers/devOpsAuditingSettings"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/devAuditTestRG/providers/Microsoft.Sql/servers/devOpsAuditTestSvr/devOpsAuditingSettings/default"), - // Properties: &armsql.ServerDevOpsAuditSettingsProperties{ - // IsAzureMonitorTargetEnabled: to.Ptr(false), - // IsManagedIdentityInUse: to.Ptr(false), - // State: to.Ptr(armsql.BlobAuditingPolicyStateDisabled), - // StorageAccountSubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ServerDevOpsAuditGet.json -func ExampleServerDevOpsAuditSettingsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServerDevOpsAuditSettingsClient().Get(ctx, "devAuditTestRG", "devOpsAuditTestSvr", armsql.DevOpsAuditingSettingsNameDefault, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServerDevOpsAuditingSettings = armsql.ServerDevOpsAuditingSettings{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.Sql/servers/devOpsAuditingSettings"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/devAuditTestRG/providers/Microsoft.Sql/servers/devOpsAuditTestSvr/devOpsAuditingSettings/default"), - // Properties: &armsql.ServerDevOpsAuditSettingsProperties{ - // IsAzureMonitorTargetEnabled: to.Ptr(false), - // IsManagedIdentityInUse: to.Ptr(false), - // State: to.Ptr(armsql.BlobAuditingPolicyStateDisabled), - // StorageAccountSubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ServerDevOpsAuditCreateMax.json -func ExampleServerDevOpsAuditSettingsClient_BeginCreateOrUpdate_updateAServersDevOpsAuditSettingsWithAllParams() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServerDevOpsAuditSettingsClient().BeginCreateOrUpdate(ctx, "devAuditTestRG", "devOpsAuditTestSvr", armsql.DevOpsAuditingSettingsNameDefault, armsql.ServerDevOpsAuditingSettings{ - Properties: &armsql.ServerDevOpsAuditSettingsProperties{ - IsAzureMonitorTargetEnabled: to.Ptr(true), - State: to.Ptr(armsql.BlobAuditingPolicyStateEnabled), - StorageAccountAccessKey: to.Ptr("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"), - StorageAccountSubscriptionID: to.Ptr("00000000-1234-0000-5678-000000000000"), - StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServerDevOpsAuditingSettings = armsql.ServerDevOpsAuditingSettings{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.Sql/servers/devOpsAuditingSettings"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/devAuditTestRG/providers/Microsoft.Sql/servers/devOpsAuditTestSvr/devOpsAuditingSettings/default"), - // Properties: &armsql.ServerDevOpsAuditSettingsProperties{ - // IsAzureMonitorTargetEnabled: to.Ptr(true), - // State: to.Ptr(armsql.BlobAuditingPolicyStateEnabled), - // StorageAccountSubscriptionID: to.Ptr("00000000-1234-0000-5678-000000000000"), - // StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ServerDevOpsAuditCreateMin.json -func ExampleServerDevOpsAuditSettingsClient_BeginCreateOrUpdate_updateAServersDevOpsAuditSettingsWithMinimalInput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServerDevOpsAuditSettingsClient().BeginCreateOrUpdate(ctx, "devAuditTestRG", "devOpsAuditTestSvr", armsql.DevOpsAuditingSettingsNameDefault, armsql.ServerDevOpsAuditingSettings{ - Properties: &armsql.ServerDevOpsAuditSettingsProperties{ - State: to.Ptr(armsql.BlobAuditingPolicyStateEnabled), - StorageAccountAccessKey: to.Ptr("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"), - StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServerDevOpsAuditingSettings = armsql.ServerDevOpsAuditingSettings{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.Sql/servers/devOpsAuditingSettings"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/devAuditTestRG/providers/Microsoft.Sql/servers/devOpsAuditTestSvr/devOpsAuditingSettings/default"), - // Properties: &armsql.ServerDevOpsAuditSettingsProperties{ - // State: to.Ptr(armsql.BlobAuditingPolicyStateEnabled), - // StorageAccountSubscriptionID: to.Ptr("00000000-1234-0000-5678-000000000000"), - // StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - // }, - // } -} diff --git a/sdk/resourcemanager/sql/armsql/serverdnsaliases_client.go b/sdk/resourcemanager/sql/armsql/serverdnsaliases_client.go index e4e9c2d3c530..61a2a5b583a3 100644 --- a/sdk/resourcemanager/sql/armsql/serverdnsaliases_client.go +++ b/sdk/resourcemanager/sql/armsql/serverdnsaliases_client.go @@ -46,7 +46,7 @@ func NewServerDNSAliasesClient(subscriptionID string, credential azcore.TokenCre // BeginAcquire - Acquires server DNS alias from another server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server that the alias is pointing to. @@ -69,7 +69,7 @@ func (client *ServerDNSAliasesClient) BeginAcquire(ctx context.Context, resource // Acquire - Acquires server DNS alias from another server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview func (client *ServerDNSAliasesClient) acquire(ctx context.Context, resourceGroupName string, serverName string, dnsAliasName string, parameters ServerDNSAliasAcquisition, options *ServerDNSAliasesClientBeginAcquireOptions) (*http.Response, error) { var err error req, err := client.acquireCreateRequest(ctx, resourceGroupName, serverName, dnsAliasName, parameters, options) @@ -111,7 +111,7 @@ func (client *ServerDNSAliasesClient) acquireCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -123,7 +123,7 @@ func (client *ServerDNSAliasesClient) acquireCreateRequest(ctx context.Context, // BeginCreateOrUpdate - Creates a server DNS alias. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server that the alias is pointing to. @@ -146,7 +146,7 @@ func (client *ServerDNSAliasesClient) BeginCreateOrUpdate(ctx context.Context, r // CreateOrUpdate - Creates a server DNS alias. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview func (client *ServerDNSAliasesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, dnsAliasName string, options *ServerDNSAliasesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, dnsAliasName, options) @@ -188,7 +188,7 @@ func (client *ServerDNSAliasesClient) createOrUpdateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -197,7 +197,7 @@ func (client *ServerDNSAliasesClient) createOrUpdateCreateRequest(ctx context.Co // BeginDelete - Deletes the server DNS alias with the given name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server that the alias is pointing to. @@ -220,7 +220,7 @@ func (client *ServerDNSAliasesClient) BeginDelete(ctx context.Context, resourceG // Delete - Deletes the server DNS alias with the given name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview func (client *ServerDNSAliasesClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, dnsAliasName string, options *ServerDNSAliasesClientBeginDeleteOptions) (*http.Response, error) { var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, dnsAliasName, options) @@ -262,7 +262,7 @@ func (client *ServerDNSAliasesClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -270,7 +270,7 @@ func (client *ServerDNSAliasesClient) deleteCreateRequest(ctx context.Context, r // Get - Gets a server DNS alias. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server that the alias is pointing to. @@ -318,7 +318,7 @@ func (client *ServerDNSAliasesClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -335,7 +335,7 @@ func (client *ServerDNSAliasesClient) getHandleResponse(resp *http.Response) (Se // NewListByServerPager - Gets a list of server DNS aliases for a server. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server that the alias is pointing to. @@ -389,7 +389,7 @@ func (client *ServerDNSAliasesClient) listByServerCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/serverdnsaliases_client_example_test.go b/sdk/resourcemanager/sql/armsql/serverdnsaliases_client_example_test.go deleted file mode 100644 index 45344565238f..000000000000 --- a/sdk/resourcemanager/sql/armsql/serverdnsaliases_client_example_test.go +++ /dev/null @@ -1,178 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerDnsAliasGet.json -func ExampleServerDNSAliasesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServerDNSAliasesClient().Get(ctx, "Default", "dns-alias-server", "dns-alias-name-1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServerDNSAlias = armsql.ServerDNSAlias{ - // Name: to.Ptr("dns-alias-name-1"), - // Type: to.Ptr("Microsoft.Sql/servers/dnsAliases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/dns-alias-server/dnsAliases/dns-alias-name-1"), - // Properties: &armsql.ServerDNSAliasProperties{ - // AzureDNSRecord: to.Ptr("dns-alias-name-1.database.windows.net"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerDnsAliasCreateOrUpdate.json -func ExampleServerDNSAliasesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServerDNSAliasesClient().BeginCreateOrUpdate(ctx, "Default", "dns-alias-server", "dns-alias-name-1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServerDNSAlias = armsql.ServerDNSAlias{ - // Name: to.Ptr("dns-alias-name-1"), - // Type: to.Ptr("Microsoft.Sql/servers/dnsAliases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/dns-alias-server/dnsAliases/dns-alias-name-1"), - // Properties: &armsql.ServerDNSAliasProperties{ - // AzureDNSRecord: to.Ptr("dns-alias-name-1.database.windows.net"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerDnsAliasDelete.json -func ExampleServerDNSAliasesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServerDNSAliasesClient().BeginDelete(ctx, "Default", "dns-alias-server", "dns-alias-name-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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerDnsAliasList.json -func ExampleServerDNSAliasesClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServerDNSAliasesClient().NewListByServerPager("Default", "dns-alias-server", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ServerDNSAliasListResult = armsql.ServerDNSAliasListResult{ - // Value: []*armsql.ServerDNSAlias{ - // { - // Name: to.Ptr("server-dns-alias-1"), - // Type: to.Ptr("Microsoft.Sql/servers/dnsAliases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/dns-alias-server/dnsAliases/dns-alias-1"), - // Properties: &armsql.ServerDNSAliasProperties{ - // AzureDNSRecord: to.Ptr("dns-alias-1.database.windows.net"), - // }, - // }, - // { - // Name: to.Ptr("server-dns-alias-2"), - // Type: to.Ptr("Microsoft.Sql/servers/dnsAliases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/dns-alias-server/dnsAliases/dns-alias-2"), - // Properties: &armsql.ServerDNSAliasProperties{ - // AzureDNSRecord: to.Ptr("dns-alias-2.database.windows.net"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerDnsAliasAcquire.json -func ExampleServerDNSAliasesClient_BeginAcquire() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServerDNSAliasesClient().BeginAcquire(ctx, "Default", "dns-alias-new-server", "dns-alias-name-1", armsql.ServerDNSAliasAcquisition{ - OldServerDNSAliasID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/dns-alias-old-server/dnsAliases/dns-alias-name-1"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServerDNSAlias = armsql.ServerDNSAlias{ - // Name: to.Ptr("server-dns-alias-name-1"), - // Type: to.Ptr("Microsoft.Sql/servers/dnsAliases"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/dns-alias-new-server/dnsAliases/dns-alias-name-1"), - // Properties: &armsql.ServerDNSAliasProperties{ - // AzureDNSRecord: to.Ptr("dns-alias-name-1.database.windows.net"), - // }, - // } -} diff --git a/sdk/resourcemanager/sql/armsql/serverkeys_client.go b/sdk/resourcemanager/sql/armsql/serverkeys_client.go index 88e54e814177..ad2476b4df9d 100644 --- a/sdk/resourcemanager/sql/armsql/serverkeys_client.go +++ b/sdk/resourcemanager/sql/armsql/serverkeys_client.go @@ -46,7 +46,7 @@ func NewServerKeysClient(subscriptionID string, credential azcore.TokenCredentia // BeginCreateOrUpdate - Creates or updates a server key. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -73,7 +73,7 @@ func (client *ServerKeysClient) BeginCreateOrUpdate(ctx context.Context, resourc // CreateOrUpdate - Creates or updates a server key. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview func (client *ServerKeysClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, keyName string, parameters ServerKey, options *ServerKeysClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, keyName, parameters, options) @@ -115,7 +115,7 @@ func (client *ServerKeysClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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 *ServerKeysClient) createOrUpdateCreateRequest(ctx context.Context, // BeginDelete - Deletes the server key with the given name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -149,7 +149,7 @@ func (client *ServerKeysClient) BeginDelete(ctx context.Context, resourceGroupNa // Delete - Deletes the server key with the given name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview func (client *ServerKeysClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, keyName string, options *ServerKeysClientBeginDeleteOptions) (*http.Response, error) { var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, keyName, options) @@ -191,7 +191,7 @@ func (client *ServerKeysClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -199,7 +199,7 @@ func (client *ServerKeysClient) deleteCreateRequest(ctx context.Context, resourc // Get - Gets a server key. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -247,7 +247,7 @@ func (client *ServerKeysClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -264,7 +264,7 @@ func (client *ServerKeysClient) getHandleResponse(resp *http.Response) (ServerKe // NewListByServerPager - Gets a list of server keys. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -318,7 +318,7 @@ func (client *ServerKeysClient) listByServerCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/serverkeys_client_example_test.go b/sdk/resourcemanager/sql/armsql/serverkeys_client_example_test.go deleted file mode 100644 index d9334997fe6e..000000000000 --- a/sdk/resourcemanager/sql/armsql/serverkeys_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 armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerKeyList.json -func ExampleServerKeysClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServerKeysClient().NewListByServerPager("sqlcrudtest-7398", "sqlcrudtest-4645", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ServerKeyListResult = armsql.ServerKeyListResult{ - // Value: []*armsql.ServerKey{ - // { - // Name: to.Ptr("someVault_someKey_01234567890123456789012345678901"), - // Type: to.Ptr("Microsoft.Sql/servers/keys"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645/keys/someVault_someKey_01234567890123456789012345678901"), - // Kind: to.Ptr("azurekeyvault"), - // Location: to.Ptr("Japan East"), - // Properties: &armsql.ServerKeyProperties{ - // AutoRotationEnabled: to.Ptr(false), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-15T00:00:00Z"); return t}()), - // Thumbprint: to.Ptr("00112233445566778899AABBCCDDEEFFAABBCCDD"), - // }, - // }, - // { - // Name: to.Ptr("myVault_myKey_11111111111111111111111111111111"), - // Type: to.Ptr("Microsoft.Sql/servers/keys"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645/keys/myVault_myKey_11111111111111111111111111111111"), - // Kind: to.Ptr("azurekeyvault"), - // Location: to.Ptr("Japan East"), - // Properties: &armsql.ServerKeyProperties{ - // AutoRotationEnabled: to.Ptr(false), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-15T00:00:00Z"); return t}()), - // Thumbprint: to.Ptr("AAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBB"), - // }, - // }, - // { - // Name: to.Ptr("ServiceManaged"), - // Type: to.Ptr("Microsoft.Sql/servers/keys"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645/keys/ServiceManaged"), - // Kind: to.Ptr("servicemanaged"), - // Location: to.Ptr("Japan East"), - // Properties: &armsql.ServerKeyProperties{ - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerKeyGet.json -func ExampleServerKeysClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServerKeysClient().Get(ctx, "sqlcrudtest-7398", "sqlcrudtest-4645", "someVault_someKey_01234567890123456789012345678901", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServerKey = armsql.ServerKey{ - // Name: to.Ptr("sqlcrudtest-4645"), - // Type: to.Ptr("Microsoft.Sql/servers/keys"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645/keys/someVault_someKey_01234567890123456789012345678901"), - // Kind: to.Ptr("azurekeyvault"), - // Location: to.Ptr("Japan East"), - // Properties: &armsql.ServerKeyProperties{ - // AutoRotationEnabled: to.Ptr(false), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-15T00:00:00Z"); return t}()), - // Thumbprint: to.Ptr("00112233445566778899AABBCCDDEEFFAABBCCDD"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerKeyCreateOrUpdate.json -func ExampleServerKeysClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServerKeysClient().BeginCreateOrUpdate(ctx, "sqlcrudtest-7398", "sqlcrudtest-4645", "someVault_someKey_01234567890123456789012345678901", armsql.ServerKey{ - Properties: &armsql.ServerKeyProperties{ - ServerKeyType: to.Ptr(armsql.ServerKeyTypeAzureKeyVault), - URI: to.Ptr("https://someVault.vault.azure.net/keys/someKey/01234567890123456789012345678901"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServerKey = armsql.ServerKey{ - // Name: to.Ptr("sqlcrudtest-4645"), - // Type: to.Ptr("Microsoft.Sql/servers/keys"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645/keys/someVault_someKey_01234567890123456789012345678901"), - // Kind: to.Ptr("azurekeyvault"), - // Location: to.Ptr("Japan East"), - // Properties: &armsql.ServerKeyProperties{ - // AutoRotationEnabled: to.Ptr(false), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-15T00:00:00Z"); return t}()), - // Thumbprint: to.Ptr("00112233445566778899AABBCCDDEEFFAABBCCDD"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerKeyDelete.json -func ExampleServerKeysClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServerKeysClient().BeginDelete(ctx, "sqlcrudtest-7398", "sqlcrudtest-4645", "someVault_someKey_01234567890123456789012345678901", 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/sql/armsql/serveroperations_client.go b/sdk/resourcemanager/sql/armsql/serveroperations_client.go index 9b8feaff7158..077956e7f85a 100644 --- a/sdk/resourcemanager/sql/armsql/serveroperations_client.go +++ b/sdk/resourcemanager/sql/armsql/serveroperations_client.go @@ -45,7 +45,7 @@ func NewServerOperationsClient(subscriptionID string, credential azcore.TokenCre // NewListByServerPager - Gets a list of operations performed on the server. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -99,7 +99,7 @@ func (client *ServerOperationsClient) listByServerCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/serveroperations_client_example_test.go b/sdk/resourcemanager/sql/armsql/serveroperations_client_example_test.go deleted file mode 100644 index fe9213445ac2..000000000000 --- a/sdk/resourcemanager/sql/armsql/serveroperations_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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListServerOperations.json -func ExampleServerOperationsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServerOperationsClient().NewListByServerPager("sqlcrudtest-7398", "sqlcrudtest-4645", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ServerOperationListResult = armsql.ServerOperationListResult{ - // Value: []*armsql.ServerOperation{ - // { - // Name: to.Ptr("11111111-1111-1111-1111-111111111111"), - // Type: to.Ptr("Microsoft.Sql/servers/operations"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645/operations/11111111-1111-1111-1111-111111111111"), - // Properties: &armsql.ServerOperationProperties{ - // Operation: to.Ptr("MakeAllLogicalDatabasesAccessible"), - // OperationFriendlyName: to.Ptr("MAKE ALL DBS ACCESSIBLE"), - // PercentComplete: to.Ptr[int32](0), - // ServerName: to.Ptr("sqlcrudtest-4645"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-01T09:10:08.1Z"); return t}()), - // State: to.Ptr(armsql.ManagementOperationStateInProgress), - // }, - // }, - // { - // Name: to.Ptr("22222222-2222-2222-2222-222222222222"), - // Type: to.Ptr("Microsoft.Sql/servers/operations"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645/operations/22222222-2222-2222-2222-222222222222"), - // Properties: &armsql.ServerOperationProperties{ - // Operation: to.Ptr("MakeAllLogicalDatabasesAccessible"), - // OperationFriendlyName: to.Ptr("MAKE ALL DBS ACCESSIBLE"), - // PercentComplete: to.Ptr[int32](100), - // ServerName: to.Ptr("sqlcrudtest-4645"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-01T09:00:08.1Z"); return t}()), - // State: to.Ptr(armsql.ManagementOperationStateSucceeded), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/sql/armsql/servers_client.go b/sdk/resourcemanager/sql/armsql/servers_client.go index 2b48ed799198..bc46d27266a5 100644 --- a/sdk/resourcemanager/sql/armsql/servers_client.go +++ b/sdk/resourcemanager/sql/armsql/servers_client.go @@ -46,7 +46,7 @@ func NewServersClient(subscriptionID string, credential azcore.TokenCredential, // CheckNameAvailability - Determines whether a resource can be created with the specified name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - parameters - The name availability request parameters. // - options - ServersClientCheckNameAvailabilityOptions contains the optional parameters for the ServersClient.CheckNameAvailability // method. @@ -80,7 +80,7 @@ func (client *ServersClient) checkNameAvailabilityCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -101,7 +101,7 @@ func (client *ServersClient) checkNameAvailabilityHandleResponse(resp *http.Resp // BeginCreateOrUpdate - Creates or updates a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -124,7 +124,7 @@ func (client *ServersClient) BeginCreateOrUpdate(ctx context.Context, resourceGr // CreateOrUpdate - Creates or updates a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview func (client *ServersClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters Server, options *ServersClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, parameters, options) @@ -162,7 +162,7 @@ func (client *ServersClient) createOrUpdateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -174,7 +174,7 @@ func (client *ServersClient) createOrUpdateCreateRequest(ctx context.Context, re // BeginDelete - Deletes a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -195,7 +195,7 @@ func (client *ServersClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Deletes a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview func (client *ServersClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, options *ServersClientBeginDeleteOptions) (*http.Response, error) { var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, options) @@ -233,7 +233,7 @@ func (client *ServersClient) deleteCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -241,7 +241,7 @@ func (client *ServersClient) deleteCreateRequest(ctx context.Context, resourceGr // Get - Gets a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -287,7 +287,7 @@ func (client *ServersClient) getCreateRequest(ctx context.Context, resourceGroup if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -305,7 +305,7 @@ func (client *ServersClient) getHandleResponse(resp *http.Response) (ServersClie // BeginImportDatabase - Imports a bacpac into a new database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -328,7 +328,7 @@ func (client *ServersClient) BeginImportDatabase(ctx context.Context, resourceGr // ImportDatabase - Imports a bacpac into a new database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview func (client *ServersClient) importDatabase(ctx context.Context, resourceGroupName string, serverName string, parameters ImportNewDatabaseDefinition, options *ServersClientBeginImportDatabaseOptions) (*http.Response, error) { var err error req, err := client.importDatabaseCreateRequest(ctx, resourceGroupName, serverName, parameters, options) @@ -366,7 +366,7 @@ func (client *ServersClient) importDatabaseCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -377,7 +377,7 @@ func (client *ServersClient) importDatabaseCreateRequest(ctx context.Context, re // NewListPager - Gets a list of all servers in the subscription. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - options - ServersClientListOptions contains the optional parameters for the ServersClient.NewListPager method. func (client *ServersClient) NewListPager(options *ServersClientListOptions) *runtime.Pager[ServersClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ServersClientListResponse]{ @@ -422,7 +422,7 @@ func (client *ServersClient) listCreateRequest(ctx context.Context, options *Ser if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -439,7 +439,7 @@ func (client *ServersClient) listHandleResponse(resp *http.Response) (ServersCli // NewListByResourceGroupPager - Gets a list of servers in a resource groups. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - options - ServersClientListByResourceGroupOptions contains the optional parameters for the ServersClient.NewListByResourceGroupPager @@ -491,7 +491,7 @@ func (client *ServersClient) listByResourceGroupCreateRequest(ctx context.Contex if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -509,7 +509,7 @@ func (client *ServersClient) listByResourceGroupHandleResponse(resp *http.Respon // BeginRefreshStatus - Refresh external governance enablement status. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -533,7 +533,7 @@ func (client *ServersClient) BeginRefreshStatus(ctx context.Context, resourceGro // RefreshStatus - Refresh external governance enablement status. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview func (client *ServersClient) refreshStatus(ctx context.Context, resourceGroupName string, serverName string, options *ServersClientBeginRefreshStatusOptions) (*http.Response, error) { var err error req, err := client.refreshStatusCreateRequest(ctx, resourceGroupName, serverName, options) @@ -571,7 +571,7 @@ func (client *ServersClient) refreshStatusCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -580,7 +580,7 @@ func (client *ServersClient) refreshStatusCreateRequest(ctx context.Context, res // BeginUpdate - Updates a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -602,7 +602,7 @@ func (client *ServersClient) BeginUpdate(ctx context.Context, resourceGroupName // Update - Updates a server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview func (client *ServersClient) update(ctx context.Context, resourceGroupName string, serverName string, parameters ServerUpdate, options *ServersClientBeginUpdateOptions) (*http.Response, error) { var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, serverName, parameters, options) @@ -640,7 +640,7 @@ func (client *ServersClient) updateCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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/sql/armsql/servers_client_example_test.go b/sdk/resourcemanager/sql/armsql/servers_client_example_test.go deleted file mode 100644 index 285fc78b694b..000000000000 --- a/sdk/resourcemanager/sql/armsql/servers_client_example_test.go +++ /dev/null @@ -1,912 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CheckNameAvailabilityServerAlreadyExists.json -func ExampleServersClient_CheckNameAvailability_checkForAServerNameThatAlreadyExists() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServersClient().CheckNameAvailability(ctx, armsql.CheckNameAvailabilityRequest{ - Name: to.Ptr("server1"), - Type: to.Ptr("Microsoft.Sql/servers"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CheckNameAvailabilityResponse = armsql.CheckNameAvailabilityResponse{ - // Name: to.Ptr("server1"), - // Available: to.Ptr(false), - // Message: to.Ptr("Specified server name is already used"), - // Reason: to.Ptr(armsql.CheckNameAvailabilityReasonAlreadyExists), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CheckNameAvailabilityServerAvailable.json -func ExampleServersClient_CheckNameAvailability_checkForAServerNameThatIsAvailable() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServersClient().CheckNameAvailability(ctx, armsql.CheckNameAvailabilityRequest{ - Name: to.Ptr("server1"), - Type: to.Ptr("Microsoft.Sql/servers"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CheckNameAvailabilityResponse = armsql.CheckNameAvailabilityResponse{ - // Name: to.Ptr("server1"), - // Available: to.Ptr(true), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CheckNameAvailabilityServerInvalid.json -func ExampleServersClient_CheckNameAvailability_checkForAServerNameThatIsInvalid() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServersClient().CheckNameAvailability(ctx, armsql.CheckNameAvailabilityRequest{ - Name: to.Ptr("SERVER1"), - Type: to.Ptr("Microsoft.Sql/servers"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CheckNameAvailabilityResponse = armsql.CheckNameAvailabilityResponse{ - // Name: to.Ptr("SERVER1"), - // Available: to.Ptr(false), - // Message: to.Ptr("Specified server name contains unsupported characters or is too long. Server name must be no longer than 63 characters long, contain only lower-case characters or digits, cannot contain '.' or '_' characters and can't start or end with '-' character."), - // Reason: to.Ptr(armsql.CheckNameAvailabilityReasonInvalid), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ServerList.json -func ExampleServersClient_NewListPager_listServers() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServersClient().NewListPager(&armsql.ServersClientListOptions{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.ServerListResult = armsql.ServerListResult{ - // Value: []*armsql.Server{ - // { - // Name: to.Ptr("sqlcrudtest-4645"), - // Type: to.Ptr("Microsoft.Sql/servers"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645"), - // Location: to.Ptr("japaneast"), - // Kind: to.Ptr("v12.0"), - // Properties: &armsql.ServerProperties{ - // AdministratorLogin: to.Ptr("dummylogin"), - // ExternalGovernanceStatus: to.Ptr(armsql.ExternalGovernanceStatusEnabled), - // FullyQualifiedDomainName: to.Ptr("sqlcrudtest-4645.database.windows.net"), - // PrivateEndpointConnections: []*armsql.ServerPrivateEndpointConnection{ - // { - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645/privateEndpointConnections/private-endpoint-name-00000000-1111-2222-3333-444444444444"), - // Properties: &armsql.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armsql.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armsql.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr(armsql.PrivateLinkServiceConnectionStateActionsRequireNone), - // Status: to.Ptr(armsql.PrivateLinkServiceConnectionStateStatusApproved), - // }, - // ProvisioningState: to.Ptr(armsql.PrivateEndpointProvisioningState("Succeeded")), - // }, - // }}, - // PublicNetworkAccess: to.Ptr(armsql.ServerPublicNetworkAccessFlagEnabled), - // RestrictOutboundNetworkAccess: to.Ptr(armsql.ServerNetworkAccessFlagEnabled), - // State: to.Ptr("Ready"), - // Version: to.Ptr("12.0"), - // WorkspaceFeature: to.Ptr(armsql.ServerWorkspaceFeatureConnected), - // }, - // }, - // { - // Name: to.Ptr("sqlcrudtest-6661"), - // Type: to.Ptr("Microsoft.Sql/servers"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-6661"), - // Location: to.Ptr("japaneast"), - // Kind: to.Ptr("v12.0"), - // Properties: &armsql.ServerProperties{ - // AdministratorLogin: to.Ptr("dummylogin"), - // ExternalGovernanceStatus: to.Ptr(armsql.ExternalGovernanceStatusEnabled), - // FullyQualifiedDomainName: to.Ptr("sqlcrudtest-6661.database.windows.net"), - // PrivateEndpointConnections: []*armsql.ServerPrivateEndpointConnection{ - // { - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645/privateEndpointConnections/private-endpoint-name-00000000-1111-2222-3333-444444444444"), - // Properties: &armsql.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armsql.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armsql.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr(armsql.PrivateLinkServiceConnectionStateActionsRequireNone), - // Status: to.Ptr(armsql.PrivateLinkServiceConnectionStateStatusApproved), - // }, - // ProvisioningState: to.Ptr(armsql.PrivateEndpointProvisioningState("Succeeded")), - // }, - // }}, - // PublicNetworkAccess: to.Ptr(armsql.ServerPublicNetworkAccessFlagEnabled), - // RestrictOutboundNetworkAccess: to.Ptr(armsql.ServerNetworkAccessFlagEnabled), - // State: to.Ptr("Ready"), - // Version: to.Ptr("12.0"), - // WorkspaceFeature: to.Ptr(armsql.ServerWorkspaceFeatureConnected), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ServerListWithExpandEqualsAdministrators.json -func ExampleServersClient_NewListPager_listServersWithExpandAdministratorsActivedirectory() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServersClient().NewListPager(&armsql.ServersClientListOptions{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.ServerListResult = armsql.ServerListResult{ - // Value: []*armsql.Server{ - // { - // Name: to.Ptr("sqlcrudtest-4645"), - // Type: to.Ptr("Microsoft.Sql/servers"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645"), - // Location: to.Ptr("japaneast"), - // Kind: to.Ptr("v12.0"), - // Properties: &armsql.ServerProperties{ - // AdministratorLogin: to.Ptr("dummylogin"), - // Administrators: &armsql.ServerExternalAdministrator{ - // AzureADOnlyAuthentication: to.Ptr(true), - // Login: to.Ptr("bob@contoso.com"), - // PrincipalType: to.Ptr(armsql.PrincipalTypeUser), - // Sid: to.Ptr("00000011-1111-2222-2222-123456789111"), - // TenantID: to.Ptr("00000011-1111-2222-2222-123456789111"), - // }, - // ExternalGovernanceStatus: to.Ptr(armsql.ExternalGovernanceStatusEnabled), - // FullyQualifiedDomainName: to.Ptr("sqlcrudtest-4645.database.windows.net"), - // PrivateEndpointConnections: []*armsql.ServerPrivateEndpointConnection{ - // { - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645/privateEndpointConnections/private-endpoint-name-00000000-1111-2222-3333-444444444444"), - // Properties: &armsql.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armsql.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armsql.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr(armsql.PrivateLinkServiceConnectionStateActionsRequireNone), - // Status: to.Ptr(armsql.PrivateLinkServiceConnectionStateStatusApproved), - // }, - // ProvisioningState: to.Ptr(armsql.PrivateEndpointProvisioningState("Succeeded")), - // }, - // }}, - // PublicNetworkAccess: to.Ptr(armsql.ServerPublicNetworkAccessFlagEnabled), - // RestrictOutboundNetworkAccess: to.Ptr(armsql.ServerNetworkAccessFlagEnabled), - // State: to.Ptr("Ready"), - // Version: to.Ptr("12.0"), - // WorkspaceFeature: to.Ptr(armsql.ServerWorkspaceFeatureConnected), - // }, - // }, - // { - // Name: to.Ptr("sqlcrudtest-6661"), - // Type: to.Ptr("Microsoft.Sql/servers"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-6661"), - // Location: to.Ptr("japaneast"), - // Kind: to.Ptr("v12.0"), - // Properties: &armsql.ServerProperties{ - // AdministratorLogin: to.Ptr("dummylogin"), - // Administrators: &armsql.ServerExternalAdministrator{ - // AzureADOnlyAuthentication: to.Ptr(true), - // Login: to.Ptr("bob@contoso.com"), - // PrincipalType: to.Ptr(armsql.PrincipalTypeUser), - // Sid: to.Ptr("00000011-1111-2222-2222-123456789111"), - // TenantID: to.Ptr("00000011-1111-2222-2222-123456789111"), - // }, - // ExternalGovernanceStatus: to.Ptr(armsql.ExternalGovernanceStatusEnabled), - // FullyQualifiedDomainName: to.Ptr("sqlcrudtest-6661.database.windows.net"), - // PrivateEndpointConnections: []*armsql.ServerPrivateEndpointConnection{ - // { - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645/privateEndpointConnections/private-endpoint-name-00000000-1111-2222-3333-444444444444"), - // Properties: &armsql.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armsql.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armsql.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr(armsql.PrivateLinkServiceConnectionStateActionsRequireNone), - // Status: to.Ptr(armsql.PrivateLinkServiceConnectionStateStatusApproved), - // }, - // ProvisioningState: to.Ptr(armsql.PrivateEndpointProvisioningState("Succeeded")), - // }, - // }}, - // PublicNetworkAccess: to.Ptr(armsql.ServerPublicNetworkAccessFlagEnabled), - // RestrictOutboundNetworkAccess: to.Ptr(armsql.ServerNetworkAccessFlagEnabled), - // State: to.Ptr("Ready"), - // Version: to.Ptr("12.0"), - // WorkspaceFeature: to.Ptr(armsql.ServerWorkspaceFeatureConnected), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ServerListByResourceGroup.json -func ExampleServersClient_NewListByResourceGroupPager_listServersByResourceGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServersClient().NewListByResourceGroupPager("sqlcrudtest-7398", &armsql.ServersClientListByResourceGroupOptions{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.ServerListResult = armsql.ServerListResult{ - // Value: []*armsql.Server{ - // { - // Name: to.Ptr("sqlcrudtest-4645"), - // Type: to.Ptr("Microsoft.Sql/servers"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645"), - // Location: to.Ptr("japaneast"), - // Kind: to.Ptr("v12.0"), - // Properties: &armsql.ServerProperties{ - // AdministratorLogin: to.Ptr("dummylogin"), - // ExternalGovernanceStatus: to.Ptr(armsql.ExternalGovernanceStatusEnabled), - // FullyQualifiedDomainName: to.Ptr("sqlcrudtest-4645.database.windows.net"), - // PrivateEndpointConnections: []*armsql.ServerPrivateEndpointConnection{ - // { - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645/privateEndpointConnections/private-endpoint-name-00000000-1111-2222-3333-444444444444"), - // Properties: &armsql.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armsql.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armsql.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr(armsql.PrivateLinkServiceConnectionStateActionsRequireNone), - // Status: to.Ptr(armsql.PrivateLinkServiceConnectionStateStatusApproved), - // }, - // ProvisioningState: to.Ptr(armsql.PrivateEndpointProvisioningState("Succeeded")), - // }, - // }}, - // PublicNetworkAccess: to.Ptr(armsql.ServerPublicNetworkAccessFlagEnabled), - // RestrictOutboundNetworkAccess: to.Ptr(armsql.ServerNetworkAccessFlagEnabled), - // State: to.Ptr("Ready"), - // Version: to.Ptr("12.0"), - // WorkspaceFeature: to.Ptr(armsql.ServerWorkspaceFeatureConnected), - // }, - // }, - // { - // Name: to.Ptr("sqlcrudtest-6661"), - // Type: to.Ptr("Microsoft.Sql/servers"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-6661"), - // Location: to.Ptr("japaneast"), - // Kind: to.Ptr("v12.0"), - // Properties: &armsql.ServerProperties{ - // AdministratorLogin: to.Ptr("dummylogin"), - // ExternalGovernanceStatus: to.Ptr(armsql.ExternalGovernanceStatusEnabled), - // FullyQualifiedDomainName: to.Ptr("sqlcrudtest-6661.database.windows.net"), - // PrivateEndpointConnections: []*armsql.ServerPrivateEndpointConnection{ - // { - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645/privateEndpointConnections/private-endpoint-name-00000000-1111-2222-3333-444444444444"), - // Properties: &armsql.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armsql.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armsql.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr(armsql.PrivateLinkServiceConnectionStateActionsRequireNone), - // Status: to.Ptr(armsql.PrivateLinkServiceConnectionStateStatusApproved), - // }, - // ProvisioningState: to.Ptr(armsql.PrivateEndpointProvisioningState("Succeeded")), - // }, - // }}, - // PublicNetworkAccess: to.Ptr(armsql.ServerPublicNetworkAccessFlagEnabled), - // RestrictOutboundNetworkAccess: to.Ptr(armsql.ServerNetworkAccessFlagEnabled), - // State: to.Ptr("Ready"), - // Version: to.Ptr("12.0"), - // WorkspaceFeature: to.Ptr(armsql.ServerWorkspaceFeatureConnected), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ServerListByResourceGroupWithExpandEqualsAdministrators.json -func ExampleServersClient_NewListByResourceGroupPager_listServersByResourceGroupWithExpandAdministratorsActivedirectory() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServersClient().NewListByResourceGroupPager("sqlcrudtest-7398", &armsql.ServersClientListByResourceGroupOptions{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.ServerListResult = armsql.ServerListResult{ - // Value: []*armsql.Server{ - // { - // Name: to.Ptr("sqlcrudtest-4645"), - // Type: to.Ptr("Microsoft.Sql/servers"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645"), - // Location: to.Ptr("japaneast"), - // Kind: to.Ptr("v12.0"), - // Properties: &armsql.ServerProperties{ - // AdministratorLogin: to.Ptr("dummylogin"), - // Administrators: &armsql.ServerExternalAdministrator{ - // AzureADOnlyAuthentication: to.Ptr(true), - // Login: to.Ptr("bob@contoso.com"), - // PrincipalType: to.Ptr(armsql.PrincipalTypeUser), - // Sid: to.Ptr("00000011-1111-2222-2222-123456789111"), - // TenantID: to.Ptr("00000011-1111-2222-2222-123456789111"), - // }, - // ExternalGovernanceStatus: to.Ptr(armsql.ExternalGovernanceStatusEnabled), - // FullyQualifiedDomainName: to.Ptr("sqlcrudtest-4645.database.windows.net"), - // PrivateEndpointConnections: []*armsql.ServerPrivateEndpointConnection{ - // { - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645/privateEndpointConnections/private-endpoint-name-00000000-1111-2222-3333-444444444444"), - // Properties: &armsql.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armsql.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armsql.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr(armsql.PrivateLinkServiceConnectionStateActionsRequireNone), - // Status: to.Ptr(armsql.PrivateLinkServiceConnectionStateStatusApproved), - // }, - // ProvisioningState: to.Ptr(armsql.PrivateEndpointProvisioningState("Succeeded")), - // }, - // }}, - // PublicNetworkAccess: to.Ptr(armsql.ServerPublicNetworkAccessFlagEnabled), - // RestrictOutboundNetworkAccess: to.Ptr(armsql.ServerNetworkAccessFlagEnabled), - // State: to.Ptr("Ready"), - // Version: to.Ptr("12.0"), - // WorkspaceFeature: to.Ptr(armsql.ServerWorkspaceFeatureConnected), - // }, - // }, - // { - // Name: to.Ptr("sqlcrudtest-6661"), - // Type: to.Ptr("Microsoft.Sql/servers"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-6661"), - // Location: to.Ptr("japaneast"), - // Kind: to.Ptr("v12.0"), - // Properties: &armsql.ServerProperties{ - // AdministratorLogin: to.Ptr("dummylogin"), - // Administrators: &armsql.ServerExternalAdministrator{ - // AzureADOnlyAuthentication: to.Ptr(true), - // Login: to.Ptr("bob@contoso.com"), - // PrincipalType: to.Ptr(armsql.PrincipalTypeUser), - // Sid: to.Ptr("00000011-1111-2222-2222-123456789111"), - // TenantID: to.Ptr("00000011-1111-2222-2222-123456789111"), - // }, - // ExternalGovernanceStatus: to.Ptr(armsql.ExternalGovernanceStatusEnabled), - // FullyQualifiedDomainName: to.Ptr("sqlcrudtest-6661.database.windows.net"), - // PrivateEndpointConnections: []*armsql.ServerPrivateEndpointConnection{ - // { - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645/privateEndpointConnections/private-endpoint-name-00000000-1111-2222-3333-444444444444"), - // Properties: &armsql.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armsql.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armsql.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr(armsql.PrivateLinkServiceConnectionStateActionsRequireNone), - // Status: to.Ptr(armsql.PrivateLinkServiceConnectionStateStatusApproved), - // }, - // ProvisioningState: to.Ptr(armsql.PrivateEndpointProvisioningState("Succeeded")), - // }, - // }}, - // PublicNetworkAccess: to.Ptr(armsql.ServerPublicNetworkAccessFlagEnabled), - // RestrictOutboundNetworkAccess: to.Ptr(armsql.ServerNetworkAccessFlagEnabled), - // State: to.Ptr("Ready"), - // Version: to.Ptr("12.0"), - // WorkspaceFeature: to.Ptr(armsql.ServerWorkspaceFeatureConnected), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ServerGet.json -func ExampleServersClient_Get_getServer() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServersClient().Get(ctx, "sqlcrudtest-7398", "sqlcrudtest-4645", &armsql.ServersClientGetOptions{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.Server = armsql.Server{ - // Name: to.Ptr("sqlcrudtest-4645"), - // Type: to.Ptr("Microsoft.Sql/servers"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645"), - // Location: to.Ptr("japaneast"), - // Tags: map[string]*string{ - // "tagKey1": to.Ptr("TagValue1"), - // }, - // Kind: to.Ptr("v12.0"), - // Properties: &armsql.ServerProperties{ - // AdministratorLogin: to.Ptr("dummylogin"), - // ExternalGovernanceStatus: to.Ptr(armsql.ExternalGovernanceStatusEnabled), - // FullyQualifiedDomainName: to.Ptr("sqlcrudtest-4645.database.windows.net"), - // PrivateEndpointConnections: []*armsql.ServerPrivateEndpointConnection{ - // { - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645/privateEndpointConnections/private-endpoint-name-00000000-1111-2222-3333-444444444444"), - // Properties: &armsql.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armsql.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armsql.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr(armsql.PrivateLinkServiceConnectionStateActionsRequireNone), - // Status: to.Ptr(armsql.PrivateLinkServiceConnectionStateStatusApproved), - // }, - // ProvisioningState: to.Ptr(armsql.PrivateEndpointProvisioningState("Succeeded")), - // }, - // }}, - // PublicNetworkAccess: to.Ptr(armsql.ServerPublicNetworkAccessFlagEnabled), - // RestrictOutboundNetworkAccess: to.Ptr(armsql.ServerNetworkAccessFlagEnabled), - // State: to.Ptr("Ready"), - // Version: to.Ptr("12.0"), - // WorkspaceFeature: to.Ptr(armsql.ServerWorkspaceFeatureConnected), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ServerGetWithExpandEqualsAdministrators.json -func ExampleServersClient_Get_getServerWithExpandAdministratorsActivedirectory() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServersClient().Get(ctx, "sqlcrudtest-7398", "sqlcrudtest-4645", &armsql.ServersClientGetOptions{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.Server = armsql.Server{ - // Name: to.Ptr("sqlcrudtest-4645"), - // Type: to.Ptr("Microsoft.Sql/servers"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645"), - // Location: to.Ptr("japaneast"), - // Tags: map[string]*string{ - // "tagKey1": to.Ptr("TagValue1"), - // }, - // Kind: to.Ptr("v12.0"), - // Properties: &armsql.ServerProperties{ - // AdministratorLogin: to.Ptr("dummylogin"), - // Administrators: &armsql.ServerExternalAdministrator{ - // AzureADOnlyAuthentication: to.Ptr(true), - // Login: to.Ptr("bob@contoso.com"), - // PrincipalType: to.Ptr(armsql.PrincipalTypeUser), - // Sid: to.Ptr("00000011-1111-2222-2222-123456789111"), - // TenantID: to.Ptr("00000011-1111-2222-2222-123456789111"), - // }, - // ExternalGovernanceStatus: to.Ptr(armsql.ExternalGovernanceStatusEnabled), - // FullyQualifiedDomainName: to.Ptr("sqlcrudtest-4645.database.windows.net"), - // PrivateEndpointConnections: []*armsql.ServerPrivateEndpointConnection{ - // { - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645/privateEndpointConnections/private-endpoint-name-00000000-1111-2222-3333-444444444444"), - // Properties: &armsql.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armsql.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armsql.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr(armsql.PrivateLinkServiceConnectionStateActionsRequireNone), - // Status: to.Ptr(armsql.PrivateLinkServiceConnectionStateStatusApproved), - // }, - // ProvisioningState: to.Ptr(armsql.PrivateEndpointProvisioningState("Succeeded")), - // }, - // }}, - // PublicNetworkAccess: to.Ptr(armsql.ServerPublicNetworkAccessFlagEnabled), - // RestrictOutboundNetworkAccess: to.Ptr(armsql.ServerNetworkAccessFlagEnabled), - // State: to.Ptr("Ready"), - // Version: to.Ptr("12.0"), - // WorkspaceFeature: to.Ptr(armsql.ServerWorkspaceFeatureConnected), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ServerCreate.json -func ExampleServersClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginCreateOrUpdate(ctx, "sqlcrudtest-7398", "sqlcrudtest-4645", armsql.Server{ - Location: to.Ptr("Japan East"), - Properties: &armsql.ServerProperties{ - AdministratorLogin: to.Ptr("dummylogin"), - AdministratorLoginPassword: to.Ptr("PLACEHOLDER"), - Administrators: &armsql.ServerExternalAdministrator{ - AzureADOnlyAuthentication: to.Ptr(true), - Login: to.Ptr("bob@contoso.com"), - PrincipalType: to.Ptr(armsql.PrincipalTypeUser), - Sid: to.Ptr("00000011-1111-2222-2222-123456789111"), - TenantID: to.Ptr("00000011-1111-2222-2222-123456789111"), - }, - PublicNetworkAccess: to.Ptr(armsql.ServerPublicNetworkAccessFlagEnabled), - RestrictOutboundNetworkAccess: to.Ptr(armsql.ServerNetworkAccessFlagEnabled), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Server = armsql.Server{ - // Name: to.Ptr("sqlcrudtest-4645"), - // Type: to.Ptr("Microsoft.Sql/servers"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645"), - // Location: to.Ptr("japaneast"), - // Kind: to.Ptr("v12.0"), - // Properties: &armsql.ServerProperties{ - // AdministratorLogin: to.Ptr("dummylogin"), - // Administrators: &armsql.ServerExternalAdministrator{ - // AzureADOnlyAuthentication: to.Ptr(true), - // Login: to.Ptr("bob@contoso.com"), - // PrincipalType: to.Ptr(armsql.PrincipalTypeUser), - // Sid: to.Ptr("00000011-1111-2222-2222-123456789111"), - // TenantID: to.Ptr("00000011-1111-2222-2222-123456789111"), - // }, - // FullyQualifiedDomainName: to.Ptr("sqlcrudtest-4645.database.windows.net"), - // PrivateEndpointConnections: []*armsql.ServerPrivateEndpointConnection{ - // { - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645/privateEndpointConnections/private-endpoint-name-00000000-1111-2222-3333-444444444444"), - // Properties: &armsql.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armsql.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armsql.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr(armsql.PrivateLinkServiceConnectionStateActionsRequireNone), - // Status: to.Ptr(armsql.PrivateLinkServiceConnectionStateStatusApproved), - // }, - // ProvisioningState: to.Ptr(armsql.PrivateEndpointProvisioningState("Succeeded")), - // }, - // }}, - // PublicNetworkAccess: to.Ptr(armsql.ServerPublicNetworkAccessFlagEnabled), - // RestrictOutboundNetworkAccess: to.Ptr(armsql.ServerNetworkAccessFlagEnabled), - // State: to.Ptr("Ready"), - // Version: to.Ptr("12.0"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ServerDelete.json -func ExampleServersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginDelete(ctx, "sqlcrudtest-7398", "sqlcrudtest-6661", 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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ServerUpdate.json -func ExampleServersClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginUpdate(ctx, "sqlcrudtest-7398", "sqlcrudtest-4645", armsql.ServerUpdate{ - Properties: &armsql.ServerProperties{ - AdministratorLogin: to.Ptr("dummylogin"), - AdministratorLoginPassword: to.Ptr("placeholder"), - PublicNetworkAccess: to.Ptr(armsql.ServerPublicNetworkAccessFlagDisabled), - RestrictOutboundNetworkAccess: to.Ptr(armsql.ServerNetworkAccessFlagEnabled), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Server = armsql.Server{ - // Name: to.Ptr("sqlcrudtest-4645"), - // Type: to.Ptr("Microsoft.Sql/servers"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645"), - // Location: to.Ptr("japaneast"), - // Tags: map[string]*string{ - // "tagKey1": to.Ptr("TagValue1"), - // }, - // Kind: to.Ptr("v12.0"), - // Properties: &armsql.ServerProperties{ - // AdministratorLogin: to.Ptr("dummylogin"), - // FullyQualifiedDomainName: to.Ptr("sqlcrudtest-4645.database.windows.net"), - // PrivateEndpointConnections: []*armsql.ServerPrivateEndpointConnection{ - // { - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645/privateEndpointConnections/private-endpoint-name-00000000-1111-2222-3333-444444444444"), - // Properties: &armsql.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armsql.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armsql.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr(armsql.PrivateLinkServiceConnectionStateActionsRequireNone), - // Status: to.Ptr(armsql.PrivateLinkServiceConnectionStateStatusApproved), - // }, - // ProvisioningState: to.Ptr(armsql.PrivateEndpointProvisioningState("Succeeded")), - // }, - // }}, - // PublicNetworkAccess: to.Ptr(armsql.ServerPublicNetworkAccessFlagDisabled), - // RestrictOutboundNetworkAccess: to.Ptr(armsql.ServerNetworkAccessFlagEnabled), - // State: to.Ptr("Ready"), - // Version: to.Ptr("12.0"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ImportNewDatabaseWithNetworkIsolation.json -func ExampleServersClient_BeginImportDatabase_importsToANewDatabaseUsingPrivateLinkForTheSqlServerAndStorageAccount() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginImportDatabase(ctx, "Default-SQL-SouthEastAsia", "testsvr", armsql.ImportNewDatabaseDefinition{ - AdministratorLogin: to.Ptr("login"), - AdministratorLoginPassword: to.Ptr("password"), - AuthenticationType: to.Ptr("Sql"), - DatabaseName: to.Ptr("testdb"), - NetworkIsolation: &armsql.NetworkIsolationSettings{ - SQLServerResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr"), - StorageAccountResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Storage/storageAccounts/test-privatelink"), - }, - StorageKey: to.Ptr("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=="), - StorageKeyType: to.Ptr(armsql.StorageKeyTypeStorageAccessKey), - StorageURI: to.Ptr("https://test.blob.core.windows.net/test.bacpac"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ImportExportOperationResult = armsql.ImportExportOperationResult{ - // Name: to.Ptr("9d9a794a-5cec-4f23-af70-d29511b522a4"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/importExportOperationResults"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb/importExportOperationResults/9d9a794a-5cec-4f23-af70-d29511b522a4"), - // Properties: &armsql.ImportExportOperationResultProperties{ - // BlobURI: to.Ptr("https://test.blob.core.windows.net/test.bacpac"), - // DatabaseName: to.Ptr("testdb"), - // LastModifiedTime: to.Ptr("2/2/2020 8:34:47 PM"), - // QueuedTime: to.Ptr("2/2/2020 8:33:27 PM"), - // RequestID: to.Ptr("9d9a794a-5cec-4f23-af70-d29511b522a4"), - // RequestType: to.Ptr("Import"), - // ServerName: to.Ptr("testsvr.database.windows.net"), - // Status: to.Ptr("Completed"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ImportNewDatabase.json -func ExampleServersClient_BeginImportDatabase_importsToANewDatabase() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginImportDatabase(ctx, "Default-SQL-SouthEastAsia", "testsvr", armsql.ImportNewDatabaseDefinition{ - AdministratorLogin: to.Ptr("login"), - AdministratorLoginPassword: to.Ptr("password"), - AuthenticationType: to.Ptr("Sql"), - DatabaseName: to.Ptr("testdb"), - StorageKey: to.Ptr("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=="), - StorageKeyType: to.Ptr(armsql.StorageKeyTypeStorageAccessKey), - StorageURI: to.Ptr("https://test.blob.core.windows.net/test.bacpac"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ImportExportOperationResult = armsql.ImportExportOperationResult{ - // Name: to.Ptr("9d9a794a-5cec-4f23-af70-d29511b522a4"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/importExportOperationResults"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb/importExportOperationResults/9d9a794a-5cec-4f23-af70-d29511b522a4"), - // Properties: &armsql.ImportExportOperationResultProperties{ - // BlobURI: to.Ptr("https://test.blob.core.windows.net/test.bacpac"), - // DatabaseName: to.Ptr("testdb"), - // LastModifiedTime: to.Ptr("2/2/2020 8:34:47 PM"), - // QueuedTime: to.Ptr("2/2/2020 8:33:27 PM"), - // RequestID: to.Ptr("9d9a794a-5cec-4f23-af70-d29511b522a4"), - // RequestType: to.Ptr("Import"), - // ServerName: to.Ptr("testsvr.database.windows.net"), - // Status: to.Ptr("Completed"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/RefreshExternalGovernanceStatus.json -func ExampleServersClient_BeginRefreshStatus() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServersClient().BeginRefreshStatus(ctx, "sqlcrudtest-7398", "sqlcrudtest-4645", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RefreshExternalGovernanceStatusOperationResult = armsql.RefreshExternalGovernanceStatusOperationResult{ - // Name: to.Ptr("9d9a794a-5cec-4f23-af70-d29511b522a4"), - // Type: to.Ptr("Microsoft.Sql/locations/refreshExternalGovernanceStatusOperationResults"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroup/providers/Microsoft.Sql/locations/japaneast/refreshExternalGovernanceStatusOperationResults/9d9a794a-5cec-4f23-af70-d29511b522a4"), - // Properties: &armsql.RefreshExternalGovernanceStatusOperationResultProperties{ - // QueuedTime: to.Ptr("2/12/2022 8:33:27 PM"), - // RequestID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // RequestType: to.Ptr("UpdatePurviewMetadata"), - // ServerName: to.Ptr("testsvr.database.windows.net"), - // Status: to.Ptr("Completed"), - // }, - // } -} diff --git a/sdk/resourcemanager/sql/armsql/serversecurityalertpolicies_client.go b/sdk/resourcemanager/sql/armsql/serversecurityalertpolicies_client.go index 0ad8fc7ec5dd..f1a97e82bc2d 100644 --- a/sdk/resourcemanager/sql/armsql/serversecurityalertpolicies_client.go +++ b/sdk/resourcemanager/sql/armsql/serversecurityalertpolicies_client.go @@ -46,7 +46,7 @@ func NewServerSecurityAlertPoliciesClient(subscriptionID string, credential azco // BeginCreateOrUpdate - Creates or updates a threat detection policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -54,7 +54,7 @@ func NewServerSecurityAlertPoliciesClient(subscriptionID string, credential azco // - parameters - The server security alert policy. // - options - ServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerSecurityAlertPoliciesClient.BeginCreateOrUpdate // method. -func (client *ServerSecurityAlertPoliciesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, securityAlertPolicyName SecurityAlertPolicyName, parameters ServerSecurityAlertPolicy, options *ServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions) (*runtime.Poller[ServerSecurityAlertPoliciesClientCreateOrUpdateResponse], error) { +func (client *ServerSecurityAlertPoliciesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, securityAlertPolicyName SecurityAlertPolicyNameAutoGenerated, parameters ServerSecurityAlertPolicy, options *ServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions) (*runtime.Poller[ServerSecurityAlertPoliciesClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, serverName, securityAlertPolicyName, parameters, options) if err != nil { @@ -70,8 +70,8 @@ func (client *ServerSecurityAlertPoliciesClient) BeginCreateOrUpdate(ctx context // CreateOrUpdate - Creates or updates a threat detection policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview -func (client *ServerSecurityAlertPoliciesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, securityAlertPolicyName SecurityAlertPolicyName, parameters ServerSecurityAlertPolicy, options *ServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions) (*http.Response, error) { +// Generated from API version 2023-05-01-preview +func (client *ServerSecurityAlertPoliciesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, securityAlertPolicyName SecurityAlertPolicyNameAutoGenerated, parameters ServerSecurityAlertPolicy, options *ServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, securityAlertPolicyName, parameters, options) if err != nil { @@ -89,7 +89,7 @@ func (client *ServerSecurityAlertPoliciesClient) createOrUpdate(ctx context.Cont } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ServerSecurityAlertPoliciesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, securityAlertPolicyName SecurityAlertPolicyName, parameters ServerSecurityAlertPolicy, options *ServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *ServerSecurityAlertPoliciesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, securityAlertPolicyName SecurityAlertPolicyNameAutoGenerated, parameters ServerSecurityAlertPolicy, options *ServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/securityAlertPolicies/{securityAlertPolicyName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -112,7 +112,7 @@ func (client *ServerSecurityAlertPoliciesClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -124,14 +124,14 @@ func (client *ServerSecurityAlertPoliciesClient) createOrUpdateCreateRequest(ctx // Get - Get a server's security alert policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. // - securityAlertPolicyName - The name of the security alert policy. // - options - ServerSecurityAlertPoliciesClientGetOptions contains the optional parameters for the ServerSecurityAlertPoliciesClient.Get // method. -func (client *ServerSecurityAlertPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string, securityAlertPolicyName SecurityAlertPolicyName, options *ServerSecurityAlertPoliciesClientGetOptions) (ServerSecurityAlertPoliciesClientGetResponse, error) { +func (client *ServerSecurityAlertPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string, securityAlertPolicyName SecurityAlertPolicyNameAutoGenerated, options *ServerSecurityAlertPoliciesClientGetOptions) (ServerSecurityAlertPoliciesClientGetResponse, error) { var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, securityAlertPolicyName, options) if err != nil { @@ -150,7 +150,7 @@ func (client *ServerSecurityAlertPoliciesClient) Get(ctx context.Context, resour } // getCreateRequest creates the Get request. -func (client *ServerSecurityAlertPoliciesClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, securityAlertPolicyName SecurityAlertPolicyName, options *ServerSecurityAlertPoliciesClientGetOptions) (*policy.Request, error) { +func (client *ServerSecurityAlertPoliciesClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, securityAlertPolicyName SecurityAlertPolicyNameAutoGenerated, options *ServerSecurityAlertPoliciesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/securityAlertPolicies/{securityAlertPolicyName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -173,7 +173,7 @@ func (client *ServerSecurityAlertPoliciesClient) getCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -190,7 +190,7 @@ func (client *ServerSecurityAlertPoliciesClient) getHandleResponse(resp *http.Re // NewListByServerPager - Get the server's threat detection policies. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -244,7 +244,7 @@ func (client *ServerSecurityAlertPoliciesClient) listByServerCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/serversecurityalertpolicies_client_example_test.go b/sdk/resourcemanager/sql/armsql/serversecurityalertpolicies_client_example_test.go deleted file mode 100644 index 55bf33aeb351..000000000000 --- a/sdk/resourcemanager/sql/armsql/serversecurityalertpolicies_client_example_test.go +++ /dev/null @@ -1,231 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerSecurityAlertsGet.json -func ExampleServerSecurityAlertPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServerSecurityAlertPoliciesClient().Get(ctx, "securityalert-4799", "securityalert-6440", armsql.SecurityAlertPolicyNameDefault, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServerSecurityAlertPolicy = armsql.ServerSecurityAlertPolicy{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.Sql/servers/securityAlertPolicies"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/securityalert-4799/providers/Microsoft.Sql/servers/securityalert-6440/securityAlertPolicies/default"), - // Properties: &armsql.SecurityAlertsPolicyProperties{ - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-03T04:41:33.937Z"); return t}()), - // DisabledAlerts: []*string{ - // to.Ptr("Access_Anomaly")}, - // EmailAccountAdmins: to.Ptr(true), - // EmailAddresses: []*string{ - // to.Ptr("test@consoto.com;user@consoto.com")}, - // RetentionDays: to.Ptr[int32](0), - // State: to.Ptr(armsql.SecurityAlertsPolicyStateEnabled), - // StorageAccountAccessKey: to.Ptr(""), - // StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - // }, - // SystemData: &armsql.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-03T04:41:33.937Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsql.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-03T04:41:33.937Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsql.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerSecurityAlertsCreateMax.json -func ExampleServerSecurityAlertPoliciesClient_BeginCreateOrUpdate_updateAServersThreatDetectionPolicyWithAllParameters() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServerSecurityAlertPoliciesClient().BeginCreateOrUpdate(ctx, "securityalert-4799", "securityalert-6440", armsql.SecurityAlertPolicyNameDefault, armsql.ServerSecurityAlertPolicy{ - Properties: &armsql.SecurityAlertsPolicyProperties{ - DisabledAlerts: []*string{ - to.Ptr("Access_Anomaly"), - to.Ptr("Usage_Anomaly")}, - EmailAccountAdmins: to.Ptr(true), - EmailAddresses: []*string{ - to.Ptr("testSecurityAlert@microsoft.com")}, - RetentionDays: to.Ptr[int32](5), - State: to.Ptr(armsql.SecurityAlertsPolicyStateEnabled), - StorageAccountAccessKey: to.Ptr("sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD=="), - StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServerSecurityAlertPolicy = armsql.ServerSecurityAlertPolicy{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.Sql/servers/securityAlertPolicies"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/securityalert-4799/providers/Microsoft.Sql/servers/securityalert-6440/securityAlertPolicies/default"), - // Properties: &armsql.SecurityAlertsPolicyProperties{ - // DisabledAlerts: []*string{ - // to.Ptr("Access_Anomaly"), - // to.Ptr("Usage_Anomaly")}, - // EmailAccountAdmins: to.Ptr(true), - // EmailAddresses: []*string{ - // to.Ptr("testSecurityAlert@microsoft.com")}, - // RetentionDays: to.Ptr[int32](5), - // State: to.Ptr(armsql.SecurityAlertsPolicyStateEnabled), - // StorageAccountAccessKey: to.Ptr(""), - // StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - // }, - // SystemData: &armsql.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-03T04:41:33.937Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsql.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-03T04:41:33.937Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsql.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerSecurityAlertsCreateMin.json -func ExampleServerSecurityAlertPoliciesClient_BeginCreateOrUpdate_updateAServersThreatDetectionPolicyWithMinimalParameters() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServerSecurityAlertPoliciesClient().BeginCreateOrUpdate(ctx, "securityalert-4799", "securityalert-6440", armsql.SecurityAlertPolicyNameDefault, armsql.ServerSecurityAlertPolicy{ - Properties: &armsql.SecurityAlertsPolicyProperties{ - State: to.Ptr(armsql.SecurityAlertsPolicyStateEnabled), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServerSecurityAlertPolicy = armsql.ServerSecurityAlertPolicy{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.Sql/servers/securityAlertPolicies"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/securityalert-4799/providers/Microsoft.Sql/servers/securityalert-6440/securityAlertPolicies/default"), - // Properties: &armsql.SecurityAlertsPolicyProperties{ - // DisabledAlerts: []*string{ - // to.Ptr("")}, - // EmailAccountAdmins: to.Ptr(false), - // EmailAddresses: []*string{ - // to.Ptr("")}, - // RetentionDays: to.Ptr[int32](0), - // State: to.Ptr(armsql.SecurityAlertsPolicyStateEnabled), - // StorageAccountAccessKey: to.Ptr(""), - // StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - // }, - // SystemData: &armsql.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-03T04:41:33.937Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsql.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-03T04:41:33.937Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsql.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerSecurityAlertsListByServer.json -func ExampleServerSecurityAlertPoliciesClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServerSecurityAlertPoliciesClient().NewListByServerPager("securityalert-4799", "securityalert-6440", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.LogicalServerSecurityAlertPolicyListResult = armsql.LogicalServerSecurityAlertPolicyListResult{ - // Value: []*armsql.ServerSecurityAlertPolicy{ - // { - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.Sql/servers/securityAlertPolicies"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/securityalert-4799/providers/Microsoft.Sql/servers/securityalert-6440/securityAlertPolicies"), - // Properties: &armsql.SecurityAlertsPolicyProperties{ - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-03T04:41:33.937Z"); return t}()), - // DisabledAlerts: []*string{ - // to.Ptr("Access_Anomaly")}, - // EmailAccountAdmins: to.Ptr(true), - // EmailAddresses: []*string{ - // to.Ptr("test@consoto.com;user@consoto.com")}, - // RetentionDays: to.Ptr[int32](0), - // State: to.Ptr(armsql.SecurityAlertsPolicyStateEnabled), - // StorageAccountAccessKey: to.Ptr(""), - // StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - // }, - // SystemData: &armsql.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-03T04:41:33.937Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsql.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-03T04:41:33.937Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsql.CreatedByTypeUser), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/sql/armsql/servertrustcertificates_client.go b/sdk/resourcemanager/sql/armsql/servertrustcertificates_client.go index 34ed1f51356c..e4ca5422671c 100644 --- a/sdk/resourcemanager/sql/armsql/servertrustcertificates_client.go +++ b/sdk/resourcemanager/sql/armsql/servertrustcertificates_client.go @@ -46,7 +46,7 @@ func NewServerTrustCertificatesClient(subscriptionID string, credential azcore.T // BeginCreateOrUpdate - Uploads a server trust certificate from box to Sql Managed Instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -70,7 +70,7 @@ func (client *ServerTrustCertificatesClient) BeginCreateOrUpdate(ctx context.Con // CreateOrUpdate - Uploads a server trust certificate from box to Sql Managed Instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01-preview +// Generated from API version 2023-05-01-preview func (client *ServerTrustCertificatesClient) createOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, certificateName string, parameters ServerTrustCertificate, options *ServerTrustCertificatesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, certificateName, parameters, options) @@ -112,7 +112,7 @@ func (client *ServerTrustCertificatesClient) createOrUpdateCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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 *ServerTrustCertificatesClient) createOrUpdateCreateRequest(ctx con // BeginDelete - Deletes a server trust certificate that was uploaded from box to Sql Managed Instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -147,7 +147,7 @@ func (client *ServerTrustCertificatesClient) BeginDelete(ctx context.Context, re // Delete - Deletes a server trust certificate that was uploaded from box to Sql Managed Instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01-preview +// Generated from API version 2023-05-01-preview func (client *ServerTrustCertificatesClient) deleteOperation(ctx context.Context, resourceGroupName string, managedInstanceName string, certificateName string, options *ServerTrustCertificatesClientBeginDeleteOptions) (*http.Response, error) { var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, managedInstanceName, certificateName, options) @@ -189,7 +189,7 @@ func (client *ServerTrustCertificatesClient) deleteCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -197,7 +197,7 @@ func (client *ServerTrustCertificatesClient) deleteCreateRequest(ctx context.Con // Get - Gets a server trust certificate that was uploaded from box to Sql Managed Instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -246,7 +246,7 @@ func (client *ServerTrustCertificatesClient) getCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -264,7 +264,7 @@ func (client *ServerTrustCertificatesClient) getHandleResponse(resp *http.Respon // NewListByInstancePager - Gets a list of server trust certificates that were uploaded from box to the given Sql Managed // Instance. // -// Generated from API version 2021-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -318,7 +318,7 @@ func (client *ServerTrustCertificatesClient) listByInstanceCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/servertrustcertificates_client_example_test.go b/sdk/resourcemanager/sql/armsql/servertrustcertificates_client_example_test.go deleted file mode 100644 index 672b4160a034..000000000000 --- a/sdk/resourcemanager/sql/armsql/servertrustcertificates_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 armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerTrustCertificatesListByInstance.json -func ExampleServerTrustCertificatesClient_NewListByInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServerTrustCertificatesClient().NewListByInstancePager("testrg", "testcl", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ServerTrustCertificatesListResult = armsql.ServerTrustCertificatesListResult{ - // Value: []*armsql.ServerTrustCertificate{ - // { - // Name: to.Ptr("customerCertificate1"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/serverTrustCertificates"), - // ID: to.Ptr("/subscriptions/38e0dc56-907f-45ba-a97c-74233baad471/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testcl/serverTrustCertificates/customerCertificate1"), - // Properties: &armsql.ServerTrustCertificateProperties{ - // CertificateName: to.Ptr("customerCertificate1"), - // Thumbprint: to.Ptr("33702D20EC861199852837AE6BD1A71544B681E2"), - // }, - // }, - // { - // Name: to.Ptr("customerCertificate2"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/serverTrustCertificates"), - // ID: to.Ptr("/subscriptions/38e0dc56-907f-45ba-a97c-74233baad471/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testcl/serverTrustCertificates/customerCertificate2"), - // Properties: &armsql.ServerTrustCertificateProperties{ - // CertificateName: to.Ptr("customerCertificate2"), - // Thumbprint: to.Ptr("57CFA9CF16F2FB2775AF059A95C6D5B897DA2C05"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerTrustCertificatesGet.json -func ExampleServerTrustCertificatesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServerTrustCertificatesClient().Get(ctx, "testrg", "testcl", "customerCertificateName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServerTrustCertificate = armsql.ServerTrustCertificate{ - // Name: to.Ptr("customerCertificateName"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/serverTrustCertificates"), - // ID: to.Ptr("/subscriptions/38e0dc56-907f-45ba-a97c-74233baad471/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testcl/serverTrustCertificates/customerCertificateName"), - // Properties: &armsql.ServerTrustCertificateProperties{ - // CertificateName: to.Ptr("customerCertificateName"), - // Thumbprint: to.Ptr("57CFA9CF16F2FB2775AF059A95C6D5B897DA2C05"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerTrustCertificatesCreate.json -func ExampleServerTrustCertificatesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServerTrustCertificatesClient().BeginCreateOrUpdate(ctx, "testrg", "testcl", "customerCertificateName", armsql.ServerTrustCertificate{ - Properties: &armsql.ServerTrustCertificateProperties{ - PublicBlob: to.Ptr("308203AE30820296A0030201020210"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServerTrustCertificate = armsql.ServerTrustCertificate{ - // Name: to.Ptr("customerCertificateName"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/serverTrustCertificates"), - // ID: to.Ptr("/subscriptions/0574222d-5c7f-489c-a172-b3013eafab53/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testcl/serverTrustCertificates/customerCertificateName"), - // Properties: &armsql.ServerTrustCertificateProperties{ - // CertificateName: to.Ptr("customerCertificateName"), - // Thumbprint: to.Ptr("33702D20EC86119985283"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerTrustCertificatesDelete.json -func ExampleServerTrustCertificatesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServerTrustCertificatesClient().BeginDelete(ctx, "testrg", "testcl", "customerCertificateName", 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/sql/armsql/servertrustgroups_client.go b/sdk/resourcemanager/sql/armsql/servertrustgroups_client.go index 5fde6499c92b..4a0a9ba5aecf 100644 --- a/sdk/resourcemanager/sql/armsql/servertrustgroups_client.go +++ b/sdk/resourcemanager/sql/armsql/servertrustgroups_client.go @@ -46,7 +46,7 @@ func NewServerTrustGroupsClient(subscriptionID string, credential azcore.TokenCr // BeginCreateOrUpdate - Creates or updates a server trust group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - locationName - The name of the region where the resource is located. @@ -70,7 +70,7 @@ func (client *ServerTrustGroupsClient) BeginCreateOrUpdate(ctx context.Context, // CreateOrUpdate - Creates or updates a server trust group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview func (client *ServerTrustGroupsClient) createOrUpdate(ctx context.Context, resourceGroupName string, locationName string, serverTrustGroupName string, parameters ServerTrustGroup, options *ServerTrustGroupsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, locationName, serverTrustGroupName, parameters, options) @@ -112,7 +112,7 @@ func (client *ServerTrustGroupsClient) createOrUpdateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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 *ServerTrustGroupsClient) createOrUpdateCreateRequest(ctx context.C // BeginDelete - Deletes a server trust group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - locationName - The name of the region where the resource is located. @@ -147,7 +147,7 @@ func (client *ServerTrustGroupsClient) BeginDelete(ctx context.Context, resource // Delete - Deletes a server trust group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview func (client *ServerTrustGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, locationName string, serverTrustGroupName string, options *ServerTrustGroupsClientBeginDeleteOptions) (*http.Response, error) { var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, locationName, serverTrustGroupName, options) @@ -189,7 +189,7 @@ func (client *ServerTrustGroupsClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -197,7 +197,7 @@ func (client *ServerTrustGroupsClient) deleteCreateRequest(ctx context.Context, // Get - Gets a server trust group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - locationName - The name of the region where the resource is located. @@ -245,7 +245,7 @@ func (client *ServerTrustGroupsClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -262,7 +262,7 @@ func (client *ServerTrustGroupsClient) getHandleResponse(resp *http.Response) (S // NewListByInstancePager - Gets a server trust groups by instance name. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -316,7 +316,7 @@ func (client *ServerTrustGroupsClient) listByInstanceCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -333,7 +333,7 @@ func (client *ServerTrustGroupsClient) listByInstanceHandleResponse(resp *http.R // NewListByLocationPager - Lists a server trust group. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - locationName - The name of the region where the resource is located. @@ -387,7 +387,7 @@ func (client *ServerTrustGroupsClient) listByLocationCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/servertrustgroups_client_example_test.go b/sdk/resourcemanager/sql/armsql/servertrustgroups_client_example_test.go deleted file mode 100644 index 8fe440bddd91..000000000000 --- a/sdk/resourcemanager/sql/armsql/servertrustgroups_client_example_test.go +++ /dev/null @@ -1,255 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerTrustGroupGet.json -func ExampleServerTrustGroupsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServerTrustGroupsClient().Get(ctx, "Default", "Japan East", "server-trust-group-test", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServerTrustGroup = armsql.ServerTrustGroup{ - // Name: to.Ptr("server-trust-group-test"), - // Type: to.Ptr("Microsoft.Sql/locations/serverTrustGroups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/locations/Japan East/serverTrustGroups/server-trust-group-test"), - // Properties: &armsql.ServerTrustGroupProperties{ - // GroupMembers: []*armsql.ServerInfo{ - // { - // ServerID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/managedInstance-1"), - // }, - // { - // ServerID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/managedInstance-2"), - // }}, - // TrustScopes: []*armsql.ServerTrustGroupPropertiesTrustScopesItem{ - // to.Ptr(armsql.ServerTrustGroupPropertiesTrustScopesItemGlobalTransactions), - // to.Ptr(armsql.ServerTrustGroupPropertiesTrustScopesItemServiceBroker)}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerTrustGroupCreate.json -func ExampleServerTrustGroupsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServerTrustGroupsClient().BeginCreateOrUpdate(ctx, "Default", "Japan East", "server-trust-group-test", armsql.ServerTrustGroup{ - Properties: &armsql.ServerTrustGroupProperties{ - GroupMembers: []*armsql.ServerInfo{ - { - ServerID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/managedInstance-1"), - }, - { - ServerID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/managedInstance-2"), - }}, - TrustScopes: []*armsql.ServerTrustGroupPropertiesTrustScopesItem{ - to.Ptr(armsql.ServerTrustGroupPropertiesTrustScopesItemGlobalTransactions), - to.Ptr(armsql.ServerTrustGroupPropertiesTrustScopesItemServiceBroker)}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServerTrustGroup = armsql.ServerTrustGroup{ - // Name: to.Ptr("server-trust-group-test"), - // Type: to.Ptr("Microsoft.Sql/locations/serverTrustGroups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/locations/Japan East/serverTrustGroups/server-trust-group-test"), - // Properties: &armsql.ServerTrustGroupProperties{ - // GroupMembers: []*armsql.ServerInfo{ - // { - // ServerID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/managedInstance-1"), - // }, - // { - // ServerID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/managedInstance-2"), - // }}, - // TrustScopes: []*armsql.ServerTrustGroupPropertiesTrustScopesItem{ - // to.Ptr(armsql.ServerTrustGroupPropertiesTrustScopesItemGlobalTransactions), - // to.Ptr(armsql.ServerTrustGroupPropertiesTrustScopesItemServiceBroker)}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerTrustGroupDelete.json -func ExampleServerTrustGroupsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServerTrustGroupsClient().BeginDelete(ctx, "Default", "Japan East", "server-trust-group-test", 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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerTrustGroupList.json -func ExampleServerTrustGroupsClient_NewListByLocationPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServerTrustGroupsClient().NewListByLocationPager("Default", "Japan East", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ServerTrustGroupListResult = armsql.ServerTrustGroupListResult{ - // Value: []*armsql.ServerTrustGroup{ - // { - // Name: to.Ptr("server-trust-group-test"), - // Type: to.Ptr("Microsoft.Sql/locations/serverTrustGroups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/locations/Japan East/serverTrustGroups/server-trust-group-test"), - // Properties: &armsql.ServerTrustGroupProperties{ - // GroupMembers: []*armsql.ServerInfo{ - // { - // ServerID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/managedInstance-1"), - // }, - // { - // ServerID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/managedInstance-2"), - // }}, - // TrustScopes: []*armsql.ServerTrustGroupPropertiesTrustScopesItem{ - // to.Ptr(armsql.ServerTrustGroupPropertiesTrustScopesItemGlobalTransactions), - // to.Ptr(armsql.ServerTrustGroupPropertiesTrustScopesItemServiceBroker)}, - // }, - // }, - // { - // Name: to.Ptr("server-trust-group-test-2"), - // Type: to.Ptr("Microsoft.Sql/locations/serverTrustGroups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/locations/Japan East/serverTrustGroups/server-trust-group-test-2"), - // Properties: &armsql.ServerTrustGroupProperties{ - // GroupMembers: []*armsql.ServerInfo{ - // { - // ServerID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/managedInstance-1"), - // }, - // { - // ServerID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/managedInstance-3"), - // }}, - // TrustScopes: []*armsql.ServerTrustGroupPropertiesTrustScopesItem{ - // to.Ptr(armsql.ServerTrustGroupPropertiesTrustScopesItemGlobalTransactions), - // to.Ptr(armsql.ServerTrustGroupPropertiesTrustScopesItemServiceBroker)}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerTrustGroupListByManagedInstance.json -func ExampleServerTrustGroupsClient_NewListByInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServerTrustGroupsClient().NewListByInstancePager("Default-SQL-SouthEastAsia", "managedInstance-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.ServerTrustGroupListResult = armsql.ServerTrustGroupListResult{ - // Value: []*armsql.ServerTrustGroup{ - // { - // Name: to.Ptr("server-trust-group-test"), - // Type: to.Ptr("Microsoft.Sql/locations/serverTrustGroups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/locations/Japan East/serverTrustGroups/server-trust-group-test"), - // Properties: &armsql.ServerTrustGroupProperties{ - // GroupMembers: []*armsql.ServerInfo{ - // { - // ServerID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/managedInstance-1"), - // }, - // { - // ServerID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/managedInstance-2"), - // }}, - // TrustScopes: []*armsql.ServerTrustGroupPropertiesTrustScopesItem{ - // to.Ptr(armsql.ServerTrustGroupPropertiesTrustScopesItemGlobalTransactions), - // to.Ptr(armsql.ServerTrustGroupPropertiesTrustScopesItemServiceBroker)}, - // }, - // }, - // { - // Name: to.Ptr("server-trust-group-test-2"), - // Type: to.Ptr("Microsoft.Sql/locations/serverTrustGroups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/locations/Japan East/serverTrustGroups/server-trust-group-test-2"), - // Properties: &armsql.ServerTrustGroupProperties{ - // GroupMembers: []*armsql.ServerInfo{ - // { - // ServerID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/managedInstance-1"), - // }, - // { - // ServerID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/managedInstance-3"), - // }}, - // TrustScopes: []*armsql.ServerTrustGroupPropertiesTrustScopesItem{ - // to.Ptr(armsql.ServerTrustGroupPropertiesTrustScopesItemGlobalTransactions), - // to.Ptr(armsql.ServerTrustGroupPropertiesTrustScopesItemServiceBroker)}, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/sql/armsql/serverusages_client.go b/sdk/resourcemanager/sql/armsql/serverusages_client.go index f158f2a99064..b3b48cb6da89 100644 --- a/sdk/resourcemanager/sql/armsql/serverusages_client.go +++ b/sdk/resourcemanager/sql/armsql/serverusages_client.go @@ -43,9 +43,9 @@ func NewServerUsagesClient(subscriptionID string, credential azcore.TokenCredent return client, nil } -// NewListByServerPager - Returns server usages. +// NewListByServerPager - Gets server usages. // -// Generated from API version 2014-04-01 +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -54,10 +54,16 @@ func NewServerUsagesClient(subscriptionID string, credential azcore.TokenCredent func (client *ServerUsagesClient) NewListByServerPager(resourceGroupName string, serverName string, options *ServerUsagesClientListByServerOptions) *runtime.Pager[ServerUsagesClientListByServerResponse] { return runtime.NewPager(runtime.PagingHandler[ServerUsagesClientListByServerResponse]{ More: func(page ServerUsagesClientListByServerResponse) bool { - return false + return page.NextLink != nil && len(*page.NextLink) > 0 }, Fetcher: func(ctx context.Context, page *ServerUsagesClientListByServerResponse) (ServerUsagesClientListByServerResponse, error) { - req, err := client.listByServerCreateRequest(ctx, resourceGroupName, serverName, options) + var req *policy.Request + var err error + if page == nil { + req, err = client.listByServerCreateRequest(ctx, resourceGroupName, serverName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } if err != nil { return ServerUsagesClientListByServerResponse{}, err } @@ -76,10 +82,6 @@ func (client *ServerUsagesClient) NewListByServerPager(resourceGroupName string, // listByServerCreateRequest creates the ListByServer request. func (client *ServerUsagesClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *ServerUsagesClientListByServerOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/usages" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -88,12 +90,16 @@ func (client *ServerUsagesClient) listByServerCreateRequest(ctx context.Context, return nil, errors.New("parameter serverName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + 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.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2014-04-01") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/serverusages_client_example_test.go b/sdk/resourcemanager/sql/armsql/serverusages_client_example_test.go deleted file mode 100644 index 02137262e63e..000000000000 --- a/sdk/resourcemanager/sql/armsql/serverusages_client_example_test.go +++ /dev/null @@ -1,62 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01-legacy/examples/ServerUsageMetricsList.json -func ExampleServerUsagesClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServerUsagesClient().NewListByServerPager("sqlcrudtest-6730", "sqlcrudtest-9007", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ServerUsageListResult = armsql.ServerUsageListResult{ - // Value: []*armsql.ServerUsage{ - // { - // Name: to.Ptr("server_dtu_quota"), - // CurrentValue: to.Ptr[float64](0), - // DisplayName: to.Ptr("Database Throughput Unit Quota"), - // Limit: to.Ptr[float64](45000), - // ResourceName: to.Ptr("sqlcrudtest-9007"), - // Unit: to.Ptr("DTUs"), - // }, - // { - // Name: to.Ptr("server_dtu_quota_current"), - // CurrentValue: to.Ptr[float64](0), - // DisplayName: to.Ptr("Database Throughput Unit Quota"), - // Limit: to.Ptr[float64](45000), - // ResourceName: to.Ptr("sqlcrudtest-9007"), - // Unit: to.Ptr("DTUs"), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/sql/armsql/servervulnerabilityassessments_client.go b/sdk/resourcemanager/sql/armsql/servervulnerabilityassessments_client.go index 98ed69b3256c..708842e23d5c 100644 --- a/sdk/resourcemanager/sql/armsql/servervulnerabilityassessments_client.go +++ b/sdk/resourcemanager/sql/armsql/servervulnerabilityassessments_client.go @@ -48,7 +48,7 @@ func NewServerVulnerabilityAssessmentsClient(subscriptionID string, credential a // https://docs.microsoft.com/azure/azure-sql/database/sql-database-vulnerability-assessment-storage // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server for which the vulnerability assessment is defined. @@ -98,7 +98,7 @@ func (client *ServerVulnerabilityAssessmentsClient) createOrUpdateCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -119,7 +119,7 @@ func (client *ServerVulnerabilityAssessmentsClient) createOrUpdateHandleResponse // Delete - Removes the server's vulnerability assessment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server for which the vulnerability assessment is defined. @@ -167,7 +167,7 @@ func (client *ServerVulnerabilityAssessmentsClient) deleteCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -175,7 +175,7 @@ func (client *ServerVulnerabilityAssessmentsClient) deleteCreateRequest(ctx cont // Get - Gets the server's vulnerability assessment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server for which the vulnerability assessment is defined. @@ -224,7 +224,7 @@ func (client *ServerVulnerabilityAssessmentsClient) getCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -241,7 +241,7 @@ func (client *ServerVulnerabilityAssessmentsClient) getHandleResponse(resp *http // NewListByServerPager - Lists the vulnerability assessment policies associated with a server. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -295,7 +295,7 @@ func (client *ServerVulnerabilityAssessmentsClient) listByServerCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/servervulnerabilityassessments_client_example_test.go b/sdk/resourcemanager/sql/armsql/servervulnerabilityassessments_client_example_test.go deleted file mode 100644 index fe18e68ecf40..000000000000 --- a/sdk/resourcemanager/sql/armsql/servervulnerabilityassessments_client_example_test.go +++ /dev/null @@ -1,235 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerVulnerabilityAssessmentGet.json -func ExampleServerVulnerabilityAssessmentsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServerVulnerabilityAssessmentsClient().Get(ctx, "vulnerabilityaseessmenttest-4799", "vulnerabilityaseessmenttest-6440", armsql.VulnerabilityAssessmentNameDefault, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServerVulnerabilityAssessment = armsql.ServerVulnerabilityAssessment{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/servers/vulnerabilityAssessments"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/servers/vulnerabilityaseessmenttest-6440/vulnerabilityAssessments/default"), - // Properties: &armsql.ServerVulnerabilityAssessmentProperties{ - // RecurringScans: &armsql.VulnerabilityAssessmentRecurringScansProperties{ - // EmailSubscriptionAdmins: to.Ptr(true), - // Emails: []*string{ - // to.Ptr("email1@mail.com"), - // to.Ptr("email2@mail.com")}, - // IsEnabled: to.Ptr(true), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerVulnerabilityAssessmentCreateMax.json -func ExampleServerVulnerabilityAssessmentsClient_CreateOrUpdate_createAServersVulnerabilityAssessmentWithAllParameters() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServerVulnerabilityAssessmentsClient().CreateOrUpdate(ctx, "vulnerabilityaseessmenttest-4799", "vulnerabilityaseessmenttest-6440", armsql.VulnerabilityAssessmentNameDefault, armsql.ServerVulnerabilityAssessment{ - Properties: &armsql.ServerVulnerabilityAssessmentProperties{ - RecurringScans: &armsql.VulnerabilityAssessmentRecurringScansProperties{ - EmailSubscriptionAdmins: to.Ptr(true), - Emails: []*string{ - to.Ptr("email1@mail.com"), - to.Ptr("email2@mail.com")}, - IsEnabled: to.Ptr(true), - }, - StorageAccountAccessKey: to.Ptr("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"), - StorageContainerPath: to.Ptr("https://myStorage.blob.core.windows.net/vulnerability-assessment/"), - StorageContainerSasKey: to.Ptr("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServerVulnerabilityAssessment = armsql.ServerVulnerabilityAssessment{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/servers/vulnerabilityAssessments"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/servers/vulnerabilityaseessmenttest-6440/vulnerabilityAssessments/default"), - // Properties: &armsql.ServerVulnerabilityAssessmentProperties{ - // RecurringScans: &armsql.VulnerabilityAssessmentRecurringScansProperties{ - // EmailSubscriptionAdmins: to.Ptr(true), - // Emails: []*string{ - // to.Ptr("email1@mail.com"), - // to.Ptr("email2@mail.com")}, - // IsEnabled: to.Ptr(true), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerVulnerabilityAssessmentCreateStorageAccessKeyMin.json -func ExampleServerVulnerabilityAssessmentsClient_CreateOrUpdate_createAServersVulnerabilityAssessmentWithMinimalParametersWhenStorageAccountAccessKeyIsSpecified() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServerVulnerabilityAssessmentsClient().CreateOrUpdate(ctx, "vulnerabilityaseessmenttest-4799", "vulnerabilityaseessmenttest-6440", armsql.VulnerabilityAssessmentNameDefault, armsql.ServerVulnerabilityAssessment{ - Properties: &armsql.ServerVulnerabilityAssessmentProperties{ - StorageAccountAccessKey: to.Ptr("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"), - StorageContainerPath: to.Ptr("https://myStorage.blob.core.windows.net/vulnerability-assessment/"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServerVulnerabilityAssessment = armsql.ServerVulnerabilityAssessment{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/servers/vulnerabilityAssessments"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/servers/vulnerabilityaseessmenttest-6440/vulnerabilityAssessments/default"), - // Properties: &armsql.ServerVulnerabilityAssessmentProperties{ - // RecurringScans: &armsql.VulnerabilityAssessmentRecurringScansProperties{ - // EmailSubscriptionAdmins: to.Ptr(false), - // Emails: []*string{ - // }, - // IsEnabled: to.Ptr(true), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerVulnerabilityAssessmentCreateContainerSasKeyMin.json -func ExampleServerVulnerabilityAssessmentsClient_CreateOrUpdate_createAServersVulnerabilityAssessmentWithMinimalParametersWhenStorageContainerSasKeyIsSpecified() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServerVulnerabilityAssessmentsClient().CreateOrUpdate(ctx, "vulnerabilityaseessmenttest-4799", "vulnerabilityaseessmenttest-6440", armsql.VulnerabilityAssessmentNameDefault, armsql.ServerVulnerabilityAssessment{ - Properties: &armsql.ServerVulnerabilityAssessmentProperties{ - StorageContainerPath: to.Ptr("https://myStorage.blob.core.windows.net/vulnerability-assessment/"), - StorageContainerSasKey: to.Ptr("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServerVulnerabilityAssessment = armsql.ServerVulnerabilityAssessment{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/servers/vulnerabilityAssessments"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/servers/vulnerabilityaseessmenttest-6440/vulnerabilityAssessments/default"), - // Properties: &armsql.ServerVulnerabilityAssessmentProperties{ - // RecurringScans: &armsql.VulnerabilityAssessmentRecurringScansProperties{ - // EmailSubscriptionAdmins: to.Ptr(false), - // Emails: []*string{ - // }, - // IsEnabled: to.Ptr(true), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerVulnerabilityAssessmentDelete.json -func ExampleServerVulnerabilityAssessmentsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewServerVulnerabilityAssessmentsClient().Delete(ctx, "vulnerabilityaseessmenttest-4799", "vulnerabilityaseessmenttest-6440", armsql.VulnerabilityAssessmentNameDefault, 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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerVulnerabilityAssessmentListByServer.json -func ExampleServerVulnerabilityAssessmentsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServerVulnerabilityAssessmentsClient().NewListByServerPager("vulnerabilityaseessmenttest-4799", "vulnerabilityaseessmenttest-6440", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ServerVulnerabilityAssessmentListResult = armsql.ServerVulnerabilityAssessmentListResult{ - // Value: []*armsql.ServerVulnerabilityAssessment{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/servers/vulnerabilityAssessments"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/servers/vulnerabilityaseessmenttest-6440/vulnerabilityAssessments/"), - // Properties: &armsql.ServerVulnerabilityAssessmentProperties{ - // RecurringScans: &armsql.VulnerabilityAssessmentRecurringScansProperties{ - // EmailSubscriptionAdmins: to.Ptr(true), - // Emails: []*string{ - // to.Ptr("email1@mail.com"), - // to.Ptr("email2@mail.com")}, - // IsEnabled: to.Ptr(true), - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/sql/armsql/serviceobjectives_client.go b/sdk/resourcemanager/sql/armsql/serviceobjectives_client.go deleted file mode 100644 index 6ef3cceecb48..000000000000 --- a/sdk/resourcemanager/sql/armsql/serviceobjectives_client.go +++ /dev/null @@ -1,175 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsql - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// ServiceObjectivesClient contains the methods for the ServiceObjectives group. -// Don't use this type directly, use NewServiceObjectivesClient() instead. -type ServiceObjectivesClient struct { - internal *arm.Client - subscriptionID string -} - -// NewServiceObjectivesClient creates a new instance of ServiceObjectivesClient with the specified values. -// - subscriptionID - The subscription ID that identifies an Azure subscription. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewServiceObjectivesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServiceObjectivesClient, error) { - cl, err := arm.NewClient(moduleName+".ServiceObjectivesClient", moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &ServiceObjectivesClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// Get - Gets a database service objective. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2014-04-01 -// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// - serverName - The name of the server. -// - serviceObjectiveName - The name of the service objective to retrieve. -// - options - ServiceObjectivesClientGetOptions contains the optional parameters for the ServiceObjectivesClient.Get method. -func (client *ServiceObjectivesClient) Get(ctx context.Context, resourceGroupName string, serverName string, serviceObjectiveName string, options *ServiceObjectivesClientGetOptions) (ServiceObjectivesClientGetResponse, error) { - var err error - req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, serviceObjectiveName, options) - if err != nil { - return ServiceObjectivesClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return ServiceObjectivesClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return ServiceObjectivesClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *ServiceObjectivesClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, serviceObjectiveName string, options *ServiceObjectivesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/serviceObjectives/{serviceObjectiveName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if serverName == "" { - return nil, errors.New("parameter serverName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) - if serviceObjectiveName == "" { - return nil, errors.New("parameter serviceObjectiveName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serviceObjectiveName}", url.PathEscape(serviceObjectiveName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2014-04-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *ServiceObjectivesClient) getHandleResponse(resp *http.Response) (ServiceObjectivesClientGetResponse, error) { - result := ServiceObjectivesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ServiceObjective); err != nil { - return ServiceObjectivesClientGetResponse{}, err - } - return result, nil -} - -// NewListByServerPager - Returns database service objectives. -// -// Generated from API version 2014-04-01 -// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// - serverName - The name of the server. -// - options - ServiceObjectivesClientListByServerOptions contains the optional parameters for the ServiceObjectivesClient.NewListByServerPager -// method. -func (client *ServiceObjectivesClient) NewListByServerPager(resourceGroupName string, serverName string, options *ServiceObjectivesClientListByServerOptions) *runtime.Pager[ServiceObjectivesClientListByServerResponse] { - return runtime.NewPager(runtime.PagingHandler[ServiceObjectivesClientListByServerResponse]{ - More: func(page ServiceObjectivesClientListByServerResponse) bool { - return false - }, - Fetcher: func(ctx context.Context, page *ServiceObjectivesClientListByServerResponse) (ServiceObjectivesClientListByServerResponse, error) { - req, err := client.listByServerCreateRequest(ctx, resourceGroupName, serverName, options) - if err != nil { - return ServiceObjectivesClientListByServerResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return ServiceObjectivesClientListByServerResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServiceObjectivesClientListByServerResponse{}, runtime.NewResponseError(resp) - } - return client.listByServerHandleResponse(resp) - }, - }) -} - -// listByServerCreateRequest creates the ListByServer request. -func (client *ServiceObjectivesClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *ServiceObjectivesClientListByServerOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/serviceObjectives" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if serverName == "" { - return nil, errors.New("parameter serverName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2014-04-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByServerHandleResponse handles the ListByServer response. -func (client *ServiceObjectivesClient) listByServerHandleResponse(resp *http.Response) (ServiceObjectivesClientListByServerResponse, error) { - result := ServiceObjectivesClientListByServerResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ServiceObjectiveListResult); err != nil { - return ServiceObjectivesClientListByServerResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/sql/armsql/serviceobjectives_client_example_test.go b/sdk/resourcemanager/sql/armsql/serviceobjectives_client_example_test.go deleted file mode 100644 index 9784ad5ac0c3..000000000000 --- a/sdk/resourcemanager/sql/armsql/serviceobjectives_client_example_test.go +++ /dev/null @@ -1,605 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ServiceObjectiveGet.json -func ExampleServiceObjectivesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServiceObjectivesClient().Get(ctx, "group1", "sqlcrudtest", "29dd7459-4a7c-4e56-be22-f0adda49440d", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServiceObjective = armsql.ServiceObjective{ - // Name: to.Ptr("29dd7459-4a7c-4e56-be22-f0adda49440d"), - // Type: to.Ptr("Microsoft.Sql/servers/serviceObjectives"), - // ID: to.Ptr("/subscriptions/b6a6e0c5-e79c-4c6d-a878-72eafbca4cf2/resourceGroups/QA/providers/Microsoft.Sql/servers/nafantest/serviceObjectives/29dd7459-4a7c-4e56-be22-f0adda49440d"), - // Properties: &armsql.ServiceObjectiveProperties{ - // Enabled: to.Ptr(false), - // IsDefault: to.Ptr(false), - // IsSystem: to.Ptr(true), - // ServiceObjectiveName: to.Ptr("System0"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ServiceObjectiveList.json -func ExampleServiceObjectivesClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServiceObjectivesClient().NewListByServerPager("group1", "sqlcrudtest", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ServiceObjectiveListResult = armsql.ServiceObjectiveListResult{ - // Value: []*armsql.ServiceObjective{ - // { - // Name: to.Ptr("26e021db-f1f9-4c98-84c6-92af8ef433d7"), - // Type: to.Ptr("Microsoft.Sql/servers/serviceObjectives"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/sqlcrudtest/serviceObjectives/26e021db-f1f9-4c98-84c6-92af8ef433d7"), - // Properties: &armsql.ServiceObjectiveProperties{ - // Enabled: to.Ptr(false), - // IsDefault: to.Ptr(false), - // IsSystem: to.Ptr(true), - // ServiceObjectiveName: to.Ptr("System"), - // }, - // }, - // { - // Name: to.Ptr("29dd7459-4a7c-4e56-be22-f0adda49440d"), - // Type: to.Ptr("Microsoft.Sql/servers/serviceObjectives"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/sqlcrudtest/serviceObjectives/29dd7459-4a7c-4e56-be22-f0adda49440d"), - // Properties: &armsql.ServiceObjectiveProperties{ - // Enabled: to.Ptr(false), - // IsDefault: to.Ptr(false), - // IsSystem: to.Ptr(true), - // ServiceObjectiveName: to.Ptr("System0"), - // }, - // }, - // { - // Name: to.Ptr("c99ac918-dbea-463f-a475-16ec020fdc12"), - // Type: to.Ptr("Microsoft.Sql/servers/serviceObjectives"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/sqlcrudtest/serviceObjectives/c99ac918-dbea-463f-a475-16ec020fdc12"), - // Properties: &armsql.ServiceObjectiveProperties{ - // Enabled: to.Ptr(false), - // IsDefault: to.Ptr(false), - // IsSystem: to.Ptr(true), - // ServiceObjectiveName: to.Ptr("System1"), - // }, - // }, - // { - // Name: to.Ptr("620323bf-2879-4807-b30d-c2e6d7b3b3aa"), - // Type: to.Ptr("Microsoft.Sql/servers/serviceObjectives"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/sqlcrudtest/serviceObjectives/620323bf-2879-4807-b30d-c2e6d7b3b3aa"), - // Properties: &armsql.ServiceObjectiveProperties{ - // Enabled: to.Ptr(false), - // IsDefault: to.Ptr(false), - // IsSystem: to.Ptr(true), - // ServiceObjectiveName: to.Ptr("System2"), - // }, - // }, - // { - // Name: to.Ptr("33d0db1f-6893-4210-99f9-463fb9b496a4"), - // Type: to.Ptr("Microsoft.Sql/servers/serviceObjectives"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/sqlcrudtest/serviceObjectives/33d0db1f-6893-4210-99f9-463fb9b496a4"), - // Properties: &armsql.ServiceObjectiveProperties{ - // Enabled: to.Ptr(false), - // IsDefault: to.Ptr(false), - // IsSystem: to.Ptr(true), - // ServiceObjectiveName: to.Ptr("System3"), - // }, - // }, - // { - // Name: to.Ptr("da24338c-a6c9-46c2-a4bf-4ac95b496ae4"), - // Type: to.Ptr("Microsoft.Sql/servers/serviceObjectives"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/sqlcrudtest/serviceObjectives/da24338c-a6c9-46c2-a4bf-4ac95b496ae4"), - // Properties: &armsql.ServiceObjectiveProperties{ - // Enabled: to.Ptr(false), - // IsDefault: to.Ptr(false), - // IsSystem: to.Ptr(true), - // ServiceObjectiveName: to.Ptr("System4"), - // }, - // }, - // { - // Name: to.Ptr("53f7fa1b-b0d0-43d6-bc29-c5f059fb36e9"), - // Type: to.Ptr("Microsoft.Sql/servers/serviceObjectives"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/sqlcrudtest/serviceObjectives/53f7fa1b-b0d0-43d6-bc29-c5f059fb36e9"), - // Properties: &armsql.ServiceObjectiveProperties{ - // Enabled: to.Ptr(false), - // IsDefault: to.Ptr(false), - // IsSystem: to.Ptr(true), - // ServiceObjectiveName: to.Ptr("System2L"), - // }, - // }, - // { - // Name: to.Ptr("e79cd55c-689f-48d9-bffa-0dd12c772248"), - // Type: to.Ptr("Microsoft.Sql/servers/serviceObjectives"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/sqlcrudtest/serviceObjectives/e79cd55c-689f-48d9-bffa-0dd12c772248"), - // Properties: &armsql.ServiceObjectiveProperties{ - // Enabled: to.Ptr(false), - // IsDefault: to.Ptr(false), - // IsSystem: to.Ptr(true), - // ServiceObjectiveName: to.Ptr("System3L"), - // }, - // }, - // { - // Name: to.Ptr("4b37bb6d-e004-47ac-8f7a-be56ac9fb490"), - // Type: to.Ptr("Microsoft.Sql/servers/serviceObjectives"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/sqlcrudtest/serviceObjectives/4b37bb6d-e004-47ac-8f7a-be56ac9fb490"), - // Properties: &armsql.ServiceObjectiveProperties{ - // Enabled: to.Ptr(false), - // IsDefault: to.Ptr(false), - // IsSystem: to.Ptr(true), - // ServiceObjectiveName: to.Ptr("System4L"), - // }, - // }, - // { - // Name: to.Ptr("6aa3bb3e-7f50-40d6-95ef-5497c30d99d8"), - // Type: to.Ptr("Microsoft.Sql/servers/serviceObjectives"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/sqlcrudtest/serviceObjectives/6aa3bb3e-7f50-40d6-95ef-5497c30d99d8"), - // Properties: &armsql.ServiceObjectiveProperties{ - // Enabled: to.Ptr(true), - // IsDefault: to.Ptr(true), - // IsSystem: to.Ptr(false), - // ServiceObjectiveName: to.Ptr("Free"), - // }, - // }, - // { - // Name: to.Ptr("dd6d99bb-f193-4ec1-86f2-43d3bccbc49c"), - // Type: to.Ptr("Microsoft.Sql/servers/serviceObjectives"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/sqlcrudtest/serviceObjectives/dd6d99bb-f193-4ec1-86f2-43d3bccbc49c"), - // Properties: &armsql.ServiceObjectiveProperties{ - // Enabled: to.Ptr(true), - // IsDefault: to.Ptr(true), - // IsSystem: to.Ptr(false), - // ServiceObjectiveName: to.Ptr("Basic"), - // }, - // }, - // { - // Name: to.Ptr("f1173c43-91bd-4aaa-973c-54e79e15235b"), - // Type: to.Ptr("Microsoft.Sql/servers/serviceObjectives"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/sqlcrudtest/serviceObjectives/f1173c43-91bd-4aaa-973c-54e79e15235b"), - // Properties: &armsql.ServiceObjectiveProperties{ - // Enabled: to.Ptr(true), - // IsDefault: to.Ptr(true), - // IsSystem: to.Ptr(false), - // ServiceObjectiveName: to.Ptr("S0"), - // }, - // }, - // { - // Name: to.Ptr("1b1ebd4d-d903-4baa-97f9-4ea675f5e928"), - // Type: to.Ptr("Microsoft.Sql/servers/serviceObjectives"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/sqlcrudtest/serviceObjectives/1b1ebd4d-d903-4baa-97f9-4ea675f5e928"), - // Properties: &armsql.ServiceObjectiveProperties{ - // Enabled: to.Ptr(true), - // IsDefault: to.Ptr(false), - // IsSystem: to.Ptr(false), - // ServiceObjectiveName: to.Ptr("S1"), - // }, - // }, - // { - // Name: to.Ptr("455330e1-00cd-488b-b5fa-177c226f28b7"), - // Type: to.Ptr("Microsoft.Sql/servers/serviceObjectives"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/sqlcrudtest/serviceObjectives/455330e1-00cd-488b-b5fa-177c226f28b7"), - // Properties: &armsql.ServiceObjectiveProperties{ - // Enabled: to.Ptr(true), - // IsDefault: to.Ptr(false), - // IsSystem: to.Ptr(false), - // ServiceObjectiveName: to.Ptr("S2"), - // }, - // }, - // { - // Name: to.Ptr("789681b8-ca10-4eb0-bdf2-e0b050601b40"), - // Type: to.Ptr("Microsoft.Sql/servers/serviceObjectives"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/sqlcrudtest/serviceObjectives/789681b8-ca10-4eb0-bdf2-e0b050601b40"), - // Properties: &armsql.ServiceObjectiveProperties{ - // Enabled: to.Ptr(true), - // IsDefault: to.Ptr(false), - // IsSystem: to.Ptr(false), - // ServiceObjectiveName: to.Ptr("S3"), - // }, - // }, - // { - // Name: to.Ptr("7203483a-c4fb-4304-9e9f-17c71c904f5d"), - // Type: to.Ptr("Microsoft.Sql/servers/serviceObjectives"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/sqlcrudtest/serviceObjectives/7203483a-c4fb-4304-9e9f-17c71c904f5d"), - // Properties: &armsql.ServiceObjectiveProperties{ - // Enabled: to.Ptr(true), - // IsDefault: to.Ptr(true), - // IsSystem: to.Ptr(false), - // ServiceObjectiveName: to.Ptr("P1"), - // }, - // }, - // { - // Name: to.Ptr("a7d1b92d-c987-4375-b54d-2b1d0e0f5bb0"), - // Type: to.Ptr("Microsoft.Sql/servers/serviceObjectives"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/sqlcrudtest/serviceObjectives/a7d1b92d-c987-4375-b54d-2b1d0e0f5bb0"), - // Properties: &armsql.ServiceObjectiveProperties{ - // Enabled: to.Ptr(true), - // IsDefault: to.Ptr(false), - // IsSystem: to.Ptr(false), - // ServiceObjectiveName: to.Ptr("P2"), - // }, - // }, - // { - // Name: to.Ptr("afe1eee1-1f12-4e5f-9ad6-2de9c12cb4dc"), - // Type: to.Ptr("Microsoft.Sql/servers/serviceObjectives"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/sqlcrudtest/serviceObjectives/afe1eee1-1f12-4e5f-9ad6-2de9c12cb4dc"), - // Properties: &armsql.ServiceObjectiveProperties{ - // Enabled: to.Ptr(true), - // IsDefault: to.Ptr(false), - // IsSystem: to.Ptr(false), - // ServiceObjectiveName: to.Ptr("P4"), - // }, - // }, - // { - // Name: to.Ptr("43940481-9191-475a-9dba-6b505615b9aa"), - // Type: to.Ptr("Microsoft.Sql/servers/serviceObjectives"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/sqlcrudtest/serviceObjectives/43940481-9191-475a-9dba-6b505615b9aa"), - // Properties: &armsql.ServiceObjectiveProperties{ - // Enabled: to.Ptr(true), - // IsDefault: to.Ptr(false), - // IsSystem: to.Ptr(false), - // ServiceObjectiveName: to.Ptr("P6"), - // }, - // }, - // { - // Name: to.Ptr("dd00d544-bbc0-4f61-ba60-cdce0c410288"), - // Type: to.Ptr("Microsoft.Sql/servers/serviceObjectives"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/sqlcrudtest/serviceObjectives/dd00d544-bbc0-4f61-ba60-cdce0c410288"), - // Properties: &armsql.ServiceObjectiveProperties{ - // Enabled: to.Ptr(true), - // IsDefault: to.Ptr(false), - // IsSystem: to.Ptr(false), - // ServiceObjectiveName: to.Ptr("P11"), - // }, - // }, - // { - // Name: to.Ptr("5bc86cca-9a96-4a94-90ef-bbdfcfbf2d71"), - // Type: to.Ptr("Microsoft.Sql/servers/serviceObjectives"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/sqlcrudtest/serviceObjectives/5bc86cca-9a96-4a94-90ef-bbdfcfbf2d71"), - // Properties: &armsql.ServiceObjectiveProperties{ - // Enabled: to.Ptr(true), - // IsDefault: to.Ptr(false), - // IsSystem: to.Ptr(false), - // ServiceObjectiveName: to.Ptr("P15"), - // }, - // }, - // { - // Name: to.Ptr("dfdc102c-ed02-4349-9756-e227f0e43bb8"), - // Type: to.Ptr("Microsoft.Sql/servers/serviceObjectives"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/sqlcrudtest/serviceObjectives/dfdc102c-ed02-4349-9756-e227f0e43bb8"), - // Properties: &armsql.ServiceObjectiveProperties{ - // Enabled: to.Ptr(true), - // IsDefault: to.Ptr(true), - // IsSystem: to.Ptr(false), - // ServiceObjectiveName: to.Ptr("PRS1"), - // }, - // }, - // { - // Name: to.Ptr("a089506e-b47a-4f42-8a32-cc19af4c86fb"), - // Type: to.Ptr("Microsoft.Sql/servers/serviceObjectives"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/sqlcrudtest/serviceObjectives/a089506e-b47a-4f42-8a32-cc19af4c86fb"), - // Properties: &armsql.ServiceObjectiveProperties{ - // Enabled: to.Ptr(true), - // IsDefault: to.Ptr(false), - // IsSystem: to.Ptr(false), - // ServiceObjectiveName: to.Ptr("PRS2"), - // }, - // }, - // { - // Name: to.Ptr("39cb8faf-cba8-4b1b-b580-1e1202f2a024"), - // Type: to.Ptr("Microsoft.Sql/servers/serviceObjectives"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/sqlcrudtest/serviceObjectives/39cb8faf-cba8-4b1b-b580-1e1202f2a024"), - // Properties: &armsql.ServiceObjectiveProperties{ - // Enabled: to.Ptr(true), - // IsDefault: to.Ptr(false), - // IsSystem: to.Ptr(false), - // ServiceObjectiveName: to.Ptr("PRS4"), - // }, - // }, - // { - // Name: to.Ptr("1e8da92e-efcd-4682-9140-bf6582120d1f"), - // Type: to.Ptr("Microsoft.Sql/servers/serviceObjectives"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/sqlcrudtest/serviceObjectives/1e8da92e-efcd-4682-9140-bf6582120d1f"), - // Properties: &armsql.ServiceObjectiveProperties{ - // Enabled: to.Ptr(true), - // IsDefault: to.Ptr(false), - // IsSystem: to.Ptr(false), - // ServiceObjectiveName: to.Ptr("PRS6"), - // }, - // }, - // { - // Name: to.Ptr("4e63cb0e-91b9-46fd-b05c-51fdd2367618"), - // Type: to.Ptr("Microsoft.Sql/servers/serviceObjectives"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/sqlcrudtest/serviceObjectives/4e63cb0e-91b9-46fd-b05c-51fdd2367618"), - // Properties: &armsql.ServiceObjectiveProperties{ - // Enabled: to.Ptr(true), - // IsDefault: to.Ptr(true), - // IsSystem: to.Ptr(false), - // ServiceObjectiveName: to.Ptr("DW100"), - // }, - // }, - // { - // Name: to.Ptr("99e78a92-d724-4e1b-857b-2be661f3d153"), - // Type: to.Ptr("Microsoft.Sql/servers/serviceObjectives"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/sqlcrudtest/serviceObjectives/99e78a92-d724-4e1b-857b-2be661f3d153"), - // Properties: &armsql.ServiceObjectiveProperties{ - // Enabled: to.Ptr(true), - // IsDefault: to.Ptr(false), - // IsSystem: to.Ptr(false), - // ServiceObjectiveName: to.Ptr("DW200"), - // }, - // }, - // { - // Name: to.Ptr("284f1aff-fee7-4d3b-a211-5b8ebdd28fea"), - // Type: to.Ptr("Microsoft.Sql/servers/serviceObjectives"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/sqlcrudtest/serviceObjectives/284f1aff-fee7-4d3b-a211-5b8ebdd28fea"), - // Properties: &armsql.ServiceObjectiveProperties{ - // Enabled: to.Ptr(true), - // IsDefault: to.Ptr(false), - // IsSystem: to.Ptr(false), - // ServiceObjectiveName: to.Ptr("DW300"), - // }, - // }, - // { - // Name: to.Ptr("3bdaeefe-8a9d-41d3-91c4-46ef896b19af"), - // Type: to.Ptr("Microsoft.Sql/servers/serviceObjectives"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/sqlcrudtest/serviceObjectives/3bdaeefe-8a9d-41d3-91c4-46ef896b19af"), - // Properties: &armsql.ServiceObjectiveProperties{ - // Enabled: to.Ptr(true), - // IsDefault: to.Ptr(false), - // IsSystem: to.Ptr(false), - // ServiceObjectiveName: to.Ptr("DW400"), - // }, - // }, - // { - // Name: to.Ptr("5f759b78-8ec0-4dfb-97cc-c1455a3b5b4d"), - // Type: to.Ptr("Microsoft.Sql/servers/serviceObjectives"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/sqlcrudtest/serviceObjectives/5f759b78-8ec0-4dfb-97cc-c1455a3b5b4d"), - // Properties: &armsql.ServiceObjectiveProperties{ - // Enabled: to.Ptr(true), - // IsDefault: to.Ptr(false), - // IsSystem: to.Ptr(false), - // ServiceObjectiveName: to.Ptr("DW500"), - // }, - // }, - // { - // Name: to.Ptr("efd65c5b-af7b-4389-9109-f6a69d6a3885"), - // Type: to.Ptr("Microsoft.Sql/servers/serviceObjectives"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/sqlcrudtest/serviceObjectives/efd65c5b-af7b-4389-9109-f6a69d6a3885"), - // Properties: &armsql.ServiceObjectiveProperties{ - // Enabled: to.Ptr(true), - // IsDefault: to.Ptr(false), - // IsSystem: to.Ptr(false), - // ServiceObjectiveName: to.Ptr("DW600"), - // }, - // }, - // { - // Name: to.Ptr("b89b9c6a-4ec2-4eb8-99db-6d2807e6aabb"), - // Type: to.Ptr("Microsoft.Sql/servers/serviceObjectives"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/sqlcrudtest/serviceObjectives/b89b9c6a-4ec2-4eb8-99db-6d2807e6aabb"), - // Properties: &armsql.ServiceObjectiveProperties{ - // Enabled: to.Ptr(true), - // IsDefault: to.Ptr(false), - // IsSystem: to.Ptr(false), - // ServiceObjectiveName: to.Ptr("DW1000"), - // }, - // }, - // { - // Name: to.Ptr("9a7a374e-b95c-4fd5-a68e-131d60796c47"), - // Type: to.Ptr("Microsoft.Sql/servers/serviceObjectives"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/sqlcrudtest/serviceObjectives/9a7a374e-b95c-4fd5-a68e-131d60796c47"), - // Properties: &armsql.ServiceObjectiveProperties{ - // Enabled: to.Ptr(true), - // IsDefault: to.Ptr(false), - // IsSystem: to.Ptr(false), - // ServiceObjectiveName: to.Ptr("DW1200"), - // }, - // }, - // { - // Name: to.Ptr("b930f58e-86b5-43e0-a2da-d8bf8769c557"), - // Type: to.Ptr("Microsoft.Sql/servers/serviceObjectives"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/sqlcrudtest/serviceObjectives/b930f58e-86b5-43e0-a2da-d8bf8769c557"), - // Properties: &armsql.ServiceObjectiveProperties{ - // Enabled: to.Ptr(true), - // IsDefault: to.Ptr(false), - // IsSystem: to.Ptr(false), - // ServiceObjectiveName: to.Ptr("DW1500"), - // }, - // }, - // { - // Name: to.Ptr("99165ede-a5ab-4b52-b317-e391d92ec370"), - // Type: to.Ptr("Microsoft.Sql/servers/serviceObjectives"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/sqlcrudtest/serviceObjectives/99165ede-a5ab-4b52-b317-e391d92ec370"), - // Properties: &armsql.ServiceObjectiveProperties{ - // Enabled: to.Ptr(true), - // IsDefault: to.Ptr(false), - // IsSystem: to.Ptr(false), - // ServiceObjectiveName: to.Ptr("DW2000"), - // }, - // }, - // { - // Name: to.Ptr("8e28c923-5cf2-43cb-bd25-28c8c69b30ff"), - // Type: to.Ptr("Microsoft.Sql/servers/serviceObjectives"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/sqlcrudtest/serviceObjectives/8e28c923-5cf2-43cb-bd25-28c8c69b30ff"), - // Properties: &armsql.ServiceObjectiveProperties{ - // Enabled: to.Ptr(true), - // IsDefault: to.Ptr(false), - // IsSystem: to.Ptr(false), - // ServiceObjectiveName: to.Ptr("DW3000"), - // }, - // }, - // { - // Name: to.Ptr("ee1df062-4f3c-42ad-91bf-58b2a7c351e4"), - // Type: to.Ptr("Microsoft.Sql/servers/serviceObjectives"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/sqlcrudtest/serviceObjectives/ee1df062-4f3c-42ad-91bf-58b2a7c351e4"), - // Properties: &armsql.ServiceObjectiveProperties{ - // Enabled: to.Ptr(true), - // IsDefault: to.Ptr(false), - // IsSystem: to.Ptr(false), - // ServiceObjectiveName: to.Ptr("DW6000"), - // }, - // }, - // { - // Name: to.Ptr("9cfc850f-d57f-4760-b5a6-bb640d268bf0"), - // Type: to.Ptr("Microsoft.Sql/servers/serviceObjectives"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/sqlcrudtest/serviceObjectives/9cfc850f-d57f-4760-b5a6-bb640d268bf0"), - // Properties: &armsql.ServiceObjectiveProperties{ - // Enabled: to.Ptr(true), - // IsDefault: to.Ptr(true), - // IsSystem: to.Ptr(false), - // ServiceObjectiveName: to.Ptr("DS100"), - // }, - // }, - // { - // Name: to.Ptr("053407ef-f01c-46f4-b829-96e01a14f449"), - // Type: to.Ptr("Microsoft.Sql/servers/serviceObjectives"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/sqlcrudtest/serviceObjectives/053407ef-f01c-46f4-b829-96e01a14f449"), - // Properties: &armsql.ServiceObjectiveProperties{ - // Enabled: to.Ptr(true), - // IsDefault: to.Ptr(false), - // IsSystem: to.Ptr(false), - // ServiceObjectiveName: to.Ptr("DS200"), - // }, - // }, - // { - // Name: to.Ptr("013a9e10-cafc-45a8-8fcf-93095655d2ce"), - // Type: to.Ptr("Microsoft.Sql/servers/serviceObjectives"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/sqlcrudtest/serviceObjectives/013a9e10-cafc-45a8-8fcf-93095655d2ce"), - // Properties: &armsql.ServiceObjectiveProperties{ - // Enabled: to.Ptr(true), - // IsDefault: to.Ptr(false), - // IsSystem: to.Ptr(false), - // ServiceObjectiveName: to.Ptr("DS300"), - // }, - // }, - // { - // Name: to.Ptr("79f61db4-8c10-46ba-a93a-d7d02dddd61c"), - // Type: to.Ptr("Microsoft.Sql/servers/serviceObjectives"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/sqlcrudtest/serviceObjectives/79f61db4-8c10-46ba-a93a-d7d02dddd61c"), - // Properties: &armsql.ServiceObjectiveProperties{ - // Enabled: to.Ptr(true), - // IsDefault: to.Ptr(false), - // IsSystem: to.Ptr(false), - // ServiceObjectiveName: to.Ptr("DS400"), - // }, - // }, - // { - // Name: to.Ptr("44eaac33-df00-4ef4-a2bb-f7ff87899eea"), - // Type: to.Ptr("Microsoft.Sql/servers/serviceObjectives"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/sqlcrudtest/serviceObjectives/44eaac33-df00-4ef4-a2bb-f7ff87899eea"), - // Properties: &armsql.ServiceObjectiveProperties{ - // Enabled: to.Ptr(true), - // IsDefault: to.Ptr(false), - // IsSystem: to.Ptr(false), - // ServiceObjectiveName: to.Ptr("DS500"), - // }, - // }, - // { - // Name: to.Ptr("f8e0f3a6-888b-459c-a9dd-d74d8b2b0e72"), - // Type: to.Ptr("Microsoft.Sql/servers/serviceObjectives"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/sqlcrudtest/serviceObjectives/f8e0f3a6-888b-459c-a9dd-d74d8b2b0e72"), - // Properties: &armsql.ServiceObjectiveProperties{ - // Enabled: to.Ptr(true), - // IsDefault: to.Ptr(false), - // IsSystem: to.Ptr(false), - // ServiceObjectiveName: to.Ptr("DS600"), - // }, - // }, - // { - // Name: to.Ptr("b9ed8f51-a414-42dc-8348-e4a1de25e12b"), - // Type: to.Ptr("Microsoft.Sql/servers/serviceObjectives"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/sqlcrudtest/serviceObjectives/b9ed8f51-a414-42dc-8348-e4a1de25e12b"), - // Properties: &armsql.ServiceObjectiveProperties{ - // Enabled: to.Ptr(true), - // IsDefault: to.Ptr(false), - // IsSystem: to.Ptr(false), - // ServiceObjectiveName: to.Ptr("DS1000"), - // }, - // }, - // { - // Name: to.Ptr("07479569-6d70-47a5-8db6-0af55d34f2c1"), - // Type: to.Ptr("Microsoft.Sql/servers/serviceObjectives"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/sqlcrudtest/serviceObjectives/07479569-6d70-47a5-8db6-0af55d34f2c1"), - // Properties: &armsql.ServiceObjectiveProperties{ - // Enabled: to.Ptr(true), - // IsDefault: to.Ptr(false), - // IsSystem: to.Ptr(false), - // ServiceObjectiveName: to.Ptr("DS1200"), - // }, - // }, - // { - // Name: to.Ptr("2d79baec-2879-46d5-9f5d-fb70eb004c4e"), - // Type: to.Ptr("Microsoft.Sql/servers/serviceObjectives"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/sqlcrudtest/serviceObjectives/2d79baec-2879-46d5-9f5d-fb70eb004c4e"), - // Properties: &armsql.ServiceObjectiveProperties{ - // Enabled: to.Ptr(true), - // IsDefault: to.Ptr(false), - // IsSystem: to.Ptr(false), - // ServiceObjectiveName: to.Ptr("DS1500"), - // }, - // }, - // { - // Name: to.Ptr("7fb5389f-6d15-4e0b-9540-fe5ecdfdbeee"), - // Type: to.Ptr("Microsoft.Sql/servers/serviceObjectives"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/sqlcrudtest/serviceObjectives/7fb5389f-6d15-4e0b-9540-fe5ecdfdbeee"), - // Properties: &armsql.ServiceObjectiveProperties{ - // Enabled: to.Ptr(true), - // IsDefault: to.Ptr(false), - // IsSystem: to.Ptr(false), - // ServiceObjectiveName: to.Ptr("DS2000"), - // }, - // }, - // { - // Name: to.Ptr("d1737d22-a8ea-4de7-9bd0-33395d2a7419"), - // Type: to.Ptr("Microsoft.Sql/servers/serviceObjectives"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/sqlcrudtest/serviceObjectives/d1737d22-a8ea-4de7-9bd0-33395d2a7419"), - // Properties: &armsql.ServiceObjectiveProperties{ - // Enabled: to.Ptr(true), - // IsDefault: to.Ptr(false), - // IsSystem: to.Ptr(false), - // ServiceObjectiveName: to.Ptr("ElasticPool"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/sql/armsql/startstopmanagedinstanceschedules_client.go b/sdk/resourcemanager/sql/armsql/startstopmanagedinstanceschedules_client.go index 0b47da1318a6..b09b4cc8436f 100644 --- a/sdk/resourcemanager/sql/armsql/startstopmanagedinstanceschedules_client.go +++ b/sdk/resourcemanager/sql/armsql/startstopmanagedinstanceschedules_client.go @@ -46,7 +46,7 @@ func NewStartStopManagedInstanceSchedulesClient(subscriptionID string, credentia // CreateOrUpdate - Creates or updates the managed instance's Start/Stop schedule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -96,7 +96,7 @@ func (client *StartStopManagedInstanceSchedulesClient) createOrUpdateCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -117,7 +117,7 @@ func (client *StartStopManagedInstanceSchedulesClient) createOrUpdateHandleRespo // Delete - Deletes the managed instance's Start/Stop schedule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -165,7 +165,7 @@ func (client *StartStopManagedInstanceSchedulesClient) deleteCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -173,7 +173,7 @@ func (client *StartStopManagedInstanceSchedulesClient) deleteCreateRequest(ctx c // Get - Gets the managed instance's Start/Stop schedule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -222,7 +222,7 @@ func (client *StartStopManagedInstanceSchedulesClient) getCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -239,7 +239,7 @@ func (client *StartStopManagedInstanceSchedulesClient) getHandleResponse(resp *h // NewListByInstancePager - Lists the managed instance's Start/Stop schedules. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - managedInstanceName - The name of the managed instance. @@ -293,7 +293,7 @@ func (client *StartStopManagedInstanceSchedulesClient) listByInstanceCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/startstopmanagedinstanceschedules_client_example_test.go b/sdk/resourcemanager/sql/armsql/startstopmanagedinstanceschedules_client_example_test.go deleted file mode 100644 index 5de402de1573..000000000000 --- a/sdk/resourcemanager/sql/armsql/startstopmanagedinstanceschedules_client_example_test.go +++ /dev/null @@ -1,286 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/StartStopManagedInstanceScheduleList.json -func ExampleStartStopManagedInstanceSchedulesClient_NewListByInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewStartStopManagedInstanceSchedulesClient().NewListByInstancePager("schedulerg", "schedulemi", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.StartStopManagedInstanceScheduleListResult = armsql.StartStopManagedInstanceScheduleListResult{ - // Value: []*armsql.StartStopManagedInstanceSchedule{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/startStopSchedules"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/schedulerg/providers/Microsoft.Sql/managedInstances/schedulemi/startStopSchedules"), - // Properties: &armsql.StartStopManagedInstanceScheduleProperties{ - // Description: to.Ptr("This is a schedule for our Dev/Test environment."), - // NextExecutionTime: to.Ptr("2021-08-26T14:00:00"), - // NextRunAction: to.Ptr("Stop"), - // ScheduleList: []*armsql.ScheduleItem{ - // { - // StartDay: to.Ptr(armsql.DayOfWeekThursday), - // StartTime: to.Ptr("06:00 PM"), - // StopDay: to.Ptr(armsql.DayOfWeekThursday), - // StopTime: to.Ptr("05:00 PM"), - // }, - // { - // StartDay: to.Ptr(armsql.DayOfWeekThursday), - // StartTime: to.Ptr("03:00 PM"), - // StopDay: to.Ptr(armsql.DayOfWeekThursday), - // StopTime: to.Ptr("02:00 PM"), - // }}, - // TimeZoneID: to.Ptr("Central European Standard Time"), - // }, - // SystemData: &armsql.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-26T04:41:33.937Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsql.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-27T04:41:33.937Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsql.CreatedByTypeUser), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/StartStopManagedInstanceScheduleGet.json -func ExampleStartStopManagedInstanceSchedulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewStartStopManagedInstanceSchedulesClient().Get(ctx, "schedulerg", "schedulemi", armsql.StartStopScheduleNameDefault, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.StartStopManagedInstanceSchedule = armsql.StartStopManagedInstanceSchedule{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/startStopSchedules"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/schedulerg/providers/Microsoft.Sql/managedInstances/schedulemi/startStopSchedules/default"), - // Properties: &armsql.StartStopManagedInstanceScheduleProperties{ - // Description: to.Ptr("This is a schedule for our Dev/Test environment."), - // NextExecutionTime: to.Ptr("2021-08-26T14:00:00"), - // NextRunAction: to.Ptr("Stop"), - // ScheduleList: []*armsql.ScheduleItem{ - // { - // StartDay: to.Ptr(armsql.DayOfWeekThursday), - // StartTime: to.Ptr("06:00 PM"), - // StopDay: to.Ptr(armsql.DayOfWeekThursday), - // StopTime: to.Ptr("05:00 PM"), - // }, - // { - // StartDay: to.Ptr(armsql.DayOfWeekThursday), - // StartTime: to.Ptr("03:00 PM"), - // StopDay: to.Ptr(armsql.DayOfWeekThursday), - // StopTime: to.Ptr("02:00 PM"), - // }}, - // TimeZoneID: to.Ptr("Central European Standard Time"), - // }, - // SystemData: &armsql.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-26T04:41:33.937Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsql.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-27T04:41:33.937Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsql.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/StartStopManagedInstanceScheduleCreateOrUpdateMax.json -func ExampleStartStopManagedInstanceSchedulesClient_CreateOrUpdate_createsOrUpdatesTheManagedInstancesStartStopScheduleWithAllOptionalParametersSpecified() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewStartStopManagedInstanceSchedulesClient().CreateOrUpdate(ctx, "schedulerg", "schedulemi", armsql.StartStopScheduleNameDefault, armsql.StartStopManagedInstanceSchedule{ - Properties: &armsql.StartStopManagedInstanceScheduleProperties{ - Description: to.Ptr("This is a schedule for our Dev/Test environment."), - ScheduleList: []*armsql.ScheduleItem{ - { - StartDay: to.Ptr(armsql.DayOfWeekThursday), - StartTime: to.Ptr("18:00"), - StopDay: to.Ptr(armsql.DayOfWeekThursday), - StopTime: to.Ptr("17:00"), - }, - { - StartDay: to.Ptr(armsql.DayOfWeekThursday), - StartTime: to.Ptr("15:00"), - StopDay: to.Ptr(armsql.DayOfWeekThursday), - StopTime: to.Ptr("14:00"), - }}, - TimeZoneID: to.Ptr("Central European Standard Time"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.StartStopManagedInstanceSchedule = armsql.StartStopManagedInstanceSchedule{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/startStopSchedules"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/schedulerg/providers/Microsoft.Sql/managedInstances/schedulemi/startStopSchedules/default"), - // Properties: &armsql.StartStopManagedInstanceScheduleProperties{ - // Description: to.Ptr("This is a schedule for our Dev/Test environment."), - // NextExecutionTime: to.Ptr("2021-08-26T14:00:00"), - // NextRunAction: to.Ptr("Stop"), - // ScheduleList: []*armsql.ScheduleItem{ - // { - // StartDay: to.Ptr(armsql.DayOfWeekThursday), - // StartTime: to.Ptr("06:00 PM"), - // StopDay: to.Ptr(armsql.DayOfWeekThursday), - // StopTime: to.Ptr("05:00 PM"), - // }, - // { - // StartDay: to.Ptr(armsql.DayOfWeekThursday), - // StartTime: to.Ptr("03:00 PM"), - // StopDay: to.Ptr(armsql.DayOfWeekThursday), - // StopTime: to.Ptr("02:00 PM"), - // }}, - // TimeZoneID: to.Ptr("Central European Standard Time"), - // }, - // SystemData: &armsql.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-26T04:41:33.937Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsql.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-27T04:41:33.937Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsql.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/StartStopManagedInstanceScheduleCreateOrUpdateMin.json -func ExampleStartStopManagedInstanceSchedulesClient_CreateOrUpdate_createsOrUpdatesTheManagedInstancesStartStopScheduleWithNoOptionalParametersSpecified() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewStartStopManagedInstanceSchedulesClient().CreateOrUpdate(ctx, "schedulerg", "schedulemi", armsql.StartStopScheduleNameDefault, armsql.StartStopManagedInstanceSchedule{ - Properties: &armsql.StartStopManagedInstanceScheduleProperties{ - ScheduleList: []*armsql.ScheduleItem{ - { - StartDay: to.Ptr(armsql.DayOfWeekThursday), - StartTime: to.Ptr("18:00"), - StopDay: to.Ptr(armsql.DayOfWeekThursday), - StopTime: to.Ptr("17:00"), - }, - { - StartDay: to.Ptr(armsql.DayOfWeekThursday), - StartTime: to.Ptr("15:00"), - StopDay: to.Ptr(armsql.DayOfWeekThursday), - StopTime: to.Ptr("14:00"), - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.StartStopManagedInstanceSchedule = armsql.StartStopManagedInstanceSchedule{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/startStopSchedules"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/schedulerg/providers/Microsoft.Sql/managedInstances/schedulemi/startStopSchedules/default"), - // Properties: &armsql.StartStopManagedInstanceScheduleProperties{ - // Description: to.Ptr(""), - // NextExecutionTime: to.Ptr("2021-08-26T14:00:00"), - // NextRunAction: to.Ptr("Stop"), - // ScheduleList: []*armsql.ScheduleItem{ - // { - // StartDay: to.Ptr(armsql.DayOfWeekThursday), - // StartTime: to.Ptr("06:00 PM"), - // StopDay: to.Ptr(armsql.DayOfWeekThursday), - // StopTime: to.Ptr("05:00 PM"), - // }, - // { - // StartDay: to.Ptr(armsql.DayOfWeekThursday), - // StartTime: to.Ptr("03:00 PM"), - // StopDay: to.Ptr(armsql.DayOfWeekThursday), - // StopTime: to.Ptr("02:00 PM"), - // }}, - // TimeZoneID: to.Ptr("UTC"), - // }, - // SystemData: &armsql.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-26T04:41:33.937Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsql.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-27T04:41:33.937Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsql.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/StartStopManagedInstanceScheduleDelete.json -func ExampleStartStopManagedInstanceSchedulesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewStartStopManagedInstanceSchedulesClient().Delete(ctx, "schedulerg", "schedulemi", armsql.StartStopScheduleNameDefault, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/sql/armsql/subscriptionusages_client.go b/sdk/resourcemanager/sql/armsql/subscriptionusages_client.go index 529f902d3349..4b1cc85f5d0a 100644 --- a/sdk/resourcemanager/sql/armsql/subscriptionusages_client.go +++ b/sdk/resourcemanager/sql/armsql/subscriptionusages_client.go @@ -46,7 +46,7 @@ func NewSubscriptionUsagesClient(subscriptionID string, credential azcore.TokenC // Get - Gets a subscription usage metric. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - locationName - The name of the region where the resource is located. // - usageName - Name of usage metric to return. // - options - SubscriptionUsagesClientGetOptions contains the optional parameters for the SubscriptionUsagesClient.Get method. @@ -88,7 +88,7 @@ func (client *SubscriptionUsagesClient) getCreateRequest(ctx context.Context, lo return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -105,7 +105,7 @@ func (client *SubscriptionUsagesClient) getHandleResponse(resp *http.Response) ( // NewListByLocationPager - Gets all subscription usage metrics in a given location. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - locationName - The name of the region where the resource is located. // - options - SubscriptionUsagesClientListByLocationOptions contains the optional parameters for the SubscriptionUsagesClient.NewListByLocationPager // method. @@ -153,7 +153,7 @@ func (client *SubscriptionUsagesClient) listByLocationCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/subscriptionusages_client_example_test.go b/sdk/resourcemanager/sql/armsql/subscriptionusages_client_example_test.go deleted file mode 100644 index 608175d17bb5..000000000000 --- a/sdk/resourcemanager/sql/armsql/subscriptionusages_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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SubscriptionUsageListByLocation.json -func ExampleSubscriptionUsagesClient_NewListByLocationPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSubscriptionUsagesClient().NewListByLocationPager("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.SubscriptionUsageListResult = armsql.SubscriptionUsageListResult{ - // Value: []*armsql.SubscriptionUsage{ - // { - // Name: to.Ptr("ServerQuota"), - // Type: to.Ptr("Microsoft.Sql/locations/usages"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/Onebox/usages/ServerQuota"), - // Properties: &armsql.SubscriptionUsageProperties{ - // CurrentValue: to.Ptr[float64](1), - // DisplayName: to.Ptr("Regional Server Quota for West US"), - // Limit: to.Ptr[float64](20), - // Unit: to.Ptr("Count"), - // }, - // }, - // { - // Name: to.Ptr("SubscriptionFreeDatabaseCount"), - // Type: to.Ptr("Microsoft.Sql/locations/usages"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/Onebox/usages/SubscriptionFreeDatabaseCount"), - // Properties: &armsql.SubscriptionUsageProperties{ - // CurrentValue: to.Ptr[float64](0), - // DisplayName: to.Ptr("Free Database Count per Subscription for West US"), - // Limit: to.Ptr[float64](1), - // Unit: to.Ptr("Count"), - // }, - // }, - // { - // Name: to.Ptr("SubscriptionFreeDatabaseDaysLeft"), - // Type: to.Ptr("Microsoft.Sql/locations/usages"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/Onebox/usages/SubscriptionFreeDatabaseDaysLeft"), - // Properties: &armsql.SubscriptionUsageProperties{ - // CurrentValue: to.Ptr[float64](365), - // DisplayName: to.Ptr("Free to Basic Database Upgrade count-down in West US"), - // Limit: to.Ptr[float64](365), - // Unit: to.Ptr("Count"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SubscriptionUsageGet.json -func ExampleSubscriptionUsagesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSubscriptionUsagesClient().Get(ctx, "WestUS", "ServerQuota", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SubscriptionUsage = armsql.SubscriptionUsage{ - // Name: to.Ptr("ServerQuota"), - // Type: to.Ptr("Microsoft.Sql/locations/usages"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/Onebox/usages/ServerQuota"), - // Properties: &armsql.SubscriptionUsageProperties{ - // CurrentValue: to.Ptr[float64](1), - // DisplayName: to.Ptr("Regional Server Quota for West US"), - // Limit: to.Ptr[float64](20), - // Unit: to.Ptr("Count"), - // }, - // } -} diff --git a/sdk/resourcemanager/sql/armsql/synapselinkworkspaces_client.go b/sdk/resourcemanager/sql/armsql/synapselinkworkspaces_client.go index 6c8196b3b6be..41d06f1b2828 100644 --- a/sdk/resourcemanager/sql/armsql/synapselinkworkspaces_client.go +++ b/sdk/resourcemanager/sql/armsql/synapselinkworkspaces_client.go @@ -45,7 +45,7 @@ func NewSynapseLinkWorkspacesClient(subscriptionID string, credential azcore.Tok // NewListByDatabasePager - Gets all synapselink workspaces for a database. // -// Generated from API version 2022-05-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -104,7 +104,7 @@ func (client *SynapseLinkWorkspacesClient) listByDatabaseCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/synapselinkworkspaces_client_example_test.go b/sdk/resourcemanager/sql/armsql/synapselinkworkspaces_client_example_test.go deleted file mode 100644 index 51457eda9c43..000000000000 --- a/sdk/resourcemanager/sql/armsql/synapselinkworkspaces_client_example_test.go +++ /dev/null @@ -1,62 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/SynapseLinkWorkspaceListByDatabase.json -func ExampleSynapseLinkWorkspacesClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSynapseLinkWorkspacesClient().NewListByDatabasePager("Default-SQL-SouthEastAsia", "testsvr", "dbSynapse", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SynapseLinkWorkspaceListResult = armsql.SynapseLinkWorkspaceListResult{ - // Value: []*armsql.SynapseLinkWorkspace{ - // { - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/linkWorkspaces"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/dbSynapse/linkWorkspaces/current"), - // Properties: &armsql.SynapseLinkWorkspaceProperties{ - // Workspaces: []*armsql.SynapseLinkWorkspaceInfoProperties{ - // { - // LinkConnectionName: to.Ptr("buildlink-cloud1"), - // WorkspaceID: to.Ptr("/subcriptions/00000000-1111-2222-3333-444444444444/resourcegroups/Default-SQL-SouthEastAsia/providers/Microsoft.Synapse/workspaces/workspace1"), - // }, - // { - // LinkConnectionName: to.Ptr("buildlink-cloud2"), - // WorkspaceID: to.Ptr("/subcriptions/00000000-1111-2222-3333-444444444444/resourcegroups/Default-SQL-SouthEastAsia/providers/Microsoft.Synapse/workspaces/workspace2"), - // }}, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/sql/armsql/syncagents_client.go b/sdk/resourcemanager/sql/armsql/syncagents_client.go index 38304d711dd8..be14ebfa59fa 100644 --- a/sdk/resourcemanager/sql/armsql/syncagents_client.go +++ b/sdk/resourcemanager/sql/armsql/syncagents_client.go @@ -46,7 +46,7 @@ func NewSyncAgentsClient(subscriptionID string, credential azcore.TokenCredentia // BeginCreateOrUpdate - Creates or updates a sync agent. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server on which the sync agent is hosted. @@ -70,7 +70,7 @@ func (client *SyncAgentsClient) BeginCreateOrUpdate(ctx context.Context, resourc // CreateOrUpdate - Creates or updates a sync agent. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview func (client *SyncAgentsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, syncAgentName string, parameters SyncAgent, options *SyncAgentsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, syncAgentName, parameters, options) @@ -112,7 +112,7 @@ func (client *SyncAgentsClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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 *SyncAgentsClient) createOrUpdateCreateRequest(ctx context.Context, // BeginDelete - Deletes a sync agent. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server on which the sync agent is hosted. @@ -146,7 +146,7 @@ func (client *SyncAgentsClient) BeginDelete(ctx context.Context, resourceGroupNa // Delete - Deletes a sync agent. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview func (client *SyncAgentsClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, syncAgentName string, options *SyncAgentsClientBeginDeleteOptions) (*http.Response, error) { var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, syncAgentName, options) @@ -188,7 +188,7 @@ func (client *SyncAgentsClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -196,7 +196,7 @@ func (client *SyncAgentsClient) deleteCreateRequest(ctx context.Context, resourc // GenerateKey - Generates a sync agent key. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server on which the sync agent is hosted. @@ -244,7 +244,7 @@ func (client *SyncAgentsClient) generateKeyCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -262,7 +262,7 @@ func (client *SyncAgentsClient) generateKeyHandleResponse(resp *http.Response) ( // Get - Gets a sync agent. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server on which the sync agent is hosted. @@ -310,7 +310,7 @@ func (client *SyncAgentsClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -327,7 +327,7 @@ func (client *SyncAgentsClient) getHandleResponse(resp *http.Response) (SyncAgen // NewListByServerPager - Lists sync agents in a server. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server on which the sync agent is hosted. @@ -381,7 +381,7 @@ func (client *SyncAgentsClient) listByServerCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -398,7 +398,7 @@ func (client *SyncAgentsClient) listByServerHandleResponse(resp *http.Response) // NewListLinkedDatabasesPager - Lists databases linked to a sync agent. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server on which the sync agent is hosted. @@ -457,7 +457,7 @@ func (client *SyncAgentsClient) listLinkedDatabasesCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/syncagents_client_example_test.go b/sdk/resourcemanager/sql/armsql/syncagents_client_example_test.go deleted file mode 100644 index e4a6ae8ba48f..000000000000 --- a/sdk/resourcemanager/sql/armsql/syncagents_client_example_test.go +++ /dev/null @@ -1,254 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncAgentGet.json -func ExampleSyncAgentsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSyncAgentsClient().Get(ctx, "syncagentcrud-65440", "syncagentcrud-8475", "syncagentcrud-3187", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SyncAgent = armsql.SyncAgent{ - // Name: to.Ptr("syncagent"), - // Type: to.Ptr("Microsoft.Sql/servers/syncAgents"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-Onebox/providers/Microsoft.Sql/servers/syncagentcrud-8475/syncAgents/syncagentcrud-3187"), - // Properties: &armsql.SyncAgentProperties{ - // ExpiryTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "9999-12-31T23:59:59.9999999Z"); return t}()), - // IsUpToDate: to.Ptr(true), - // State: to.Ptr(armsql.SyncAgentStateNeverConnected), - // SyncDatabaseID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-Onebox/providers/Microsoft.Sql/servers/syncagentcrud-8475/databases/sync"), - // Version: to.Ptr("4.2.0.0"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncAgentCreate.json -func ExampleSyncAgentsClient_BeginCreateOrUpdate_createANewSyncAgent() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSyncAgentsClient().BeginCreateOrUpdate(ctx, "syncagentcrud-65440", "syncagentcrud-8475", "syncagentcrud-3187", armsql.SyncAgent{ - Properties: &armsql.SyncAgentProperties{ - SyncDatabaseID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-Onebox/providers/Microsoft.Sql/servers/syncagentcrud-8475/databases/sync"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SyncAgent = armsql.SyncAgent{ - // Name: to.Ptr("syncagent"), - // Type: to.Ptr("Microsoft.Sql/servers/syncAgents"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-Onebox/providers/Microsoft.Sql/servers/syncagentcrud-8475/syncAgents/syncagentcrud-3187"), - // Properties: &armsql.SyncAgentProperties{ - // ExpiryTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "9999-12-31T23:59:59.9999999Z"); return t}()), - // IsUpToDate: to.Ptr(true), - // State: to.Ptr(armsql.SyncAgentStateNeverConnected), - // SyncDatabaseID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-Onebox/providers/Microsoft.Sql/servers/syncagentcrud-8475/databases/sync"), - // Version: to.Ptr("4.2.0.0"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncAgentUpdate.json -func ExampleSyncAgentsClient_BeginCreateOrUpdate_updateASyncAgent() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSyncAgentsClient().BeginCreateOrUpdate(ctx, "syncagentcrud-65440", "syncagentcrud-8475", "syncagentcrud-3187", armsql.SyncAgent{ - Properties: &armsql.SyncAgentProperties{ - SyncDatabaseID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-Onebox/providers/Microsoft.Sql/servers/syncagentcrud-8475/databases/sync"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SyncAgent = armsql.SyncAgent{ - // Name: to.Ptr("syncagent"), - // Type: to.Ptr("Microsoft.Sql/servers/syncAgents"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-Onebox/providers/Microsoft.Sql/servers/syncagentcrud-8475/syncAgents/syncagentcrud-3187"), - // Properties: &armsql.SyncAgentProperties{ - // ExpiryTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "9999-12-31T23:59:59.9999999Z"); return t}()), - // IsUpToDate: to.Ptr(true), - // State: to.Ptr(armsql.SyncAgentStateNeverConnected), - // SyncDatabaseID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-Onebox/providers/Microsoft.Sql/servers/syncagentcrud-8475/databases/sync"), - // Version: to.Ptr("4.2.0.0"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncAgentDelete.json -func ExampleSyncAgentsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSyncAgentsClient().BeginDelete(ctx, "syncagentcrud-65440", "syncagentcrud-8475", "syncagentcrud-3187", 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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncAgentListByServer.json -func ExampleSyncAgentsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSyncAgentsClient().NewListByServerPager("syncagentcrud-65440", "syncagentcrud-8475", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SyncAgentListResult = armsql.SyncAgentListResult{ - // Value: []*armsql.SyncAgent{ - // { - // Name: to.Ptr("syncagent"), - // Type: to.Ptr("Microsoft.Sql/servers/syncAgents"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-Onebox/providers/Microsoft.Sql/servers/syncagentcrud-8475/syncAgents/syncagentcrud-3187"), - // Properties: &armsql.SyncAgentProperties{ - // ExpiryTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "9999-12-31T23:59:59.9999999Z"); return t}()), - // IsUpToDate: to.Ptr(true), - // State: to.Ptr(armsql.SyncAgentStateNeverConnected), - // SyncDatabaseID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-Onebox/providers/Microsoft.Sql/servers/syncagentcrud-8475/databases/sync"), - // Version: to.Ptr("4.2.0.0"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncAgentGenerateKey.json -func ExampleSyncAgentsClient_GenerateKey() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSyncAgentsClient().GenerateKey(ctx, "syncagentcrud-65440", "syncagentcrud-8475", "syncagentcrud-3187", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SyncAgentKeyProperties = armsql.SyncAgentKeyProperties{ - // SyncAgentKey: to.Ptr("865f9998-6dae-4214-bbb1-4796b7c76ca0:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX=:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX="), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncAgentGetLinkedDatabases.json -func ExampleSyncAgentsClient_NewListLinkedDatabasesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSyncAgentsClient().NewListLinkedDatabasesPager("syncagentcrud-65440", "syncagentcrud-8475", "syncagentcrud-3187", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SyncAgentLinkedDatabaseListResult = armsql.SyncAgentLinkedDatabaseListResult{ - // Value: []*armsql.SyncAgentLinkedDatabase{ - // { - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-Onebox/providers/Microsoft.Sql/servers/syncagentcrud-8475/syncAgents/syncagentcrud-3187/linkedDatabases/55555555-6666-7777-8888-999999999999"), - // Properties: &armsql.SyncAgentLinkedDatabaseProperties{ - // Description: to.Ptr(""), - // DatabaseID: to.Ptr("55555555-6666-7777-8888-999999999999"), - // DatabaseName: to.Ptr("DummySqlServerDb"), - // DatabaseType: to.Ptr(armsql.SyncMemberDbTypeSQLServerDatabase), - // ServerName: to.Ptr("DummySqlServer"), - // UserName: to.Ptr("DummyUser"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/sql/armsql/syncgroups_client.go b/sdk/resourcemanager/sql/armsql/syncgroups_client.go index a32adedfe74b..fb5213ce9521 100644 --- a/sdk/resourcemanager/sql/armsql/syncgroups_client.go +++ b/sdk/resourcemanager/sql/armsql/syncgroups_client.go @@ -46,7 +46,7 @@ func NewSyncGroupsClient(subscriptionID string, credential azcore.TokenCredentia // CancelSync - Cancels a sync group synchronization. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -98,7 +98,7 @@ func (client *SyncGroupsClient) cancelSyncCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -106,7 +106,7 @@ func (client *SyncGroupsClient) cancelSyncCreateRequest(ctx context.Context, res // BeginCreateOrUpdate - Creates or updates a sync group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -131,7 +131,7 @@ func (client *SyncGroupsClient) BeginCreateOrUpdate(ctx context.Context, resourc // CreateOrUpdate - Creates or updates a sync group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview func (client *SyncGroupsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, parameters SyncGroup, options *SyncGroupsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, syncGroupName, parameters, options) @@ -177,7 +177,7 @@ func (client *SyncGroupsClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -189,7 +189,7 @@ func (client *SyncGroupsClient) createOrUpdateCreateRequest(ctx context.Context, // BeginDelete - Deletes a sync group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -212,7 +212,7 @@ func (client *SyncGroupsClient) BeginDelete(ctx context.Context, resourceGroupNa // Delete - Deletes a sync group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview func (client *SyncGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, options *SyncGroupsClientBeginDeleteOptions) (*http.Response, error) { var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, databaseName, syncGroupName, options) @@ -258,7 +258,7 @@ func (client *SyncGroupsClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -266,7 +266,7 @@ func (client *SyncGroupsClient) deleteCreateRequest(ctx context.Context, resourc // Get - Gets a sync group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -319,7 +319,7 @@ func (client *SyncGroupsClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -336,7 +336,7 @@ func (client *SyncGroupsClient) getHandleResponse(resp *http.Response) (SyncGrou // NewListByDatabasePager - Lists sync groups under a hub database. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -395,7 +395,7 @@ func (client *SyncGroupsClient) listByDatabaseCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -412,7 +412,7 @@ func (client *SyncGroupsClient) listByDatabaseHandleResponse(resp *http.Response // NewListHubSchemasPager - Gets a collection of hub database schemas. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -476,7 +476,7 @@ func (client *SyncGroupsClient) listHubSchemasCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -493,7 +493,7 @@ func (client *SyncGroupsClient) listHubSchemasHandleResponse(resp *http.Response // NewListLogsPager - Gets a collection of sync group logs. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -565,7 +565,7 @@ func (client *SyncGroupsClient) listLogsCreateRequest(ctx context.Context, resou if options != nil && options.ContinuationToken != nil { reqQP.Set("continuationToken", *options.ContinuationToken) } - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -582,7 +582,7 @@ func (client *SyncGroupsClient) listLogsHandleResponse(resp *http.Response) (Syn // NewListSyncDatabaseIDsPager - Gets a collection of sync database ids. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - locationName - The name of the region where the resource is located. // - options - SyncGroupsClientListSyncDatabaseIDsOptions contains the optional parameters for the SyncGroupsClient.NewListSyncDatabaseIDsPager // method. @@ -630,7 +630,7 @@ func (client *SyncGroupsClient) listSyncDatabaseIDsCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -648,7 +648,7 @@ func (client *SyncGroupsClient) listSyncDatabaseIDsHandleResponse(resp *http.Res // BeginRefreshHubSchema - Refreshes a hub database schema. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -672,7 +672,7 @@ func (client *SyncGroupsClient) BeginRefreshHubSchema(ctx context.Context, resou // RefreshHubSchema - Refreshes a hub database schema. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview func (client *SyncGroupsClient) refreshHubSchema(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, options *SyncGroupsClientBeginRefreshHubSchemaOptions) (*http.Response, error) { var err error req, err := client.refreshHubSchemaCreateRequest(ctx, resourceGroupName, serverName, databaseName, syncGroupName, options) @@ -718,7 +718,7 @@ func (client *SyncGroupsClient) refreshHubSchemaCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -726,7 +726,7 @@ func (client *SyncGroupsClient) refreshHubSchemaCreateRequest(ctx context.Contex // TriggerSync - Triggers a sync group synchronization. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -778,7 +778,7 @@ func (client *SyncGroupsClient) triggerSyncCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -786,7 +786,7 @@ func (client *SyncGroupsClient) triggerSyncCreateRequest(ctx context.Context, re // BeginUpdate - Updates a sync group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -810,7 +810,7 @@ func (client *SyncGroupsClient) BeginUpdate(ctx context.Context, resourceGroupNa // Update - Updates a sync group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview func (client *SyncGroupsClient) update(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, parameters SyncGroup, options *SyncGroupsClientBeginUpdateOptions) (*http.Response, error) { var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, serverName, databaseName, syncGroupName, parameters, options) @@ -856,7 +856,7 @@ func (client *SyncGroupsClient) updateCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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/sql/armsql/syncgroups_client_example_test.go b/sdk/resourcemanager/sql/armsql/syncgroups_client_example_test.go deleted file mode 100644 index e9f037102780..000000000000 --- a/sdk/resourcemanager/sql/armsql/syncgroups_client_example_test.go +++ /dev/null @@ -1,460 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupGetSyncDatabaseId.json -func ExampleSyncGroupsClient_NewListSyncDatabaseIDsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSyncGroupsClient().NewListSyncDatabaseIDsPager("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.SyncDatabaseIDListResult = armsql.SyncDatabaseIDListResult{ - // Value: []*armsql.SyncDatabaseIDProperties{ - // { - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-3521/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupRefreshHubSchema.json -func ExampleSyncGroupsClient_BeginRefreshHubSchema() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSyncGroupsClient().BeginRefreshHubSchema(ctx, "syncgroupcrud-65440", "syncgroupcrud-8475", "syncgroupcrud-4328", "syncgroupcrud-3187", 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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupGetHubSchema.json -func ExampleSyncGroupsClient_NewListHubSchemasPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSyncGroupsClient().NewListHubSchemasPager("syncgroupcrud-65440", "syncgroupcrud-8475", "syncgroupcrud-4328", "syncgroupcrud-3187", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SyncFullSchemaPropertiesListResult = armsql.SyncFullSchemaPropertiesListResult{ - // Value: []*armsql.SyncFullSchemaProperties{ - // { - // LastUpdateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-30T07:16:08.21Z"); return t}()), - // Tables: []*armsql.SyncFullSchemaTable{ - // { - // Name: to.Ptr("dbo.myTable"), - // Columns: []*armsql.SyncFullSchemaTableColumn{ - // { - // Name: to.Ptr("intField"), - // DataSize: to.Ptr("4"), - // DataType: to.Ptr("int"), - // HasError: to.Ptr(false), - // IsPrimaryKey: to.Ptr(false), - // QuotedName: to.Ptr("[intField]"), - // }, - // { - // Name: to.Ptr("charField"), - // DataSize: to.Ptr("100"), - // DataType: to.Ptr("nvarchar"), - // HasError: to.Ptr(false), - // IsPrimaryKey: to.Ptr(false), - // QuotedName: to.Ptr("[charField]"), - // }}, - // ErrorID: to.Ptr("Schema_TableHasNoPrimaryKey"), - // HasError: to.Ptr(true), - // QuotedName: to.Ptr("[dbo].[myTable]"), - // }}, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupGetLog.json -func ExampleSyncGroupsClient_NewListLogsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSyncGroupsClient().NewListLogsPager("syncgroupcrud-65440", "syncgroupcrud-8475", "syncgroupcrud-4328", "syncgroupcrud-3187", "2017-01-01T00:00:00", "2017-12-31T00:00:00", armsql.SyncGroupsTypeAll, &armsql.SyncGroupsClientListLogsOptions{ContinuationToken: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SyncGroupLogListResult = armsql.SyncGroupLogListResult{ - // Value: []*armsql.SyncGroupLogProperties{ - // { - // Type: to.Ptr(armsql.SyncGroupLogTypeSuccess), - // OperationStatus: to.Ptr("SchemaRefreshSuccess"), - // Source: to.Ptr("syncgroupcrud-8475.database.windows.net/hub"), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-30T07:16:08.25Z"); return t}()), - // TracingID: to.Ptr("c0480c8e-6269-424e-9404-b00efce0ebae"), - // Details: to.Ptr("Schema information obtained successfully."), - // }, - // { - // Type: to.Ptr(armsql.SyncGroupLogTypeError), - // OperationStatus: to.Ptr("SchemaRefreshFailure"), - // Source: to.Ptr("syncgroupcrud-8475.database.windows.net/member"), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-30T07:03:37.5733333Z"); return t}()), - // TracingID: to.Ptr("cd3aa28c-0c31-471f-8a77-f1b21c908cbd"), - // Details: to.Ptr("Getting schema information for the database failed with the exception \"Failed to connect to server .\nInner exception: SqlException Error Code: -2146232060 - SqlError Number:53, Message: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) \nInner exception: The network path was not found\n For more information, provide tracing ID ‘cd3aa28c-0c31-471f-8a77-f1b21c908cbd’ to customer support.\""), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupCancelSync.json -func ExampleSyncGroupsClient_CancelSync() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewSyncGroupsClient().CancelSync(ctx, "syncgroupcrud-65440", "syncgroupcrud-8475", "syncgroupcrud-4328", "syncgroupcrud-3187", 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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupTriggerSync.json -func ExampleSyncGroupsClient_TriggerSync() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewSyncGroupsClient().TriggerSync(ctx, "syncgroupcrud-65440", "syncgroupcrud-8475", "syncgroupcrud-4328", "syncgroupcrud-3187", 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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupGet.json -func ExampleSyncGroupsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSyncGroupsClient().Get(ctx, "syncgroupcrud-65440", "syncgroupcrud-8475", "syncgroupcrud-4328", "syncgroupcrud-3187", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SyncGroup = armsql.SyncGroup{ - // Name: to.Ptr("syncgroupcrud-3187"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/syncGroups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-3521/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328/syncGroups/syncgroupcrud-3187"), - // Properties: &armsql.SyncGroupProperties{ - // ConflictResolutionPolicy: to.Ptr(armsql.SyncConflictResolutionPolicyHubWin), - // HubDatabaseUserName: to.Ptr("hubUser"), - // Interval: to.Ptr[int32](-1), - // LastSyncTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "0001-01-01T08:00:00Z"); return t}()), - // PrivateEndpointName: to.Ptr("PE_67FDBBD6-B2D8-4014-9CC6-C68ABBCFD481_syncgroupcrud-3187"), - // SyncDatabaseID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-3521/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328"), - // SyncState: to.Ptr(armsql.SyncGroupStateNotReady), - // UsePrivateLinkConnection: to.Ptr(true), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupCreate.json -func ExampleSyncGroupsClient_BeginCreateOrUpdate_createASyncGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSyncGroupsClient().BeginCreateOrUpdate(ctx, "syncgroupcrud-65440", "syncgroupcrud-8475", "syncgroupcrud-4328", "syncgroupcrud-3187", armsql.SyncGroup{ - Properties: &armsql.SyncGroupProperties{ - ConflictResolutionPolicy: to.Ptr(armsql.SyncConflictResolutionPolicyHubWin), - HubDatabaseUserName: to.Ptr("hubUser"), - Interval: to.Ptr[int32](-1), - SyncDatabaseID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-3521/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328"), - UsePrivateLinkConnection: 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.SyncGroup = armsql.SyncGroup{ - // Name: to.Ptr("syncgroupcrud-3187"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/syncGroups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-3521/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328/syncGroups/syncgroupcrud-3187"), - // Properties: &armsql.SyncGroupProperties{ - // ConflictResolutionPolicy: to.Ptr(armsql.SyncConflictResolutionPolicyHubWin), - // HubDatabaseUserName: to.Ptr("hubUser"), - // Interval: to.Ptr[int32](-1), - // LastSyncTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "0001-01-01T08:00:00Z"); return t}()), - // PrivateEndpointName: to.Ptr("PE_67FDBBD6-B2D8-4014-9CC6-C68ABBCFD481_syncgroupcrud-8475"), - // SyncDatabaseID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-3521/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328"), - // SyncState: to.Ptr(armsql.SyncGroupStateNotReady), - // UsePrivateLinkConnection: to.Ptr(true), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupUpdate.json -func ExampleSyncGroupsClient_BeginCreateOrUpdate_updateASyncGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSyncGroupsClient().BeginCreateOrUpdate(ctx, "syncgroupcrud-65440", "syncgroupcrud-8475", "syncgroupcrud-4328", "syncgroupcrud-3187", armsql.SyncGroup{ - Properties: &armsql.SyncGroupProperties{ - ConflictResolutionPolicy: to.Ptr(armsql.SyncConflictResolutionPolicyHubWin), - HubDatabaseUserName: to.Ptr("hubUser"), - Interval: to.Ptr[int32](-1), - SyncDatabaseID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-3521/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328"), - UsePrivateLinkConnection: 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.SyncGroup = armsql.SyncGroup{ - // Name: to.Ptr("syncgroupcrud-3187"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/syncGroups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-3521/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328/syncGroups/syncgroupcrud-3187"), - // Properties: &armsql.SyncGroupProperties{ - // ConflictResolutionPolicy: to.Ptr(armsql.SyncConflictResolutionPolicyHubWin), - // HubDatabaseUserName: to.Ptr("hubUser"), - // Interval: to.Ptr[int32](-1), - // LastSyncTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "0001-01-01T08:00:00Z"); return t}()), - // PrivateEndpointName: to.Ptr("PE_67FDBBD6-B2D8-4014-9CC6-C68ABBCFD481_syncgroupcrud-3187"), - // SyncDatabaseID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-3521/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328"), - // SyncState: to.Ptr(armsql.SyncGroupStateNotReady), - // UsePrivateLinkConnection: to.Ptr(true), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupDelete.json -func ExampleSyncGroupsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSyncGroupsClient().BeginDelete(ctx, "syncgroupcrud-65440", "syncgroupcrud-8475", "syncgroupcrud-4328", "syncgroupcrud-3187", 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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupPatch.json -func ExampleSyncGroupsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSyncGroupsClient().BeginUpdate(ctx, "syncgroupcrud-65440", "syncgroupcrud-8475", "syncgroupcrud-4328", "syncgroupcrud-3187", armsql.SyncGroup{ - Properties: &armsql.SyncGroupProperties{ - ConflictResolutionPolicy: to.Ptr(armsql.SyncConflictResolutionPolicyHubWin), - HubDatabasePassword: to.Ptr("hubPassword"), - HubDatabaseUserName: to.Ptr("hubUser"), - Interval: to.Ptr[int32](-1), - SyncDatabaseID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-3521/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328"), - UsePrivateLinkConnection: 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.SyncGroup = armsql.SyncGroup{ - // Name: to.Ptr("syncgroup"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/syncGroups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-3521/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328/syncGroups/syncgroupcrud-3187"), - // Properties: &armsql.SyncGroupProperties{ - // ConflictResolutionPolicy: to.Ptr(armsql.SyncConflictResolutionPolicyHubWin), - // HubDatabaseUserName: to.Ptr("hubUser"), - // Interval: to.Ptr[int32](-1), - // LastSyncTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "0001-01-01T08:00:00Z"); return t}()), - // PrivateEndpointName: to.Ptr("PE_67FDBBD6-B2D8-4014-9CC6-C68ABBCFD481_syncgroupcrud-3187"), - // SyncDatabaseID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-3521/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328"), - // SyncState: to.Ptr(armsql.SyncGroupStateNotReady), - // UsePrivateLinkConnection: to.Ptr(true), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupListByDatabase.json -func ExampleSyncGroupsClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSyncGroupsClient().NewListByDatabasePager("syncgroupcrud-65440", "syncgroupcrud-8475", "syncgroupcrud-4328", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SyncGroupListResult = armsql.SyncGroupListResult{ - // Value: []*armsql.SyncGroup{ - // { - // Name: to.Ptr("syncgroupcrud-3187"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/syncGroups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-3521/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328/syncGroups/syncgroupcrud-3187"), - // Properties: &armsql.SyncGroupProperties{ - // ConflictResolutionPolicy: to.Ptr(armsql.SyncConflictResolutionPolicyHubWin), - // HubDatabaseUserName: to.Ptr("hubUser"), - // Interval: to.Ptr[int32](-1), - // LastSyncTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "0001-01-01T08:00:00Z"); return t}()), - // PrivateEndpointName: to.Ptr("PE_67FDBBD6-B2D8-4014-9CC6-C68ABBCFD481_syncgroupcrud-3187"), - // SyncDatabaseID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-3521/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328"), - // SyncState: to.Ptr(armsql.SyncGroupStateNotReady), - // UsePrivateLinkConnection: to.Ptr(true), - // }, - // }, - // { - // Name: to.Ptr("syncgroupcrud-5374"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/syncGroups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-3521/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328/syncGroups/syncgroupcrud-5374"), - // Properties: &armsql.SyncGroupProperties{ - // ConflictResolutionPolicy: to.Ptr(armsql.SyncConflictResolutionPolicyHubWin), - // HubDatabaseUserName: to.Ptr("hubUser"), - // Interval: to.Ptr[int32](-1), - // LastSyncTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "0001-01-01T08:00:00Z"); return t}()), - // PrivateEndpointName: to.Ptr("PE_67FDBBD6-B2D8-4014-9CC6-C68ABBCFD481_syncgroupcrud-5374"), - // SyncDatabaseID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-3521/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328"), - // SyncState: to.Ptr(armsql.SyncGroupStateNotReady), - // UsePrivateLinkConnection: to.Ptr(true), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/sql/armsql/syncmembers_client.go b/sdk/resourcemanager/sql/armsql/syncmembers_client.go index 6c4e9c7da081..4c33540e9e22 100644 --- a/sdk/resourcemanager/sql/armsql/syncmembers_client.go +++ b/sdk/resourcemanager/sql/armsql/syncmembers_client.go @@ -46,7 +46,7 @@ func NewSyncMembersClient(subscriptionID string, credential azcore.TokenCredenti // BeginCreateOrUpdate - Creates or updates a sync member. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -72,7 +72,7 @@ func (client *SyncMembersClient) BeginCreateOrUpdate(ctx context.Context, resour // CreateOrUpdate - Creates or updates a sync member. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview func (client *SyncMembersClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string, parameters SyncMember, options *SyncMembersClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, parameters, options) @@ -122,7 +122,7 @@ func (client *SyncMembersClient) createOrUpdateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -134,7 +134,7 @@ func (client *SyncMembersClient) createOrUpdateCreateRequest(ctx context.Context // BeginDelete - Deletes a sync member. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -158,7 +158,7 @@ func (client *SyncMembersClient) BeginDelete(ctx context.Context, resourceGroupN // Delete - Deletes a sync member. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview func (client *SyncMembersClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string, options *SyncMembersClientBeginDeleteOptions) (*http.Response, error) { var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, options) @@ -208,7 +208,7 @@ func (client *SyncMembersClient) deleteCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -216,7 +216,7 @@ func (client *SyncMembersClient) deleteCreateRequest(ctx context.Context, resour // Get - Gets a sync member. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -274,7 +274,7 @@ func (client *SyncMembersClient) getCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -291,7 +291,7 @@ func (client *SyncMembersClient) getHandleResponse(resp *http.Response) (SyncMem // NewListBySyncGroupPager - Lists sync members in the given sync group. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -355,7 +355,7 @@ func (client *SyncMembersClient) listBySyncGroupCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -372,7 +372,7 @@ func (client *SyncMembersClient) listBySyncGroupHandleResponse(resp *http.Respon // NewListMemberSchemasPager - Gets a sync member database schema. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -441,7 +441,7 @@ func (client *SyncMembersClient) listMemberSchemasCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -459,7 +459,7 @@ func (client *SyncMembersClient) listMemberSchemasHandleResponse(resp *http.Resp // BeginRefreshMemberSchema - Refreshes a sync member database schema. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -484,7 +484,7 @@ func (client *SyncMembersClient) BeginRefreshMemberSchema(ctx context.Context, r // RefreshMemberSchema - Refreshes a sync member database schema. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview func (client *SyncMembersClient) refreshMemberSchema(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string, options *SyncMembersClientBeginRefreshMemberSchemaOptions) (*http.Response, error) { var err error req, err := client.refreshMemberSchemaCreateRequest(ctx, resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, options) @@ -534,7 +534,7 @@ func (client *SyncMembersClient) refreshMemberSchemaCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -542,7 +542,7 @@ func (client *SyncMembersClient) refreshMemberSchemaCreateRequest(ctx context.Co // BeginUpdate - Updates an existing sync member. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -567,7 +567,7 @@ func (client *SyncMembersClient) BeginUpdate(ctx context.Context, resourceGroupN // Update - Updates an existing sync member. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview func (client *SyncMembersClient) update(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string, parameters SyncMember, options *SyncMembersClientBeginUpdateOptions) (*http.Response, error) { var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, parameters, options) @@ -617,7 +617,7 @@ func (client *SyncMembersClient) updateCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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/sql/armsql/syncmembers_client_example_test.go b/sdk/resourcemanager/sql/armsql/syncmembers_client_example_test.go deleted file mode 100644 index 83a2dae0b99c..000000000000 --- a/sdk/resourcemanager/sql/armsql/syncmembers_client_example_test.go +++ /dev/null @@ -1,346 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberGet.json -func ExampleSyncMembersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSyncMembersClient().Get(ctx, "syncgroupcrud-65440", "syncgroupcrud-8475", "syncgroupcrud-4328", "syncgroupcrud-3187", "syncmembercrud-4879", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SyncMember = armsql.SyncMember{ - // Name: to.Ptr("syncmembercrud-4879"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/syncGroups/syncMembers"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-65440/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328/syncGroups/syncgroupcrud-3187/syncMembers/syncmembercrud-4879"), - // Properties: &armsql.SyncMemberProperties{ - // DatabaseName: to.Ptr("syncgroupcrud-7421"), - // DatabaseType: to.Ptr(armsql.SyncMemberDbTypeAzureSQLDatabase), - // PrivateEndpointName: to.Ptr("PE_67FDBBD6-B2D8-4014-9CC6-C68ABBCFD481_syncmembercrud-4879"), - // ServerName: to.Ptr("syncgroupcrud-3379.database.windows.net"), - // SyncDirection: to.Ptr(armsql.SyncDirectionBidirectional), - // SyncMemberAzureDatabaseResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-65440/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328"), - // SyncState: to.Ptr(armsql.SyncMemberStateUnProvisioned), - // UsePrivateLinkConnection: to.Ptr(true), - // UserName: to.Ptr("myUser"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberCreate.json -func ExampleSyncMembersClient_BeginCreateOrUpdate_createANewSyncMember() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSyncMembersClient().BeginCreateOrUpdate(ctx, "syncgroupcrud-65440", "syncgroupcrud-8475", "syncgroupcrud-4328", "syncgroupcrud-3187", "syncmembercrud-4879", armsql.SyncMember{ - Properties: &armsql.SyncMemberProperties{ - DatabaseName: to.Ptr("syncgroupcrud-7421"), - DatabaseType: to.Ptr(armsql.SyncMemberDbTypeAzureSQLDatabase), - ServerName: to.Ptr("syncgroupcrud-3379.database.windows.net"), - SyncDirection: to.Ptr(armsql.SyncDirectionBidirectional), - SyncMemberAzureDatabaseResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-65440/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328"), - UsePrivateLinkConnection: to.Ptr(true), - UserName: to.Ptr("myUser"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SyncMember = armsql.SyncMember{ - // Name: to.Ptr("syncmembercrud-4879"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/syncGroups/syncMembers"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-65440/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328/syncGroups/syncgroupcrud-3187/syncMembers/syncmembercrud-4879"), - // Properties: &armsql.SyncMemberProperties{ - // DatabaseName: to.Ptr("syncgroupcrud-7421"), - // DatabaseType: to.Ptr(armsql.SyncMemberDbTypeAzureSQLDatabase), - // PrivateEndpointName: to.Ptr("PE_67FDBBD6-B2D8-4014-9CC6-C68ABBCFD481_syncmembercrud-4879"), - // ServerName: to.Ptr("syncgroupcrud-3379.database.windows.net"), - // SyncDirection: to.Ptr(armsql.SyncDirectionBidirectional), - // SyncMemberAzureDatabaseResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-65440/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328"), - // SyncState: to.Ptr(armsql.SyncMemberStateUnProvisioned), - // UsePrivateLinkConnection: to.Ptr(true), - // UserName: to.Ptr("myUser"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberUpdate.json -func ExampleSyncMembersClient_BeginCreateOrUpdate_updateASyncMember() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSyncMembersClient().BeginCreateOrUpdate(ctx, "syncgroupcrud-65440", "syncgroupcrud-8475", "syncgroupcrud-4328", "syncgroupcrud-3187", "syncmembercrud-4879", armsql.SyncMember{ - Properties: &armsql.SyncMemberProperties{ - DatabaseName: to.Ptr("syncgroupcrud-7421"), - DatabaseType: to.Ptr(armsql.SyncMemberDbTypeAzureSQLDatabase), - ServerName: to.Ptr("syncgroupcrud-3379.database.windows.net"), - SyncDirection: to.Ptr(armsql.SyncDirectionBidirectional), - SyncMemberAzureDatabaseResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-65440/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328"), - UsePrivateLinkConnection: to.Ptr(true), - UserName: to.Ptr("myUser"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SyncMember = armsql.SyncMember{ - // Name: to.Ptr("syncmembercrud-4879"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/syncGroups/syncMembers"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-65440/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328/syncGroups/syncgroupcrud-3187/syncMembers/syncmembercrud-4879"), - // Properties: &armsql.SyncMemberProperties{ - // DatabaseName: to.Ptr("syncgroupcrud-7421"), - // DatabaseType: to.Ptr(armsql.SyncMemberDbTypeAzureSQLDatabase), - // PrivateEndpointName: to.Ptr("PE_67FDBBD6-B2D8-4014-9CC6-C68ABBCFD481_syncmembercrud-4879"), - // ServerName: to.Ptr("syncgroupcrud-3379.database.windows.net"), - // SyncDirection: to.Ptr(armsql.SyncDirectionBidirectional), - // SyncMemberAzureDatabaseResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-65440/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328"), - // SyncState: to.Ptr(armsql.SyncMemberStateUnProvisioned), - // UsePrivateLinkConnection: to.Ptr(true), - // UserName: to.Ptr("myUser"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberDelete.json -func ExampleSyncMembersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSyncMembersClient().BeginDelete(ctx, "syncgroupcrud-65440", "syncgroupcrud-8475", "syncgroupcrud-4328", "syncgroupcrud-3187", "syncgroupcrud-4879", 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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberPatch.json -func ExampleSyncMembersClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSyncMembersClient().BeginUpdate(ctx, "syncgroupcrud-65440", "syncgroupcrud-8475", "syncgroupcrud-4328", "syncgroupcrud-3187", "syncmembercrud-4879", armsql.SyncMember{ - Properties: &armsql.SyncMemberProperties{ - DatabaseName: to.Ptr("syncgroupcrud-7421"), - DatabaseType: to.Ptr(armsql.SyncMemberDbTypeAzureSQLDatabase), - ServerName: to.Ptr("syncgroupcrud-3379.database.windows.net"), - SyncDirection: to.Ptr(armsql.SyncDirectionBidirectional), - SyncMemberAzureDatabaseResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-65440/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328"), - UsePrivateLinkConnection: to.Ptr(true), - UserName: to.Ptr("myUser"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SyncMember = armsql.SyncMember{ - // Name: to.Ptr("syncmembercrud-4879"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/syncGroups/syncMembers"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-65440/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328/syncGroups/syncgroupcrud-3187/syncMembers/syncmembercrud-4879"), - // Properties: &armsql.SyncMemberProperties{ - // DatabaseName: to.Ptr("syncgroupcrud-7421"), - // DatabaseType: to.Ptr(armsql.SyncMemberDbTypeAzureSQLDatabase), - // PrivateEndpointName: to.Ptr("PE_67FDBBD6-B2D8-4014-9CC6-C68ABBCFD481_syncmembercrud-4879"), - // ServerName: to.Ptr("syncgroupcrud-3379.database.windows.net"), - // SyncDirection: to.Ptr(armsql.SyncDirectionBidirectional), - // SyncMemberAzureDatabaseResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-65440/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328"), - // SyncState: to.Ptr(armsql.SyncMemberStateUnProvisioned), - // UsePrivateLinkConnection: to.Ptr(true), - // UserName: to.Ptr("myUser"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberListBySyncGroup.json -func ExampleSyncMembersClient_NewListBySyncGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSyncMembersClient().NewListBySyncGroupPager("syncgroupcrud-65440", "syncgroupcrud-8475", "syncgroupcrud-4328", "syncgroupcrud-3187", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SyncMemberListResult = armsql.SyncMemberListResult{ - // Value: []*armsql.SyncMember{ - // { - // Name: to.Ptr("syncmembercrud-4879"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/syncGroups/syncMembers"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-65440/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328/syncGroups/syncgroupcrud-3187/syncMembers/syncmembercrud-4879"), - // Properties: &armsql.SyncMemberProperties{ - // DatabaseName: to.Ptr("syncgroupcrud-7421"), - // DatabaseType: to.Ptr(armsql.SyncMemberDbTypeAzureSQLDatabase), - // PrivateEndpointName: to.Ptr("PE_67FDBBD6-B2D8-4014-9CC6-C68ABBCFD481_syncmembercrud-4879"), - // ServerName: to.Ptr("syncgroupcrud-3379.database.windows.net"), - // SyncDirection: to.Ptr(armsql.SyncDirectionBidirectional), - // SyncMemberAzureDatabaseResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-65440/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328"), - // SyncState: to.Ptr(armsql.SyncMemberStateUnProvisioned), - // UsePrivateLinkConnection: to.Ptr(true), - // UserName: to.Ptr("myUser"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberGetSchema.json -func ExampleSyncMembersClient_NewListMemberSchemasPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSyncMembersClient().NewListMemberSchemasPager("syncgroupcrud-65440", "syncgroupcrud-8475", "syncgroupcrud-4328", "syncgroupcrud-3187", "syncgroupcrud-4879", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SyncFullSchemaPropertiesListResult = armsql.SyncFullSchemaPropertiesListResult{ - // Value: []*armsql.SyncFullSchemaProperties{ - // { - // LastUpdateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-30T07:16:08.21Z"); return t}()), - // Tables: []*armsql.SyncFullSchemaTable{ - // { - // Name: to.Ptr("dbo.myTable"), - // Columns: []*armsql.SyncFullSchemaTableColumn{ - // { - // Name: to.Ptr("intField"), - // DataSize: to.Ptr("4"), - // DataType: to.Ptr("int"), - // HasError: to.Ptr(false), - // IsPrimaryKey: to.Ptr(false), - // QuotedName: to.Ptr("[intField]"), - // }, - // { - // Name: to.Ptr("charField"), - // DataSize: to.Ptr("100"), - // DataType: to.Ptr("nvarchar"), - // HasError: to.Ptr(false), - // IsPrimaryKey: to.Ptr(false), - // QuotedName: to.Ptr("[charField]"), - // }}, - // ErrorID: to.Ptr("Schema_TableHasNoPrimaryKey"), - // HasError: to.Ptr(true), - // QuotedName: to.Ptr("[dbo].[myTable]"), - // }}, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberRefreshSchema.json -func ExampleSyncMembersClient_BeginRefreshMemberSchema() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSyncMembersClient().BeginRefreshMemberSchema(ctx, "syncgroupcrud-65440", "syncgroupcrud-8475", "syncgroupcrud-4328", "syncgroupcrud-3187", "syncgroupcrud-4879", 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/sql/armsql/tdecertificates_client.go b/sdk/resourcemanager/sql/armsql/tdecertificates_client.go index 263e81fbe1b1..a6fcfb3db491 100644 --- a/sdk/resourcemanager/sql/armsql/tdecertificates_client.go +++ b/sdk/resourcemanager/sql/armsql/tdecertificates_client.go @@ -46,7 +46,7 @@ func NewTdeCertificatesClient(subscriptionID string, credential azcore.TokenCred // BeginCreate - Creates a TDE certificate for a given server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -69,7 +69,7 @@ func (client *TdeCertificatesClient) BeginCreate(ctx context.Context, resourceGr // Create - Creates a TDE certificate for a given server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview func (client *TdeCertificatesClient) create(ctx context.Context, resourceGroupName string, serverName string, parameters TdeCertificate, options *TdeCertificatesClientBeginCreateOptions) (*http.Response, error) { var err error req, err := client.createCreateRequest(ctx, resourceGroupName, serverName, parameters, options) @@ -107,7 +107,7 @@ func (client *TdeCertificatesClient) createCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err diff --git a/sdk/resourcemanager/sql/armsql/tdecertificates_client_example_test.go b/sdk/resourcemanager/sql/armsql/tdecertificates_client_example_test.go deleted file mode 100644 index f5c163a00af6..000000000000 --- a/sdk/resourcemanager/sql/armsql/tdecertificates_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 armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SqlTdeCertificateCreate.json -func ExampleTdeCertificatesClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewTdeCertificatesClient().BeginCreate(ctx, "testtdecert", "testtdecert", armsql.TdeCertificate{ - Properties: &armsql.TdeCertificateProperties{ - PrivateBlob: to.Ptr("MIIXXXXXXXX"), - }, - }, 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/sql/armsql/timezones_client.go b/sdk/resourcemanager/sql/armsql/timezones_client.go index c352a00b7308..55a566562dd6 100644 --- a/sdk/resourcemanager/sql/armsql/timezones_client.go +++ b/sdk/resourcemanager/sql/armsql/timezones_client.go @@ -46,7 +46,7 @@ func NewTimeZonesClient(subscriptionID string, credential azcore.TokenCredential // Get - Gets a managed instance time zone. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - options - TimeZonesClientGetOptions contains the optional parameters for the TimeZonesClient.Get method. func (client *TimeZonesClient) Get(ctx context.Context, locationName string, timeZoneID string, options *TimeZonesClientGetOptions) (TimeZonesClientGetResponse, error) { var err error @@ -86,7 +86,7 @@ func (client *TimeZonesClient) getCreateRequest(ctx context.Context, locationNam return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -103,7 +103,7 @@ func (client *TimeZonesClient) getHandleResponse(resp *http.Response) (TimeZones // NewListByLocationPager - Gets a list of managed instance time zones by location. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - options - TimeZonesClientListByLocationOptions contains the optional parameters for the TimeZonesClient.NewListByLocationPager // method. func (client *TimeZonesClient) NewListByLocationPager(locationName string, options *TimeZonesClientListByLocationOptions) *runtime.Pager[TimeZonesClientListByLocationResponse] { @@ -150,7 +150,7 @@ func (client *TimeZonesClient) listByLocationCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/timezones_client_example_test.go b/sdk/resourcemanager/sql/armsql/timezones_client_example_test.go deleted file mode 100644 index e15b6c4ffab4..000000000000 --- a/sdk/resourcemanager/sql/armsql/timezones_client_example_test.go +++ /dev/null @@ -1,1326 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceTimeZoneListByLocation.json -func ExampleTimeZonesClient_NewListByLocationPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewTimeZonesClient().NewListByLocationPager("canadaeast", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.TimeZoneListResult = armsql.TimeZoneListResult{ - // Value: []*armsql.TimeZone{ - // { - // Name: to.Ptr("Afghanistan Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Afghanistan Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+04:30) Kabul"), - // TimeZoneID: to.Ptr("Afghanistan Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Alaskan Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Alaskan Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC-09:00) Alaska"), - // TimeZoneID: to.Ptr("Alaskan Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Aleutian Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Aleutian Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC-10:00) Aleutian Islands"), - // TimeZoneID: to.Ptr("Aleutian Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Altai Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Altai Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+07:00) Barnaul, Gorno-Altaysk"), - // TimeZoneID: to.Ptr("Altai Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Arab Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Arab Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+03:00) Kuwait, Riyadh"), - // TimeZoneID: to.Ptr("Arab Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Arabian Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Arabian Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+04:00) Abu Dhabi, Muscat"), - // TimeZoneID: to.Ptr("Arabian Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Arabic Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Arabic Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+03:00) Baghdad"), - // TimeZoneID: to.Ptr("Arabic Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Argentina Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Argentina Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC-03:00) City of Buenos Aires"), - // TimeZoneID: to.Ptr("Argentina Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Astrakhan Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Astrakhan Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+04:00) Astrakhan, Ulyanovsk"), - // TimeZoneID: to.Ptr("Astrakhan Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Atlantic Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Atlantic Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC-04:00) Atlantic Time (Canada)"), - // TimeZoneID: to.Ptr("Atlantic Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("AUS Central Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/AUS Central Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+09:30) Darwin"), - // TimeZoneID: to.Ptr("AUS Central Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Aus Central W. Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Aus Central W. Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+08:45) Eucla"), - // TimeZoneID: to.Ptr("Aus Central W. Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("AUS Eastern Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/AUS Eastern Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+10:00) Canberra, Melbourne, Sydney"), - // TimeZoneID: to.Ptr("AUS Eastern Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Azerbaijan Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Azerbaijan Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+04:00) Baku"), - // TimeZoneID: to.Ptr("Azerbaijan Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Azores Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Azores Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC-01:00) Azores"), - // TimeZoneID: to.Ptr("Azores Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Bahia Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Bahia Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC-03:00) Salvador"), - // TimeZoneID: to.Ptr("Bahia Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Bangladesh Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Bangladesh Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+06:00) Dhaka"), - // TimeZoneID: to.Ptr("Bangladesh Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Belarus Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Belarus Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+03:00) Minsk"), - // TimeZoneID: to.Ptr("Belarus Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Bougainville Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Bougainville Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+11:00) Bougainville Island"), - // TimeZoneID: to.Ptr("Bougainville Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Canada Central Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Canada Central Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC-06:00) Saskatchewan"), - // TimeZoneID: to.Ptr("Canada Central Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Cape Verde Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Cape Verde Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC-01:00) Cabo Verde Is."), - // TimeZoneID: to.Ptr("Cape Verde Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Caucasus Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Caucasus Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+04:00) Yerevan"), - // TimeZoneID: to.Ptr("Caucasus Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Cen. Australia Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Cen. Australia Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+09:30) Adelaide"), - // TimeZoneID: to.Ptr("Cen. Australia Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Central America Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Central America Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC-06:00) Central America"), - // TimeZoneID: to.Ptr("Central America Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Central Asia Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Central Asia Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+06:00) Nur-Sultan"), - // TimeZoneID: to.Ptr("Central Asia Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Central Brazilian Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Central Brazilian Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC-04:00) Cuiaba"), - // TimeZoneID: to.Ptr("Central Brazilian Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Central Europe Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Central Europe Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague"), - // TimeZoneID: to.Ptr("Central Europe Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Central European Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Central European Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+01:00) Sarajevo, Skopje, Warsaw, Zagreb"), - // TimeZoneID: to.Ptr("Central European Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Central Pacific Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Central Pacific Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+11:00) Solomon Is., New Caledonia"), - // TimeZoneID: to.Ptr("Central Pacific Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Central Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Central Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC-06:00) Central Time (US & Canada)"), - // TimeZoneID: to.Ptr("Central Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Central Standard Time (Mexico)"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Central Standard Time (Mexico)"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC-06:00) Guadalajara, Mexico City, Monterrey"), - // TimeZoneID: to.Ptr("Central Standard Time (Mexico)"), - // }, - // }, - // { - // Name: to.Ptr("Chatham Islands Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Chatham Islands Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+12:45) Chatham Islands"), - // TimeZoneID: to.Ptr("Chatham Islands Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("China Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/China Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+08:00) Beijing, Chongqing, Hong Kong, Urumqi"), - // TimeZoneID: to.Ptr("China Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Cuba Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Cuba Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC-05:00) Havana"), - // TimeZoneID: to.Ptr("Cuba Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Dateline Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Dateline Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC-12:00) International Date Line West"), - // TimeZoneID: to.Ptr("Dateline Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("E. Africa Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/E. Africa Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+03:00) Nairobi"), - // TimeZoneID: to.Ptr("E. Africa Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("E. Australia Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/E. Australia Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+10:00) Brisbane"), - // TimeZoneID: to.Ptr("E. Australia Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("E. Europe Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/E. Europe Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+02:00) Chisinau"), - // TimeZoneID: to.Ptr("E. Europe Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("E. South America Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/E. South America Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC-03:00) Brasilia"), - // TimeZoneID: to.Ptr("E. South America Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Easter Island Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Easter Island Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC-06:00) Easter Island"), - // TimeZoneID: to.Ptr("Easter Island Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Eastern Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Eastern Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC-05:00) Eastern Time (US & Canada)"), - // TimeZoneID: to.Ptr("Eastern Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Eastern Standard Time (Mexico)"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Eastern Standard Time (Mexico)"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC-05:00) Chetumal"), - // TimeZoneID: to.Ptr("Eastern Standard Time (Mexico)"), - // }, - // }, - // { - // Name: to.Ptr("Egypt Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Egypt Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+02:00) Cairo"), - // TimeZoneID: to.Ptr("Egypt Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Ekaterinburg Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Ekaterinburg Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+05:00) Ekaterinburg"), - // TimeZoneID: to.Ptr("Ekaterinburg Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Fiji Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Fiji Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+12:00) Fiji"), - // TimeZoneID: to.Ptr("Fiji Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("FLE Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/FLE Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+02:00) Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius"), - // TimeZoneID: to.Ptr("FLE Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Georgian Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Georgian Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+04:00) Tbilisi"), - // TimeZoneID: to.Ptr("Georgian Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("GMT Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/GMT Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+00:00) Dublin, Edinburgh, Lisbon, London"), - // TimeZoneID: to.Ptr("GMT Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Greenland Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Greenland Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC-03:00) Greenland"), - // TimeZoneID: to.Ptr("Greenland Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Greenwich Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Greenwich Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+00:00) Monrovia, Reykjavik"), - // TimeZoneID: to.Ptr("Greenwich Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("GTB Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/GTB Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+02:00) Athens, Bucharest"), - // TimeZoneID: to.Ptr("GTB Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Haiti Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Haiti Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC-05:00) Haiti"), - // TimeZoneID: to.Ptr("Haiti Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Hawaiian Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Hawaiian Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC-10:00) Hawaii"), - // TimeZoneID: to.Ptr("Hawaiian Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("India Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/India Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+05:30) Chennai, Kolkata, Mumbai, New Delhi"), - // TimeZoneID: to.Ptr("India Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Iran Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Iran Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+03:30) Tehran"), - // TimeZoneID: to.Ptr("Iran Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Israel Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Israel Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+02:00) Jerusalem"), - // TimeZoneID: to.Ptr("Israel Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Jordan Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Jordan Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+02:00) Amman"), - // TimeZoneID: to.Ptr("Jordan Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Kaliningrad Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Kaliningrad Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+02:00) Kaliningrad"), - // TimeZoneID: to.Ptr("Kaliningrad Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Kamchatka Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Kamchatka Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+12:00) Petropavlovsk-Kamchatsky - Old"), - // TimeZoneID: to.Ptr("Kamchatka Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Korea Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Korea Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+09:00) Seoul"), - // TimeZoneID: to.Ptr("Korea Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Libya Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Libya Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+02:00) Tripoli"), - // TimeZoneID: to.Ptr("Libya Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Line Islands Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Line Islands Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+14:00) Kiritimati Island"), - // TimeZoneID: to.Ptr("Line Islands Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Lord Howe Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Lord Howe Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+10:30) Lord Howe Island"), - // TimeZoneID: to.Ptr("Lord Howe Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Magadan Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Magadan Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+11:00) Magadan"), - // TimeZoneID: to.Ptr("Magadan Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Magallanes Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Magallanes Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC-03:00) Punta Arenas"), - // TimeZoneID: to.Ptr("Magallanes Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Marquesas Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Marquesas Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC-09:30) Marquesas Islands"), - // TimeZoneID: to.Ptr("Marquesas Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Mauritius Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Mauritius Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+04:00) Port Louis"), - // TimeZoneID: to.Ptr("Mauritius Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Mid-Atlantic Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Mid-Atlantic Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC-02:00) Mid-Atlantic - Old"), - // TimeZoneID: to.Ptr("Mid-Atlantic Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Middle East Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Middle East Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+02:00) Beirut"), - // TimeZoneID: to.Ptr("Middle East Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Montevideo Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Montevideo Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC-03:00) Montevideo"), - // TimeZoneID: to.Ptr("Montevideo Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Morocco Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Morocco Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+01:00) Casablanca"), - // TimeZoneID: to.Ptr("Morocco Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Mountain Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Mountain Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC-07:00) Mountain Time (US & Canada)"), - // TimeZoneID: to.Ptr("Mountain Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Mountain Standard Time (Mexico)"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Mountain Standard Time (Mexico)"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC-07:00) Chihuahua, La Paz, Mazatlan"), - // TimeZoneID: to.Ptr("Mountain Standard Time (Mexico)"), - // }, - // }, - // { - // Name: to.Ptr("Myanmar Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Myanmar Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+06:30) Yangon (Rangoon)"), - // TimeZoneID: to.Ptr("Myanmar Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("N. Central Asia Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/N. Central Asia Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+07:00) Novosibirsk"), - // TimeZoneID: to.Ptr("N. Central Asia Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Namibia Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Namibia Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+02:00) Windhoek"), - // TimeZoneID: to.Ptr("Namibia Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Nepal Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Nepal Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+05:45) Kathmandu"), - // TimeZoneID: to.Ptr("Nepal Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("New Zealand Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/New Zealand Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+12:00) Auckland, Wellington"), - // TimeZoneID: to.Ptr("New Zealand Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Newfoundland Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Newfoundland Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC-03:30) Newfoundland"), - // TimeZoneID: to.Ptr("Newfoundland Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Norfolk Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Norfolk Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+11:00) Norfolk Island"), - // TimeZoneID: to.Ptr("Norfolk Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("North Asia East Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/North Asia East Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+08:00) Irkutsk"), - // TimeZoneID: to.Ptr("North Asia East Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("North Asia Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/North Asia Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+07:00) Krasnoyarsk"), - // TimeZoneID: to.Ptr("North Asia Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("North Korea Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/North Korea Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+09:00) Pyongyang"), - // TimeZoneID: to.Ptr("North Korea Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Omsk Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Omsk Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+06:00) Omsk"), - // TimeZoneID: to.Ptr("Omsk Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Pacific SA Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Pacific SA Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC-04:00) Santiago"), - // TimeZoneID: to.Ptr("Pacific SA Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Pacific Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Pacific Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC-08:00) Pacific Time (US & Canada)"), - // TimeZoneID: to.Ptr("Pacific Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Pacific Standard Time (Mexico)"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Pacific Standard Time (Mexico)"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC-08:00) Baja California"), - // TimeZoneID: to.Ptr("Pacific Standard Time (Mexico)"), - // }, - // }, - // { - // Name: to.Ptr("Pakistan Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Pakistan Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+05:00) Islamabad, Karachi"), - // TimeZoneID: to.Ptr("Pakistan Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Paraguay Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Paraguay Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC-04:00) Asuncion"), - // TimeZoneID: to.Ptr("Paraguay Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Qyzylorda Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Qyzylorda Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+05:00) Qyzylorda"), - // TimeZoneID: to.Ptr("Qyzylorda Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Romance Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Romance Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+01:00) Brussels, Copenhagen, Madrid, Paris"), - // TimeZoneID: to.Ptr("Romance Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Russia Time Zone 10"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Russia Time Zone 10"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+11:00) Chokurdakh"), - // TimeZoneID: to.Ptr("Russia Time Zone 10"), - // }, - // }, - // { - // Name: to.Ptr("Russia Time Zone 11"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Russia Time Zone 11"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+12:00) Anadyr, Petropavlovsk-Kamchatsky"), - // TimeZoneID: to.Ptr("Russia Time Zone 11"), - // }, - // }, - // { - // Name: to.Ptr("Russia Time Zone 3"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Russia Time Zone 3"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+04:00) Izhevsk, Samara"), - // TimeZoneID: to.Ptr("Russia Time Zone 3"), - // }, - // }, - // { - // Name: to.Ptr("Russian Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Russian Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+03:00) Moscow, St. Petersburg"), - // TimeZoneID: to.Ptr("Russian Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("SA Eastern Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/SA Eastern Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC-03:00) Cayenne, Fortaleza"), - // TimeZoneID: to.Ptr("SA Eastern Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("SA Pacific Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/SA Pacific Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC-05:00) Bogota, Lima, Quito, Rio Branco"), - // TimeZoneID: to.Ptr("SA Pacific Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("SA Western Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/SA Western Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC-04:00) Georgetown, La Paz, Manaus, San Juan"), - // TimeZoneID: to.Ptr("SA Western Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Saint Pierre Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Saint Pierre Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC-03:00) Saint Pierre and Miquelon"), - // TimeZoneID: to.Ptr("Saint Pierre Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Sakhalin Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Sakhalin Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+11:00) Sakhalin"), - // TimeZoneID: to.Ptr("Sakhalin Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Samoa Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Samoa Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+13:00) Samoa"), - // TimeZoneID: to.Ptr("Samoa Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Sao Tome Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Sao Tome Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+00:00) Sao Tome"), - // TimeZoneID: to.Ptr("Sao Tome Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Saratov Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Saratov Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+04:00) Saratov"), - // TimeZoneID: to.Ptr("Saratov Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("SE Asia Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/SE Asia Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+07:00) Bangkok, Hanoi, Jakarta"), - // TimeZoneID: to.Ptr("SE Asia Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Singapore Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Singapore Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+08:00) Kuala Lumpur, Singapore"), - // TimeZoneID: to.Ptr("Singapore Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("South Africa Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/South Africa Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+02:00) Harare, Pretoria"), - // TimeZoneID: to.Ptr("South Africa Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Sri Lanka Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Sri Lanka Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+05:30) Sri Jayawardenepura"), - // TimeZoneID: to.Ptr("Sri Lanka Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Sudan Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Sudan Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+02:00) Khartoum"), - // TimeZoneID: to.Ptr("Sudan Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Syria Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Syria Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+02:00) Damascus"), - // TimeZoneID: to.Ptr("Syria Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Taipei Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Taipei Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+08:00) Taipei"), - // TimeZoneID: to.Ptr("Taipei Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Tasmania Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Tasmania Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+10:00) Hobart"), - // TimeZoneID: to.Ptr("Tasmania Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Tocantins Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Tocantins Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC-03:00) Araguaina"), - // TimeZoneID: to.Ptr("Tocantins Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Tokyo Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Tokyo Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+09:00) Osaka, Sapporo, Tokyo"), - // TimeZoneID: to.Ptr("Tokyo Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Tomsk Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Tomsk Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+07:00) Tomsk"), - // TimeZoneID: to.Ptr("Tomsk Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Tonga Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Tonga Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+13:00) Nuku'alofa"), - // TimeZoneID: to.Ptr("Tonga Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Transbaikal Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Transbaikal Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+09:00) Chita"), - // TimeZoneID: to.Ptr("Transbaikal Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Turkey Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Turkey Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+03:00) Istanbul"), - // TimeZoneID: to.Ptr("Turkey Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Turks And Caicos Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Turks And Caicos Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC-05:00) Turks and Caicos"), - // TimeZoneID: to.Ptr("Turks And Caicos Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Ulaanbaatar Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Ulaanbaatar Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+08:00) Ulaanbaatar"), - // TimeZoneID: to.Ptr("Ulaanbaatar Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("US Eastern Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/US Eastern Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC-05:00) Indiana (East)"), - // TimeZoneID: to.Ptr("US Eastern Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("US Mountain Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/US Mountain Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC-07:00) Arizona"), - // TimeZoneID: to.Ptr("US Mountain Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("UTC"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/UTC"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC) Coordinated Universal Time"), - // TimeZoneID: to.Ptr("UTC"), - // }, - // }, - // { - // Name: to.Ptr("UTC+12"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/UTC+12"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+12:00) Coordinated Universal Time+12"), - // TimeZoneID: to.Ptr("UTC+12"), - // }, - // }, - // { - // Name: to.Ptr("UTC+13"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/UTC+13"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+13:00) Coordinated Universal Time+13"), - // TimeZoneID: to.Ptr("UTC+13"), - // }, - // }, - // { - // Name: to.Ptr("UTC-02"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/UTC-02"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC-02:00) Coordinated Universal Time-02"), - // TimeZoneID: to.Ptr("UTC-02"), - // }, - // }, - // { - // Name: to.Ptr("UTC-08"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/UTC-08"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC-08:00) Coordinated Universal Time-08"), - // TimeZoneID: to.Ptr("UTC-08"), - // }, - // }, - // { - // Name: to.Ptr("UTC-09"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/UTC-09"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC-09:00) Coordinated Universal Time-09"), - // TimeZoneID: to.Ptr("UTC-09"), - // }, - // }, - // { - // Name: to.Ptr("UTC-11"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/UTC-11"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC-11:00) Coordinated Universal Time-11"), - // TimeZoneID: to.Ptr("UTC-11"), - // }, - // }, - // { - // Name: to.Ptr("Venezuela Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Venezuela Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC-04:00) Caracas"), - // TimeZoneID: to.Ptr("Venezuela Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Vladivostok Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Vladivostok Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+10:00) Vladivostok"), - // TimeZoneID: to.Ptr("Vladivostok Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Volgograd Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Volgograd Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+04:00) Volgograd"), - // TimeZoneID: to.Ptr("Volgograd Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("W. Australia Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/W. Australia Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+08:00) Perth"), - // TimeZoneID: to.Ptr("W. Australia Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("W. Central Africa Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/W. Central Africa Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+01:00) West Central Africa"), - // TimeZoneID: to.Ptr("W. Central Africa Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("W. Europe Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/W. Europe Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna"), - // TimeZoneID: to.Ptr("W. Europe Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("W. Mongolia Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/W. Mongolia Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+07:00) Hovd"), - // TimeZoneID: to.Ptr("W. Mongolia Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("West Asia Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/West Asia Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+05:00) Ashgabat, Tashkent"), - // TimeZoneID: to.Ptr("West Asia Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("West Bank Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/West Bank Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+02:00) Gaza, Hebron"), - // TimeZoneID: to.Ptr("West Bank Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("West Pacific Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/West Pacific Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+10:00) Guam, Port Moresby"), - // TimeZoneID: to.Ptr("West Pacific Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("Yakutsk Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Yakutsk Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC+09:00) Yakutsk"), - // TimeZoneID: to.Ptr("Yakutsk Standard Time"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceTimeZoneGet.json -func ExampleTimeZonesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTimeZonesClient().Get(ctx, "canadaeast", "Haiti Standard Time", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.TimeZone = armsql.TimeZone{ - // Name: to.Ptr("Haiti Standard Time"), - // Type: to.Ptr("Microsoft.Sql/locations/timeZones"), - // ID: to.Ptr("/subscriptions/37d5e605-6142-4d79-b564-28b6dbfeec0f/providers/Microsoft.Sql/locations/onebox/timeZones/Haiti Standard Time"), - // Properties: &armsql.TimeZoneProperties{ - // DisplayName: to.Ptr("(UTC-05:00) Haiti"), - // TimeZoneID: to.Ptr("Haiti Standard Time"), - // }, - // } -} diff --git a/sdk/resourcemanager/sql/armsql/transparentdataencryptions_client.go b/sdk/resourcemanager/sql/armsql/transparentdataencryptions_client.go index da948c29ce3a..34c580649802 100644 --- a/sdk/resourcemanager/sql/armsql/transparentdataencryptions_client.go +++ b/sdk/resourcemanager/sql/armsql/transparentdataencryptions_client.go @@ -46,7 +46,7 @@ func NewTransparentDataEncryptionsClient(subscriptionID string, credential azcor // BeginCreateOrUpdate - Updates a logical database's transparent data encryption configuration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -73,7 +73,7 @@ func (client *TransparentDataEncryptionsClient) BeginCreateOrUpdate(ctx context. // CreateOrUpdate - Updates a logical database's transparent data encryption configuration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview func (client *TransparentDataEncryptionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, tdeName TransparentDataEncryptionName, parameters LogicalDatabaseTransparentDataEncryption, options *TransparentDataEncryptionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, tdeName, parameters, options) @@ -119,7 +119,7 @@ func (client *TransparentDataEncryptionsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -131,7 +131,7 @@ func (client *TransparentDataEncryptionsClient) createOrUpdateCreateRequest(ctx // Get - Gets a logical database's transparent data encryption. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -185,7 +185,7 @@ func (client *TransparentDataEncryptionsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -202,7 +202,7 @@ func (client *TransparentDataEncryptionsClient) getHandleResponse(resp *http.Res // NewListByDatabasePager - Gets a list of the logical database's transparent data encryption. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -261,7 +261,7 @@ func (client *TransparentDataEncryptionsClient) listByDatabaseCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/transparentdataencryptions_client_example_test.go b/sdk/resourcemanager/sql/armsql/transparentdataencryptions_client_example_test.go deleted file mode 100644 index 0112f950287a..000000000000 --- a/sdk/resourcemanager/sql/armsql/transparentdataencryptions_client_example_test.go +++ /dev/null @@ -1,119 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/TransparentDataEncryptionList.json -func ExampleTransparentDataEncryptionsClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewTransparentDataEncryptionsClient().NewListByDatabasePager("security-tde-resourcegroup", "securitytde", "testdb", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.LogicalDatabaseTransparentDataEncryptionListResult = armsql.LogicalDatabaseTransparentDataEncryptionListResult{ - // Value: []*armsql.LogicalDatabaseTransparentDataEncryption{ - // { - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/transparentDataEncryption"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/security-tde-resourcegroup/providers/Microsoft.Sql/servers/securitytde/databases/testdb"), - // Properties: &armsql.TransparentDataEncryptionProperties{ - // State: to.Ptr(armsql.TransparentDataEncryptionStateEnabled), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/TransparentDataEncryptionGet.json -func ExampleTransparentDataEncryptionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTransparentDataEncryptionsClient().Get(ctx, "security-tde-resourcegroup", "securitytde", "testdb", armsql.TransparentDataEncryptionNameCurrent, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LogicalDatabaseTransparentDataEncryption = armsql.LogicalDatabaseTransparentDataEncryption{ - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/transparentDataEncryption"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/security-tde-resourcegroup/providers/Microsoft.Sql/servers/securitytde/databases/testdb"), - // Properties: &armsql.TransparentDataEncryptionProperties{ - // State: to.Ptr(armsql.TransparentDataEncryptionStateEnabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/TransparentDataEncryptionUpdate.json -func ExampleTransparentDataEncryptionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewTransparentDataEncryptionsClient().BeginCreateOrUpdate(ctx, "securitytde-42-rg", "securitytde-42", "testdb", armsql.TransparentDataEncryptionNameCurrent, armsql.LogicalDatabaseTransparentDataEncryption{ - Properties: &armsql.TransparentDataEncryptionProperties{ - State: to.Ptr(armsql.TransparentDataEncryptionStateEnabled), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LogicalDatabaseTransparentDataEncryption = armsql.LogicalDatabaseTransparentDataEncryption{ - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/transparentDataEncryption"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/securitytde-42-rg/providers/Microsoft.Sql/servers/securitytde-42/databases/testdb/transparentDataEncryption"), - // Properties: &armsql.TransparentDataEncryptionProperties{ - // State: to.Ptr(armsql.TransparentDataEncryptionStateEnabled), - // }, - // } -} diff --git a/sdk/resourcemanager/sql/armsql/usages_client.go b/sdk/resourcemanager/sql/armsql/usages_client.go index 530bb3958bb2..ef1e9d7c1326 100644 --- a/sdk/resourcemanager/sql/armsql/usages_client.go +++ b/sdk/resourcemanager/sql/armsql/usages_client.go @@ -46,7 +46,7 @@ func NewUsagesClient(subscriptionID string, credential azcore.TokenCredential, o // NewListByInstancePoolPager - Gets all instance pool usage metrics // -// Generated from API version 2021-02-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - instancePoolName - The name of the instance pool to be retrieved. @@ -103,7 +103,7 @@ func (client *UsagesClient) listByInstancePoolCreateRequest(ctx context.Context, if options != nil && options.ExpandChildren != nil { reqQP.Set("expandChildren", strconv.FormatBool(*options.ExpandChildren)) } - reqQP.Set("api-version", "2021-02-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/usages_client_example_test.go b/sdk/resourcemanager/sql/armsql/usages_client_example_test.go deleted file mode 100644 index 559b7859a439..000000000000 --- a/sdk/resourcemanager/sql/armsql/usages_client_example_test.go +++ /dev/null @@ -1,207 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ListInstancePoolUsageExpanded.json -func ExampleUsagesClient_NewListByInstancePoolPager_listInstancePoolUsagesExpandedWithChildren() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewUsagesClient().NewListByInstancePoolPager("group1", "testIP", &armsql.UsagesClientListByInstancePoolOptions{ExpandChildren: to.Ptr(true)}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.UsageListResult = armsql.UsageListResult{ - // Value: []*armsql.Usage{ - // { - // Name: &armsql.Name{ - // LocalizedValue: to.Ptr("VCore utilization"), - // Value: to.Ptr("VCore utilization"), - // }, - // Type: to.Ptr("Microsoft.Sql/instancePools/usages"), - // CurrentValue: to.Ptr[int32](12), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/instancePools/testIP/usages/vcore_utilization"), - // Limit: to.Ptr[int32](16), - // RequestedLimit: to.Ptr[int32](40), - // Unit: to.Ptr("VCores"), - // }, - // { - // Name: &armsql.Name{ - // LocalizedValue: to.Ptr("Storage utilization"), - // Value: to.Ptr("Storage utilization"), - // }, - // Type: to.Ptr("Microsoft.Sql/instancePools/usages"), - // CurrentValue: to.Ptr[int32](384), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/instancePools/testIP/usages/storage_utilization"), - // Limit: to.Ptr[int32](8196), - // Unit: to.Ptr("VCores"), - // }, - // { - // Name: &armsql.Name{ - // LocalizedValue: to.Ptr("Database utilization"), - // Value: to.Ptr("Database utilization"), - // }, - // Type: to.Ptr("Microsoft.Sql/instancePools/usages"), - // CurrentValue: to.Ptr[int32](5), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/instancePools/testIP/usages/database_utilization"), - // Limit: to.Ptr[int32](100), - // Unit: to.Ptr("Number Of Databases"), - // }, - // { - // Name: &armsql.Name{ - // LocalizedValue: to.Ptr("VCore utilization"), - // Value: to.Ptr("VCore utilization"), - // }, - // Type: to.Ptr("Microsoft.Sql/instancePools/managedInstances/usages"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/instancePools/testIP/managedInstances/managedInstance1/usages/vcore_utilization"), - // Limit: to.Ptr[int32](4), - // Unit: to.Ptr("VCores"), - // }, - // { - // Name: &armsql.Name{ - // LocalizedValue: to.Ptr("VCore utilization"), - // Value: to.Ptr("VCore utilization"), - // }, - // Type: to.Ptr("Microsoft.Sql/instancePools/managedInstances/usages"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/instancePools/testIP/managedInstances/managedInstance2/usages/vcore_utilization"), - // Limit: to.Ptr[int32](4), - // RequestedLimit: to.Ptr[int32](8), - // Unit: to.Ptr("VCores"), - // }, - // { - // Name: &armsql.Name{ - // LocalizedValue: to.Ptr("Storage utilization"), - // Value: to.Ptr("Storage utilization"), - // }, - // Type: to.Ptr("Microsoft.Sql/instancePools/managedInstances/usages"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/instancePools/testIP/managedInstances/managedInstance1/usages/storage_utilization"), - // Limit: to.Ptr[int32](128), - // Unit: to.Ptr("Gigabytes"), - // }, - // { - // Name: &armsql.Name{ - // LocalizedValue: to.Ptr("VCore utilization"), - // Value: to.Ptr("VCore utilization"), - // }, - // Type: to.Ptr("Microsoft.Sql/instancePools/managedInstances/usages"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/instancePools/testIP/managedInstances/managedInstance2/usages/storage_utilization"), - // Limit: to.Ptr[int32](128), - // RequestedLimit: to.Ptr[int32](256), - // Unit: to.Ptr("Gigabytes"), - // }, - // { - // Name: &armsql.Name{ - // LocalizedValue: to.Ptr("Database utilization"), - // Value: to.Ptr("Database utilization"), - // }, - // Type: to.Ptr("Microsoft.Sql/instancePools/managedInstances/usages"), - // CurrentValue: to.Ptr[int32](2), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/instancePools/testIP/managedInstances/managedInstance1/usages/database_utilization"), - // Limit: to.Ptr[int32](100), - // Unit: to.Ptr("Number Of Databases"), - // }, - // { - // Name: &armsql.Name{ - // LocalizedValue: to.Ptr("Database utilization"), - // Value: to.Ptr("Database utilization"), - // }, - // Type: to.Ptr("Microsoft.Sql/instancePools/managedInstances/usages"), - // CurrentValue: to.Ptr[int32](3), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/instancePools/testIP/managedInstances/managedInstance2/usages/database_utilization"), - // Limit: to.Ptr[int32](100), - // Unit: to.Ptr("Number Of Databases"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ListInstancePoolUsage.json -func ExampleUsagesClient_NewListByInstancePoolPager_listInstancePoolUsages() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewUsagesClient().NewListByInstancePoolPager("group1", "testIP", &armsql.UsagesClientListByInstancePoolOptions{ExpandChildren: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.UsageListResult = armsql.UsageListResult{ - // Value: []*armsql.Usage{ - // { - // Name: &armsql.Name{ - // LocalizedValue: to.Ptr("VCore utilization"), - // Value: to.Ptr("VCore utilization"), - // }, - // Type: to.Ptr("Microsoft.Sql/instancePools/usages"), - // CurrentValue: to.Ptr[int32](12), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/instancePools/testIP/usages/vcore_utilization"), - // Limit: to.Ptr[int32](16), - // RequestedLimit: to.Ptr[int32](40), - // Unit: to.Ptr("VCores"), - // }, - // { - // Name: &armsql.Name{ - // LocalizedValue: to.Ptr("Storage utilization"), - // Value: to.Ptr("Storage utilization"), - // }, - // Type: to.Ptr("Microsoft.Sql/instancePools/usages"), - // CurrentValue: to.Ptr[int32](384), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/instancePools/testIP/usages/storage_utilization"), - // Limit: to.Ptr[int32](8196), - // Unit: to.Ptr("VCores"), - // }, - // { - // Name: &armsql.Name{ - // LocalizedValue: to.Ptr("Database utilization"), - // Value: to.Ptr("Database utilization"), - // }, - // Type: to.Ptr("Microsoft.Sql/instancePools/usages"), - // CurrentValue: to.Ptr[int32](5), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/instancePools/testIP/usages/database_utilization"), - // Limit: to.Ptr[int32](100), - // Unit: to.Ptr("Number Of Databases"), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/sql/armsql/virtualclusters_client.go b/sdk/resourcemanager/sql/armsql/virtualclusters_client.go index 14c256a612ed..c6b9ad83b87f 100644 --- a/sdk/resourcemanager/sql/armsql/virtualclusters_client.go +++ b/sdk/resourcemanager/sql/armsql/virtualclusters_client.go @@ -46,7 +46,7 @@ func NewVirtualClustersClient(subscriptionID string, credential azcore.TokenCred // BeginDelete - Deletes a virtual cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - virtualClusterName - The name of the virtual cluster. @@ -68,7 +68,7 @@ func (client *VirtualClustersClient) BeginDelete(ctx context.Context, resourceGr // Delete - Deletes a virtual cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01-preview +// Generated from API version 2023-05-01-preview func (client *VirtualClustersClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualClusterName string, options *VirtualClustersClientBeginDeleteOptions) (*http.Response, error) { var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, virtualClusterName, options) @@ -106,7 +106,7 @@ func (client *VirtualClustersClient) deleteCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -114,7 +114,7 @@ func (client *VirtualClustersClient) deleteCreateRequest(ctx context.Context, re // Get - Gets a virtual cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - virtualClusterName - The name of the virtual cluster. @@ -157,7 +157,7 @@ func (client *VirtualClustersClient) getCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -174,7 +174,7 @@ func (client *VirtualClustersClient) getHandleResponse(resp *http.Response) (Vir // NewListPager - Gets a list of all virtualClusters in the subscription. // -// Generated from API version 2022-05-01-preview +// Generated from API version 2023-05-01-preview // - options - VirtualClustersClientListOptions contains the optional parameters for the VirtualClustersClient.NewListPager // method. func (client *VirtualClustersClient) NewListPager(options *VirtualClustersClientListOptions) *runtime.Pager[VirtualClustersClientListResponse] { @@ -217,7 +217,7 @@ func (client *VirtualClustersClient) listCreateRequest(ctx context.Context, opti return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -234,7 +234,7 @@ func (client *VirtualClustersClient) listHandleResponse(resp *http.Response) (Vi // NewListByResourceGroupPager - Gets a list of virtual clusters in a resource group. // -// Generated from API version 2022-05-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - options - VirtualClustersClientListByResourceGroupOptions contains the optional parameters for the VirtualClustersClient.NewListByResourceGroupPager @@ -283,7 +283,7 @@ func (client *VirtualClustersClient) listByResourceGroupCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -301,7 +301,7 @@ func (client *VirtualClustersClient) listByResourceGroupHandleResponse(resp *htt // BeginUpdate - Updates an existing virtual cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - virtualClusterName - The name of the virtual cluster. @@ -324,7 +324,7 @@ func (client *VirtualClustersClient) BeginUpdate(ctx context.Context, resourceGr // Update - Updates an existing virtual cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01-preview +// Generated from API version 2023-05-01-preview func (client *VirtualClustersClient) update(ctx context.Context, resourceGroupName string, virtualClusterName string, parameters VirtualClusterUpdate, options *VirtualClustersClientBeginUpdateOptions) (*http.Response, error) { var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, virtualClusterName, parameters, options) @@ -362,7 +362,7 @@ func (client *VirtualClustersClient) updateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -374,7 +374,7 @@ func (client *VirtualClustersClient) updateCreateRequest(ctx context.Context, re // BeginUpdateDNSServers - Synchronizes the DNS server settings used by the managed instances inside the given virtual cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - virtualClusterName - The name of the virtual cluster. @@ -396,7 +396,7 @@ func (client *VirtualClustersClient) BeginUpdateDNSServers(ctx context.Context, // UpdateDNSServers - Synchronizes the DNS server settings used by the managed instances inside the given virtual cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01-preview +// Generated from API version 2023-05-01-preview func (client *VirtualClustersClient) updateDNSServers(ctx context.Context, resourceGroupName string, virtualClusterName string, options *VirtualClustersClientBeginUpdateDNSServersOptions) (*http.Response, error) { var err error req, err := client.updateDNSServersCreateRequest(ctx, resourceGroupName, virtualClusterName, options) @@ -434,7 +434,7 @@ func (client *VirtualClustersClient) updateDNSServersCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/virtualclusters_client_example_test.go b/sdk/resourcemanager/sql/armsql/virtualclusters_client_example_test.go deleted file mode 100644 index ec33811490a7..000000000000 --- a/sdk/resourcemanager/sql/armsql/virtualclusters_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 armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/VirtualClusterList.json -func ExampleVirtualClustersClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualClustersClient().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.VirtualClusterListResult = armsql.VirtualClusterListResult{ - // Value: []*armsql.VirtualCluster{ - // { - // Name: to.Ptr("VirtualClustercltest"), - // Type: to.Ptr("Microsoft.Sql/virtualClusters"), - // ID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/testrg/providers/Microsoft.Sql/virtualClusters/VirtualClustercltest"), - // Location: to.Ptr("japaneast"), - // Properties: &armsql.VirtualClusterProperties{ - // ChildResources: []*string{ - // to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testcl")}, - // SubnetID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/cltest"), - // Version: to.Ptr("1.0"), - // }, - // }, - // { - // Name: to.Ptr("vc2"), - // Type: to.Ptr("Microsoft.Sql/virtualClusters"), - // ID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/testrg/providers/Microsoft.Sql/virtualClusters/vc2"), - // Location: to.Ptr("japaneast"), - // Properties: &armsql.VirtualClusterProperties{ - // ChildResources: []*string{ - // }, - // SubnetID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/cltest2"), - // Version: to.Ptr("2.0"), - // }, - // }, - // { - // Name: to.Ptr("vc1"), - // Type: to.Ptr("Microsoft.Sql/virtualClusters"), - // ID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/testrg/providers/Microsoft.Sql/virtualClusters/vc1"), - // Location: to.Ptr("japaneast"), - // Properties: &armsql.VirtualClusterProperties{ - // ChildResources: []*string{ - // to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testcl"), - // to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/mi")}, - // SubnetID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/cltest"), - // Version: to.Ptr("2.0"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/VirtualClusterListByResourceGroup.json -func ExampleVirtualClustersClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualClustersClient().NewListByResourceGroupPager("testrg", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualClusterListResult = armsql.VirtualClusterListResult{ - // Value: []*armsql.VirtualCluster{ - // { - // Name: to.Ptr("VirtualClustercltest"), - // Type: to.Ptr("Microsoft.Sql/virtualClusters"), - // ID: to.Ptr("/subscriptions/65dc2520-d3b9-4d11-b638-f3c41f962550/resourceGroups/testrg/providers/Microsoft.Sql/virtualClusters/VirtualClustercltest"), - // Location: to.Ptr("japaneast"), - // Properties: &armsql.VirtualClusterProperties{ - // ChildResources: []*string{ - // to.Ptr("/subscriptions/65dc2520-d3b9-4d11-b638-f3c41f962550/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testcl")}, - // SubnetID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/cltest"), - // Version: to.Ptr("1.0"), - // }, - // }, - // { - // Name: to.Ptr("vc2"), - // Type: to.Ptr("Microsoft.Sql/virtualClusters"), - // ID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/testrg/providers/Microsoft.Sql/virtualClusters/vc2"), - // Location: to.Ptr("japaneast"), - // Properties: &armsql.VirtualClusterProperties{ - // ChildResources: []*string{ - // }, - // SubnetID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/cltest2"), - // Version: to.Ptr("2.0"), - // }, - // }, - // { - // Name: to.Ptr("vc1"), - // Type: to.Ptr("Microsoft.Sql/virtualClusters"), - // ID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/testrg/providers/Microsoft.Sql/virtualClusters/vc1"), - // Location: to.Ptr("japaneast"), - // Tags: map[string]*string{ - // "tkey": to.Ptr("tvalue3"), - // }, - // Properties: &armsql.VirtualClusterProperties{ - // ChildResources: []*string{ - // to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testcl"), - // to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/mi")}, - // SubnetID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/cltest"), - // Version: to.Ptr("2.0"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/VirtualClusterGet.json -func ExampleVirtualClustersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualClustersClient().Get(ctx, "testrg", "vc-f769ed71-b3ad-491a-a9d5-26eeceaa6be2", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualCluster = armsql.VirtualCluster{ - // Name: to.Ptr("vc-f769ed71-b3ad-491a-a9d5-26eeceaa6be2"), - // Type: to.Ptr("Microsoft.Sql/virtualClusters"), - // ID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/testrg/providers/Microsoft.Sql/virtualClusters/vc-f769ed71-b3ad-491a-a9d5-26eeceaa6be2"), - // Location: to.Ptr("japaneast"), - // Tags: map[string]*string{ - // "key": to.Ptr("value"), - // }, - // Properties: &armsql.VirtualClusterProperties{ - // ChildResources: []*string{ - // to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testcl"), - // to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/mi")}, - // SubnetID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/cltest"), - // Version: to.Ptr("2.0"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/VirtualClusterDelete.json -func ExampleVirtualClustersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualClustersClient().BeginDelete(ctx, "testrg", "vc-subnet1-f769ed71-b3ad-491a-a9d5-26eeceaa6be2", 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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/VirtualClusterUpdate.json -func ExampleVirtualClustersClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualClustersClient().BeginUpdate(ctx, "testrg", "vc-subnet1-f769ed71-b3ad-491a-a9d5-26eeceaa6be2", armsql.VirtualClusterUpdate{ - Tags: map[string]*string{ - "tkey": to.Ptr("tvalue1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualCluster = armsql.VirtualCluster{ - // Name: to.Ptr("vc-subnet1-f769ed71-b3ad-491a-a9d5-26eeceaa6be2"), - // Type: to.Ptr("Microsoft.Sql/virtualClusters"), - // ID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/resourceGroups/testrg/providers/Microsoft.Sql/virtualClusters/vc-subnet1-f769ed71-b3ad-491a-a9d5-26eeceaa6be2"), - // Location: to.Ptr("japaneast"), - // Tags: map[string]*string{ - // "tkey": to.Ptr("tvalue3"), - // }, - // Properties: &armsql.VirtualClusterProperties{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/UpdateVirtualClusterDnsServers.json -func ExampleVirtualClustersClient_BeginUpdateDNSServers() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualClustersClient().BeginUpdateDNSServers(ctx, "sqlcrudtest-7398", "VirtualCluster2b9a846b-2e37-43ef-a8e9-f2c6d645c1d7", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.UpdateVirtualClusterDNSServersOperation = armsql.UpdateVirtualClusterDNSServersOperation{ - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/virtualClusters/VirtualCluster2b9a846b-2e37-43ef-a8e9-f2c6d645c1d7/updateManagedInstanceDnsServers"), - // Properties: &armsql.VirtualClusterDNSServersProperties{ - // Status: to.Ptr(armsql.DNSRefreshOperationStatusSucceeded), - // }, - // } -} diff --git a/sdk/resourcemanager/sql/armsql/virtualnetworkrules_client.go b/sdk/resourcemanager/sql/armsql/virtualnetworkrules_client.go index eeec326cd013..b05925f50c51 100644 --- a/sdk/resourcemanager/sql/armsql/virtualnetworkrules_client.go +++ b/sdk/resourcemanager/sql/armsql/virtualnetworkrules_client.go @@ -46,7 +46,7 @@ func NewVirtualNetworkRulesClient(subscriptionID string, credential azcore.Token // BeginCreateOrUpdate - Creates or updates an existing virtual network rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -70,7 +70,7 @@ func (client *VirtualNetworkRulesClient) BeginCreateOrUpdate(ctx context.Context // CreateOrUpdate - Creates or updates an existing virtual network rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview func (client *VirtualNetworkRulesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string, parameters VirtualNetworkRule, options *VirtualNetworkRulesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, virtualNetworkRuleName, parameters, options) @@ -112,7 +112,7 @@ func (client *VirtualNetworkRulesClient) createOrUpdateCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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 *VirtualNetworkRulesClient) createOrUpdateCreateRequest(ctx context // BeginDelete - Deletes the virtual network rule with the given name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -147,7 +147,7 @@ func (client *VirtualNetworkRulesClient) BeginDelete(ctx context.Context, resour // Delete - Deletes the virtual network rule with the given name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview func (client *VirtualNetworkRulesClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string, options *VirtualNetworkRulesClientBeginDeleteOptions) (*http.Response, error) { var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, virtualNetworkRuleName, options) @@ -189,7 +189,7 @@ func (client *VirtualNetworkRulesClient) deleteCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -197,7 +197,7 @@ func (client *VirtualNetworkRulesClient) deleteCreateRequest(ctx context.Context // Get - Gets a virtual network rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -245,7 +245,7 @@ func (client *VirtualNetworkRulesClient) getCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -262,7 +262,7 @@ func (client *VirtualNetworkRulesClient) getHandleResponse(resp *http.Response) // NewListByServerPager - Gets a list of virtual network rules in a server. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -316,7 +316,7 @@ func (client *VirtualNetworkRulesClient) listByServerCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/virtualnetworkrules_client_example_test.go b/sdk/resourcemanager/sql/armsql/virtualnetworkrules_client_example_test.go deleted file mode 100644 index d34da6f1a1d3..000000000000 --- a/sdk/resourcemanager/sql/armsql/virtualnetworkrules_client_example_test.go +++ /dev/null @@ -1,156 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/VirtualNetworkRulesGet.json -func ExampleVirtualNetworkRulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualNetworkRulesClient().Get(ctx, "Default", "vnet-test-svr", "vnet-firewall-rule", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualNetworkRule = armsql.VirtualNetworkRule{ - // Name: to.Ptr("vnet-firewall-rule"), - // Type: to.Ptr("Microsoft.Sql/servers/virtualNetworkRules"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/vnet-test-svr/virtualNetworkRules/vnet-firewall-rule"), - // Properties: &armsql.VirtualNetworkRuleProperties{ - // IgnoreMissingVnetServiceEndpoint: to.Ptr(false), - // State: to.Ptr(armsql.VirtualNetworkRuleStateReady), - // VirtualNetworkSubnetID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Network/virtualNetworks/testvnet/subnets/testsubnet"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/VirtualNetworkRulesCreateOrUpdate.json -func ExampleVirtualNetworkRulesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkRulesClient().BeginCreateOrUpdate(ctx, "Default", "vnet-test-svr", "vnet-firewall-rule", armsql.VirtualNetworkRule{ - Properties: &armsql.VirtualNetworkRuleProperties{ - IgnoreMissingVnetServiceEndpoint: to.Ptr(false), - VirtualNetworkSubnetID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Network/virtualNetworks/testvnet/subnets/testsubnet"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualNetworkRule = armsql.VirtualNetworkRule{ - // Name: to.Ptr("vnet-firewall-rule"), - // Type: to.Ptr("Microsoft.Sql/servers/virtualNetworkRules"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/vnet-test-svr/virtualNetworkRules/vnet-firewall-rule"), - // Properties: &armsql.VirtualNetworkRuleProperties{ - // IgnoreMissingVnetServiceEndpoint: to.Ptr(false), - // VirtualNetworkSubnetID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Network/virtualNetworks/testvnet/subnets/testsubnet"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/VirtualNetworkRulesDelete.json -func ExampleVirtualNetworkRulesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkRulesClient().BeginDelete(ctx, "Default", "vnet-test-svr", "vnet-firewall-rule", 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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/VirtualNetworkRulesList.json -func ExampleVirtualNetworkRulesClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualNetworkRulesClient().NewListByServerPager("Default", "vnet-test-svr", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualNetworkRuleListResult = armsql.VirtualNetworkRuleListResult{ - // Value: []*armsql.VirtualNetworkRule{ - // { - // Name: to.Ptr("vnet-firewall-rule"), - // Type: to.Ptr("Microsoft.Sql/servers/virtualNetworkRules"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/vnet-test-svr/virtualNetworkRules/vnet-firewall-rule"), - // Properties: &armsql.VirtualNetworkRuleProperties{ - // IgnoreMissingVnetServiceEndpoint: to.Ptr(false), - // State: to.Ptr(armsql.VirtualNetworkRuleStateReady), - // VirtualNetworkSubnetID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Network/virtualNetworks/testvnet/subnets/testsubnet"), - // }, - // }, - // { - // Name: to.Ptr("vnet-firewall-rule"), - // Type: to.Ptr("Microsoft.Sql/servers/virtualNetworkRules"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/vnet-test-svr/virtualNetworkRules/vnet-firewall-rule"), - // Properties: &armsql.VirtualNetworkRuleProperties{ - // IgnoreMissingVnetServiceEndpoint: to.Ptr(false), - // State: to.Ptr(armsql.VirtualNetworkRuleStateReady), - // VirtualNetworkSubnetID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Network/virtualNetworks/testvnet/subnets/testsubnet"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentbaseline_client.go b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentbaseline_client.go index 267cec117d8d..4ed947956add 100644 --- a/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentbaseline_client.go +++ b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentbaseline_client.go @@ -46,7 +46,7 @@ func NewVulnerabilityAssessmentBaselineClient(subscriptionID string, credential // Get - Gets a list of database's sql vulnerability assessment rule baselines. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -100,7 +100,7 @@ func (client *VulnerabilityAssessmentBaselineClient) getCreateRequest(ctx contex } reqQP := req.Raw().URL.Query() reqQP.Set("systemDatabaseName", "master") - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -117,7 +117,7 @@ func (client *VulnerabilityAssessmentBaselineClient) getHandleResponse(resp *htt // NewListBySQLVulnerabilityAssessmentPager - Gets a list of database's sql vulnerability assessment rule baselines. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -177,7 +177,7 @@ func (client *VulnerabilityAssessmentBaselineClient) listBySQLVulnerabilityAsses } reqQP := req.Raw().URL.Query() reqQP.Set("systemDatabaseName", "master") - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentbaseline_client_example_test.go b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentbaseline_client_example_test.go deleted file mode 100644 index 228de3dcb635..000000000000 --- a/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentbaseline_client_example_test.go +++ /dev/null @@ -1,140 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/SqlVulnerabilityAssessmentBaselineListBySqlVulnerabilityAssessment.json -func ExampleVulnerabilityAssessmentBaselineClient_NewListBySQLVulnerabilityAssessmentPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVulnerabilityAssessmentBaselineClient().NewListBySQLVulnerabilityAssessmentPager("vulnerabilityaseessmenttest-4711", "vulnerabilityaseessmenttest-6411", armsql.VulnerabilityAssessmentNameDefault, nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DatabaseSQLVulnerabilityAssessmentBaselineSetListResult = armsql.DatabaseSQLVulnerabilityAssessmentBaselineSetListResult{ - // Value: []*armsql.DatabaseSQLVulnerabilityAssessmentBaselineSet{ - // { - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.Sql/servers/sqlVulnerabilityAssessments/baselines"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/servers/vulnerabilityaseessmenttest-6440/sqlVulnerabilityAssessments/Default/baselines/Default"), - // Properties: &armsql.DatabaseSQLVulnerabilityAssessmentBaselineSetProperties{ - // Results: map[string][][]*string{ - // "VA1223": [][]*string{ - // }, - // "VA2060": [][]*string{ - // []*string{ - // to.Ptr("False")}}, - // "VA2061": [][]*string{ - // []*string{ - // to.Ptr("True")}}, - // "VA2062": [][]*string{ - // }, - // "VA2063": [][]*string{ - // []*string{ - // to.Ptr("AllowAll"), - // to.Ptr("0.0.0.0"), - // to.Ptr("255.255.255.255")}}, - // "VA2064": [][]*string{ - // }, - // "VA2065": [][]*string{ - // []*string{ - // to.Ptr("AllowAll"), - // to.Ptr("0.0.0.0"), - // to.Ptr("255.255.255.255")}}, - // "VA2107": [][]*string{ - // }, - // "VA2130": [][]*string{ - // []*string{ - // to.Ptr("Value1"), - // to.Ptr("Value2")}}, - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/SqlVulnerabilityAssessmentBaselineGet.json -func ExampleVulnerabilityAssessmentBaselineClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVulnerabilityAssessmentBaselineClient().Get(ctx, "vulnerabilityaseessmenttest-4711", "vulnerabilityaseessmenttest-6411", armsql.VulnerabilityAssessmentNameDefault, armsql.BaselineNameDefault, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DatabaseSQLVulnerabilityAssessmentBaselineSet = armsql.DatabaseSQLVulnerabilityAssessmentBaselineSet{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/sqlVulnerabilityAssessments/baselines"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/servers/vulnerabilityaseessmenttest-6440/sqlVulnerabilityAssessments/Default/baselines/Default"), - // Properties: &armsql.DatabaseSQLVulnerabilityAssessmentBaselineSetProperties{ - // Results: map[string][][]*string{ - // "VA1223": [][]*string{ - // }, - // "VA2060": [][]*string{ - // []*string{ - // to.Ptr("False")}}, - // "VA2061": [][]*string{ - // []*string{ - // to.Ptr("True")}}, - // "VA2062": [][]*string{ - // }, - // "VA2063": [][]*string{ - // []*string{ - // to.Ptr("AllowAll"), - // to.Ptr("0.0.0.0"), - // to.Ptr("255.255.255.255")}}, - // "VA2064": [][]*string{ - // }, - // "VA2065": [][]*string{ - // []*string{ - // to.Ptr("AllowAll"), - // to.Ptr("0.0.0.0"), - // to.Ptr("255.255.255.255")}}, - // "VA2107": [][]*string{ - // }, - // "VA2130": [][]*string{ - // []*string{ - // to.Ptr("Value1"), - // to.Ptr("Value2")}}, - // }, - // }, - // } -} diff --git a/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentbaselines_client.go b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentbaselines_client.go index 6aa52ff7cac5..f6b7d5327e2e 100644 --- a/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentbaselines_client.go +++ b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentbaselines_client.go @@ -46,7 +46,7 @@ func NewVulnerabilityAssessmentBaselinesClient(subscriptionID string, credential // CreateOrUpdate - Add a database's vulnerability assessment rule baseline list. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -101,7 +101,7 @@ func (client *VulnerabilityAssessmentBaselinesClient) createOrUpdateCreateReques } reqQP := req.Raw().URL.Query() reqQP.Set("systemDatabaseName", "master") - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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/sql/armsql/vulnerabilityassessmentbaselines_client_example_test.go b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentbaselines_client_example_test.go deleted file mode 100644 index cec1575cdf7c..000000000000 --- a/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentbaselines_client_example_test.go +++ /dev/null @@ -1,136 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/SqlVulnerabilityAssessmentBaselineAddLatest.json -func ExampleVulnerabilityAssessmentBaselinesClient_CreateOrUpdate_addADatabasesVulnerabilityAssessmentRuleBaselineFromTheLatestScanResult() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVulnerabilityAssessmentBaselinesClient().CreateOrUpdate(ctx, "vulnerabilityaseessmenttest-4799", "vulnerabilityaseessmenttest-6440", armsql.VulnerabilityAssessmentNameDefault, armsql.BaselineNameDefault, armsql.DatabaseSQLVulnerabilityAssessmentRuleBaselineListInput{ - Properties: &armsql.DatabaseSQLVulnerabilityAssessmentRuleBaselineListInputProperties{ - LatestScan: to.Ptr(true), - Results: map[string][][]*string{}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DatabaseSQLVulnerabilityAssessmentBaselineSet = armsql.DatabaseSQLVulnerabilityAssessmentBaselineSet{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.Sql/servers/sqlVulnerabilityAssessments/baselines"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/servers/vulnerabilityaseessmenttest-6440/sqlVulnerabilityAssessments/Default/baselines/Default"), - // Properties: &armsql.DatabaseSQLVulnerabilityAssessmentBaselineSetProperties{ - // Results: map[string][][]*string{ - // "VA1223": [][]*string{ - // }, - // "VA2060": [][]*string{ - // []*string{ - // to.Ptr("False")}}, - // "VA2061": [][]*string{ - // []*string{ - // to.Ptr("True")}}, - // "VA2062": [][]*string{ - // }, - // "VA2063": [][]*string{ - // []*string{ - // to.Ptr("AllowAll"), - // to.Ptr("0.0.0.0"), - // to.Ptr("255.255.255.255")}}, - // "VA2064": [][]*string{ - // }, - // "VA2065": [][]*string{ - // []*string{ - // to.Ptr("AllowAll"), - // to.Ptr("0.0.0.0"), - // to.Ptr("255.255.255.255")}}, - // "VA2107": [][]*string{ - // }, - // "VA2130": [][]*string{ - // []*string{ - // to.Ptr("Value1"), - // to.Ptr("Value2")}}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/SqlVulnerabilityAssessmentBaselineAdd.json -func ExampleVulnerabilityAssessmentBaselinesClient_CreateOrUpdate_addADatabasesVulnerabilityAssessmentRuleBaselineList() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVulnerabilityAssessmentBaselinesClient().CreateOrUpdate(ctx, "vulnerabilityaseessmenttest-4711", "vulnerabilityaseessmenttest-6411", armsql.VulnerabilityAssessmentNameDefault, armsql.BaselineNameDefault, armsql.DatabaseSQLVulnerabilityAssessmentRuleBaselineListInput{ - Properties: &armsql.DatabaseSQLVulnerabilityAssessmentRuleBaselineListInputProperties{ - LatestScan: to.Ptr(false), - Results: map[string][][]*string{ - "VA2063": { - { - to.Ptr("AllowAll"), - to.Ptr("0.0.0.0"), - to.Ptr("255.255.255.255")}}, - "VA2065": { - { - to.Ptr("AllowAll"), - to.Ptr("0.0.0.0"), - to.Ptr("255.255.255.255")}}, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DatabaseSQLVulnerabilityAssessmentBaselineSet = armsql.DatabaseSQLVulnerabilityAssessmentBaselineSet{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.Sql/servers/sqlVulnerabilityAssessments/baselines"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/servers/vulnerabilityaseessmenttest-6440/sqlVulnerabilityAssessments/Default/baselines/Default"), - // Properties: &armsql.DatabaseSQLVulnerabilityAssessmentBaselineSetProperties{ - // Results: map[string][][]*string{ - // "VA2063": [][]*string{ - // []*string{ - // to.Ptr("AllowAll"), - // to.Ptr("0.0.0.0"), - // to.Ptr("255.255.255.255")}}, - // "VA2065": [][]*string{ - // []*string{ - // to.Ptr("AllowAll"), - // to.Ptr("0.0.0.0"), - // to.Ptr("255.255.255.255")}}, - // }, - // }, - // } -} diff --git a/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentexecutescan_client.go b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentexecutescan_client.go index b8f40f3b7cce..66f59eb8fd63 100644 --- a/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentexecutescan_client.go +++ b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentexecutescan_client.go @@ -46,7 +46,7 @@ func NewVulnerabilityAssessmentExecuteScanClient(subscriptionID string, credenti // BeginExecute - Executes a Vulnerability Assessment database scan. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -69,7 +69,7 @@ func (client *VulnerabilityAssessmentExecuteScanClient) BeginExecute(ctx context // Execute - Executes a Vulnerability Assessment database scan. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-05-01-preview func (client *VulnerabilityAssessmentExecuteScanClient) execute(ctx context.Context, resourceGroupName string, serverName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, options *VulnerabilityAssessmentExecuteScanClientBeginExecuteOptions) (*http.Response, error) { var err error req, err := client.executeCreateRequest(ctx, resourceGroupName, serverName, vulnerabilityAssessmentName, options) @@ -112,7 +112,7 @@ func (client *VulnerabilityAssessmentExecuteScanClient) executeCreateRequest(ctx } reqQP := req.Raw().URL.Query() reqQP.Set("systemDatabaseName", "master") - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } diff --git a/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentexecutescan_client_example_test.go b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentexecutescan_client_example_test.go deleted file mode 100644 index fdb825bbc795..000000000000 --- a/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentexecutescan_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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/SqlVulnerabilityAssessmentScansExecute.json -func ExampleVulnerabilityAssessmentExecuteScanClient_BeginExecute() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVulnerabilityAssessmentExecuteScanClient().BeginExecute(ctx, "vulnerabilityassessmenttest-4711", "vulnerabilityassessmenttest-6411", armsql.VulnerabilityAssessmentNameDefault, 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/sql/armsql/vulnerabilityassessmentrulebaseline_client.go b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentrulebaseline_client.go index cd26f7135f66..3ced07fa39b2 100644 --- a/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentrulebaseline_client.go +++ b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentrulebaseline_client.go @@ -46,7 +46,7 @@ func NewVulnerabilityAssessmentRuleBaselineClient(subscriptionID string, credent // CreateOrUpdate - Creates or updates a database's vulnerability assessment rule baseline. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -106,7 +106,7 @@ func (client *VulnerabilityAssessmentRuleBaselineClient) createOrUpdateCreateReq } reqQP := req.Raw().URL.Query() reqQP.Set("systemDatabaseName", "master") - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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 *VulnerabilityAssessmentRuleBaselineClient) createOrUpdateHandleRes // Get - Gets a system database's sql vulnerability assessment rule baseline. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -186,7 +186,7 @@ func (client *VulnerabilityAssessmentRuleBaselineClient) getCreateRequest(ctx co } reqQP := req.Raw().URL.Query() reqQP.Set("systemDatabaseName", "master") - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -203,7 +203,7 @@ func (client *VulnerabilityAssessmentRuleBaselineClient) getHandleResponse(resp // NewListByBaselinePager - Gets a system database's sql vulnerability assessment rule baseline. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -267,7 +267,7 @@ func (client *VulnerabilityAssessmentRuleBaselineClient) listByBaselineCreateReq } reqQP := req.Raw().URL.Query() reqQP.Set("systemDatabaseName", "master") - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentrulebaseline_client_example_test.go b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentrulebaseline_client_example_test.go deleted file mode 100644 index 9724b376614f..000000000000 --- a/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentrulebaseline_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 armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/SqlVulnerabilityAssessmentRuleBaselineListByBaseline.json -func ExampleVulnerabilityAssessmentRuleBaselineClient_NewListByBaselinePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVulnerabilityAssessmentRuleBaselineClient().NewListByBaselinePager("vulnerabilityaseessmenttest-4711", "vulnerabilityaseessmenttest-6411", armsql.VulnerabilityAssessmentNameDefault, armsql.BaselineNameDefault, nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DatabaseSQLVulnerabilityAssessmentRuleBaselineListResult = armsql.DatabaseSQLVulnerabilityAssessmentRuleBaselineListResult{ - // Value: []*armsql.DatabaseSQLVulnerabilityAssessmentRuleBaseline{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/sqlVulnerabilityAssessments/baselines"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/servers/vulnerabilityaseessmenttest-6440/sqlVulnerabilityAssessments/default/baselines/default/rules/VA1001"), - // Properties: &armsql.DatabaseSQLVulnerabilityAssessmentRuleBaselineProperties{ - // Results: [][]*string{ - // []*string{ - // to.Ptr("userA"), - // to.Ptr("SELECT")}, - // []*string{ - // to.Ptr("userB"), - // to.Ptr("SELECT")}, - // []*string{ - // to.Ptr("userC"), - // to.Ptr("SELECT")}}, - // }, - // }, - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/sqlVulnerabilityAssessments/baselines"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/servers/vulnerabilityaseessmenttest-6440/sqlVulnerabilityAssessments/default/baselines/default/rules/VA1002"), - // Properties: &armsql.DatabaseSQLVulnerabilityAssessmentRuleBaselineProperties{ - // Results: [][]*string{ - // []*string{ - // to.Ptr("userA"), - // to.Ptr("SELECT")}, - // []*string{ - // to.Ptr("userB"), - // to.Ptr("SELECT")}, - // []*string{ - // to.Ptr("userC"), - // to.Ptr("SELECT")}}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/SqlVulnerabilityAssessmentRuleBaselineGet.json -func ExampleVulnerabilityAssessmentRuleBaselineClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVulnerabilityAssessmentRuleBaselineClient().Get(ctx, "vulnerabilityaseessmenttest-4711", "vulnerabilityaseessmenttest-6411", armsql.VulnerabilityAssessmentNameDefault, armsql.BaselineNameDefault, "VA1001", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DatabaseSQLVulnerabilityAssessmentRuleBaseline = armsql.DatabaseSQLVulnerabilityAssessmentRuleBaseline{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/servers/sqlVulnerabilityAssessments/baselines"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/servers/vulnerabilityaseessmenttest-6440/sqlVulnerabilityAssessments/default/baselines/default/rules/VA1001"), - // Properties: &armsql.DatabaseSQLVulnerabilityAssessmentRuleBaselineProperties{ - // Results: [][]*string{ - // []*string{ - // to.Ptr("userA"), - // to.Ptr("SELECT")}, - // []*string{ - // to.Ptr("userB"), - // to.Ptr("SELECT")}, - // []*string{ - // to.Ptr("userC"), - // to.Ptr("SELECT")}}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/SqlVulnerabilityAssessmentRuleBaselineCreate.json -func ExampleVulnerabilityAssessmentRuleBaselineClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVulnerabilityAssessmentRuleBaselineClient().CreateOrUpdate(ctx, "vulnerabilityaseessmenttest-4799", "vulnerabilityaseessmenttest-6440", armsql.VulnerabilityAssessmentNameDefault, armsql.BaselineNameDefault, "VA1001", armsql.DatabaseSQLVulnerabilityAssessmentRuleBaselineInput{ - Properties: &armsql.DatabaseSQLVulnerabilityAssessmentRuleBaselineInputProperties{ - LatestScan: to.Ptr(false), - Results: [][]*string{ - { - to.Ptr("userA"), - to.Ptr("SELECT")}, - { - to.Ptr("userB"), - to.Ptr("SELECT")}, - { - to.Ptr("userC"), - to.Ptr("SELECT")}}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DatabaseSQLVulnerabilityAssessmentRuleBaseline = armsql.DatabaseSQLVulnerabilityAssessmentRuleBaseline{ - // Name: to.Ptr("Scan123"), - // Type: to.Ptr("Microsoft.Sql/servers/vulnerabilityAssessments/rules/baselines"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/servers/vulnerabilityaseessmenttest-6440/sqlVulnerabilityAssessments/default/rules/VA1001"), - // Properties: &armsql.DatabaseSQLVulnerabilityAssessmentRuleBaselineProperties{ - // Results: [][]*string{ - // []*string{ - // to.Ptr("userA"), - // to.Ptr("SELECT")}, - // []*string{ - // to.Ptr("userB"), - // to.Ptr("SELECT")}, - // []*string{ - // to.Ptr("userC"), - // to.Ptr("SELECT")}}, - // }, - // } -} diff --git a/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentrulebaselines_client.go b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentrulebaselines_client.go index 5df71ea6b1e8..b6b79fc31855 100644 --- a/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentrulebaselines_client.go +++ b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentrulebaselines_client.go @@ -46,7 +46,7 @@ func NewVulnerabilityAssessmentRuleBaselinesClient(subscriptionID string, creden // Delete - Removes the database's vulnerability assessment rule baseline. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -104,7 +104,7 @@ func (client *VulnerabilityAssessmentRuleBaselinesClient) deleteCreateRequest(ct } reqQP := req.Raw().URL.Query() reqQP.Set("systemDatabaseName", "master") - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } diff --git a/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentrulebaselines_client_example_test.go b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentrulebaselines_client_example_test.go deleted file mode 100644 index bc598ea6ac94..000000000000 --- a/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentrulebaselines_client_example_test.go +++ /dev/null @@ -1,35 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/SqlVulnerabilityAssessmentRuleBaselineDelete.json -func ExampleVulnerabilityAssessmentRuleBaselinesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewVulnerabilityAssessmentRuleBaselinesClient().Delete(ctx, "vulnerabilityaseessmenttest-4711", "vulnerabilityaseessmenttest-6411", armsql.VulnerabilityAssessmentNameDefault, armsql.BaselineNameDefault, "VA1001", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/sql/armsql/vulnerabilityassessments_client.go b/sdk/resourcemanager/sql/armsql/vulnerabilityassessments_client.go index 3921f6455ac4..aa1d2ecbeaf1 100644 --- a/sdk/resourcemanager/sql/armsql/vulnerabilityassessments_client.go +++ b/sdk/resourcemanager/sql/armsql/vulnerabilityassessments_client.go @@ -46,7 +46,7 @@ func NewVulnerabilityAssessmentsClient(subscriptionID string, credential azcore. // Delete - Removes SQL Vulnerability Assessment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -94,7 +94,7 @@ func (client *VulnerabilityAssessmentsClient) deleteCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } diff --git a/sdk/resourcemanager/sql/armsql/vulnerabilityassessments_client_example_test.go b/sdk/resourcemanager/sql/armsql/vulnerabilityassessments_client_example_test.go deleted file mode 100644 index 887a18d824d0..000000000000 --- a/sdk/resourcemanager/sql/armsql/vulnerabilityassessments_client_example_test.go +++ /dev/null @@ -1,35 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/SqlVulnerabilityAssessmentDelete.json -func ExampleVulnerabilityAssessmentsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewVulnerabilityAssessmentsClient().Delete(ctx, "vulnerabilityaseessmenttest-4799", "vulnerabilityaseessmenttest-6440", armsql.VulnerabilityAssessmentNameDefault, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentscanresult_client.go b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentscanresult_client.go index 6add9bba8800..25ba0ded2db0 100644 --- a/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentscanresult_client.go +++ b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentscanresult_client.go @@ -46,7 +46,7 @@ func NewVulnerabilityAssessmentScanResultClient(subscriptionID string, credentia // Get - Gets a vulnerability assessment scan record of a database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -106,7 +106,7 @@ func (client *VulnerabilityAssessmentScanResultClient) getCreateRequest(ctx cont } reqQP := req.Raw().URL.Query() reqQP.Set("systemDatabaseName", "master") - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -123,7 +123,7 @@ func (client *VulnerabilityAssessmentScanResultClient) getHandleResponse(resp *h // NewListByScanPager - Gets a vulnerability assessment scan record of a database. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -188,7 +188,7 @@ func (client *VulnerabilityAssessmentScanResultClient) listByScanCreateRequest(c } reqQP := req.Raw().URL.Query() reqQP.Set("systemDatabaseName", "master") - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentscanresult_client_example_test.go b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentscanresult_client_example_test.go deleted file mode 100644 index fb330f255000..000000000000 --- a/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentscanresult_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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/SqlVulnerabilityAssessmentListScansResults.json -func ExampleVulnerabilityAssessmentScanResultClient_NewListByScanPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVulnerabilityAssessmentScanResultClient().NewListByScanPager("vulnerabilityassessmenttest-4711", "testsvr", armsql.SQLVulnerabilityAssessmentNameDefault, "scanId1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VulnerabilityAssessmentScanListResult = armsql.VulnerabilityAssessmentScanListResult{ - // Value: []*armsql.VulnerabilityAssessmentScanResults{ - // { - // Name: to.Ptr("VA1234"), - // Type: to.Ptr("Microsoft.Sql/servers/sqlVulnerabilityAssessments/scans/scanResults"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityassessmenttest-4711/providers/Microsoft.Sql/servers/testsvr/sqlVulnerabilityAssessments/Default/scans/scanId1/scanResults/VA1234"), - // Properties: &armsql.VulnerabilityAssessmentScanResultProperties{ - // IsTrimmed: to.Ptr(false), - // QueryResults: [][]*string{ - // []*string{ - // to.Ptr("a1"), - // to.Ptr("a2"), - // to.Ptr("a3")}, - // []*string{ - // to.Ptr("b1"), - // to.Ptr("b2"), - // to.Ptr("b3")}}, - // Remediation: &armsql.Remediation{ - // Description: to.Ptr("Remove users"), - // Automated: to.Ptr(false), - // Scripts: []*string{ - // to.Ptr("drop user a"), - // to.Ptr("drop user b")}, - // }, - // RuleID: to.Ptr("VA1234"), - // RuleMetadata: &armsql.VaRule{ - // Description: to.Ptr("This is an example check"), - // BenchmarkReferences: []*armsql.BenchmarkReference{ - // { - // Benchmark: to.Ptr("fedramp"), - // Reference: to.Ptr("v1"), - // }}, - // Category: to.Ptr("information"), - // QueryCheck: &armsql.QueryCheck{ - // ColumnNames: []*string{ - // to.Ptr("col1"), - // to.Ptr("col2"), - // to.Ptr("col3")}, - // ExpectedResult: [][]*string{ - // }, - // Query: to.Ptr("Select a1,a2, a3"), - // }, - // Rationale: to.Ptr("This is important"), - // RuleID: to.Ptr("VA1234"), - // RuleType: to.Ptr(armsql.RuleTypeNegativeList), - // Severity: to.Ptr(armsql.RuleSeverityInformational), - // Title: to.Ptr("This is the title"), - // }, - // Status: to.Ptr(armsql.RuleStatusNonFinding), - // }, - // }, - // { - // Name: to.Ptr("VA2341"), - // Type: to.Ptr("Microsoft.Sql/servers/sqlVulnerabilityAssessments/scans/scanResults"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityassessmenttest-4711/providers/Microsoft.Sql/servers/testsvr/sqlVulnerabilityAssessments/Default/scans/scanId1/scanResults/VA2341"), - // Properties: &armsql.VulnerabilityAssessmentScanResultProperties{ - // IsTrimmed: to.Ptr(false), - // QueryResults: [][]*string{ - // []*string{ - // to.Ptr("a1"), - // to.Ptr("a2"), - // to.Ptr("a3")}, - // []*string{ - // to.Ptr("b1"), - // to.Ptr("b2"), - // to.Ptr("b3")}}, - // Remediation: &armsql.Remediation{ - // Description: to.Ptr("Remove users"), - // Automated: to.Ptr(false), - // Scripts: []*string{ - // to.Ptr("drop user a"), - // to.Ptr("drop user b")}, - // }, - // RuleID: to.Ptr("VA2341"), - // RuleMetadata: &armsql.VaRule{ - // Description: to.Ptr("This is an example check"), - // BenchmarkReferences: []*armsql.BenchmarkReference{ - // { - // Benchmark: to.Ptr("fedramp"), - // Reference: to.Ptr("v1"), - // }}, - // Category: to.Ptr("information"), - // QueryCheck: &armsql.QueryCheck{ - // ColumnNames: []*string{ - // to.Ptr("col1"), - // to.Ptr("col2"), - // to.Ptr("col3")}, - // ExpectedResult: [][]*string{ - // }, - // Query: to.Ptr("Select a1,a2, a3"), - // }, - // Rationale: to.Ptr("This is important"), - // RuleID: to.Ptr("VA1234"), - // RuleType: to.Ptr(armsql.RuleTypeNegativeList), - // Severity: to.Ptr(armsql.RuleSeverityInformational), - // Title: to.Ptr("This is the title"), - // }, - // Status: to.Ptr(armsql.RuleStatusNonFinding), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/SqlVulnerabilityAssessmentScansResults.json -func ExampleVulnerabilityAssessmentScanResultClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVulnerabilityAssessmentScanResultClient().Get(ctx, "vulnerabilityassessmenttest-4711", "vulnerabilityassessmenttest-6411", armsql.SQLVulnerabilityAssessmentNameDefault, "scanId1", "VA1234", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VulnerabilityAssessmentScanResults = armsql.VulnerabilityAssessmentScanResults{ - // Name: to.Ptr("VA1234"), - // Type: to.Ptr("Microsoft.Sql/servers/sqlVulnerabilityAssessments/scans/scanResults"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityassessmenttest-4711/providers/Microsoft.Sql/servers/vulnerabilityassessmenttest-6411/sqlVulnerabilityAssessments/Default/scans/scanId1/scanResults/VA1234"), - // Properties: &armsql.VulnerabilityAssessmentScanResultProperties{ - // IsTrimmed: to.Ptr(false), - // QueryResults: [][]*string{ - // []*string{ - // to.Ptr("a1"), - // to.Ptr("a2"), - // to.Ptr("a3")}, - // []*string{ - // to.Ptr("b1"), - // to.Ptr("b2"), - // to.Ptr("b3")}}, - // Remediation: &armsql.Remediation{ - // Description: to.Ptr("Remove users"), - // Automated: to.Ptr(false), - // Scripts: []*string{ - // to.Ptr("drop user a"), - // to.Ptr("drop user b")}, - // }, - // RuleID: to.Ptr("VA1234"), - // RuleMetadata: &armsql.VaRule{ - // Description: to.Ptr("This is an example check"), - // BenchmarkReferences: []*armsql.BenchmarkReference{ - // { - // Benchmark: to.Ptr("fedramp"), - // Reference: to.Ptr("v1"), - // }}, - // Category: to.Ptr("information"), - // QueryCheck: &armsql.QueryCheck{ - // ColumnNames: []*string{ - // to.Ptr("col1"), - // to.Ptr("col2"), - // to.Ptr("col3")}, - // ExpectedResult: [][]*string{ - // }, - // Query: to.Ptr("Select a1,a2, a3"), - // }, - // Rationale: to.Ptr("This is important"), - // RuleID: to.Ptr("VA1234"), - // RuleType: to.Ptr(armsql.RuleTypeNegativeList), - // Severity: to.Ptr(armsql.RuleSeverityInformational), - // Title: to.Ptr("This is the title"), - // }, - // Status: to.Ptr(armsql.RuleStatusNonFinding), - // }, - // } -} diff --git a/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentscans_client.go b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentscans_client.go index 430d670851f3..0cc06827e4c1 100644 --- a/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentscans_client.go +++ b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentscans_client.go @@ -46,7 +46,7 @@ func NewVulnerabilityAssessmentScansClient(subscriptionID string, credential azc // Get - Get a system database vulnerability assessment scan record. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -100,7 +100,7 @@ func (client *VulnerabilityAssessmentScansClient) getCreateRequest(ctx context.C } reqQP := req.Raw().URL.Query() reqQP.Set("systemDatabaseName", "master") - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -117,7 +117,7 @@ func (client *VulnerabilityAssessmentScansClient) getHandleResponse(resp *http.R // NewListBySQLVulnerabilityAssessmentsPager - Lists the vulnerability assessment scans of a database. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -177,7 +177,7 @@ func (client *VulnerabilityAssessmentScansClient) listBySQLVulnerabilityAssessme } reqQP := req.Raw().URL.Query() reqQP.Set("systemDatabaseName", "master") - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentscans_client_example_test.go b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentscans_client_example_test.go deleted file mode 100644 index 805fc10257c2..000000000000 --- a/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentscans_client_example_test.go +++ /dev/null @@ -1,158 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/SqlVulnerabilityAssessmentScanRecordsListByDatabase.json -func ExampleVulnerabilityAssessmentScansClient_NewListBySQLVulnerabilityAssessmentsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVulnerabilityAssessmentScansClient().NewListBySQLVulnerabilityAssessmentsPager("vulnerabilityassessmenttest-4711", "vulnerabilityassessmenttest-6411", armsql.VulnerabilityAssessmentNameDefault, nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VulnerabilityAssessmentScanRecordForSQLListResult = armsql.VulnerabilityAssessmentScanRecordForSQLListResult{ - // Value: []*armsql.VulnerabilityAssessmentScanRecordForSQL{ - // { - // Name: to.Ptr("scan001"), - // Type: to.Ptr("Microsoft.Sql/servers/sqlVulnerabilityAssessments/scans"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityassessmenttest-4711/providers/Microsoft.Sql/servers/vulnerabilityassessmenttest-6411/sqlVulnerabilityAssessments/default/scans/scan001"), - // Properties: &armsql.VulnerabilityAssessmentScanRecordForSQLProperties{ - // Database: to.Ptr("master"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-23T06:49:00.7236217Z"); return t}()), - // HighSeverityFailedRulesCount: to.Ptr[int32](3), - // IsBaselineApplied: to.Ptr(false), - // LastScanTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-22T23:49:00.6455136-07:00"); return t}()), - // LowSeverityFailedRulesCount: to.Ptr[int32](1), - // MediumSeverityFailedRulesCount: to.Ptr[int32](2), - // ScanID: to.Ptr("scan001"), - // Server: to.Ptr("vulnerabilityassessmenttest-6411"), - // SQLVersion: to.Ptr("15.0.2000"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-22T23:49:00.6455136-07:00"); return t}()), - // State: to.Ptr(armsql.VulnerabilityAssessmentScanStateFailed), - // TotalFailedRulesCount: to.Ptr[int32](6), - // TotalPassedRulesCount: to.Ptr[int32](20), - // TotalRulesCount: to.Ptr[int32](26), - // TriggerType: to.Ptr(armsql.VulnerabilityAssessmentScanTriggerTypeRecurring), - // }, - // }, - // { - // Name: to.Ptr("scan001"), - // Type: to.Ptr("Microsoft.Sql/servers/sqlVulnerabilityAssessments/scans"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityassessmenttest-4711/providers/Microsoft.Sql/servers/vulnerabilityassessmenttest-6411/sqlVulnerabilityAssessments/default/scans/scan002"), - // Properties: &armsql.VulnerabilityAssessmentScanRecordForSQLProperties{ - // Database: to.Ptr("master"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-23T06:49:00.7236217Z"); return t}()), - // HighSeverityFailedRulesCount: to.Ptr[int32](3), - // IsBaselineApplied: to.Ptr(false), - // LastScanTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-22T23:49:00.6455136-07:00"); return t}()), - // LowSeverityFailedRulesCount: to.Ptr[int32](1), - // MediumSeverityFailedRulesCount: to.Ptr[int32](2), - // ScanID: to.Ptr("scan002"), - // Server: to.Ptr("vulnerabilityassessmenttest-6411"), - // SQLVersion: to.Ptr("15.0.2000"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-22T23:49:00.6455136-07:00"); return t}()), - // State: to.Ptr(armsql.VulnerabilityAssessmentScanStateFailed), - // TotalFailedRulesCount: to.Ptr[int32](6), - // TotalPassedRulesCount: to.Ptr[int32](20), - // TotalRulesCount: to.Ptr[int32](26), - // TriggerType: to.Ptr(armsql.VulnerabilityAssessmentScanTriggerTypeRecurring), - // }, - // }, - // { - // Name: to.Ptr("scan001"), - // Type: to.Ptr("Microsoft.Sql/servers/sqlVulnerabilityAssessments/scans"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityassessmenttest-4711/providers/Microsoft.Sql/servers/vulnerabilityassessmenttest-6411/sqlVulnerabilityAssessments/default/scans/scan003"), - // Properties: &armsql.VulnerabilityAssessmentScanRecordForSQLProperties{ - // Database: to.Ptr("master"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-23T06:49:00.7236217Z"); return t}()), - // HighSeverityFailedRulesCount: to.Ptr[int32](0), - // IsBaselineApplied: to.Ptr(true), - // LastScanTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-22T23:49:00.6455136-07:00"); return t}()), - // LowSeverityFailedRulesCount: to.Ptr[int32](0), - // MediumSeverityFailedRulesCount: to.Ptr[int32](0), - // ScanID: to.Ptr("scan003"), - // Server: to.Ptr("vulnerabilityassessmenttest-6411"), - // SQLVersion: to.Ptr("15.0.2000"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-22T23:49:00.6455136-07:00"); return t}()), - // State: to.Ptr(armsql.VulnerabilityAssessmentScanStateFailed), - // TotalFailedRulesCount: to.Ptr[int32](6), - // TotalPassedRulesCount: to.Ptr[int32](20), - // TotalRulesCount: to.Ptr[int32](26), - // TriggerType: to.Ptr(armsql.VulnerabilityAssessmentScanTriggerTypeRecurring), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/SqlVulnerabilityAssessmentScan.json -func ExampleVulnerabilityAssessmentScansClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVulnerabilityAssessmentScansClient().Get(ctx, "vulnerabilityassessmenttest-4711", "vulnerabilityassessmenttest-6411", armsql.VulnerabilityAssessmentNameDefault, "scan001", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VulnerabilityAssessmentScanRecordForSQL = armsql.VulnerabilityAssessmentScanRecordForSQL{ - // Name: to.Ptr("scan001"), - // Type: to.Ptr("Microsoft.Sql/servers/sqlVulnerabilityAssessments/scans"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityassessmenttest-4711/providers/Microsoft.Sql/servers/vulnerabilityassessmenttest-6411/sqlVulnerabilityAssessments/default/scans/scan001"), - // Properties: &armsql.VulnerabilityAssessmentScanRecordForSQLProperties{ - // Database: to.Ptr("master"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-23T06:49:00.7236217Z"); return t}()), - // HighSeverityFailedRulesCount: to.Ptr[int32](3), - // IsBaselineApplied: to.Ptr(false), - // LastScanTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-22T23:49:00.6455136-07:00"); return t}()), - // LowSeverityFailedRulesCount: to.Ptr[int32](1), - // MediumSeverityFailedRulesCount: to.Ptr[int32](2), - // ScanID: to.Ptr("scan001"), - // Server: to.Ptr("vulnerabilityassessmenttest-6411"), - // SQLVersion: to.Ptr("15.0.2000"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-22T23:49:00.6455136-07:00"); return t}()), - // State: to.Ptr(armsql.VulnerabilityAssessmentScanStateFailed), - // TotalFailedRulesCount: to.Ptr[int32](6), - // TotalPassedRulesCount: to.Ptr[int32](20), - // TotalRulesCount: to.Ptr[int32](26), - // TriggerType: to.Ptr(armsql.VulnerabilityAssessmentScanTriggerTypeRecurring), - // }, - // } -} diff --git a/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentssettings_client.go b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentssettings_client.go index f8690e0c51ad..e11d52882d9f 100644 --- a/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentssettings_client.go +++ b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentssettings_client.go @@ -46,7 +46,7 @@ func NewVulnerabilityAssessmentsSettingsClient(subscriptionID string, credential // CreateOrUpdate - Creates or updates SQL Vulnerability Assessment policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -96,7 +96,7 @@ func (client *VulnerabilityAssessmentsSettingsClient) createOrUpdateCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -117,7 +117,7 @@ func (client *VulnerabilityAssessmentsSettingsClient) createOrUpdateHandleRespon // Get - Gets SQL Vulnerability Assessment policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -166,7 +166,7 @@ func (client *VulnerabilityAssessmentsSettingsClient) getCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -183,7 +183,7 @@ func (client *VulnerabilityAssessmentsSettingsClient) getHandleResponse(resp *ht // NewListByServerPager - Lists SQL Vulnerability Assessment policies associated with a server. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -237,7 +237,7 @@ func (client *VulnerabilityAssessmentsSettingsClient) listByServerCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentssettings_client_example_test.go b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentssettings_client_example_test.go deleted file mode 100644 index 7662c09ae5fa..000000000000 --- a/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentssettings_client_example_test.go +++ /dev/null @@ -1,115 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/SqlVulnerabilityAssessmentListByServer.json -func ExampleVulnerabilityAssessmentsSettingsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVulnerabilityAssessmentsSettingsClient().NewListByServerPager("vulnerabilityaseessmenttest-4799", "vulnerabilityaseessmenttest-6440", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VulnerabilityAssessmentListResult = armsql.VulnerabilityAssessmentListResult{ - // Value: []*armsql.VulnerabilityAssessment{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/servers/sqlVulnerabilityAssessments"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/servers/vulnerabilityaseessmenttest-6440/sqlVulnerabilityAssessments/"), - // Properties: &armsql.VulnerabilityAssessmentPolicyProperties{ - // State: to.Ptr(armsql.SQLVulnerabilityAssessmentStateEnabled), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/SqlVulnerabilityAssessmentGet.json -func ExampleVulnerabilityAssessmentsSettingsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVulnerabilityAssessmentsSettingsClient().Get(ctx, "vulnerabilityaseessmenttest-4799", "vulnerabilityaseessmenttest-6440", armsql.SQLVulnerabilityAssessmentNameDefault, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VulnerabilityAssessment = armsql.VulnerabilityAssessment{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/servers/sqlVulnerabilityAssessments"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/servers/vulnerabilityaseessmenttest-6440/sqlVulnerabilityAssessments/default"), - // Properties: &armsql.VulnerabilityAssessmentPolicyProperties{ - // State: to.Ptr(armsql.SQLVulnerabilityAssessmentStateEnabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/SqlVulnerabilityAssessmentCreate.json -func ExampleVulnerabilityAssessmentsSettingsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVulnerabilityAssessmentsSettingsClient().CreateOrUpdate(ctx, "vulnerabilityaseessmenttest-4799", "vulnerabilityaseessmenttest-6440", armsql.VulnerabilityAssessmentNameDefault, armsql.VulnerabilityAssessment{ - Properties: &armsql.VulnerabilityAssessmentPolicyProperties{ - State: to.Ptr(armsql.SQLVulnerabilityAssessmentStateEnabled), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VulnerabilityAssessment = armsql.VulnerabilityAssessment{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Sql/servers/sqlVulnerabilityAssessments"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttest-4799/providers/Microsoft.Sql/servers/vulnerabilityaseessmenttest-6440/sqlVulnerabilityAssessments/default"), - // Properties: &armsql.VulnerabilityAssessmentPolicyProperties{ - // State: to.Ptr(armsql.SQLVulnerabilityAssessmentStateEnabled), - // }, - // } -} diff --git a/sdk/resourcemanager/sql/armsql/workloadclassifiers_client.go b/sdk/resourcemanager/sql/armsql/workloadclassifiers_client.go index cb9fd6b2a845..caa1b6c15de8 100644 --- a/sdk/resourcemanager/sql/armsql/workloadclassifiers_client.go +++ b/sdk/resourcemanager/sql/armsql/workloadclassifiers_client.go @@ -46,7 +46,7 @@ func NewWorkloadClassifiersClient(subscriptionID string, credential azcore.Token // BeginCreateOrUpdate - Creates or updates a workload classifier. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -72,7 +72,7 @@ func (client *WorkloadClassifiersClient) BeginCreateOrUpdate(ctx context.Context // CreateOrUpdate - Creates or updates a workload classifier. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview func (client *WorkloadClassifiersClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, workloadGroupName string, workloadClassifierName string, parameters WorkloadClassifier, options *WorkloadClassifiersClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, workloadGroupName, workloadClassifierName, parameters, options) @@ -122,7 +122,7 @@ func (client *WorkloadClassifiersClient) createOrUpdateCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -134,7 +134,7 @@ func (client *WorkloadClassifiersClient) createOrUpdateCreateRequest(ctx context // BeginDelete - Deletes a workload classifier. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -159,7 +159,7 @@ func (client *WorkloadClassifiersClient) BeginDelete(ctx context.Context, resour // Delete - Deletes a workload classifier. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview func (client *WorkloadClassifiersClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, databaseName string, workloadGroupName string, workloadClassifierName string, options *WorkloadClassifiersClientBeginDeleteOptions) (*http.Response, error) { var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, databaseName, workloadGroupName, workloadClassifierName, options) @@ -209,7 +209,7 @@ func (client *WorkloadClassifiersClient) deleteCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -217,7 +217,7 @@ func (client *WorkloadClassifiersClient) deleteCreateRequest(ctx context.Context // Get - Gets a workload classifier // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -275,7 +275,7 @@ func (client *WorkloadClassifiersClient) getCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -292,7 +292,7 @@ func (client *WorkloadClassifiersClient) getHandleResponse(resp *http.Response) // NewListByWorkloadGroupPager - Gets the list of workload classifiers for a workload group // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -356,7 +356,7 @@ func (client *WorkloadClassifiersClient) listByWorkloadGroupCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/workloadclassifiers_client_example_test.go b/sdk/resourcemanager/sql/armsql/workloadclassifiers_client_example_test.go deleted file mode 100644 index 674c1c9aad8c..000000000000 --- a/sdk/resourcemanager/sql/armsql/workloadclassifiers_client_example_test.go +++ /dev/null @@ -1,227 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetWorkloadClassifier.json -func ExampleWorkloadClassifiersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWorkloadClassifiersClient().Get(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", "wlm_workloadgroup", "wlm_classifier", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.WorkloadClassifier = armsql.WorkloadClassifier{ - // Name: to.Ptr("wlm_classifier"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/workloadGroups/workloadClassifiers"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb/workloadGroups/wlm_workloadgroup/workloadClassifiers/wlm_classifier"), - // Properties: &armsql.WorkloadClassifierProperties{ - // Context: to.Ptr("test_context"), - // EndTime: to.Ptr("14:00"), - // Importance: to.Ptr("high"), - // Label: to.Ptr("test_label"), - // MemberName: to.Ptr("dbo"), - // StartTime: to.Ptr("12:00"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateWorkloadClassifierMax.json -func ExampleWorkloadClassifiersClient_BeginCreateOrUpdate_createAWorkloadGroupWithAllPropertiesSpecified() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewWorkloadClassifiersClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", "wlm_workloadgroup", "wlm_workloadclassifier", armsql.WorkloadClassifier{ - Properties: &armsql.WorkloadClassifierProperties{ - Context: to.Ptr("test_context"), - EndTime: to.Ptr("14:00"), - Importance: to.Ptr("high"), - Label: to.Ptr("test_label"), - MemberName: to.Ptr("dbo"), - StartTime: to.Ptr("12:00"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.WorkloadClassifier = armsql.WorkloadClassifier{ - // Name: to.Ptr("wlm_workloadclassifier"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/workloadGroups/workloadClassifiers"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb/workloadGroups/wlm_workloadgroup/workloadClassifiers/wlm_workloadclassifier"), - // Properties: &armsql.WorkloadClassifierProperties{ - // Context: to.Ptr("test_context"), - // EndTime: to.Ptr("14:00"), - // Importance: to.Ptr("high"), - // Label: to.Ptr("test_label"), - // MemberName: to.Ptr("dbo"), - // StartTime: to.Ptr("12:00"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateWorkloadClassifierMin.json -func ExampleWorkloadClassifiersClient_BeginCreateOrUpdate_createAWorkloadGroupWithTheRequiredPropertiesSpecified() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewWorkloadClassifiersClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", "wlm_workloadgroup", "wlm_workloadclassifier", armsql.WorkloadClassifier{ - Properties: &armsql.WorkloadClassifierProperties{ - MemberName: to.Ptr("dbo"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.WorkloadClassifier = armsql.WorkloadClassifier{ - // Name: to.Ptr("wlm_workloadclassifier"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/workloadGroups/workloadClassifiers"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb/workloadGroups/wlm_workloadgroup/workloadClassifiers/wlm_workloadclassifier"), - // Properties: &armsql.WorkloadClassifierProperties{ - // Context: to.Ptr(""), - // EndTime: to.Ptr(""), - // Importance: to.Ptr(""), - // Label: to.Ptr(""), - // MemberName: to.Ptr("dbo"), - // StartTime: to.Ptr(""), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteWorkloadClassifier.json -func ExampleWorkloadClassifiersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewWorkloadClassifiersClient().BeginDelete(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", "wlm_workloadgroup", "wlm_workloadclassifier", 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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetWorkloadClassifierList.json -func ExampleWorkloadClassifiersClient_NewListByWorkloadGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewWorkloadClassifiersClient().NewListByWorkloadGroupPager("Default-SQL-SouthEastAsia", "testsvr", "testdb", "wlm_workloadgroup", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.WorkloadClassifierListResult = armsql.WorkloadClassifierListResult{ - // Value: []*armsql.WorkloadClassifier{ - // { - // Name: to.Ptr("classifier3"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/workloadGroups/workloadClassifiers"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb/workloadGroups/wlm_workloadgroup/workloadClassifiers/classifier3"), - // Properties: &armsql.WorkloadClassifierProperties{ - // Context: to.Ptr(""), - // EndTime: to.Ptr(""), - // Importance: to.Ptr("high"), - // Label: to.Ptr(""), - // MemberName: to.Ptr("dbo"), - // StartTime: to.Ptr(""), - // }, - // }, - // { - // Name: to.Ptr("classifier1"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/workloadGroups/workloadClassifiers"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb/workloadGroups/wlm_workloadgroup/workloadClassifiers/classifier1"), - // Properties: &armsql.WorkloadClassifierProperties{ - // Context: to.Ptr("test_context"), - // EndTime: to.Ptr("14:00"), - // Importance: to.Ptr("high"), - // Label: to.Ptr("test_label"), - // MemberName: to.Ptr("dbo"), - // StartTime: to.Ptr("12:00"), - // }, - // }, - // { - // Name: to.Ptr("classifier2"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/workloadGroups/workloadClassifiers"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb/workloadGroups/wlm_workloadgroup/workloadClassifiers/classifier2"), - // Properties: &armsql.WorkloadClassifierProperties{ - // Context: to.Ptr(""), - // EndTime: to.Ptr("17:00"), - // Importance: to.Ptr("high"), - // Label: to.Ptr(""), - // MemberName: to.Ptr("dbo"), - // StartTime: to.Ptr("11:00"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/sql/armsql/workloadgroups_client.go b/sdk/resourcemanager/sql/armsql/workloadgroups_client.go index 38e032c9745b..002535f9879c 100644 --- a/sdk/resourcemanager/sql/armsql/workloadgroups_client.go +++ b/sdk/resourcemanager/sql/armsql/workloadgroups_client.go @@ -46,7 +46,7 @@ func NewWorkloadGroupsClient(subscriptionID string, credential azcore.TokenCrede // BeginCreateOrUpdate - Creates or updates a workload group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -71,7 +71,7 @@ func (client *WorkloadGroupsClient) BeginCreateOrUpdate(ctx context.Context, res // CreateOrUpdate - Creates or updates a workload group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview func (client *WorkloadGroupsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, workloadGroupName string, parameters WorkloadGroup, options *WorkloadGroupsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, workloadGroupName, parameters, options) @@ -117,7 +117,7 @@ func (client *WorkloadGroupsClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") 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 *WorkloadGroupsClient) createOrUpdateCreateRequest(ctx context.Cont // BeginDelete - Deletes a workload group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -153,7 +153,7 @@ func (client *WorkloadGroupsClient) BeginDelete(ctx context.Context, resourceGro // Delete - Deletes a workload group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview func (client *WorkloadGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, databaseName string, workloadGroupName string, options *WorkloadGroupsClientBeginDeleteOptions) (*http.Response, error) { var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, databaseName, workloadGroupName, options) @@ -199,7 +199,7 @@ func (client *WorkloadGroupsClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -207,7 +207,7 @@ func (client *WorkloadGroupsClient) deleteCreateRequest(ctx context.Context, res // Get - Gets a workload group // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -260,7 +260,7 @@ func (client *WorkloadGroupsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -277,7 +277,7 @@ func (client *WorkloadGroupsClient) getHandleResponse(resp *http.Response) (Work // NewListByDatabasePager - Gets the list of workload groups // -// Generated from API version 2020-11-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serverName - The name of the server. @@ -336,7 +336,7 @@ func (client *WorkloadGroupsClient) listByDatabaseCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/workloadgroups_client_example_test.go b/sdk/resourcemanager/sql/armsql/workloadgroups_client_example_test.go deleted file mode 100644 index fa3c3cfce3c6..000000000000 --- a/sdk/resourcemanager/sql/armsql/workloadgroups_client_example_test.go +++ /dev/null @@ -1,229 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsql_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/sql/armsql/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetWorkloadGroup.json -func ExampleWorkloadGroupsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWorkloadGroupsClient().Get(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", "smallrc", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.WorkloadGroup = armsql.WorkloadGroup{ - // Name: to.Ptr("smallrc"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/workloadGroups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb/workloadGroups/smallrc"), - // Properties: &armsql.WorkloadGroupProperties{ - // Importance: to.Ptr("normal"), - // MaxResourcePercent: to.Ptr[int32](100), - // MaxResourcePercentPerRequest: to.Ptr[float64](3), - // MinResourcePercent: to.Ptr[int32](0), - // MinResourcePercentPerRequest: to.Ptr[float64](3), - // QueryExecutionTimeout: to.Ptr[int32](0), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateWorkloadGroupMax.json -func ExampleWorkloadGroupsClient_BeginCreateOrUpdate_createAWorkloadGroupWithAllPropertiesSpecified() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewWorkloadGroupsClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", "smallrc", armsql.WorkloadGroup{ - Properties: &armsql.WorkloadGroupProperties{ - Importance: to.Ptr("normal"), - MaxResourcePercent: to.Ptr[int32](100), - MaxResourcePercentPerRequest: to.Ptr[float64](3), - MinResourcePercent: to.Ptr[int32](0), - MinResourcePercentPerRequest: to.Ptr[float64](3), - QueryExecutionTimeout: 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.WorkloadGroup = armsql.WorkloadGroup{ - // Name: to.Ptr("smallrc"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/workloadGroups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb/workloadGroups/smallrc"), - // Properties: &armsql.WorkloadGroupProperties{ - // Importance: to.Ptr("normal"), - // MaxResourcePercent: to.Ptr[int32](100), - // MaxResourcePercentPerRequest: to.Ptr[float64](3), - // MinResourcePercent: to.Ptr[int32](0), - // MinResourcePercentPerRequest: to.Ptr[float64](3), - // QueryExecutionTimeout: to.Ptr[int32](0), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateWorkloadGroupMin.json -func ExampleWorkloadGroupsClient_BeginCreateOrUpdate_createAWorkloadGroupWithTheRequiredPropertiesSpecified() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewWorkloadGroupsClient().BeginCreateOrUpdate(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", "smallrc", armsql.WorkloadGroup{ - Properties: &armsql.WorkloadGroupProperties{ - MaxResourcePercent: to.Ptr[int32](100), - MinResourcePercent: to.Ptr[int32](0), - MinResourcePercentPerRequest: to.Ptr[float64](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.WorkloadGroup = armsql.WorkloadGroup{ - // Name: to.Ptr("smallrc"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/workloadGroups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb/workloadGroups/smallrc"), - // Properties: &armsql.WorkloadGroupProperties{ - // Importance: to.Ptr("normal"), - // MaxResourcePercent: to.Ptr[int32](100), - // MaxResourcePercentPerRequest: to.Ptr[float64](3), - // MinResourcePercent: to.Ptr[int32](0), - // MinResourcePercentPerRequest: to.Ptr[float64](3), - // QueryExecutionTimeout: to.Ptr[int32](0), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteWorkloadGroup.json -func ExampleWorkloadGroupsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewWorkloadGroupsClient().BeginDelete(ctx, "Default-SQL-SouthEastAsia", "testsvr", "testdb", "wlm_workloadgroup", 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/fe78d8f1e7bd86c778c7e1cafd52cb0e9fec67ef/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetWorkloadGroupList.json -func ExampleWorkloadGroupsClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsql.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewWorkloadGroupsClient().NewListByDatabasePager("Default-SQL-SouthEastAsia", "testsvr", "testdb", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.WorkloadGroupListResult = armsql.WorkloadGroupListResult{ - // Value: []*armsql.WorkloadGroup{ - // { - // Name: to.Ptr("smallrc"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/workloadGroups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb/workloadGroups/smallrc"), - // Properties: &armsql.WorkloadGroupProperties{ - // Importance: to.Ptr("normal"), - // MaxResourcePercent: to.Ptr[int32](100), - // MaxResourcePercentPerRequest: to.Ptr[float64](5), - // MinResourcePercent: to.Ptr[int32](0), - // MinResourcePercentPerRequest: to.Ptr[float64](5), - // QueryExecutionTimeout: to.Ptr[int32](0), - // }, - // }, - // { - // Name: to.Ptr("mediumrc"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/workloadGroups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb/workloadGroups/mediumrc"), - // Properties: &armsql.WorkloadGroupProperties{ - // Importance: to.Ptr("normal"), - // MaxResourcePercent: to.Ptr[int32](100), - // MaxResourcePercentPerRequest: to.Ptr[float64](10), - // MinResourcePercent: to.Ptr[int32](0), - // MinResourcePercentPerRequest: to.Ptr[float64](10), - // QueryExecutionTimeout: to.Ptr[int32](0), - // }, - // }, - // { - // Name: to.Ptr("largerc"), - // Type: to.Ptr("Microsoft.Sql/servers/databases/workloadGroups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb/workloadGroups/largerc"), - // Properties: &armsql.WorkloadGroupProperties{ - // Importance: to.Ptr("high"), - // MaxResourcePercent: to.Ptr[int32](100), - // MaxResourcePercentPerRequest: to.Ptr[float64](20), - // MinResourcePercent: to.Ptr[int32](0), - // MinResourcePercentPerRequest: to.Ptr[float64](20), - // QueryExecutionTimeout: to.Ptr[int32](0), - // }, - // }}, - // } - } -}