From 24662ec3fa02fd74d9bcc2a7e6c9d43bae8921a6 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 5 Jun 2024 03:02:12 +0000 Subject: [PATCH] CodeGen from PR 29316 in Azure/azure-rest-api-specs Merge 08a92a0e84fd5a2b506934ca731f21e4eff6eb93 into f6f50c6388fd5836fa142384641b8353a99874ef --- sdk/resourcemanager/sql/armsql/CHANGELOG.md | 51 + .../sql/armsql/agent_client_example_test.go | 79 - sdk/resourcemanager/sql/armsql/autorest.md | 7 +- ...rmretentionpolicies_client_example_test.go | 123 - .../capabilities_client_example_test.go | 3048 --------------- sdk/resourcemanager/sql/armsql/constants.go | 295 +- ...tprotectionsettings_client_example_test.go | 183 - .../databaseadvisors_client_example_test.go | 815 ---- ...baseautomatictuning_client_example_test.go | 199 - ...lobauditingpolicies_client_example_test.go | 238 -- .../databasecolumns_client_example_test.go | 205 - ...ncryptionprotectors_client_example_test.go | 60 - .../databaseextensions_client_example_test.go | 109 - .../databaseoperations_client_example_test.go | 125 - ...erecommendedactions_client_example_test.go | 372 -- .../armsql/databases_client_example_test.go | 3318 ----------------- .../databaseschemas_client_example_test.go | 81 - ...curityalertpolicies_client_example_test.go | 226 -- ...assessmentbaselines_client_example_test.go | 324 -- ...sessmentexecutescan_client_example_test.go | 39 - ...ssmentrulebaselines_client_example_test.go | 186 - ...ssessmentscanresult_client_example_test.go | 213 -- ...lityassessmentscans_client_example_test.go | 158 - ...assessmentssettings_client_example_test.go | 82 - .../databasetables_client_example_test.go | 81 - .../databaseusages_client_example_test.go | 57 - ...ssmentrulebaselines_client_example_test.go | 144 - ...rabilityassessments_client_example_test.go | 235 -- ...lityassessmentscans_client_example_test.go | 182 - ...datamaskingpolicies_client_example_test.go | 124 - .../datamaskingrules_client_example_test.go | 251 -- ...houseuseractivities_client_example_test.go | 81 - .../deletedservers_client_example_test.go | 184 - .../distributedavailabilitygroups_client.go | 201 +- ...davailabilitygroups_client_example_test.go | 436 --- ...asticpoolactivities_client_example_test.go | 67 - ...ldatabaseactivities_client_example_test.go | 82 - ...asticpooloperations_client_example_test.go | 91 - .../elasticpools_client_example_test.go | 1547 -------- ...ncryptionprotectors_client_example_test.go | 195 - ...ndpointcertificates_client_example_test.go | 90 - ...lobauditingpolicies_client_example_test.go | 239 -- ...lobauditingpolicies_client_example_test.go | 207 - .../sql/armsql/failovergroups_client.go | 44 +- .../failovergroups_client_example_test.go | 447 --- .../distributedavailabilitygroups_server.go | 120 - .../armsql/fake/managedinstances_server.go | 70 +- .../armsql/fake/replicationlinks_server.go | 128 + .../firewallrules_client_example_test.go | 235 -- .../geobackuppolicies_client_example_test.go | 119 - sdk/resourcemanager/sql/armsql/go.mod | 12 +- sdk/resourcemanager/sql/armsql/go.sum | 17 - ...tancefailovergroups_client_example_test.go | 342 -- .../instancepools_client_example_test.go | 384 -- .../ipv6firewallrules_client_example_test.go | 197 - .../armsql/jobagents_client_example_test.go | 209 -- .../jobcredentials_client_example_test.go | 141 - .../jobexecutions_client_example_test.go | 355 -- ...jobprivateendpoints_client_example_test.go | 152 - .../sql/armsql/jobs_client_example_test.go | 229 -- .../jobstepexecutions_client_example_test.go | 111 - .../armsql/jobsteps_client_example_test.go | 454 --- ...jobtargetexecutions_client_example_test.go | 180 - .../jobtargetgroups_client_example_test.go | 269 -- .../armsql/jobversions_client_example_test.go | 81 - ...ledgerdigestuploads_client_example_test.go | 154 - ...ermretentionbackups_client_example_test.go | 807 ---- ...agedinstancebackups_client_example_test.go | 522 --- ...rmretentionpolicies_client_example_test.go | 139 - ...enancewindowoptions_client_example_test.go | 57 - .../maintenancewindows_client_example_test.go | 78 - ...rmretentionpolicies_client_example_test.go | 119 - ...tprotectionsettings_client_example_test.go | 183 - ...ageddatabasecolumns_client_example_test.go | 196 - ...abasemoveoperations_client_example_test.go | 262 -- ...ageddatabasequeries_client_example_test.go | 538 --- ...edsensitivitylabels_client_example_test.go | 62 - ...abaserestoredetails_client_example_test.go | 168 - .../manageddatabases_client_example_test.go | 786 ---- ...ageddatabaseschemas_client_example_test.go | 81 - ...curityalertpolicies_client_example_test.go | 193 - ...abasesecurityevents_client_example_test.go | 179 - ...sesensitivitylabels_client_example_test.go | 327 -- ...nageddatabasetables_client_example_test.go | 81 - ...arentdataencryption_client_example_test.go | 115 - ...ssmentrulebaselines_client_example_test.go | 144 - ...rabilityassessments_client_example_test.go | 196 - ...lityassessmentscans_client_example_test.go | 182 - ...tanceadministrators_client_example_test.go | 194 - ...tprotectionsettings_client_example_test.go | 191 - ...onlyauthentications_client_example_test.go | 140 - ...managedinstancedtcs_client_example_test.go | 233 -- ...ncryptionprotectors_client_example_test.go | 190 - ...managedinstancekeys_client_example_test.go | 169 - ...rmretentionpolicies_client_example_test.go | 131 - ...dinstanceoperations_client_example_test.go | 230 -- ...endpointconnections_client_example_test.go | 183 - ...rivatelinkresources_client_example_test.go | 86 - .../sql/armsql/managedinstances_client.go | 144 +- .../managedinstances_client_example_test.go | 2135 ----------- ...ancetdecertificates_client_example_test.go | 44 - ...rabilityassessments_client_example_test.go | 235 -- ...ledgerdigestuploads_client_example_test.go | 154 - ...rmretentionpolicies_client_example_test.go | 127 - ...gedserverdnsaliases_client_example_test.go | 181 - ...curityalertpolicies_client_example_test.go | 231 -- sdk/resourcemanager/sql/armsql/models.go | 281 +- .../sql/armsql/models_serde.go | 540 +-- sdk/resourcemanager/sql/armsql/options.go | 34 +- ...tboundfirewallrules_client_example_test.go | 143 - ...endpointconnections_client_example_test.go | 183 - ...rivatelinkresources_client_example_test.go | 86 - ...edsensitivitylabels_client_example_test.go | 62 - ...ecoverabledatabases_client_example_test.go | 147 - ...blemanageddatabases_client_example_test.go | 90 - .../sql/armsql/replicationlinks_client.go | 208 +- .../replicationlinks_client_example_test.go | 299 -- sdk/resourcemanager/sql/armsql/responses.go | 36 +- ...bledroppeddatabases_client_example_test.go | 165 - ...pedmanageddatabases_client_example_test.go | 99 - .../restorepoints_client_example_test.go | 232 -- .../sensitivitylabels_client_example_test.go | 329 -- ...tprotectionsettings_client_example_test.go | 191 - .../serveradvisors_client_example_test.go | 812 ---- ...rverautomatictuning_client_example_test.go | 199 - ...ureadadministrators_client_example_test.go | 155 - ...onlyauthentications_client_example_test.go | 140 - ...lobauditingpolicies_client_example_test.go | 202 - ...rcommunicationlinks_client_example_test.go | 129 - ...onfigurationoptions_client_example_test.go | 122 - ...rconnectionpolicies_client_example_test.go | 122 - ...devopsauditsettings_client_example_test.go | 174 - .../serverdnsaliases_client_example_test.go | 178 - .../armsql/serverkeys_client_example_test.go | 174 - .../serveroperations_client_example_test.go | 72 - .../sql/armsql/servers_client_example_test.go | 925 ----- ...curityalertpolicies_client_example_test.go | 231 -- ...ertrustcertificates_client_example_test.go | 152 - .../servertrustgroups_client_example_test.go | 255 -- .../serverusages_client_example_test.go | 62 - ...rabilityassessments_client_example_test.go | 235 -- .../serviceobjectives_client_example_test.go | 605 --- ...edinstanceschedules_client_example_test.go | 286 -- .../subscriptionusages_client_example_test.go | 110 - ...napselinkworkspaces_client_example_test.go | 62 - .../armsql/syncagents_client_example_test.go | 254 -- .../armsql/syncgroups_client_example_test.go | 460 --- .../armsql/syncmembers_client_example_test.go | 346 -- .../tdecertificates_client_example_test.go | 44 - .../armsql/timezones_client_example_test.go | 1326 ------- ...rentdataencryptions_client_example_test.go | 119 - .../sql/armsql/usages_client_example_test.go | 207 - .../virtualclusters_client_example_test.go | 278 -- ...virtualnetworkrules_client_example_test.go | 156 - ...yassessmentbaseline_client_example_test.go | 140 - ...assessmentbaselines_client_example_test.go | 136 - ...sessmentexecutescan_client_example_test.go | 39 - ...essmentrulebaseline_client_example_test.go | 169 - ...ssmentrulebaselines_client_example_test.go | 35 - ...rabilityassessments_client_example_test.go | 35 - ...ssessmentscanresult_client_example_test.go | 213 -- ...lityassessmentscans_client_example_test.go | 158 - ...assessmentssettings_client_example_test.go | 115 - ...workloadclassifiers_client_example_test.go | 227 -- .../workloadgroups_client_example_test.go | 229 -- 165 files changed, 705 insertions(+), 42401 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_example_test.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/jobprivateendpoints_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 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_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_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 f2482b9b4b93..d9ad2823185f 100644 --- a/sdk/resourcemanager/sql/armsql/CHANGELOG.md +++ b/sdk/resourcemanager/sql/armsql/CHANGELOG.md @@ -1,5 +1,56 @@ # Release History +## 2.0.0-beta.6 (2024-06-05) +### Breaking Changes + +- Type of `DistributedAvailabilityGroupProperties.ReplicationMode` has been changed from `*ReplicationModeType` to `*ReplicationMode` +- Type of `ManagedInstanceProperties.ProvisioningState` has been changed from `*ProvisioningState` to `*ManagedInstancePropertiesProvisioningState` +- Type of `TopQueries.Queries` has been changed from `[]*QueryStatisticsPropertiesAutoGenerated` to `[]*QueryStatisticsProperties` +- Enum `AuthMetadataLookupModes` has been removed +- Enum `FailoverModeType` has been removed +- Enum `FailoverType` has been removed +- Enum `FreemiumType` has been removed +- Enum `HybridSecondaryUsage` has been removed +- Enum `HybridSecondaryUsageDetected` has been removed +- Enum `InstanceRole` has been removed +- Enum `LinkRole` has been removed +- Enum `ManagedInstanceDatabaseFormat` has been removed +- Enum `ReplicaConnectedState` has been removed +- Enum `ReplicaSynchronizationHealth` has been removed +- Enum `ReplicationModeType` has been removed +- Enum `RoleChangeType` has been removed +- Enum `SeedingModeType` has been removed +- Function `*DistributedAvailabilityGroupsClient.BeginFailover` has been removed +- Function `*DistributedAvailabilityGroupsClient.BeginSetRole` has been removed +- Function `*ManagedInstancesClient.BeginRefreshStatus` has been removed +- Struct `CertificateInfo` has been removed +- Struct `DistributedAvailabilityGroupDatabase` has been removed +- Struct `DistributedAvailabilityGroupSetRole` has been removed +- Struct `DistributedAvailabilityGroupsFailoverRequest` has been removed +- Struct `QueryMetricIntervalAutoGenerated` has been removed +- Struct `QueryStatisticsPropertiesAutoGenerated` has been removed +- Struct `RefreshExternalGovernanceStatusOperationResultMI` has been removed +- Struct `RefreshExternalGovernanceStatusOperationResultPropertiesMI` has been removed +- Field `Databases`, `DistributedAvailabilityGroupName`, `FailoverMode`, `InstanceAvailabilityGroupName`, `InstanceLinkRole`, `PartnerAvailabilityGroupName`, `PartnerEndpoint`, `PartnerLinkRole`, `SeedingMode` of struct `DistributedAvailabilityGroupProperties` has been removed +- Field `AuthenticationMetadata`, `CreateTime`, `DatabaseFormat`, `ExternalGovernanceStatus`, `HybridSecondaryUsage`, `HybridSecondaryUsageDetected`, `IsGeneralPurposeV2`, `PricingModel`, `StorageIOps`, `StorageThroughputMBps`, `VirtualClusterID` of struct `ManagedInstanceProperties` has been removed +- Field `ManagedInstance` of struct `ManagedInstancesClientStartResponse` has been removed +- Field `ManagedInstance` of struct `ManagedInstancesClientStopResponse` has been removed + +### Features Added + +- New enum type `FailoverGroupDatabasesSecondaryType` with values `FailoverGroupDatabasesSecondaryTypeGeo`, `FailoverGroupDatabasesSecondaryTypeStandby` +- New enum type `ManagedInstancePropertiesProvisioningState` with values `ManagedInstancePropertiesProvisioningStateAccepted`, `ManagedInstancePropertiesProvisioningStateCanceled`, `ManagedInstancePropertiesProvisioningStateCreated`, `ManagedInstancePropertiesProvisioningStateCreating`, `ManagedInstancePropertiesProvisioningStateDeleted`, `ManagedInstancePropertiesProvisioningStateDeleting`, `ManagedInstancePropertiesProvisioningStateFailed`, `ManagedInstancePropertiesProvisioningStateNotSpecified`, `ManagedInstancePropertiesProvisioningStateRegistering`, `ManagedInstancePropertiesProvisioningStateRunning`, `ManagedInstancePropertiesProvisioningStateSucceeded`, `ManagedInstancePropertiesProvisioningStateTimedOut`, `ManagedInstancePropertiesProvisioningStateUnknown`, `ManagedInstancePropertiesProvisioningStateUnrecognized`, `ManagedInstancePropertiesProvisioningStateUpdating` +- New enum type `ReplicationMode` with values `ReplicationModeAsync`, `ReplicationModeSync` +- New function `*ReplicationLinksClient.BeginCreateOrUpdate(context.Context, string, string, string, string, ReplicationLink, *ReplicationLinksClientBeginCreateOrUpdateOptions) (*runtime.Poller[ReplicationLinksClientCreateOrUpdateResponse], error)` +- New function `*ReplicationLinksClient.BeginUpdate(context.Context, string, string, string, string, ReplicationLinkUpdate, *ReplicationLinksClientBeginUpdateOptions) (*runtime.Poller[ReplicationLinksClientUpdateResponse], error)` +- New struct `ReplicationLinkUpdate` +- New struct `ReplicationLinkUpdateProperties` +- New field `LastHardenedLsn`, `LinkState`, `PrimaryAvailabilityGroupName`, `SecondaryAvailabilityGroupName`, `SourceEndpoint`, `SourceReplicaID`, `TargetDatabase`, `TargetReplicaID` in struct `DistributedAvailabilityGroupProperties` +- New field `SecondaryType` in struct `FailoverGroupProperties` +- New field `SecondaryType` in struct `FailoverGroupUpdateProperties` +- New field `PartnerDatabaseID` in struct `ReplicationLinkProperties` + + ## 2.0.0-beta.5 (2024-05-24) ### Breaking Changes 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 f4401f6bef28..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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 7f0164f6a5fd..efa0863950cf 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/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.5 -tag: package-composite-v5 +module-version: 2.0.0-beta.6 ``` \ No newline at end of file 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 8bd4313b9bba..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/capabilities_client_example_test.go deleted file mode 100644 index acdb93f513b3..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/constants.go b/sdk/resourcemanager/sql/armsql/constants.go index 604497c0f8a2..1a033193851e 100644 --- a/sdk/resourcemanager/sql/armsql/constants.go +++ b/sdk/resourcemanager/sql/armsql/constants.go @@ -10,7 +10,7 @@ package armsql const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" - moduleVersion = "v2.0.0-beta.5" + moduleVersion = "v2.0.0-beta.6" ) type AdministratorName string @@ -130,24 +130,6 @@ func PossibleAlwaysEncryptedEnclaveTypeValues() []AlwaysEncryptedEnclaveType { } } -// AuthMetadataLookupModes - The managed instance's authentication metadata lookup mode. -type AuthMetadataLookupModes string - -const ( - AuthMetadataLookupModesAzureAD AuthMetadataLookupModes = "AzureAD" - AuthMetadataLookupModesPaired AuthMetadataLookupModes = "Paired" - AuthMetadataLookupModesWindows AuthMetadataLookupModes = "Windows" -) - -// PossibleAuthMetadataLookupModesValues returns the possible values for the AuthMetadataLookupModes const type. -func PossibleAuthMetadataLookupModesValues() []AuthMetadataLookupModes { - return []AuthMetadataLookupModes{ - AuthMetadataLookupModesAzureAD, - AuthMetadataLookupModesPaired, - AuthMetadataLookupModesWindows, - } -} - type AuthenticationName string const ( @@ -1006,6 +988,22 @@ func PossibleExternalGovernanceStatusValues() []ExternalGovernanceStatus { } } +// FailoverGroupDatabasesSecondaryType - Databases secondary type on partner server. +type FailoverGroupDatabasesSecondaryType string + +const ( + FailoverGroupDatabasesSecondaryTypeGeo FailoverGroupDatabasesSecondaryType = "Geo" + FailoverGroupDatabasesSecondaryTypeStandby FailoverGroupDatabasesSecondaryType = "Standby" +) + +// PossibleFailoverGroupDatabasesSecondaryTypeValues returns the possible values for the FailoverGroupDatabasesSecondaryType const type. +func PossibleFailoverGroupDatabasesSecondaryTypeValues() []FailoverGroupDatabasesSecondaryType { + return []FailoverGroupDatabasesSecondaryType{ + FailoverGroupDatabasesSecondaryTypeGeo, + FailoverGroupDatabasesSecondaryTypeStandby, + } +} + // FailoverGroupReplicationRole - Local replication role of the failover group instance. type FailoverGroupReplicationRole string @@ -1022,39 +1020,6 @@ func PossibleFailoverGroupReplicationRoleValues() []FailoverGroupReplicationRole } } -// FailoverModeType - The link failover mode - can be Manual if intended to be used for two-way failover with a supported -// SQL Server, or None for one-way failover to Azure. -type FailoverModeType string - -const ( - FailoverModeTypeManual FailoverModeType = "Manual" - FailoverModeTypeNone FailoverModeType = "None" -) - -// PossibleFailoverModeTypeValues returns the possible values for the FailoverModeType const type. -func PossibleFailoverModeTypeValues() []FailoverModeType { - return []FailoverModeType{ - FailoverModeTypeManual, - FailoverModeTypeNone, - } -} - -// FailoverType - The failover type, can be ForcedAllowDataLoss or Planned. -type FailoverType string - -const ( - FailoverTypeForcedAllowDataLoss FailoverType = "ForcedAllowDataLoss" - FailoverTypePlanned FailoverType = "Planned" -) - -// PossibleFailoverTypeValues returns the possible values for the FailoverType const type. -func PossibleFailoverTypeValues() []FailoverType { - return []FailoverType{ - FailoverTypeForcedAllowDataLoss, - FailoverTypePlanned, - } -} - // 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. @@ -1073,22 +1038,6 @@ func PossibleFreeLimitExhaustionBehaviorValues() []FreeLimitExhaustionBehavior { } } -// 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 ( @@ -1118,41 +1067,6 @@ 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 @@ -1223,22 +1137,6 @@ 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 @@ -1434,22 +1332,6 @@ 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 @@ -1563,22 +1445,6 @@ func PossibleManagedInstanceAdministratorTypeValues() []ManagedInstanceAdministr } } -// ManagedInstanceDatabaseFormat - Specifies the internal format of instance databases specific to the SQL engine version. -type ManagedInstanceDatabaseFormat string - -const ( - ManagedInstanceDatabaseFormatAlwaysUpToDate ManagedInstanceDatabaseFormat = "AlwaysUpToDate" - ManagedInstanceDatabaseFormatSQLServer2022 ManagedInstanceDatabaseFormat = "SQLServer2022" -) - -// PossibleManagedInstanceDatabaseFormatValues returns the possible values for the ManagedInstanceDatabaseFormat const type. -func PossibleManagedInstanceDatabaseFormatValues() []ManagedInstanceDatabaseFormat { - return []ManagedInstanceDatabaseFormat{ - ManagedInstanceDatabaseFormatAlwaysUpToDate, - ManagedInstanceDatabaseFormatSQLServer2022, - } -} - // ManagedInstanceLicenseType - The license type. Possible values are 'LicenseIncluded' (regular price inclusive of a new // SQL license) and 'BasePrice' (discounted AHB price for bringing your own SQL licenses). type ManagedInstanceLicenseType string @@ -1609,6 +1475,47 @@ 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 @@ -2139,40 +2046,6 @@ 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 ( @@ -2188,7 +2061,7 @@ func PossibleReplicaTypeValues() []ReplicaType { } } -// ReplicationLinkType - Link type (GEO, NAMED, STANDBY). +// ReplicationLinkType - Link type (GEO, NAMED, STANDBY). Update operation does not support NAMED. type ReplicationLinkType string const ( @@ -2206,19 +2079,19 @@ func PossibleReplicationLinkTypeValues() []ReplicationLinkType { } } -// ReplicationModeType - Replication mode of the link -type ReplicationModeType string +// ReplicationMode - The replication mode of a distributed availability group. Parameter will be ignored during link creation. +type ReplicationMode string const ( - ReplicationModeTypeAsync ReplicationModeType = "Async" - ReplicationModeTypeSync ReplicationModeType = "Sync" + ReplicationModeAsync ReplicationMode = "Async" + ReplicationModeSync ReplicationMode = "Sync" ) -// PossibleReplicationModeTypeValues returns the possible values for the ReplicationModeType const type. -func PossibleReplicationModeTypeValues() []ReplicationModeType { - return []ReplicationModeType{ - ReplicationModeTypeAsync, - ReplicationModeTypeSync, +// PossibleReplicationModeValues returns the possible values for the ReplicationMode const type. +func PossibleReplicationModeValues() []ReplicationMode { + return []ReplicationMode{ + ReplicationModeAsync, + ReplicationModeSync, } } @@ -2293,22 +2166,6 @@ 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 @@ -2534,22 +2391,6 @@ func PossibleSecurityEventTypeValues() []SecurityEventType { } } -// SeedingModeType - Database seeding mode – can be Automatic (default), or Manual for supported scenarios. -type SeedingModeType string - -const ( - SeedingModeTypeAutomatic SeedingModeType = "Automatic" - SeedingModeTypeManual SeedingModeType = "Manual" -) - -// PossibleSeedingModeTypeValues returns the possible values for the SeedingModeType const type. -func PossibleSeedingModeTypeValues() []SeedingModeType { - return []SeedingModeType{ - SeedingModeTypeAutomatic, - SeedingModeTypeManual, - } -} - type SensitivityLabelRank string const ( 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 0fc868bb4ad8..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/databaseadvisors_client_example_test.go deleted file mode 100644 index 288e1db767f9..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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:39.000Z"); 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:43.000Z"); 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:03.000Z"); 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:32.000Z"); 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/33c4457b1d13f83965f4fe3367dca4a6df898100/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:16.000Z"); 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:04.000Z"); 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:40.000Z"); return t}()), - // }, - // TimeSeries: []*armsql.RecommendedActionMetricInfo{ - // }, - // ValidSince: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:04.000Z"); 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:05.000Z"); return t}()), - // ExecuteActionStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05.000Z"); 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:05.000Z"); 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:05.000Z"); return t}()), - // }, - // TimeSeries: []*armsql.RecommendedActionMetricInfo{ - // }, - // ValidSince: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05.000Z"); 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:05.000Z"); 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:05.000Z"); return t}()), - // }, - // TimeSeries: []*armsql.RecommendedActionMetricInfo{ - // }, - // ValidSince: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05.000Z"); 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:43.000Z"); 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:35.000Z"); 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:05.000Z"); 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:35.000Z"); return t}()), - // }, - // TimeSeries: []*armsql.RecommendedActionMetricInfo{ - // }, - // ValidSince: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05.000Z"); 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:05.000Z"); 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:05.000Z"); 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:05.000Z"); return t}()), - // }, - // TimeSeries: []*armsql.RecommendedActionMetricInfo{ - // }, - // ValidSince: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05.000Z"); 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:05.000Z"); return t}()), - // ExecuteActionStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05.000Z"); 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:05.000Z"); 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:05.000Z"); return t}()), - // }, - // TimeSeries: []*armsql.RecommendedActionMetricInfo{ - // }, - // ValidSince: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05.000Z"); 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:05.000Z"); return t}()), - // ExecuteActionStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05.000Z"); 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:05.000Z"); 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:05.000Z"); return t}()), - // }, - // TimeSeries: []*armsql.RecommendedActionMetricInfo{ - // }, - // ValidSince: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05.000Z"); 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:03.000Z"); 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:31.000Z"); 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:44.000Z"); 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:31.000Z"); return t}()), - // }, - // TimeSeries: []*armsql.RecommendedActionMetricInfo{ - // }, - // ValidSince: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:37:44.000Z"); 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:21.000Z"); 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:53.000Z"); 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:48.000Z"); return t}()), - // }, - // TimeSeries: []*armsql.RecommendedActionMetricInfo{ - // }, - // ValidSince: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:37:48.000Z"); 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/33c4457b1d13f83965f4fe3367dca4a6df898100/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:39.000Z"); return t}()), - // RecommendationsStatus: to.Ptr("Ok"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/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:39.000Z"); return t}()), - // RecommendationsStatus: to.Ptr("Ok"), - // }, - // } -} 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 56642699b81e..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/databaseblobauditingpolicies_client_example_test.go deleted file mode 100644 index 420654e05a1b..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/databasecolumns_client_example_test.go deleted file mode 100644 index f7497e6d56b7..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/databaseencryptionprotectors_client_example_test.go deleted file mode 100644 index f806cb55acc2..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/databaseextensions_client_example_test.go deleted file mode 100644 index 5cb85a66e383..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/databaseoperations_client_example_test.go deleted file mode 100644 index e57be58fbb90..000000000000 --- a/sdk/resourcemanager/sql/armsql/databaseoperations_client_example_test.go +++ /dev/null @@ -1,125 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-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("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.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/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb/operations/11111111-1111-1111-1111-111111111111"), - // Properties: &armsql.DatabaseOperationProperties{ - // Description: to.Ptr("'UpdateLogicalDatabase' on database 'testdb', Source ServiceLevelObjective 'SQLDB_GP_Gen5_2', target ServiceLevelObjective 'SQLDB_HS_Gen5_2', target database MaxSize '32'GB"), - // DatabaseName: to.Ptr("testdb"), - // EstimatedCompletionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-17T14:30:30.710Z"); return t}()), - // IsCancellable: to.Ptr(true), - // Operation: to.Ptr("UpdateLogicalDatabase"), - // OperationFriendlyName: to.Ptr("ALTER DATABASE"), - // PercentComplete: to.Ptr[int32](100), - // ServerName: to.Ptr("testsvr"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-13T06:25:23.670Z"); 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/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb/operations/55555555-5555-5555-5555-555555555555"), - // Properties: &armsql.DatabaseOperationProperties{ - // Description: to.Ptr("'UpdateLogicalDatabase' on database 'testdb', Source ServiceLevelObjective 'SQLDB_GP_Gen5_2', target ServiceLevelObjective 'SQLDB_HS_Gen5_2', target database MaxSize '32'GB"), - // DatabaseName: to.Ptr("testdb"), - // EstimatedCompletionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-17T14:30:30.710Z"); return t}()), - // IsCancellable: to.Ptr(true), - // Operation: to.Ptr("UpdateLogicalDatabase"), - // OperationFriendlyName: to.Ptr("ALTER DATABASE"), - // OperationPhaseDetails: &armsql.PhaseDetails{ - // Phase: to.Ptr(armsql.PhaseWaitingForCutover), - // PhaseInformation: map[string]*string{ - // "currentStep": to.Ptr("3"), - // "dataDelayInMb": to.Ptr("31"), - // "performCutoverBy": to.Ptr("2023-02-17T11:57:06.71Z"), - // "totalSteps": to.Ptr("4"), - // }, - // }, - // PercentComplete: to.Ptr[int32](19), - // ServerName: to.Ptr("testsvr"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-13T06:25:23.670Z"); return t}()), - // State: to.Ptr(armsql.ManagementOperationStateInProgress), - // }, - // }, - // { - // 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/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb/operations/55555555-5555-5555-5555-555555555555"), - // Properties: &armsql.DatabaseOperationProperties{ - // Description: to.Ptr("'UpdateLogicalDatabase' on database 'testdb'"), - // DatabaseName: to.Ptr("testdb"), - // ErrorCode: to.Ptr[int32](40640), - // ErrorDescription: to.Ptr("The server encountered an unexpected exception."), - // ErrorSeverity: to.Ptr[int32](20), - // IsUserError: to.Ptr(true), - // Operation: to.Ptr("UpdateLogicalDatabase"), - // OperationFriendlyName: to.Ptr("ALTER DATABASE"), - // PercentComplete: to.Ptr[int32](100), - // ServerName: to.Ptr("testsvr"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-24T11:48:29.160Z"); return t}()), - // State: to.Ptr(armsql.ManagementOperationStateFailed), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-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) - } -} 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 7bc372d6ff3f..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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:04.000Z"); 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:05.000Z"); return t}()), - // }, - // TimeSeries: []*armsql.RecommendedActionMetricInfo{ - // }, - // ValidSince: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:04.000Z"); 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:05.000Z"); return t}()), - // ExecuteActionStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05.000Z"); 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:05.000Z"); 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:05.000Z"); return t}()), - // }, - // TimeSeries: []*armsql.RecommendedActionMetricInfo{ - // }, - // ValidSince: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05.000Z"); 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:05.000Z"); 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:05.000Z"); return t}()), - // }, - // TimeSeries: []*armsql.RecommendedActionMetricInfo{ - // }, - // ValidSince: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05.000Z"); 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/33c4457b1d13f83965f4fe3367dca4a6df898100/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:04.000Z"); 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:05.000Z"); return t}()), - // }, - // TimeSeries: []*armsql.RecommendedActionMetricInfo{ - // }, - // ValidSince: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:04.000Z"); 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/33c4457b1d13f83965f4fe3367dca4a6df898100/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:15.000Z"); 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:04.000Z"); 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:15.000Z"); return t}()), - // }, - // TimeSeries: []*armsql.RecommendedActionMetricInfo{ - // }, - // ValidSince: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:04.000Z"); 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_example_test.go b/sdk/resourcemanager/sql/armsql/databases_client_example_test.go deleted file mode 100644 index 817b0179a1da..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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:00.000Z"); 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:01.000Z"); 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:01.000Z"); 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:01.000Z"); return t}()), - // Total: to.Ptr[float64](0), - // }}, - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-02T18:35:00.000Z"); 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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-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.990Z"); 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-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.990Z"); 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-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.990Z"); 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-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:37.000Z"); 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-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:00.000Z"); 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-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:00.000Z"); 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-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_example_test.go b/sdk/resourcemanager/sql/armsql/databaseschemas_client_example_test.go deleted file mode 100644 index 31f54435a723..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/databasesecurityalertpolicies_client_example_test.go deleted file mode 100644 index cacbac821f67..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentbaselines_client_example_test.go deleted file mode 100644 index 709609f2bba9..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentexecutescan_client_example_test.go deleted file mode 100644 index 53de6ed94a23..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentrulebaselines_client_example_test.go deleted file mode 100644 index 6ece4539075a..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentscanresult_client_example_test.go deleted file mode 100644 index c4df8c5d0668..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentscans_client_example_test.go deleted file mode 100644 index 81991df8f23a..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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.723Z"); return t}()), - // HighSeverityFailedRulesCount: to.Ptr[int32](3), - // IsBaselineApplied: to.Ptr(false), - // LastScanTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-23T06:49:00.645Z"); 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-23T06:49:00.645Z"); 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.723Z"); return t}()), - // HighSeverityFailedRulesCount: to.Ptr[int32](3), - // IsBaselineApplied: to.Ptr(false), - // LastScanTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-23T06:49:00.645Z"); 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-23T06:49:00.645Z"); 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.723Z"); return t}()), - // HighSeverityFailedRulesCount: to.Ptr[int32](3), - // IsBaselineApplied: to.Ptr(false), - // LastScanTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-23T06:49:00.645Z"); 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-23T06:49:00.645Z"); 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/33c4457b1d13f83965f4fe3367dca4a6df898100/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.723Z"); return t}()), - // HighSeverityFailedRulesCount: to.Ptr[int32](3), - // IsBaselineApplied: to.Ptr(false), - // LastScanTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-23T06:49:00.645Z"); 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-23T06:49:00.645Z"); 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_example_test.go b/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentssettings_client_example_test.go deleted file mode 100644 index fe25817d4a13..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/databasetables_client_example_test.go deleted file mode 100644 index 3d2a87f70273..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/databaseusages_client_example_test.go deleted file mode 100644 index 71010fcdcdd7..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/databasevulnerabilityassessmentrulebaselines_client_example_test.go deleted file mode 100644 index 2257ea0ca0d7..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/databasevulnerabilityassessments_client_example_test.go deleted file mode 100644 index ba9238fbd4af..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/databasevulnerabilityassessmentscans_client_example_test.go deleted file mode 100644 index 3f7f3ca40392..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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:06.000Z"); 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:06.000Z"); 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:06.000Z"); 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:06.000Z"); 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:06.000Z"); 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:06.000Z"); 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/33c4457b1d13f83965f4fe3367dca4a6df898100/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:06.000Z"); 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:06.000Z"); 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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/datamaskingpolicies_client_example_test.go deleted file mode 100644 index 7992550c4db7..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/datamaskingrules_client_example_test.go deleted file mode 100644 index c1d5466085ec..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/datawarehouseuseractivities_client_example_test.go deleted file mode 100644 index 7b606b1a495f..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/deletedservers_client_example_test.go deleted file mode 100644 index c37bc1eff009..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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 e4d12b5d14a9..6fa4adc2ee28 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 2023-08-01-preview +// Generated from API version 2021-11-01-preview // - resourceGroupName - 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. @@ -74,7 +74,7 @@ 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 2023-08-01-preview +// 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) { var err error const operationName = "DistributedAvailabilityGroupsClient.BeginCreateOrUpdate" @@ -120,7 +120,7 @@ func (client *DistributedAvailabilityGroupsClient) createOrUpdateCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2021-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -132,7 +132,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 2023-08-01-preview +// Generated from API version 2021-11-01-preview // - resourceGroupName - 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. @@ -159,7 +159,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 2023-08-01-preview +// Generated from API version 2021-11-01-preview func (client *DistributedAvailabilityGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, managedInstanceName string, distributedAvailabilityGroupName string, options *DistributedAvailabilityGroupsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "DistributedAvailabilityGroupsClient.BeginDelete" @@ -205,103 +205,15 @@ func (client *DistributedAvailabilityGroupsClient) deleteCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2021-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginFailover - Performs requested failover type in this distributed availability group. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-08-01-preview -// - resourceGroupName - 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 failover request parameters. -// - options - DistributedAvailabilityGroupsClientBeginFailoverOptions contains the optional parameters for the DistributedAvailabilityGroupsClient.BeginFailover -// method. -func (client *DistributedAvailabilityGroupsClient) BeginFailover(ctx context.Context, resourceGroupName string, managedInstanceName string, distributedAvailabilityGroupName string, parameters DistributedAvailabilityGroupsFailoverRequest, options *DistributedAvailabilityGroupsClientBeginFailoverOptions) (*runtime.Poller[DistributedAvailabilityGroupsClientFailoverResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.failover(ctx, resourceGroupName, managedInstanceName, distributedAvailabilityGroupName, parameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DistributedAvailabilityGroupsClientFailoverResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DistributedAvailabilityGroupsClientFailoverResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Failover - Performs requested failover type in this distributed availability group. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-08-01-preview -func (client *DistributedAvailabilityGroupsClient) failover(ctx context.Context, resourceGroupName string, managedInstanceName string, distributedAvailabilityGroupName string, parameters DistributedAvailabilityGroupsFailoverRequest, options *DistributedAvailabilityGroupsClientBeginFailoverOptions) (*http.Response, error) { - var err error - const operationName = "DistributedAvailabilityGroupsClient.BeginFailover" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.failoverCreateRequest(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 -} - -// failoverCreateRequest creates the Failover request. -func (client *DistributedAvailabilityGroupsClient) failoverCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, distributedAvailabilityGroupName string, parameters DistributedAvailabilityGroupsFailoverRequest, options *DistributedAvailabilityGroupsClientBeginFailoverOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}/failover" - 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-08-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 } // Get - Gets a distributed availability group info. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-08-01-preview +// Generated from API version 2021-11-01-preview // - resourceGroupName - 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. @@ -354,7 +266,7 @@ func (client *DistributedAvailabilityGroupsClient) getCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2021-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -371,7 +283,7 @@ func (client *DistributedAvailabilityGroupsClient) getHandleResponse(resp *http. // NewListByInstancePager - Gets a list of a distributed availability groups in instance. // -// Generated from API version 2023-08-01-preview +// Generated from API version 2021-11-01-preview // - resourceGroupName - 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 +332,7 @@ func (client *DistributedAvailabilityGroupsClient) listByInstanceCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2021-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -435,97 +347,10 @@ 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-08-01-preview -// - resourceGroupName - 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, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DistributedAvailabilityGroupsClientSetRoleResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// 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-08-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 - const operationName = "DistributedAvailabilityGroupsClient.BeginSetRole" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - 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-08-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 2023-08-01-preview +// Generated from API version 2021-11-01-preview // - resourceGroupName - 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. @@ -553,7 +378,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 2023-08-01-preview +// Generated from API version 2021-11-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 const operationName = "DistributedAvailabilityGroupsClient.BeginUpdate" @@ -599,7 +424,7 @@ func (client *DistributedAvailabilityGroupsClient) updateCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01-preview") + reqQP.Set("api-version", "2021-11-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 4a93ae4eba9c..000000000000 --- a/sdk/resourcemanager/sql/armsql/distributedavailabilitygroups_client_example_test.go +++ /dev/null @@ -1,436 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-08-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/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testcl/distributedAvailabilityGroups/dag"), - // Properties: &armsql.DistributedAvailabilityGroupProperties{ - // Databases: []*armsql.DistributedAvailabilityGroupDatabase{ - // { - // ConnectedState: to.Ptr(armsql.ReplicaConnectedStateCONNECTED), - // DatabaseName: to.Ptr("testdb"), - // InstanceRedoReplicationLagSeconds: to.Ptr[int32](1), - // InstanceReplicaID: to.Ptr("4713ed91-1e8c-497d-9bd4-d8a3935ae49a"), - // InstanceSendReplicationLagSeconds: to.Ptr[int32](1), - // LastBackupLsn: to.Ptr("71000009405700001"), - // LastBackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-01T00:00:00.000Z"); return t}()), - // LastCommitLsn: to.Ptr("71000009407900004"), - // LastCommitTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-01T00:00:00.000Z"); return t}()), - // LastHardenedLsn: to.Ptr("71000009408100001"), - // LastHardenedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-01T00:00:00.000Z"); return t}()), - // LastReceivedLsn: to.Ptr("71000009407900001"), - // LastReceivedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-01T00:00:00.000Z"); return t}()), - // PartnerReplicaID: to.Ptr("8ffa9723-a1ec-4323-b929-c4aedee3894b"), - // ReplicaState: to.Ptr("Catchup"), - // SynchronizationHealth: to.Ptr(armsql.ReplicaSynchronizationHealthHEALTHY), - // }}, - // DistributedAvailabilityGroupID: to.Ptr("c856cff5-a6fe-418e-8894-17799cc20f5d"), - // DistributedAvailabilityGroupName: to.Ptr("dag"), - // FailoverMode: to.Ptr(armsql.FailoverModeTypeNone), - // InstanceAvailabilityGroupName: to.Ptr("testcl"), - // InstanceLinkRole: to.Ptr(armsql.LinkRolePrimary), - // PartnerAvailabilityGroupName: to.Ptr("BoxLocalAg1"), - // PartnerEndpoint: to.Ptr("TCP://SERVER:7022"), - // PartnerLinkRole: to.Ptr(armsql.LinkRoleSecondary), - // ReplicationMode: to.Ptr(armsql.ReplicationModeTypeAsync), - // SeedingMode: to.Ptr(armsql.SeedingModeTypeAutomatic), - // }, - // }, - // { - // Name: to.Ptr("dag2"), - // Type: to.Ptr("Microsoft.Sql/managedInstances/distributedAvailabilityGroups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testcl/distributedAvailabilityGroups/dag2"), - // Properties: &armsql.DistributedAvailabilityGroupProperties{ - // Databases: []*armsql.DistributedAvailabilityGroupDatabase{ - // { - // ConnectedState: to.Ptr(armsql.ReplicaConnectedStateCONNECTED), - // DatabaseName: to.Ptr("testdb2"), - // InstanceReplicaID: to.Ptr("81608df4-0840-4219-b3ae-9cc46be9dae9"), - // LastBackupLsn: to.Ptr("71000009405700001"), - // LastBackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-01T00:00:00.000Z"); return t}()), - // LastCommitLsn: to.Ptr("71000009407900004"), - // LastCommitTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-01T00:00:00.000Z"); return t}()), - // LastHardenedLsn: to.Ptr("71000009408100001"), - // LastHardenedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-01T00:00:00.000Z"); return t}()), - // LastReceivedLsn: to.Ptr("71000009407900001"), - // LastReceivedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-01T00:00:00.000Z"); return t}()), - // PartnerReplicaID: to.Ptr("57bc3421-e77a-4fdc-8a62-af105c4b1e38"), - // ReplicaState: to.Ptr("Seeding"), - // SeedingProgress: to.Ptr("80%"), - // SynchronizationHealth: to.Ptr(armsql.ReplicaSynchronizationHealthHEALTHY), - // }}, - // DistributedAvailabilityGroupID: to.Ptr("8a52d869-c17e-4546-ab03-e038569e672a"), - // DistributedAvailabilityGroupName: to.Ptr("dag2"), - // InstanceAvailabilityGroupName: to.Ptr("testcl2"), - // InstanceLinkRole: to.Ptr(armsql.LinkRoleSecondary), - // PartnerAvailabilityGroupName: to.Ptr("BoxLocalAg2"), - // PartnerEndpoint: to.Ptr("TCP://SERVER:7022"), - // PartnerLinkRole: to.Ptr(armsql.LinkRolePrimary), - // ReplicationMode: to.Ptr(armsql.ReplicationModeTypeAsync), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-08-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/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testcl/distributedAvailabilityGroups/dag"), - // Properties: &armsql.DistributedAvailabilityGroupProperties{ - // Databases: []*armsql.DistributedAvailabilityGroupDatabase{ - // { - // ConnectedState: to.Ptr(armsql.ReplicaConnectedStateCONNECTED), - // DatabaseName: to.Ptr("testdb"), - // InstanceRedoReplicationLagSeconds: to.Ptr[int32](1), - // InstanceReplicaID: to.Ptr("4713ed91-1e8c-497d-9bd4-d8a3935ae49a"), - // InstanceSendReplicationLagSeconds: to.Ptr[int32](1), - // LastBackupLsn: to.Ptr("71000009405700001"), - // LastBackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-01T00:00:00.000Z"); return t}()), - // LastCommitLsn: to.Ptr("71000009407900004"), - // LastCommitTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-01T00:00:00.000Z"); return t}()), - // LastHardenedLsn: to.Ptr("71000009408100001"), - // LastHardenedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-01T00:00:00.000Z"); return t}()), - // LastReceivedLsn: to.Ptr("71000009407900001"), - // LastReceivedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-01T00:00:00.000Z"); return t}()), - // PartnerReplicaID: to.Ptr("8ffa9723-a1ec-4323-b929-c4aedee3894b"), - // ReplicaState: to.Ptr("Seeding"), - // SeedingProgress: to.Ptr("80%"), - // SynchronizationHealth: to.Ptr(armsql.ReplicaSynchronizationHealthHEALTHY), - // }}, - // DistributedAvailabilityGroupID: to.Ptr("c856cff5-a6fe-418e-8894-17799cc20f5d"), - // DistributedAvailabilityGroupName: to.Ptr("dag"), - // FailoverMode: to.Ptr(armsql.FailoverModeTypeNone), - // InstanceAvailabilityGroupName: to.Ptr("testcl"), - // InstanceLinkRole: to.Ptr(armsql.LinkRolePrimary), - // PartnerAvailabilityGroupName: to.Ptr("BoxLocalAg1"), - // PartnerEndpoint: to.Ptr("TCP://SERVER:7022"), - // PartnerLinkRole: to.Ptr(armsql.LinkRoleSecondary), - // ReplicationMode: to.Ptr(armsql.ReplicationModeTypeAsync), - // SeedingMode: to.Ptr(armsql.SeedingModeTypeAutomatic), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-08-01-preview/examples/DistributedAvailabilityGroupsCreateMax.json -func ExampleDistributedAvailabilityGroupsClient_BeginCreateOrUpdate_createADistributedAvailabilityGroupWithAllProperties() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain 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{ - Databases: []*armsql.DistributedAvailabilityGroupDatabase{ - { - DatabaseName: to.Ptr("testdb"), - }}, - FailoverMode: to.Ptr(armsql.FailoverModeTypeNone), - InstanceAvailabilityGroupName: to.Ptr("testcl"), - InstanceLinkRole: to.Ptr(armsql.LinkRolePrimary), - PartnerAvailabilityGroupName: to.Ptr("BoxLocalAg1"), - PartnerEndpoint: to.Ptr("TCP://SERVER:7022"), - SeedingMode: to.Ptr(armsql.SeedingModeTypeAutomatic), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testcl/distributedAvailabilityGroups/dag"), - // Properties: &armsql.DistributedAvailabilityGroupProperties{ - // Databases: []*armsql.DistributedAvailabilityGroupDatabase{ - // { - // DatabaseName: to.Ptr("testdb"), - // }}, - // DistributedAvailabilityGroupName: to.Ptr("dag"), - // FailoverMode: to.Ptr(armsql.FailoverModeTypeNone), - // InstanceAvailabilityGroupName: to.Ptr("testcl"), - // InstanceLinkRole: to.Ptr(armsql.LinkRolePrimary), - // PartnerAvailabilityGroupName: to.Ptr("BoxLocalAg1"), - // PartnerEndpoint: to.Ptr("TCP://SERVER:7022"), - // SeedingMode: to.Ptr(armsql.SeedingModeTypeAutomatic), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-08-01-preview/examples/DistributedAvailabilityGroupsCreateMin.json -func ExampleDistributedAvailabilityGroupsClient_BeginCreateOrUpdate_createADistributedAvailabilityGroupWithMinimalProperties() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain 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{ - Databases: []*armsql.DistributedAvailabilityGroupDatabase{ - { - DatabaseName: to.Ptr("testdb"), - }}, - InstanceAvailabilityGroupName: to.Ptr("testcl"), - PartnerAvailabilityGroupName: to.Ptr("BoxLocalAg1"), - PartnerEndpoint: to.Ptr("TCP://SERVER:7022"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testcl/distributedAvailabilityGroups/dag"), - // Properties: &armsql.DistributedAvailabilityGroupProperties{ - // Databases: []*armsql.DistributedAvailabilityGroupDatabase{ - // { - // DatabaseName: to.Ptr("testdb"), - // }}, - // DistributedAvailabilityGroupName: to.Ptr("dag"), - // FailoverMode: to.Ptr(armsql.FailoverModeTypeNone), - // InstanceAvailabilityGroupName: to.Ptr("testcl"), - // InstanceLinkRole: to.Ptr(armsql.LinkRoleSecondary), - // PartnerAvailabilityGroupName: to.Ptr("BoxLocalAg1"), - // PartnerEndpoint: to.Ptr("TCP://SERVER:7022"), - // SeedingMode: to.Ptr(armsql.SeedingModeTypeAutomatic), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-08-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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-08-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.ReplicationModeTypeSync), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testcl/distributedAvailabilityGroups/dag"), - // Properties: &armsql.DistributedAvailabilityGroupProperties{ - // DistributedAvailabilityGroupName: to.Ptr("dag"), - // ReplicationMode: to.Ptr(armsql.ReplicationModeTypeSync), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-08-01-preview/examples/DistributedAvailabilityGroupsFailover.json -func ExampleDistributedAvailabilityGroupsClient_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.NewDistributedAvailabilityGroupsClient().BeginFailover(ctx, "testrg", "testcl", "dag", armsql.DistributedAvailabilityGroupsFailoverRequest{ - FailoverType: to.Ptr(armsql.FailoverTypeForcedAllowDataLoss), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testcl/distributedAvailabilityGroups/dag"), - // Properties: &armsql.DistributedAvailabilityGroupProperties{ - // Databases: []*armsql.DistributedAvailabilityGroupDatabase{ - // { - // ConnectedState: to.Ptr(armsql.ReplicaConnectedStateCONNECTED), - // DatabaseName: to.Ptr("testdb"), - // InstanceRedoReplicationLagSeconds: to.Ptr[int32](1), - // InstanceReplicaID: to.Ptr("4713ed91-1e8c-497d-9bd4-d8a3935ae49a"), - // InstanceSendReplicationLagSeconds: to.Ptr[int32](1), - // LastBackupLsn: to.Ptr("71000009405700001"), - // LastBackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-01T00:00:00.000Z"); return t}()), - // LastCommitLsn: to.Ptr("71000009407900004"), - // LastCommitTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-01T00:00:00.000Z"); return t}()), - // LastHardenedLsn: to.Ptr("71000009408100001"), - // LastHardenedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-01T00:00:00.000Z"); return t}()), - // LastReceivedLsn: to.Ptr("71000009407900001"), - // LastReceivedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-01T00:00:00.000Z"); return t}()), - // PartnerReplicaID: to.Ptr("8ffa9723-a1ec-4323-b929-c4aedee3894b"), - // ReplicaState: to.Ptr("Catchup"), - // SynchronizationHealth: to.Ptr(armsql.ReplicaSynchronizationHealthHEALTHY), - // }}, - // DistributedAvailabilityGroupID: to.Ptr("c856cff5-a6fe-418e-8894-17799cc20f5d"), - // DistributedAvailabilityGroupName: to.Ptr("dag"), - // FailoverMode: to.Ptr(armsql.FailoverModeTypeNone), - // InstanceAvailabilityGroupName: to.Ptr("testcl"), - // InstanceLinkRole: to.Ptr(armsql.LinkRolePrimary), - // PartnerAvailabilityGroupName: to.Ptr("BoxLocalAg1"), - // PartnerEndpoint: to.Ptr("TCP://SERVER:7022"), - // PartnerLinkRole: to.Ptr(armsql.LinkRoleSecondary), - // ReplicationMode: to.Ptr(armsql.ReplicationModeTypeAsync), - // SeedingMode: to.Ptr(armsql.SeedingModeTypeAutomatic), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-08-01-preview/examples/DistributedAvailabilityGroupsSetRole.json -func ExampleDistributedAvailabilityGroupsClient_BeginSetRole() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain 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().BeginSetRole(ctx, "testrg", "testcl", "dag", armsql.DistributedAvailabilityGroupSetRole{ - InstanceRole: to.Ptr(armsql.InstanceRolePrimary), - RoleChangeType: to.Ptr(armsql.RoleChangeTypeForced), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testcl/distributedAvailabilityGroups/dag"), - // Properties: &armsql.DistributedAvailabilityGroupProperties{ - // DistributedAvailabilityGroupName: to.Ptr("dag"), - // InstanceLinkRole: to.Ptr(armsql.LinkRolePrimary), - // }, - // } -} 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 6687a0b22199..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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.160Z"); return t}()), - // State: to.Ptr("COMPLETED"), - // }, - // }}, - // } - } -} 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 f8cd70d629ad..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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.950Z"); 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.570Z"); 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.190Z"); 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.190Z"); return t}()), - // State: to.Ptr("COMPLETED"), - // }, - // }}, - // } - } -} 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 7245ec2e5c10..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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.100Z"); 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.100Z"); return t}()), - // State: to.Ptr("IN_PROGRESS"), - // }, - // }}, - // } - } -} 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 a135045a0695..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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:00.000Z"); 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:01.000Z"); 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:01.000Z"); 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:01.000Z"); return t}()), - // Total: to.Ptr[float64](0), - // }}, - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-02T18:35:00.000Z"); 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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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.320Z"); 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.450Z"); 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/33c4457b1d13f83965f4fe3367dca4a6df898100/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.570Z"); 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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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.570Z"); 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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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.570Z"); 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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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.570Z"); 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/33c4457b1d13f83965f4fe3367dca4a6df898100/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.570Z"); 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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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.570Z"); 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/33c4457b1d13f83965f4fe3367dca4a6df898100/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.570Z"); 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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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.320Z"); 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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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.570Z"); 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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/encryptionprotectors_client_example_test.go deleted file mode 100644 index fc64b6ad5e30..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/endpointcertificates_client_example_test.go deleted file mode 100644 index e137e74b8597..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/extendeddatabaseblobauditingpolicies_client_example_test.go deleted file mode 100644 index f0264f643826..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/extendedserverblobauditingpolicies_client_example_test.go deleted file mode 100644 index 0677b2684149..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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 1e74f90eb41e..95193ee56ea7 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 2023-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 containing the failover group. @@ -74,7 +74,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 2023-02-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 const operationName = "FailoverGroupsClient.BeginCreateOrUpdate" @@ -120,7 +120,7 @@ func (client *FailoverGroupsClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-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 { @@ -132,7 +132,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 2023-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 containing the failover group. @@ -159,7 +159,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 2023-02-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 const operationName = "FailoverGroupsClient.BeginDelete" @@ -205,7 +205,7 @@ func (client *FailoverGroupsClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -213,7 +213,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 2023-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 containing the failover group. @@ -240,7 +240,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 2023-02-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 const operationName = "FailoverGroupsClient.BeginFailover" @@ -286,7 +286,7 @@ func (client *FailoverGroupsClient) failoverCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-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 @@ -296,7 +296,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 2023-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 containing the failover group. @@ -324,7 +324,7 @@ func (client *FailoverGroupsClient) BeginForceFailoverAllowDataLoss(ctx context. // data loss. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-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 const operationName = "FailoverGroupsClient.BeginForceFailoverAllowDataLoss" @@ -370,7 +370,7 @@ func (client *FailoverGroupsClient) forceFailoverAllowDataLossCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-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 @@ -379,7 +379,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 2023-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 containing the failover group. @@ -431,7 +431,7 @@ func (client *FailoverGroupsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-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 @@ -448,7 +448,7 @@ func (client *FailoverGroupsClient) getHandleResponse(resp *http.Response) (Fail // NewListByServerPager - Lists the failover groups in a server. // -// Generated from API version 2023-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 containing the failover group. @@ -497,7 +497,7 @@ func (client *FailoverGroupsClient) listByServerCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-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 @@ -516,7 +516,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 2023-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. @@ -545,7 +545,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 2023-02-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 const operationName = "FailoverGroupsClient.BeginTryPlannedBeforeForcedFailover" @@ -591,7 +591,7 @@ func (client *FailoverGroupsClient) tryPlannedBeforeForcedFailoverCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-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 @@ -600,7 +600,7 @@ func (client *FailoverGroupsClient) tryPlannedBeforeForcedFailoverCreateRequest( // BeginUpdate - Updates a failover group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-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 containing the failover group. @@ -628,7 +628,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 2023-02-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 const operationName = "FailoverGroupsClient.BeginUpdate" @@ -674,7 +674,7 @@ func (client *FailoverGroupsClient) updateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-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/failovergroups_client_example_test.go b/sdk/resourcemanager/sql/armsql/failovergroups_client_example_test.go deleted file mode 100644 index d219b4837eb3..000000000000 --- a/sdk/resourcemanager/sql/armsql/failovergroups_client_example_test.go +++ /dev/null @@ -1,447 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-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), - // TargetServer: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-secondary-server"), - // }, - // 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), - // TargetServer: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-secondary-server"), - // }, - // 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-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", "failovergroupprimaryserver", "failovergrouptest3", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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/failovergroupprimaryserver/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/failovergroupprimaryserver/databases/testdb1"), - // to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failovergroupprimaryserver/databases/testdb2")}, - // PartnerServers: []*armsql.PartnerInfo{ - // { - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failovergroupsecondaryserver"), - // Location: to.Ptr("Japan East"), - // ReplicationRole: to.Ptr(armsql.FailoverGroupReplicationRoleSecondary), - // }}, - // ReadOnlyEndpoint: &armsql.FailoverGroupReadOnlyEndpoint{ - // FailoverPolicy: to.Ptr(armsql.ReadOnlyEndpointFailoverPolicyEnabled), - // TargetServer: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failovergroupsecondaryserver"), - // }, - // 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-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), - // TargetServer: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-secondary-server"), - // }, - // 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-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), - // TargetServer: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-secondary-server"), - // }, - // 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-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), - // TargetServer: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-primary-server"), - // }, - // 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-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), - // TargetServer: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-primary-server"), - // }, - // 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-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), - // TargetServer: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failovergroupprimaryserver"), - // }, - // 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/fake/distributedavailabilitygroups_server.go b/sdk/resourcemanager/sql/armsql/fake/distributedavailabilitygroups_server.go index 9514cfae4b3d..d3e175261c80 100644 --- a/sdk/resourcemanager/sql/armsql/fake/distributedavailabilitygroups_server.go +++ b/sdk/resourcemanager/sql/armsql/fake/distributedavailabilitygroups_server.go @@ -32,10 +32,6 @@ type DistributedAvailabilityGroupsServer struct { // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDelete func(ctx context.Context, resourceGroupName string, managedInstanceName string, distributedAvailabilityGroupName string, options *armsql.DistributedAvailabilityGroupsClientBeginDeleteOptions) (resp azfake.PollerResponder[armsql.DistributedAvailabilityGroupsClientDeleteResponse], errResp azfake.ErrorResponder) - // BeginFailover is the fake for method DistributedAvailabilityGroupsClient.BeginFailover - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginFailover func(ctx context.Context, resourceGroupName string, managedInstanceName string, distributedAvailabilityGroupName string, parameters armsql.DistributedAvailabilityGroupsFailoverRequest, options *armsql.DistributedAvailabilityGroupsClientBeginFailoverOptions) (resp azfake.PollerResponder[armsql.DistributedAvailabilityGroupsClientFailoverResponse], errResp azfake.ErrorResponder) - // Get is the fake for method DistributedAvailabilityGroupsClient.Get // HTTP status codes to indicate success: http.StatusOK Get func(ctx context.Context, resourceGroupName string, managedInstanceName string, distributedAvailabilityGroupName string, options *armsql.DistributedAvailabilityGroupsClientGetOptions) (resp azfake.Responder[armsql.DistributedAvailabilityGroupsClientGetResponse], errResp azfake.ErrorResponder) @@ -44,10 +40,6 @@ type DistributedAvailabilityGroupsServer struct { // HTTP status codes to indicate success: http.StatusOK NewListByInstancePager func(resourceGroupName string, managedInstanceName string, options *armsql.DistributedAvailabilityGroupsClientListByInstanceOptions) (resp azfake.PagerResponder[armsql.DistributedAvailabilityGroupsClientListByInstanceResponse]) - // BeginSetRole is the fake for method DistributedAvailabilityGroupsClient.BeginSetRole - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginSetRole func(ctx context.Context, resourceGroupName string, managedInstanceName string, distributedAvailabilityGroupName string, parameters armsql.DistributedAvailabilityGroupSetRole, options *armsql.DistributedAvailabilityGroupsClientBeginSetRoleOptions) (resp azfake.PollerResponder[armsql.DistributedAvailabilityGroupsClientSetRoleResponse], errResp azfake.ErrorResponder) - // BeginUpdate is the fake for method DistributedAvailabilityGroupsClient.BeginUpdate // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted BeginUpdate func(ctx context.Context, resourceGroupName string, managedInstanceName string, distributedAvailabilityGroupName string, parameters armsql.DistributedAvailabilityGroup, options *armsql.DistributedAvailabilityGroupsClientBeginUpdateOptions) (resp azfake.PollerResponder[armsql.DistributedAvailabilityGroupsClientUpdateResponse], errResp azfake.ErrorResponder) @@ -61,9 +53,7 @@ func NewDistributedAvailabilityGroupsServerTransport(srv *DistributedAvailabilit srv: srv, beginCreateOrUpdate: newTracker[azfake.PollerResponder[armsql.DistributedAvailabilityGroupsClientCreateOrUpdateResponse]](), beginDelete: newTracker[azfake.PollerResponder[armsql.DistributedAvailabilityGroupsClientDeleteResponse]](), - beginFailover: newTracker[azfake.PollerResponder[armsql.DistributedAvailabilityGroupsClientFailoverResponse]](), newListByInstancePager: newTracker[azfake.PagerResponder[armsql.DistributedAvailabilityGroupsClientListByInstanceResponse]](), - beginSetRole: newTracker[azfake.PollerResponder[armsql.DistributedAvailabilityGroupsClientSetRoleResponse]](), beginUpdate: newTracker[azfake.PollerResponder[armsql.DistributedAvailabilityGroupsClientUpdateResponse]](), } } @@ -74,9 +64,7 @@ type DistributedAvailabilityGroupsServerTransport struct { srv *DistributedAvailabilityGroupsServer beginCreateOrUpdate *tracker[azfake.PollerResponder[armsql.DistributedAvailabilityGroupsClientCreateOrUpdateResponse]] beginDelete *tracker[azfake.PollerResponder[armsql.DistributedAvailabilityGroupsClientDeleteResponse]] - beginFailover *tracker[azfake.PollerResponder[armsql.DistributedAvailabilityGroupsClientFailoverResponse]] newListByInstancePager *tracker[azfake.PagerResponder[armsql.DistributedAvailabilityGroupsClientListByInstanceResponse]] - beginSetRole *tracker[azfake.PollerResponder[armsql.DistributedAvailabilityGroupsClientSetRoleResponse]] beginUpdate *tracker[azfake.PollerResponder[armsql.DistributedAvailabilityGroupsClientUpdateResponse]] } @@ -96,14 +84,10 @@ func (d *DistributedAvailabilityGroupsServerTransport) Do(req *http.Request) (*h resp, err = d.dispatchBeginCreateOrUpdate(req) case "DistributedAvailabilityGroupsClient.BeginDelete": resp, err = d.dispatchBeginDelete(req) - case "DistributedAvailabilityGroupsClient.BeginFailover": - resp, err = d.dispatchBeginFailover(req) case "DistributedAvailabilityGroupsClient.Get": resp, err = d.dispatchGet(req) case "DistributedAvailabilityGroupsClient.NewListByInstancePager": resp, err = d.dispatchNewListByInstancePager(req) - case "DistributedAvailabilityGroupsClient.BeginSetRole": - resp, err = d.dispatchBeginSetRole(req) case "DistributedAvailabilityGroupsClient.BeginUpdate": resp, err = d.dispatchBeginUpdate(req) default: @@ -217,58 +201,6 @@ func (d *DistributedAvailabilityGroupsServerTransport) dispatchBeginDelete(req * return resp, nil } -func (d *DistributedAvailabilityGroupsServerTransport) dispatchBeginFailover(req *http.Request) (*http.Response, error) { - if d.srv.BeginFailover == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginFailover not implemented")} - } - beginFailover := d.beginFailover.get(req) - if beginFailover == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Sql/managedInstances/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/distributedAvailabilityGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/failover` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armsql.DistributedAvailabilityGroupsFailoverRequest](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - managedInstanceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("managedInstanceName")]) - if err != nil { - return nil, err - } - distributedAvailabilityGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("distributedAvailabilityGroupName")]) - if err != nil { - return nil, err - } - respr, errRespr := d.srv.BeginFailover(req.Context(), resourceGroupNameParam, managedInstanceNameParam, distributedAvailabilityGroupNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginFailover = &respr - d.beginFailover.add(req, beginFailover) - } - - resp, err := server.PollerResponderNext(beginFailover, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { - d.beginFailover.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} - } - if !server.PollerResponderMore(beginFailover) { - d.beginFailover.remove(req) - } - - return resp, nil -} - func (d *DistributedAvailabilityGroupsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { if d.srv.Get == nil { return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} @@ -347,58 +279,6 @@ func (d *DistributedAvailabilityGroupsServerTransport) dispatchNewListByInstance return resp, nil } -func (d *DistributedAvailabilityGroupsServerTransport) dispatchBeginSetRole(req *http.Request) (*http.Response, error) { - if d.srv.BeginSetRole == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginSetRole not implemented")} - } - beginSetRole := d.beginSetRole.get(req) - if beginSetRole == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Sql/managedInstances/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/distributedAvailabilityGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/setRole` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armsql.DistributedAvailabilityGroupSetRole](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - managedInstanceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("managedInstanceName")]) - if err != nil { - return nil, err - } - distributedAvailabilityGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("distributedAvailabilityGroupName")]) - if err != nil { - return nil, err - } - respr, errRespr := d.srv.BeginSetRole(req.Context(), resourceGroupNameParam, managedInstanceNameParam, distributedAvailabilityGroupNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginSetRole = &respr - d.beginSetRole.add(req, beginSetRole) - } - - resp, err := server.PollerResponderNext(beginSetRole, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { - d.beginSetRole.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} - } - if !server.PollerResponderMore(beginSetRole) { - d.beginSetRole.remove(req) - } - - return resp, nil -} - func (d *DistributedAvailabilityGroupsServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Response, error) { if d.srv.BeginUpdate == nil { return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} diff --git a/sdk/resourcemanager/sql/armsql/fake/managedinstances_server.go b/sdk/resourcemanager/sql/armsql/fake/managedinstances_server.go index ddae33e6821f..2e1204c713f9 100644 --- a/sdk/resourcemanager/sql/armsql/fake/managedinstances_server.go +++ b/sdk/resourcemanager/sql/armsql/fake/managedinstances_server.go @@ -61,16 +61,12 @@ type ManagedInstancesServer struct { // HTTP status codes to indicate success: http.StatusOK NewListOutboundNetworkDependenciesByManagedInstancePager func(resourceGroupName string, managedInstanceName string, options *armsql.ManagedInstancesClientListOutboundNetworkDependenciesByManagedInstanceOptions) (resp azfake.PagerResponder[armsql.ManagedInstancesClientListOutboundNetworkDependenciesByManagedInstanceResponse]) - // BeginRefreshStatus is the fake for method ManagedInstancesClient.BeginRefreshStatus - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginRefreshStatus func(ctx context.Context, resourceGroupName string, managedInstanceName string, options *armsql.ManagedInstancesClientBeginRefreshStatusOptions) (resp azfake.PollerResponder[armsql.ManagedInstancesClientRefreshStatusResponse], errResp azfake.ErrorResponder) - // BeginStart is the fake for method ManagedInstancesClient.BeginStart - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusAccepted BeginStart func(ctx context.Context, resourceGroupName string, managedInstanceName string, options *armsql.ManagedInstancesClientBeginStartOptions) (resp azfake.PollerResponder[armsql.ManagedInstancesClientStartResponse], errResp azfake.ErrorResponder) // BeginStop is the fake for method ManagedInstancesClient.BeginStop - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusAccepted BeginStop func(ctx context.Context, resourceGroupName string, managedInstanceName string, options *armsql.ManagedInstancesClientBeginStopOptions) (resp azfake.PollerResponder[armsql.ManagedInstancesClientStopResponse], errResp azfake.ErrorResponder) // BeginUpdate is the fake for method ManagedInstancesClient.BeginUpdate @@ -92,10 +88,9 @@ func NewManagedInstancesServerTransport(srv *ManagedInstancesServer) *ManagedIns newListByManagedInstancePager: newTracker[azfake.PagerResponder[armsql.ManagedInstancesClientListByManagedInstanceResponse]](), newListByResourceGroupPager: newTracker[azfake.PagerResponder[armsql.ManagedInstancesClientListByResourceGroupResponse]](), newListOutboundNetworkDependenciesByManagedInstancePager: newTracker[azfake.PagerResponder[armsql.ManagedInstancesClientListOutboundNetworkDependenciesByManagedInstanceResponse]](), - beginRefreshStatus: newTracker[azfake.PollerResponder[armsql.ManagedInstancesClientRefreshStatusResponse]](), - beginStart: newTracker[azfake.PollerResponder[armsql.ManagedInstancesClientStartResponse]](), - beginStop: newTracker[azfake.PollerResponder[armsql.ManagedInstancesClientStopResponse]](), - beginUpdate: newTracker[azfake.PollerResponder[armsql.ManagedInstancesClientUpdateResponse]](), + beginStart: newTracker[azfake.PollerResponder[armsql.ManagedInstancesClientStartResponse]](), + beginStop: newTracker[azfake.PollerResponder[armsql.ManagedInstancesClientStopResponse]](), + beginUpdate: newTracker[azfake.PollerResponder[armsql.ManagedInstancesClientUpdateResponse]](), } } @@ -111,7 +106,6 @@ type ManagedInstancesServerTransport struct { newListByManagedInstancePager *tracker[azfake.PagerResponder[armsql.ManagedInstancesClientListByManagedInstanceResponse]] newListByResourceGroupPager *tracker[azfake.PagerResponder[armsql.ManagedInstancesClientListByResourceGroupResponse]] newListOutboundNetworkDependenciesByManagedInstancePager *tracker[azfake.PagerResponder[armsql.ManagedInstancesClientListOutboundNetworkDependenciesByManagedInstanceResponse]] - beginRefreshStatus *tracker[azfake.PollerResponder[armsql.ManagedInstancesClientRefreshStatusResponse]] beginStart *tracker[azfake.PollerResponder[armsql.ManagedInstancesClientStartResponse]] beginStop *tracker[azfake.PollerResponder[armsql.ManagedInstancesClientStopResponse]] beginUpdate *tracker[azfake.PollerResponder[armsql.ManagedInstancesClientUpdateResponse]] @@ -147,8 +141,6 @@ func (m *ManagedInstancesServerTransport) Do(req *http.Request) (*http.Response, resp, err = m.dispatchNewListByResourceGroupPager(req) case "ManagedInstancesClient.NewListOutboundNetworkDependenciesByManagedInstancePager": resp, err = m.dispatchNewListOutboundNetworkDependenciesByManagedInstancePager(req) - case "ManagedInstancesClient.BeginRefreshStatus": - resp, err = m.dispatchBeginRefreshStatus(req) case "ManagedInstancesClient.BeginStart": resp, err = m.dispatchBeginStart(req) case "ManagedInstancesClient.BeginStop": @@ -645,50 +637,6 @@ func (m *ManagedInstancesServerTransport) dispatchNewListOutboundNetworkDependen return resp, nil } -func (m *ManagedInstancesServerTransport) dispatchBeginRefreshStatus(req *http.Request) (*http.Response, error) { - if m.srv.BeginRefreshStatus == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginRefreshStatus not implemented")} - } - beginRefreshStatus := m.beginRefreshStatus.get(req) - if beginRefreshStatus == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Sql/managedInstances/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/refreshExternalGovernanceStatus` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - managedInstanceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("managedInstanceName")]) - if err != nil { - return nil, err - } - respr, errRespr := m.srv.BeginRefreshStatus(req.Context(), resourceGroupNameParam, managedInstanceNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginRefreshStatus = &respr - m.beginRefreshStatus.add(req, beginRefreshStatus) - } - - resp, err := server.PollerResponderNext(beginRefreshStatus, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { - m.beginRefreshStatus.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} - } - if !server.PollerResponderMore(beginRefreshStatus) { - m.beginRefreshStatus.remove(req) - } - - return resp, nil -} - func (m *ManagedInstancesServerTransport) dispatchBeginStart(req *http.Request) (*http.Response, error) { if m.srv.BeginStart == nil { return nil, &nonRetriableError{errors.New("fake for method BeginStart not implemented")} @@ -722,9 +670,9 @@ func (m *ManagedInstancesServerTransport) dispatchBeginStart(req *http.Request) return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusAccepted}, resp.StatusCode) { m.beginStart.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} } if !server.PollerResponderMore(beginStart) { m.beginStart.remove(req) @@ -766,9 +714,9 @@ func (m *ManagedInstancesServerTransport) dispatchBeginStop(req *http.Request) ( return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusAccepted}, resp.StatusCode) { m.beginStop.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} } if !server.PollerResponderMore(beginStop) { m.beginStop.remove(req) diff --git a/sdk/resourcemanager/sql/armsql/fake/replicationlinks_server.go b/sdk/resourcemanager/sql/armsql/fake/replicationlinks_server.go index cc509f72c55a..04c98bb476d2 100644 --- a/sdk/resourcemanager/sql/armsql/fake/replicationlinks_server.go +++ b/sdk/resourcemanager/sql/armsql/fake/replicationlinks_server.go @@ -24,6 +24,10 @@ import ( // ReplicationLinksServer is a fake server for instances of the armsql.ReplicationLinksClient type. type ReplicationLinksServer struct { + // BeginCreateOrUpdate is the fake for method ReplicationLinksClient.BeginCreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string, parameters armsql.ReplicationLink, options *armsql.ReplicationLinksClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armsql.ReplicationLinksClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + // BeginDelete is the fake for method ReplicationLinksClient.BeginDelete // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted BeginDelete func(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string, options *armsql.ReplicationLinksClientBeginDeleteOptions) (resp azfake.PollerResponder[armsql.ReplicationLinksClientDeleteResponse], errResp azfake.ErrorResponder) @@ -47,6 +51,10 @@ type ReplicationLinksServer struct { // NewListByServerPager is the fake for method ReplicationLinksClient.NewListByServerPager // HTTP status codes to indicate success: http.StatusOK NewListByServerPager func(resourceGroupName string, serverName string, options *armsql.ReplicationLinksClientListByServerOptions) (resp azfake.PagerResponder[armsql.ReplicationLinksClientListByServerResponse]) + + // BeginUpdate is the fake for method ReplicationLinksClient.BeginUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginUpdate func(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string, parameters armsql.ReplicationLinkUpdate, options *armsql.ReplicationLinksClientBeginUpdateOptions) (resp azfake.PollerResponder[armsql.ReplicationLinksClientUpdateResponse], errResp azfake.ErrorResponder) } // NewReplicationLinksServerTransport creates a new instance of ReplicationLinksServerTransport with the provided implementation. @@ -55,11 +63,13 @@ type ReplicationLinksServer struct { func NewReplicationLinksServerTransport(srv *ReplicationLinksServer) *ReplicationLinksServerTransport { return &ReplicationLinksServerTransport{ srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armsql.ReplicationLinksClientCreateOrUpdateResponse]](), beginDelete: newTracker[azfake.PollerResponder[armsql.ReplicationLinksClientDeleteResponse]](), beginFailover: newTracker[azfake.PollerResponder[armsql.ReplicationLinksClientFailoverResponse]](), beginFailoverAllowDataLoss: newTracker[azfake.PollerResponder[armsql.ReplicationLinksClientFailoverAllowDataLossResponse]](), newListByDatabasePager: newTracker[azfake.PagerResponder[armsql.ReplicationLinksClientListByDatabaseResponse]](), newListByServerPager: newTracker[azfake.PagerResponder[armsql.ReplicationLinksClientListByServerResponse]](), + beginUpdate: newTracker[azfake.PollerResponder[armsql.ReplicationLinksClientUpdateResponse]](), } } @@ -67,11 +77,13 @@ func NewReplicationLinksServerTransport(srv *ReplicationLinksServer) *Replicatio // Don't use this type directly, use NewReplicationLinksServerTransport instead. type ReplicationLinksServerTransport struct { srv *ReplicationLinksServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armsql.ReplicationLinksClientCreateOrUpdateResponse]] beginDelete *tracker[azfake.PollerResponder[armsql.ReplicationLinksClientDeleteResponse]] beginFailover *tracker[azfake.PollerResponder[armsql.ReplicationLinksClientFailoverResponse]] beginFailoverAllowDataLoss *tracker[azfake.PollerResponder[armsql.ReplicationLinksClientFailoverAllowDataLossResponse]] newListByDatabasePager *tracker[azfake.PagerResponder[armsql.ReplicationLinksClientListByDatabaseResponse]] newListByServerPager *tracker[azfake.PagerResponder[armsql.ReplicationLinksClientListByServerResponse]] + beginUpdate *tracker[azfake.PollerResponder[armsql.ReplicationLinksClientUpdateResponse]] } // Do implements the policy.Transporter interface for ReplicationLinksServerTransport. @@ -86,6 +98,8 @@ func (r *ReplicationLinksServerTransport) Do(req *http.Request) (*http.Response, var err error switch method { + case "ReplicationLinksClient.BeginCreateOrUpdate": + resp, err = r.dispatchBeginCreateOrUpdate(req) case "ReplicationLinksClient.BeginDelete": resp, err = r.dispatchBeginDelete(req) case "ReplicationLinksClient.BeginFailover": @@ -98,6 +112,8 @@ func (r *ReplicationLinksServerTransport) Do(req *http.Request) (*http.Response, resp, err = r.dispatchNewListByDatabasePager(req) case "ReplicationLinksClient.NewListByServerPager": resp, err = r.dispatchNewListByServerPager(req) + case "ReplicationLinksClient.BeginUpdate": + resp, err = r.dispatchBeginUpdate(req) default: err = fmt.Errorf("unhandled API %s", method) } @@ -109,6 +125,62 @@ func (r *ReplicationLinksServerTransport) Do(req *http.Request) (*http.Response, return resp, nil } +func (r *ReplicationLinksServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { + if r.srv.BeginCreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} + } + beginCreateOrUpdate := r.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Sql/servers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/databases/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/replicationLinks/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armsql.ReplicationLink](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + serverNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serverName")]) + if err != nil { + return nil, err + } + databaseNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("databaseName")]) + if err != nil { + return nil, err + } + linkIDParam, err := url.PathUnescape(matches[regex.SubexpIndex("linkId")]) + if err != nil { + return nil, err + } + respr, errRespr := r.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, serverNameParam, databaseNameParam, linkIDParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreateOrUpdate = &respr + r.beginCreateOrUpdate.add(req, beginCreateOrUpdate) + } + + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + r.beginCreateOrUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreateOrUpdate) { + r.beginCreateOrUpdate.remove(req) + } + + return resp, nil +} + func (r *ReplicationLinksServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { if r.srv.BeginDelete == nil { return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} @@ -391,3 +463,59 @@ func (r *ReplicationLinksServerTransport) dispatchNewListByServerPager(req *http } return resp, nil } + +func (r *ReplicationLinksServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Response, error) { + if r.srv.BeginUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} + } + beginUpdate := r.beginUpdate.get(req) + if beginUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Sql/servers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/databases/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/replicationLinks/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armsql.ReplicationLinkUpdate](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + serverNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serverName")]) + if err != nil { + return nil, err + } + databaseNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("databaseName")]) + if err != nil { + return nil, err + } + linkIDParam, err := url.PathUnescape(matches[regex.SubexpIndex("linkId")]) + if err != nil { + return nil, err + } + respr, errRespr := r.srv.BeginUpdate(req.Context(), resourceGroupNameParam, serverNameParam, databaseNameParam, linkIDParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginUpdate = &respr + r.beginUpdate.add(req, beginUpdate) + } + + resp, err := server.PollerResponderNext(beginUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + r.beginUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginUpdate) { + r.beginUpdate.remove(req) + } + + return resp, 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 7c3a46658b8d..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/geobackuppolicies_client_example_test.go deleted file mode 100644 index f25de9dcf1e4..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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 222d43bea47a..dc40881405da 100644 --- a/sdk/resourcemanager/sql/armsql/go.mod +++ b/sdk/resourcemanager/sql/armsql/go.mod @@ -2,20 +2,10 @@ 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.11.1 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.2 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.11.1 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.7.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect - github.com/golang-jwt/jwt/v5 v5.2.1 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect - golang.org/x/crypto v0.22.0 // indirect golang.org/x/net v0.24.0 // indirect - golang.org/x/sys v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect ) diff --git a/sdk/resourcemanager/sql/armsql/go.sum b/sdk/resourcemanager/sql/armsql/go.sum index 453385ef9f88..ffdff03203f8 100644 --- a/sdk/resourcemanager/sql/armsql/go.sum +++ b/sdk/resourcemanager/sql/armsql/go.sum @@ -1,29 +1,12 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.11.1 h1:E+OJmp2tPvt1W+amx48v1eqbjDYsgN+RzP4q16yV5eM= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.11.1/go.mod h1:a6xsAQUZg+VsS3TJ05SRp524Hs4pZ/AeFSr5ENf0Yjo= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.2 h1:FDif4R1+UUR+00q6wquyX90K7A8dN+R5E8GEadoP7sU= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.2/go.mod h1:aiYBYui4BJ/BJCAIKs92XiPyQfTaBWqvHujDwKb6CBU= github.com/Azure/azure-sdk-for-go/sdk/internal v1.7.0 h1:rTfKOCZGy5ViVrlA74ZPE99a+SgoEE2K/yg3RyW9dFA= github.com/Azure/azure-sdk-for-go/sdk/internal v1.7.0/go.mod h1:4OG6tQ9EOP/MT0NMjDlRzWoVFxfu9rN9B2X+tlSVktg= -github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 h1:XHOnouVk1mxXfQidrMEnLlPk9UMeRtyBTnEFtxkV0kU= -github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= -github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.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-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= -github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= -golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= -golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= 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 7dff55b433b9..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/instancepools_client_example_test.go deleted file mode 100644 index 1f1e45d40e98..000000000000 --- a/sdk/resourcemanager/sql/armsql/instancepools_client_example_test.go +++ /dev/null @@ -1,384 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-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{ - // DNSZone: to.Ptr("1234567890"), - // LicenseType: to.Ptr(armsql.InstancePoolLicenseTypeLicenseIncluded), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_1"), - // 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{ - // DNSZone: to.Ptr("1234567890"), - // LicenseType: to.Ptr(armsql.InstancePoolLicenseTypeLicenseIncluded), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_1"), - // 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"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-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{ - // DNSZone: to.Ptr("1234567890"), - // LicenseType: to.Ptr(armsql.InstancePoolLicenseTypeLicenseIncluded), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_1"), - // 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{ - // DNSZone: to.Ptr("1234567890"), - // LicenseType: to.Ptr(armsql.InstancePoolLicenseTypeLicenseIncluded), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_1"), - // 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-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{ - // DNSZone: to.Ptr("1234567890"), - // LicenseType: to.Ptr(armsql.InstancePoolLicenseTypeLicenseIncluded), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_1"), - // 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-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), - MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_1"), - 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{ - // DNSZone: to.Ptr("1234567890"), - // LicenseType: to.Ptr(armsql.InstancePoolLicenseTypeLicenseIncluded), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_1"), - // 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-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), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_1"), - // 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"), - // }, - // } -} 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 d8950471b0cd..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/jobagents_client_example_test.go deleted file mode 100644 index 5d81f73c7edd..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/jobcredentials_client_example_test.go deleted file mode 100644 index 33f62cb4739e..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/jobexecutions_client_example_test.go deleted file mode 100644 index 731a120e98b4..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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:00.000Z"); return t }()), - CreateTimeMax: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-21T19:05:00.000Z"); return t }()), - EndTimeMin: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-21T19:20:00.000Z"); return t }()), - EndTimeMax: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-21T19:25:00.000Z"); 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.870Z"); return t}()), - // CurrentAttemptStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-21T19:12:00.870Z"); return t}()), - // CurrentAttempts: to.Ptr[int32](0), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-21T19:22:00.870Z"); 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.870Z"); 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.870Z"); return t}()), - // CurrentAttempts: to.Ptr[int32](1), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-15T19:22:00.870Z"); 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.870Z"); return t}()), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/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.870Z"); return t}()), - // CurrentAttemptStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-21T19:12:00.870Z"); return t}()), - // CurrentAttempts: to.Ptr[int32](0), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-21T19:22:00.870Z"); 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.870Z"); 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.870Z"); return t}()), - // CurrentAttempts: to.Ptr[int32](1), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-15T19:22:00.870Z"); 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.870Z"); return t}()), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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:00.000Z"); 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/33c4457b1d13f83965f4fe3367dca4a6df898100/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.870Z"); return t}()), - // CurrentAttemptStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-21T19:12:00.870Z"); return t}()), - // CurrentAttempts: to.Ptr[int32](0), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-21T19:22:00.870Z"); 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.870Z"); 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.870Z"); return t}()), - // CurrentAttempts: to.Ptr[int32](1), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-15T19:22:00.870Z"); 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.870Z"); return t}()), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/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.870Z"); return t}()), - // CurrentAttemptStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-13T19:12:00.870Z"); return t}()), - // CurrentAttempts: to.Ptr[int32](0), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-21T19:22:00.870Z"); 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.870Z"); return t}()), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/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.870Z"); 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/jobprivateendpoints_client_example_test.go b/sdk/resourcemanager/sql/armsql/jobprivateendpoints_client_example_test.go deleted file mode 100644 index 6d2da2ae0e4c..000000000000 --- a/sdk/resourcemanager/sql/armsql/jobprivateendpoints_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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ListJobPrivateEndpointsByAgent.json -func ExampleJobPrivateEndpointsClient_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.NewJobPrivateEndpointsClient().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.JobPrivateEndpointListResult = armsql.JobPrivateEndpointListResult{ - // Value: []*armsql.JobPrivateEndpoint{ - // { - // Name: to.Ptr("endpoint1"), - // Type: to.Ptr("Microsoft.Sql/servers/jobAgents/privateEndpoints"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/privateEndpoints/endpoint1"), - // Properties: &armsql.JobPrivateEndpointProperties{ - // PrivateEndpointID: to.Ptr("EJ_47e33188-85ff-4705-8d78-444444444444_endpoint1"), - // TargetServerAzureResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/targetserver1"), - // }, - // }, - // { - // Name: to.Ptr("endpoint2"), - // Type: to.Ptr("Microsoft.Sql/servers/jobAgents/privateEndpoints"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/privateEndpoints/endpoint2"), - // Properties: &armsql.JobPrivateEndpointProperties{ - // PrivateEndpointID: to.Ptr("EJ_00000000-85ff-222-8d78-444444444444_endpoint2"), - // TargetServerAzureResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/targetserver2"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/GetJobPrivateEndpoint.json -func ExampleJobPrivateEndpointsClient_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.NewJobPrivateEndpointsClient().Get(ctx, "group1", "server1", "agent1", "endpoint1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.JobPrivateEndpoint = armsql.JobPrivateEndpoint{ - // Name: to.Ptr("endpoint1"), - // Type: to.Ptr("Microsoft.Sql/servers/jobAgents/privateEndpoints"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/privateEndpoints/endpoint1"), - // Properties: &armsql.JobPrivateEndpointProperties{ - // PrivateEndpointID: to.Ptr("EJ_47e33188-85ff-4705-8d78-444444444444_endpoint1"), - // TargetServerAzureResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/targetserver1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/CreateOrUpdateJobPrivateEndpoint.json -func ExampleJobPrivateEndpointsClient_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.NewJobPrivateEndpointsClient().BeginCreateOrUpdate(ctx, "group1", "server1", "agent1", "endpoint1", armsql.JobPrivateEndpoint{ - Properties: &armsql.JobPrivateEndpointProperties{ - TargetServerAzureResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/targetserver1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.JobPrivateEndpoint = armsql.JobPrivateEndpoint{ - // Name: to.Ptr("endpoint1"), - // Type: to.Ptr("Microsoft.Sql/servers/jobAgents/privateEndpoints"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/privateEndpoints/endpoint1"), - // Properties: &armsql.JobPrivateEndpointProperties{ - // PrivateEndpointID: to.Ptr("EJ_47e33188-85ff-4705-8d78-444444444444_endpoint1"), - // TargetServerAzureResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/targetserver1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/DeleteJobPrivateEndpoint.json -func ExampleJobPrivateEndpointsClient_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.NewJobPrivateEndpointsClient().BeginDelete(ctx, "group1", "server1", "agent1", "endpoint1", nil) - if err != nil { - log.Fatalf("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/jobs_client_example_test.go b/sdk/resourcemanager/sql/armsql/jobs_client_example_test.go deleted file mode 100644 index 1658dd1a1239..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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:59.000Z"); return t}()), - // Interval: to.Ptr("PT5M"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-09-24T18:30:01.000Z"); 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:00.000Z"); return t}()), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-07-01T03:45:00.000Z"); 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:00.000Z"); return t}()), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-07-01T03:45:00.000Z"); return t}()), - // }, - // Version: to.Ptr[int32](1), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/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:59.000Z"); return t}()), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-09-24T18:30:01.000Z"); return t}()), - // }, - // Version: to.Ptr[int32](0), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/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:59.000Z"); return t }()), - Interval: to.Ptr("PT5M"), - StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-09-24T18:30:01.000Z"); 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:59.000Z"); return t}()), - // Interval: to.Ptr("PT5M"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-09-24T18:30:01.000Z"); return t}()), - // }, - // Version: to.Ptr[int32](0), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/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:59.000Z"); return t}()), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "1-01-01T00:00:00.000Z"); return t}()), - // }, - // Version: to.Ptr[int32](0), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/jobstepexecutions_client_example_test.go deleted file mode 100644 index bd3c42bba698..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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.718Z"); return t}()), - // CurrentAttemptStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-03T04:33:17.484Z"); return t}()), - // CurrentAttempts: to.Ptr[int32](1), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-03T04:33:19.060Z"); 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.176Z"); return t}()), - // StepID: to.Ptr[int32](1), - // StepName: to.Ptr("step1"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/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.718Z"); return t}()), - // CurrentAttemptStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-27T04:33:17.484Z"); return t}()), - // CurrentAttempts: to.Ptr[int32](1), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-27T04:33:19.060Z"); 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.176Z"); return t}()), - // StepID: to.Ptr[int32](1), - // StepName: to.Ptr("step1"), - // }, - // } -} 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 36df99cc0b93..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/jobtargetexecutions_client_example_test.go deleted file mode 100644 index 46ab8dc2eed6..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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.513Z"); return t}()), - // CurrentAttemptStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-07-01T04:33:18.239Z"); return t}()), - // CurrentAttempts: to.Ptr[int32](1), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-07-01T04:33:18.703Z"); 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.123Z"); 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/33c4457b1d13f83965f4fe3367dca4a6df898100/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.513Z"); return t}()), - // CurrentAttemptStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-07-01T04:33:18.239Z"); return t}()), - // CurrentAttempts: to.Ptr[int32](1), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-07-01T04:33:18.703Z"); 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.123Z"); 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/33c4457b1d13f83965f4fe3367dca4a6df898100/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.513Z"); return t}()), - // CurrentAttemptStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-05T04:33:18.239Z"); return t}()), - // CurrentAttempts: to.Ptr[int32](1), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-05T04:33:18.703Z"); 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.123Z"); 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_example_test.go b/sdk/resourcemanager/sql/armsql/jobtargetgroups_client_example_test.go deleted file mode 100644 index 7cfab8fa45d5..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/jobversions_client_example_test.go deleted file mode 100644 index 12cbade81da5..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/ledgerdigestuploads_client_example_test.go deleted file mode 100644 index 34e750184fce..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/longtermretentionbackups_client_example_test.go deleted file mode 100644 index 112e6dbe1732..000000000000 --- a/sdk/resourcemanager/sql/armsql/longtermretentionbackups_client_example_test.go +++ /dev/null @@ -1,807 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-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;131637960820000000;Archive"), - // 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;Archive"), - // Properties: &armsql.LongTermRetentionBackupProperties{ - // BackupStorageAccessTier: to.Ptr(armsql.BackupStorageAccessTierArchive), - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // BackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-23T08:00:00.000Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase1"), - // IsBackupImmutable: to.Ptr(false), - // ServerCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00.000Z"); return t}()), - // ServerName: to.Ptr("testserver1"), - // }, - // }, - // { - // Name: to.Ptr("55555555-6666-7777-8888-999999999999;131637960820000000;Hot"), - // 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;Hot"), - // Properties: &armsql.LongTermRetentionBackupProperties{ - // BackupStorageAccessTier: to.Ptr(armsql.BackupStorageAccessTierHot), - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // BackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-23T08:00:00.000Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase1"), - // IsBackupImmutable: to.Ptr(false), - // ServerCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00.000Z"); return t}()), - // ServerName: to.Ptr("testserver1"), - // }, - // }, - // { - // Name: to.Ptr("12341234-1234-1234-1234-123123123123;131657960820000000;Archive"), - // 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;Archive"), - // Properties: &armsql.LongTermRetentionBackupProperties{ - // BackupStorageAccessTier: to.Ptr(armsql.BackupStorageAccessTierArchive), - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // BackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-30T08:00:00.000Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase2"), - // IsBackupImmutable: to.Ptr(false), - // ServerCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-10T08:00:00.000Z"); return t}()), - // ServerName: to.Ptr("testserver2"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-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;Archive"), - // 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;Archive"), - // Properties: &armsql.LongTermRetentionBackupProperties{ - // BackupStorageAccessTier: to.Ptr(armsql.BackupStorageAccessTierArchive), - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // BackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-23T08:00:00.000Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase1"), - // IsBackupImmutable: to.Ptr(false), - // ServerCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00.000Z"); return t}()), - // ServerName: to.Ptr("testserver"), - // }, - // }, - // { - // Name: to.Ptr("55555555-6666-7777-8888-999999999999;131637960820000000;Hot"), - // 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;Hot"), - // Properties: &armsql.LongTermRetentionBackupProperties{ - // BackupStorageAccessTier: to.Ptr(armsql.BackupStorageAccessTierHot), - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // BackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-23T08:00:00.000Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase1"), - // IsBackupImmutable: to.Ptr(false), - // ServerCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00.000Z"); return t}()), - // ServerName: to.Ptr("testserver"), - // }, - // }, - // { - // Name: to.Ptr("12341234-1234-1234-1234-123123123123;131657960820000000;Archive"), - // 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;Archive"), - // Properties: &armsql.LongTermRetentionBackupProperties{ - // BackupStorageAccessTier: to.Ptr(armsql.BackupStorageAccessTierArchive), - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // BackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-30T08:00:00.000Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase2"), - // IsBackupImmutable: to.Ptr(false), - // ServerCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00.000Z"); return t}()), - // ServerName: to.Ptr("testserver"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-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;Archive"), - // 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;Archive"), - // Properties: &armsql.LongTermRetentionBackupProperties{ - // BackupStorageAccessTier: to.Ptr(armsql.BackupStorageAccessTierArchive), - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // BackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-23T08:00:00.000Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase"), - // IsBackupImmutable: to.Ptr(false), - // ServerCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00.000Z"); return t}()), - // ServerName: to.Ptr("testserver"), - // }, - // }, - // { - // Name: to.Ptr("55555555-6666-7777-8888-999999999999;131637960820000000;Hot"), - // 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;Hot"), - // Properties: &armsql.LongTermRetentionBackupProperties{ - // BackupStorageAccessTier: to.Ptr(armsql.BackupStorageAccessTierHot), - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // BackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-23T08:00:00.000Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase"), - // IsBackupImmutable: to.Ptr(false), - // ServerCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00.000Z"); return t}()), - // ServerName: to.Ptr("testserver"), - // }, - // }, - // { - // Name: to.Ptr("55555555-6666-7777-8888-999999999999;131677960820000000;Archive"), - // 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;Hot"), - // Properties: &armsql.LongTermRetentionBackupProperties{ - // BackupStorageAccessTier: to.Ptr(armsql.BackupStorageAccessTierHot), - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // BackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-06T08:00:00.000Z"); return t}()), - // DatabaseDeletionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-07T08:00:00.000Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase"), - // IsBackupImmutable: to.Ptr(false), - // ServerCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00.000Z"); return t}()), - // ServerName: to.Ptr("testserver"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-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;Archive", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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("55555555-6666-7777-8888-999999999999;131637960820000000;Archive"), - // 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;Archive"), - // Properties: &armsql.LongTermRetentionBackupProperties{ - // BackupStorageAccessTier: to.Ptr(armsql.BackupStorageAccessTierArchive), - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // BackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-06T08:00:00.000Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase"), - // IsBackupImmutable: to.Ptr(false), - // ServerCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00.000Z"); return t}()), - // ServerName: to.Ptr("testserver"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-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;Hot", nil) - if err != nil { - log.Fatalf("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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ChangeLongTermRetentionBackupAccessTier.json -func ExampleLongTermRetentionBackupsClient_BeginChangeAccessTier() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain 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().BeginChangeAccessTier(ctx, "japaneast", "serverName", "databaseName", "55555555-6666-7777-8888-999999999999;131637960820000000;Archive", armsql.ChangeLongTermRetentionBackupAccessTierParameters{ - BackupStorageAccessTier: to.Ptr("Hot"), - OperationMode: to.Ptr("Copy"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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("55555555-6666-7777-8888-999999999999;131637960820000000;Archive"), - // Type: to.Ptr("Microsoft.Sql/locations/longTermRetentionServers/longTermRetentionDatabases/longTermRetentionBackups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/locations/japaneast/longTermRetentionServers/serverName/longTermRetentionDatabases/databaseName/longTermRetentionBackups/55555555-6666-7777-8888-999999999999;131637960820000000;Archive"), - // Properties: &armsql.LongTermRetentionBackupProperties{ - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // BackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-06T08:00:00.000Z"); return t}()), - // DatabaseDeletionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-06T08:00:00.000Z"); return t}()), - // DatabaseName: to.Ptr("databaseName"), - // ServerCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-06T08:00:00.000Z"); return t}()), - // ServerName: to.Ptr("serverName"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-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;131637960820000000;Archive"), - // 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;Archive"), - // Properties: &armsql.LongTermRetentionBackupProperties{ - // BackupStorageAccessTier: to.Ptr(armsql.BackupStorageAccessTierArchive), - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // BackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-23T08:00:00.000Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase1"), - // IsBackupImmutable: to.Ptr(false), - // ServerCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00.000Z"); return t}()), - // ServerName: to.Ptr("testserver1"), - // }, - // }, - // { - // Name: to.Ptr("55555555-6666-7777-8888-999999999999;131637960820000000;Hot"), - // 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;Hot"), - // Properties: &armsql.LongTermRetentionBackupProperties{ - // BackupStorageAccessTier: to.Ptr(armsql.BackupStorageAccessTierHot), - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // BackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-23T08:00:00.000Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase1"), - // IsBackupImmutable: to.Ptr(false), - // ServerCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00.000Z"); return t}()), - // ServerName: to.Ptr("testserver1"), - // }, - // }, - // { - // Name: to.Ptr("12341234-1234-1234-1234-123123123123;131657960820000000;Archive"), - // 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;Archive"), - // Properties: &armsql.LongTermRetentionBackupProperties{ - // BackupStorageAccessTier: to.Ptr(armsql.BackupStorageAccessTierArchive), - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // BackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-30T08:00:00.000Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase2"), - // IsBackupImmutable: to.Ptr(false), - // ServerCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-10T08:00:00.000Z"); return t}()), - // ServerName: to.Ptr("testserver2"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-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;Archive"), - // 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;Archive"), - // Properties: &armsql.LongTermRetentionBackupProperties{ - // BackupStorageAccessTier: to.Ptr(armsql.BackupStorageAccessTierArchive), - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // BackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-23T08:00:00.000Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase1"), - // IsBackupImmutable: to.Ptr(false), - // ServerCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00.000Z"); return t}()), - // ServerName: to.Ptr("testserver"), - // }, - // }, - // { - // Name: to.Ptr("55555555-6666-7777-8888-999999999999;131637960820000000;Hot"), - // 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;Hot"), - // Properties: &armsql.LongTermRetentionBackupProperties{ - // BackupStorageAccessTier: to.Ptr(armsql.BackupStorageAccessTierHot), - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // BackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-23T08:00:00.000Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase1"), - // IsBackupImmutable: to.Ptr(false), - // ServerCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00.000Z"); return t}()), - // ServerName: to.Ptr("testserver"), - // }, - // }, - // { - // Name: to.Ptr("12341234-1234-1234-1234-123123123123;131657960820000000;Archive"), - // 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;Archive"), - // Properties: &armsql.LongTermRetentionBackupProperties{ - // BackupStorageAccessTier: to.Ptr(armsql.BackupStorageAccessTierArchive), - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // BackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-30T08:00:00.000Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase2"), - // IsBackupImmutable: to.Ptr(false), - // ServerCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00.000Z"); return t}()), - // ServerName: to.Ptr("testserver"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-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;Archive"), - // 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;Archive"), - // Properties: &armsql.LongTermRetentionBackupProperties{ - // BackupStorageAccessTier: to.Ptr(armsql.BackupStorageAccessTierArchive), - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // BackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-23T08:00:00.000Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase"), - // IsBackupImmutable: to.Ptr(false), - // ServerCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00.000Z"); return t}()), - // ServerName: to.Ptr("testserver"), - // }, - // }, - // { - // Name: to.Ptr("55555555-6666-7777-8888-999999999999;131637960820000000;Hot"), - // 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;Hot"), - // Properties: &armsql.LongTermRetentionBackupProperties{ - // BackupStorageAccessTier: to.Ptr(armsql.BackupStorageAccessTierHot), - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // BackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-23T08:00:00.000Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase"), - // IsBackupImmutable: to.Ptr(false), - // ServerCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00.000Z"); return t}()), - // ServerName: to.Ptr("testserver"), - // }, - // }, - // { - // Name: to.Ptr("55555555-6666-7777-8888-999999999999;131657960820000000;Archive"), - // 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;Archive"), - // Properties: &armsql.LongTermRetentionBackupProperties{ - // BackupStorageAccessTier: to.Ptr(armsql.BackupStorageAccessTierArchive), - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // BackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-30T08:00:00.000Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase"), - // IsBackupImmutable: to.Ptr(false), - // ServerCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00.000Z"); return t}()), - // ServerName: to.Ptr("testserver"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-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;Archive", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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("55555555-6666-7777-8888-999999999999;131637960820000000;Archive"), - // 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;Archive"), - // Properties: &armsql.LongTermRetentionBackupProperties{ - // BackupStorageAccessTier: to.Ptr(armsql.BackupStorageAccessTierArchive), - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // BackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-06T08:00:00.000Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase"), - // IsBackupImmutable: to.Ptr(false), - // ServerCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00.000Z"); return t}()), - // ServerName: to.Ptr("testserver"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-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;Archive", nil) - if err != nil { - log.Fatalf("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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ResourceGroupBasedChangeLongTermRetentionBackupAccessTier.json -func ExampleLongTermRetentionBackupsClient_BeginChangeAccessTierByResourceGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain 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().BeginChangeAccessTierByResourceGroup(ctx, "resourceGroupName", "japaneast", "serverName", "databaseName", "55555555-6666-7777-8888-999999999999;131637960820000000;Archive", armsql.ChangeLongTermRetentionBackupAccessTierParameters{ - BackupStorageAccessTier: to.Ptr("Hot"), - OperationMode: to.Ptr("Copy"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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("55555555-6666-7777-8888-999999999999;131637960820000000;Archive"), - // Type: to.Ptr("Microsoft.Sql/locations/longTermRetentionServers/longTermRetentionDatabases/longTermRetentionBackups"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/resourceGroupName/providers/Microsoft.Sql/locations/japaneast/longTermRetentionServers/serverName/longTermRetentionDatabases/databaseName/longTermRetentionBackups/55555555-6666-7777-8888-999999999999;131637960820000000;Archive"), - // Properties: &armsql.LongTermRetentionBackupProperties{ - // BackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // BackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-06T08:00:00.000Z"); return t}()), - // DatabaseName: to.Ptr("databaseName"), - // ServerCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-06T08:00:00.000Z"); return t}()), - // ServerName: to.Ptr("serverName"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-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), - // }, - // } -} 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 be070533cbad..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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:00.000Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase"), - // ManagedInstanceCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-01T08:00:00.000Z"); return t}()), - // ManagedInstanceName: to.Ptr("testInstance"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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:00.000Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase"), - // ManagedInstanceCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00.000Z"); 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:00.000Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase"), - // ManagedInstanceCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00.000Z"); 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:00.000Z"); return t}()), - // DatabaseDeletionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-07T08:00:00.000Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase"), - // ManagedInstanceCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00.000Z"); return t}()), - // ManagedInstanceName: to.Ptr("testInstance"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/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:00.000Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase1"), - // ManagedInstanceCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00.000Z"); 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:00.000Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase2"), - // ManagedInstanceCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00.000Z"); 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:00.000Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase3"), - // ManagedInstanceCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00.000Z"); return t}()), - // ManagedInstanceName: to.Ptr("testInstance"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/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:00.000Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase1"), - // ManagedInstanceCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00.000Z"); 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:00.000Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase2"), - // ManagedInstanceCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-10T08:00:00.000Z"); 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:00.000Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase3"), - // ManagedInstanceCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-10T08:00:00.000Z"); return t}()), - // ManagedInstanceName: to.Ptr("testInstance3"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/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:00.000Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase"), - // ManagedInstanceCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00.000Z"); return t}()), - // ManagedInstanceName: to.Ptr("testInstance"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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:00.000Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase"), - // ManagedInstanceCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00.000Z"); 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:00.000Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase"), - // ManagedInstanceCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00.000Z"); 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:00.000Z"); return t}()), - // DatabaseDeletionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-07T08:00:00.000Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase"), - // ManagedInstanceCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-10T08:00:00.000Z"); return t}()), - // ManagedInstanceName: to.Ptr("testInstance"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/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:00.000Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase1"), - // ManagedInstanceCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00.000Z"); 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:00.000Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase2"), - // ManagedInstanceCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00.000Z"); 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:00.000Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase3"), - // ManagedInstanceCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00.000Z"); return t}()), - // ManagedInstanceName: to.Ptr("testInstance"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/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:00.000Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase1"), - // ManagedInstanceCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-10T08:00:00.000Z"); 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:00.000Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase2"), - // ManagedInstanceCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-10T08:00:00.000Z"); 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:00.000Z"); return t}()), - // DatabaseName: to.Ptr("testDatabase3"), - // ManagedInstanceCreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-10T08:00:00.000Z"); return t}()), - // ManagedInstanceName: to.Ptr("testInstance3"), - // }, - // }}, - // } - } -} 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 15fcbd84a1e1..000000000000 --- a/sdk/resourcemanager/sql/armsql/longtermretentionpolicies_client_example_test.go +++ /dev/null @@ -1,139 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-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.LongTermRetentionPolicyProperties{ - // BackupStorageAccessTier: to.Ptr(armsql.BackupStorageAccessTierArchive), - // MakeBackupsImmutable: to.Ptr(true), - // 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-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.LongTermRetentionPolicyProperties{ - // BackupStorageAccessTier: to.Ptr(armsql.BackupStorageAccessTierArchive), - // MakeBackupsImmutable: to.Ptr(true), - // 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-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.LongTermRetentionPolicyProperties{ - BackupStorageAccessTier: to.Ptr(armsql.BackupStorageAccessTierHot), - MakeBackupsImmutable: to.Ptr(true), - 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.LongTermRetentionPolicyProperties{ - // BackupStorageAccessTier: to.Ptr(armsql.BackupStorageAccessTierHot), - // MakeBackupsImmutable: to.Ptr(true), - // 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_example_test.go b/sdk/resourcemanager/sql/armsql/maintenancewindowoptions_client_example_test.go deleted file mode 100644 index 62d501df9071..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/maintenancewindows_client_example_test.go deleted file mode 100644 index 1c7f166ef1ef..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/managedbackupshorttermretentionpolicies_client_example_test.go deleted file mode 100644 index ac986eafacd6..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/manageddatabaseadvancedthreatprotectionsettings_client_example_test.go deleted file mode 100644 index 07a24562acbc..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/manageddatabasecolumns_client_example_test.go deleted file mode 100644 index 5a2fb7cb5775..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/manageddatabasemoveoperations_client_example_test.go deleted file mode 100644 index afbfae6566cc..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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.720Z"); 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.720Z"); 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.710Z"); 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/33c4457b1d13f83965f4fe3367dca4a6df898100/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.720Z"); 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/33c4457b1d13f83965f4fe3367dca4a6df898100/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.720Z"); 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.710Z"); 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/33c4457b1d13f83965f4fe3367dca4a6df898100/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.720Z"); 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_example_test.go b/sdk/resourcemanager/sql/armsql/manageddatabasequeries_client_example_test.go deleted file mode 100644 index 1cfa44a157ea..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/manageddatabaserecommendedsensitivitylabels_client_example_test.go deleted file mode 100644 index daf12100c89f..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/manageddatabaserestoredetails_client_example_test.go deleted file mode 100644 index 9bb1a08b35ca..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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.366Z"); return t}()), - // RestoreStartedTimestampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-09T12:19:40.545Z"); 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.378Z"); return t}()), - // RestoreStartedTimestampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-09T12:15:40.314Z"); 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.493Z"); return t}()), - // LastUploadedFileName: to.Ptr("RestoreDetailsFullBlownExampleLog11.bak"), - // LastUploadedFileTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-01T07:54:21.000Z"); 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.755Z"); return t}()), - // RestoreStartedTimestampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-09T12:21:01.771Z"); 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.709Z"); return t}()), - // RestoreStartedTimestampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-09T12:22:41.878Z"); 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.927Z"); return t}()), - // RestoreStartedTimestampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-09T12:23:36.626Z"); 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.995Z"); return t}()), - // RestoreStartedTimestampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-09T12:24:25.899Z"); 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.808Z"); return t}()), - // RestoreStartedTimestampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-09T12:25:10.880Z"); 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.781Z"); 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_example_test.go b/sdk/resourcemanager/sql/armsql/manageddatabases_client_example_test.go deleted file mode 100644 index 622bc9cca0b9..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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.730Z"); 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.730Z"); 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/33c4457b1d13f83965f4fe3367dca4a6df898100/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.730Z"); 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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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.730Z"); 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.730Z"); return t}()), - // DefaultSecondaryLocation: to.Ptr("North Europe"), - // Status: to.Ptr(armsql.ManagedDatabaseStatusInaccessible), - // }, - // }}, - // } - } -} 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 6a3e5047d446..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/manageddatabasesecurityalertpolicies_client_example_test.go deleted file mode 100644 index 5f52c3cdb408..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/manageddatabasesecurityevents_client_example_test.go deleted file mode 100644 index 6ff2d7850290..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/manageddatabasesensitivitylabels_client_example_test.go deleted file mode 100644 index 031610ff77ac..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/manageddatabasetables_client_example_test.go deleted file mode 100644 index a43a1f8cfc65..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/manageddatabasetransparentdataencryption_client_example_test.go deleted file mode 100644 index c40346805f5e..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessmentrulebaselines_client_example_test.go deleted file mode 100644 index bc89876a444d..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessments_client_example_test.go deleted file mode 100644 index dc78a5117eaa..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessmentscans_client_example_test.go deleted file mode 100644 index 1bb686eb1bd3..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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:06.000Z"); 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:06.000Z"); 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:06.000Z"); 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:06.000Z"); 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:06.000Z"); 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:06.000Z"); 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/33c4457b1d13f83965f4fe3367dca4a6df898100/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:06.000Z"); 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:06.000Z"); 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_example_test.go b/sdk/resourcemanager/sql/armsql/managedinstanceadministrators_client_example_test.go deleted file mode 100644 index 0ed32c184267..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/managedinstanceadvancedthreatprotectionsettings_client_example_test.go deleted file mode 100644 index 3881b11497e4..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/managedinstanceazureadonlyauthentications_client_example_test.go deleted file mode 100644 index 4cae7b426289..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/managedinstancedtcs_client_example_test.go deleted file mode 100644 index 7715fc7d3101..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/managedinstanceencryptionprotectors_client_example_test.go deleted file mode 100644 index f89a28b15fcf..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/managedinstancekeys_client_example_test.go deleted file mode 100644 index cfa62ab43eb3..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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:00.000Z"); 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:00.000Z"); 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/33c4457b1d13f83965f4fe3367dca4a6df898100/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:00.000Z"); return t}()), - // Thumbprint: to.Ptr("00112233445566778899AABBCCDDEEFFAABBCCDD"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/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:00.000Z"); return t}()), - // Thumbprint: to.Ptr("00112233445566778899AABBCCDDEEFFAABBCCDD"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/managedinstancelongtermretentionpolicies_client_example_test.go deleted file mode 100644 index 729b675f8c94..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/managedinstanceoperations_client_example_test.go deleted file mode 100644 index a13e2e65d0e4..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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.490Z"); 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.490Z"); 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.100Z"); return t}()), - // State: to.Ptr(armsql.ManagementOperationStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/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.490Z"); return t}()), - // State: to.Ptr(armsql.ManagementOperationStateCancelled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/managedinstanceprivateendpointconnections_client_example_test.go deleted file mode 100644 index 6ecedeba3469..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/managedinstanceprivatelinkresources_client_example_test.go deleted file mode 100644 index 4dc0930d93b7..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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 93be3a8fa80e..31a5b42a07eb 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 2023-05-01-preview +// Generated from API version 2022-08-01-preview // - resourceGroupName - 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. @@ -74,7 +74,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 2023-05-01-preview +// Generated from API version 2022-08-01-preview func (client *ManagedInstancesClient) createOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, parameters ManagedInstance, options *ManagedInstancesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ManagedInstancesClient.BeginCreateOrUpdate" @@ -116,7 +116,7 @@ func (client *ManagedInstancesClient) createOrUpdateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2022-08-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 *ManagedInstancesClient) createOrUpdateCreateRequest(ctx context.Co // BeginDelete - Deletes a managed instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01-preview +// Generated from API version 2022-08-01-preview // - resourceGroupName - 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. @@ -154,7 +154,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 2023-05-01-preview +// Generated from API version 2022-08-01-preview func (client *ManagedInstancesClient) deleteOperation(ctx context.Context, resourceGroupName string, managedInstanceName string, options *ManagedInstancesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ManagedInstancesClient.BeginDelete" @@ -196,7 +196,7 @@ func (client *ManagedInstancesClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2022-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -204,7 +204,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 2023-05-01-preview +// Generated from API version 2022-08-01-preview // - resourceGroupName - 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. @@ -230,7 +230,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 2023-05-01-preview +// Generated from API version 2022-08-01-preview func (client *ManagedInstancesClient) failover(ctx context.Context, resourceGroupName string, managedInstanceName string, options *ManagedInstancesClientBeginFailoverOptions) (*http.Response, error) { var err error const operationName = "ManagedInstancesClient.BeginFailover" @@ -272,7 +272,7 @@ func (client *ManagedInstancesClient) failoverCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2022-08-01-preview") if options != nil && options.ReplicaType != nil { reqQP.Set("replicaType", string(*options.ReplicaType)) } @@ -283,7 +283,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 2023-05-01-preview +// Generated from API version 2022-08-01-preview // - resourceGroupName - 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. @@ -333,7 +333,7 @@ func (client *ManagedInstancesClient) getCreateRequest(ctx context.Context, reso if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2022-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -350,7 +350,7 @@ func (client *ManagedInstancesClient) getHandleResponse(resp *http.Response) (Ma // NewListPager - Gets a list of all managed instances in the subscription. // -// Generated from API version 2023-05-01-preview +// Generated from API version 2022-08-01-preview // - options - ManagedInstancesClientListOptions contains the optional parameters for the ManagedInstancesClient.NewListPager // method. func (client *ManagedInstancesClient) NewListPager(options *ManagedInstancesClientListOptions) *runtime.Pager[ManagedInstancesClientListResponse] { @@ -391,7 +391,7 @@ func (client *ManagedInstancesClient) listCreateRequest(ctx context.Context, opt if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2022-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -408,7 +408,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 2023-05-01-preview +// Generated from API version 2022-08-01-preview // - resourceGroupName - 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. @@ -460,7 +460,7 @@ func (client *ManagedInstancesClient) listByInstancePoolCreateRequest(ctx contex if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2022-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -477,7 +477,7 @@ func (client *ManagedInstancesClient) listByInstancePoolHandleResponse(resp *htt // NewListByManagedInstancePager - Get top resource consuming queries of a managed instance. // -// Generated from API version 2023-05-01-preview +// Generated from API version 2022-08-01-preview // - resourceGroupName - 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. @@ -529,7 +529,7 @@ func (client *ManagedInstancesClient) listByManagedInstanceCreateRequest(ctx con if options != nil && options.AggregationFunction != nil { reqQP.Set("aggregationFunction", string(*options.AggregationFunction)) } - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2022-08-01-preview") if options != nil && options.Databases != nil { reqQP.Set("databases", *options.Databases) } @@ -564,7 +564,7 @@ func (client *ManagedInstancesClient) listByManagedInstanceHandleResponse(resp * // NewListByResourceGroupPager - Gets a list of managed instances in a resource group. // -// Generated from API version 2023-05-01-preview +// Generated from API version 2022-08-01-preview // - resourceGroupName - 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 @@ -611,7 +611,7 @@ func (client *ManagedInstancesClient) listByResourceGroupCreateRequest(ctx conte if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2022-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -629,7 +629,7 @@ func (client *ManagedInstancesClient) listByResourceGroupHandleResponse(resp *ht // NewListOutboundNetworkDependenciesByManagedInstancePager - Gets the collection of outbound network dependencies for the // given managed instance. // -// Generated from API version 2023-05-01-preview +// Generated from API version 2022-08-01-preview // - resourceGroupName - 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. @@ -678,7 +678,7 @@ func (client *ManagedInstancesClient) listOutboundNetworkDependenciesByManagedIn return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2022-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -693,88 +693,10 @@ 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, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ManagedInstancesClientRefreshStatusResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// 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 - const operationName = "ManagedInstancesClient.BeginRefreshStatus" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - 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 2023-05-01-preview +// Generated from API version 2022-08-01-preview // - resourceGroupName - 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. @@ -801,7 +723,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 2023-05-01-preview +// Generated from API version 2022-08-01-preview func (client *ManagedInstancesClient) start(ctx context.Context, resourceGroupName string, managedInstanceName string, options *ManagedInstancesClientBeginStartOptions) (*http.Response, error) { var err error const operationName = "ManagedInstancesClient.BeginStart" @@ -816,7 +738,7 @@ func (client *ManagedInstancesClient) start(ctx context.Context, resourceGroupNa if err != nil { return nil, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { err = runtime.NewResponseError(httpResp) return nil, err } @@ -843,16 +765,15 @@ func (client *ManagedInstancesClient) startCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2022-08-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 2023-05-01-preview +// Generated from API version 2022-08-01-preview // - resourceGroupName - 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. @@ -879,7 +800,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 2023-05-01-preview +// Generated from API version 2022-08-01-preview func (client *ManagedInstancesClient) stop(ctx context.Context, resourceGroupName string, managedInstanceName string, options *ManagedInstancesClientBeginStopOptions) (*http.Response, error) { var err error const operationName = "ManagedInstancesClient.BeginStop" @@ -894,7 +815,7 @@ func (client *ManagedInstancesClient) stop(ctx context.Context, resourceGroupNam if err != nil { return nil, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { err = runtime.NewResponseError(httpResp) return nil, err } @@ -921,16 +842,15 @@ func (client *ManagedInstancesClient) stopCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2022-08-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 2023-05-01-preview +// Generated from API version 2022-08-01-preview // - resourceGroupName - 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. @@ -957,7 +877,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 2023-05-01-preview +// Generated from API version 2022-08-01-preview func (client *ManagedInstancesClient) update(ctx context.Context, resourceGroupName string, managedInstanceName string, parameters ManagedInstanceUpdate, options *ManagedInstancesClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "ManagedInstancesClient.BeginUpdate" @@ -999,7 +919,7 @@ func (client *ManagedInstancesClient) updateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2022-08-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 fc00003c9e28..000000000000 --- a/sdk/resourcemanager/sql/armsql/managedinstances_client_example_test.go +++ /dev/null @@ -1,2135 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-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/00000000-1111-2222-3333-444444444444/resourceGroups/Test1/providers/Microsoft.Sql/managedInstances/testinstance1"), - // Location: to.Ptr("japaneast"), - // Properties: &armsql.ManagedInstanceProperties{ - // AdministratorLogin: to.Ptr("dummylogin"), - // AuthenticationMetadata: to.Ptr(armsql.AuthMetadataLookupModesWindows), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-01T01:01:01.011Z"); return t}()), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // DatabaseFormat: to.Ptr(armsql.ManagedInstanceDatabaseFormatSQLServer2022), - // DNSZone: to.Ptr("1b4e2caff2530"), - // ExternalGovernanceStatus: to.Ptr(armsql.ExternalGovernanceStatusEnabled), - // FullyQualifiedDomainName: to.Ptr("testinstance1.1b4e2caff2530.database.windows.net"), - // HybridSecondaryUsage: to.Ptr(armsql.HybridSecondaryUsagePassive), - // LicenseType: to.Ptr(armsql.ManagedInstanceLicenseTypeLicenseIncluded), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_1"), - // MinimalTLSVersion: to.Ptr("1.2"), - // PricingModel: to.Ptr(armsql.FreemiumTypeRegular), - // ProvisioningState: to.Ptr(armsql.ProvisioningStateSucceeded), - // 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/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // VCores: to.Ptr[int32](8), - // VirtualClusterID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/virtualClusters/vc-5555555-6666-7777-8888-999999999999"), - // }, - // 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/00000000-1111-2222-3333-444444444444/resourceGroups/Test1/providers/Microsoft.Sql/managedInstances/testinstance2"), - // Location: to.Ptr("japaneast"), - // Properties: &armsql.ManagedInstanceProperties{ - // AdministratorLogin: to.Ptr("dummylogin"), - // AuthenticationMetadata: to.Ptr(armsql.AuthMetadataLookupModesWindows), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-01T01:01:01.011Z"); return t}()), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // DatabaseFormat: to.Ptr(armsql.ManagedInstanceDatabaseFormatSQLServer2022), - // DNSZone: to.Ptr("2c3d1bdae3412"), - // ExternalGovernanceStatus: to.Ptr(armsql.ExternalGovernanceStatusEnabled), - // FullyQualifiedDomainName: to.Ptr("testinstance2.2c3d1bdae3412.database.windows.net"), - // HybridSecondaryUsage: to.Ptr(armsql.HybridSecondaryUsagePassive), - // LicenseType: to.Ptr(armsql.ManagedInstanceLicenseType("Full")), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_1"), - // MinimalTLSVersion: to.Ptr("1.2"), - // PricingModel: to.Ptr(armsql.FreemiumTypeRegular), - // ProvisioningState: to.Ptr(armsql.ProvisioningStateSucceeded), - // 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/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/subnet2"), - // VCores: to.Ptr[int32](16), - // VirtualClusterID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/virtualClusters/vc-5555555-6666-7777-8888-444444444444"), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("BC_Gen5"), - // Capacity: to.Ptr[int32](16), - // Family: to.Ptr("Gen5"), - // Tier: to.Ptr("BusinessCritical"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-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/00000000-1111-2222-3333-444444444444/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"), - // }, - // AuthenticationMetadata: to.Ptr(armsql.AuthMetadataLookupModesWindows), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-01T01:01:01.011Z"); return t}()), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // DatabaseFormat: to.Ptr(armsql.ManagedInstanceDatabaseFormatSQLServer2022), - // DNSZone: to.Ptr("1b4e2caff2530"), - // ExternalGovernanceStatus: to.Ptr(armsql.ExternalGovernanceStatusEnabled), - // FullyQualifiedDomainName: to.Ptr("testinstance1.1b4e2caff2530.database.windows.net"), - // HybridSecondaryUsage: to.Ptr(armsql.HybridSecondaryUsagePassive), - // LicenseType: to.Ptr(armsql.ManagedInstanceLicenseTypeLicenseIncluded), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_1"), - // MinimalTLSVersion: to.Ptr("1.2"), - // PricingModel: to.Ptr(armsql.FreemiumTypeRegular), - // ProvisioningState: to.Ptr(armsql.ProvisioningStateSucceeded), - // 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/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // VCores: to.Ptr[int32](8), - // VirtualClusterID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/virtualClusters/vc-5555555-6666-7777-8888-999999999999"), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("GP_Gen5"), - // 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/00000000-1111-2222-3333-444444444444/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"), - // }, - // AuthenticationMetadata: to.Ptr(armsql.AuthMetadataLookupModesWindows), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-01T01:01:01.011Z"); return t}()), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // DatabaseFormat: to.Ptr(armsql.ManagedInstanceDatabaseFormatSQLServer2022), - // DNSZone: to.Ptr("2c3d1bdae3412"), - // ExternalGovernanceStatus: to.Ptr(armsql.ExternalGovernanceStatusEnabled), - // FullyQualifiedDomainName: to.Ptr("testinstance2.2c3d1bdae3412.database.windows.net"), - // HybridSecondaryUsage: to.Ptr(armsql.HybridSecondaryUsagePassive), - // LicenseType: to.Ptr(armsql.ManagedInstanceLicenseType("Full")), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_2"), - // MinimalTLSVersion: to.Ptr("1.2"), - // PricingModel: to.Ptr(armsql.FreemiumTypeRegular), - // ProvisioningState: to.Ptr(armsql.ProvisioningStateSucceeded), - // 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/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/subnet2"), - // VCores: to.Ptr[int32](16), - // VirtualClusterID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/virtualClusters/vc-5555555-6666-7777-8888-444444444444"), - // }, - // 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-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/00000000-1111-2222-3333-444444444444/resourceGroups/Test1/providers/Microsoft.Sql/managedInstances/testinstance1"), - // Location: to.Ptr("canadacentral"), - // Properties: &armsql.ManagedInstanceProperties{ - // AdministratorLogin: to.Ptr("dummylogin"), - // AuthenticationMetadata: to.Ptr(armsql.AuthMetadataLookupModesWindows), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-01T01:01:01.011Z"); return t}()), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // DatabaseFormat: to.Ptr(armsql.ManagedInstanceDatabaseFormatSQLServer2022), - // DNSZone: to.Ptr("1b4e2caff2530"), - // ExternalGovernanceStatus: to.Ptr(armsql.ExternalGovernanceStatusEnabled), - // FullyQualifiedDomainName: to.Ptr("testinstance1.1b4e2caff2530.database.windows.net"), - // HybridSecondaryUsage: to.Ptr(armsql.HybridSecondaryUsagePassive), - // InstancePoolID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Test1/providers/Microsoft.Sql/instancePools/pool1"), - // LicenseType: to.Ptr(armsql.ManagedInstanceLicenseTypeLicenseIncluded), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_CanadaCentral_MI_1"), - // MinimalTLSVersion: to.Ptr("1.2"), - // PricingModel: to.Ptr(armsql.FreemiumTypeRegular), - // ProvisioningState: to.Ptr(armsql.ProvisioningStateSucceeded), - // 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/00000000-1111-2222-3333-444444444444/resourceGroups/Test1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // VCores: to.Ptr[int32](8), - // VirtualClusterID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/virtualClusters/vc-5555555-6666-7777-8888-999999999999"), - // }, - // 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/00000000-1111-2222-3333-444444444444/resourceGroups/Test1/providers/Microsoft.Sql/managedInstances/testinstance2"), - // Location: to.Ptr("canadacentral"), - // Properties: &armsql.ManagedInstanceProperties{ - // AdministratorLogin: to.Ptr("dummylogin"), - // AuthenticationMetadata: to.Ptr(armsql.AuthMetadataLookupModesWindows), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-01T01:01:01.011Z"); return t}()), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // DatabaseFormat: to.Ptr(armsql.ManagedInstanceDatabaseFormatSQLServer2022), - // DNSZone: to.Ptr("2c3d1bdae3412"), - // ExternalGovernanceStatus: to.Ptr(armsql.ExternalGovernanceStatusEnabled), - // FullyQualifiedDomainName: to.Ptr("testinstance2.2c3d1bdae3412.database.windows.net"), - // HybridSecondaryUsage: to.Ptr(armsql.HybridSecondaryUsagePassive), - // InstancePoolID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Test1/providers/Microsoft.Sql/instancePools/pool1"), - // LicenseType: to.Ptr(armsql.ManagedInstanceLicenseType("Full")), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_CanadaCentral_MI_1"), - // MinimalTLSVersion: to.Ptr("1.2"), - // PricingModel: to.Ptr(armsql.FreemiumTypeRegular), - // ProvisioningState: to.Ptr(armsql.ProvisioningStateSucceeded), - // 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/00000000-1111-2222-3333-444444444444/resourceGroups/Test1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // VCores: to.Ptr[int32](16), - // VirtualClusterID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/virtualClusters/vc-5555555-6666-7777-8888-999999999999"), - // }, - // 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-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/00000000-1111-2222-3333-444444444444/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"), - // }, - // AuthenticationMetadata: to.Ptr(armsql.AuthMetadataLookupModesWindows), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-01T01:01:01.011Z"); return t}()), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // DatabaseFormat: to.Ptr(armsql.ManagedInstanceDatabaseFormatSQLServer2022), - // DNSZone: to.Ptr("1b4e2caff2530"), - // ExternalGovernanceStatus: to.Ptr(armsql.ExternalGovernanceStatusEnabled), - // FullyQualifiedDomainName: to.Ptr("testinstance1.1b4e2caff2530.database.windows.net"), - // HybridSecondaryUsage: to.Ptr(armsql.HybridSecondaryUsagePassive), - // InstancePoolID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Test1/providers/Microsoft.Sql/instancePools/pool1"), - // LicenseType: to.Ptr(armsql.ManagedInstanceLicenseTypeLicenseIncluded), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_CanadaCentral_MI_1"), - // MinimalTLSVersion: to.Ptr("1.2"), - // PricingModel: to.Ptr(armsql.FreemiumTypeRegular), - // ProvisioningState: to.Ptr(armsql.ProvisioningStateSucceeded), - // 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/00000000-1111-2222-3333-444444444444/resourceGroups/Test1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // VCores: to.Ptr[int32](8), - // VirtualClusterID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/virtualClusters/vc-5555555-6666-7777-8888-999999999999"), - // }, - // 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/00000000-1111-2222-3333-444444444444/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"), - // }, - // AuthenticationMetadata: to.Ptr(armsql.AuthMetadataLookupModesWindows), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-01T01:01:01.011Z"); return t}()), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // DatabaseFormat: to.Ptr(armsql.ManagedInstanceDatabaseFormatSQLServer2022), - // DNSZone: to.Ptr("2c3d1bdae3412"), - // ExternalGovernanceStatus: to.Ptr(armsql.ExternalGovernanceStatusEnabled), - // FullyQualifiedDomainName: to.Ptr("testinstance2.2c3d1bdae3412.database.windows.net"), - // HybridSecondaryUsage: to.Ptr(armsql.HybridSecondaryUsagePassive), - // InstancePoolID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Test1/providers/Microsoft.Sql/instancePools/pool1"), - // LicenseType: to.Ptr(armsql.ManagedInstanceLicenseType("Full")), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_CanadaCentral_MI_2"), - // MinimalTLSVersion: to.Ptr("1.2"), - // PricingModel: to.Ptr(armsql.FreemiumTypeRegular), - // ProvisioningState: to.Ptr(armsql.ProvisioningStateSucceeded), - // 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/00000000-1111-2222-3333-444444444444/resourceGroups/Test1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // VCores: to.Ptr[int32](16), - // VirtualClusterID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/virtualClusters/vc-5555555-6666-7777-8888-999999999999"), - // }, - // 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-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/00000000-1111-2222-3333-444444444444/resourceGroups/Test1/providers/Microsoft.Sql/managedInstances/testinstance1"), - // Location: to.Ptr("japaneast"), - // Properties: &armsql.ManagedInstanceProperties{ - // AdministratorLogin: to.Ptr("dummylogin"), - // AuthenticationMetadata: to.Ptr(armsql.AuthMetadataLookupModesWindows), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-01T01:01:01.011Z"); return t}()), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // DatabaseFormat: to.Ptr(armsql.ManagedInstanceDatabaseFormatSQLServer2022), - // DNSZone: to.Ptr("1b4e2caff2530"), - // ExternalGovernanceStatus: to.Ptr(armsql.ExternalGovernanceStatusEnabled), - // FullyQualifiedDomainName: to.Ptr("testinstance1.1b4e2caff2530.database.windows.net"), - // HybridSecondaryUsage: to.Ptr(armsql.HybridSecondaryUsagePassive), - // LicenseType: to.Ptr(armsql.ManagedInstanceLicenseTypeLicenseIncluded), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_1"), - // MinimalTLSVersion: to.Ptr("1.2"), - // PricingModel: to.Ptr(armsql.FreemiumTypeRegular), - // ProvisioningState: to.Ptr(armsql.ProvisioningStateSucceeded), - // 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/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // VCores: to.Ptr[int32](8), - // VirtualClusterID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/virtualClusters/vc-5555555-6666-7777-8888-999999999999"), - // }, - // 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/00000000-1111-2222-3333-444444444444/resourceGroups/Test1/providers/Microsoft.Sql/managedInstances/testinstance2"), - // Location: to.Ptr("japaneast"), - // Properties: &armsql.ManagedInstanceProperties{ - // AdministratorLogin: to.Ptr("dummylogin"), - // AuthenticationMetadata: to.Ptr(armsql.AuthMetadataLookupModesWindows), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-01T01:01:01.011Z"); return t}()), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // DatabaseFormat: to.Ptr(armsql.ManagedInstanceDatabaseFormatSQLServer2022), - // DNSZone: to.Ptr("2c3d1bdae3412"), - // ExternalGovernanceStatus: to.Ptr(armsql.ExternalGovernanceStatusEnabled), - // FullyQualifiedDomainName: to.Ptr("testinstance2.2c3d1bdae3412.database.windows.net"), - // HybridSecondaryUsage: to.Ptr(armsql.HybridSecondaryUsagePassive), - // LicenseType: to.Ptr(armsql.ManagedInstanceLicenseType("Full")), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_1"), - // MinimalTLSVersion: to.Ptr("1.2"), - // PricingModel: to.Ptr(armsql.FreemiumTypeRegular), - // ProvisioningState: to.Ptr(armsql.ProvisioningStateSucceeded), - // 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/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/subnet2"), - // VCores: to.Ptr[int32](16), - // VirtualClusterID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/virtualClusters/vc-5555555-6666-7777-8888-444444444444"), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("BC_Gen5"), - // Capacity: to.Ptr[int32](16), - // Family: to.Ptr("Gen5"), - // Tier: to.Ptr("BusinessCritical"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-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/00000000-1111-2222-3333-444444444444/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"), - // }, - // AuthenticationMetadata: to.Ptr(armsql.AuthMetadataLookupModesWindows), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-01T01:01:01.011Z"); return t}()), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // DatabaseFormat: to.Ptr(armsql.ManagedInstanceDatabaseFormatSQLServer2022), - // DNSZone: to.Ptr("1b4e2caff2530"), - // ExternalGovernanceStatus: to.Ptr(armsql.ExternalGovernanceStatusEnabled), - // FullyQualifiedDomainName: to.Ptr("testinstance1.1b4e2caff2530.database.windows.net"), - // HybridSecondaryUsage: to.Ptr(armsql.HybridSecondaryUsagePassive), - // LicenseType: to.Ptr(armsql.ManagedInstanceLicenseTypeLicenseIncluded), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_1"), - // MinimalTLSVersion: to.Ptr("1.2"), - // PricingModel: to.Ptr(armsql.FreemiumTypeRegular), - // ProvisioningState: to.Ptr(armsql.ProvisioningStateSucceeded), - // 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/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // VCores: to.Ptr[int32](8), - // VirtualClusterID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/virtualClusters/vc-5555555-6666-7777-8888-999999999999"), - // }, - // SKU: &armsql.SKU{ - // Name: to.Ptr("GP_Gen5"), - // 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/00000000-1111-2222-3333-444444444444/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"), - // }, - // AuthenticationMetadata: to.Ptr(armsql.AuthMetadataLookupModesWindows), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-01T01:01:01.011Z"); return t}()), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // DatabaseFormat: to.Ptr(armsql.ManagedInstanceDatabaseFormatSQLServer2022), - // DNSZone: to.Ptr("2c3d1bdae3412"), - // ExternalGovernanceStatus: to.Ptr(armsql.ExternalGovernanceStatusEnabled), - // FullyQualifiedDomainName: to.Ptr("testinstance2.2c3d1bdae3412.database.windows.net"), - // HybridSecondaryUsage: to.Ptr(armsql.HybridSecondaryUsagePassive), - // LicenseType: to.Ptr(armsql.ManagedInstanceLicenseType("Full")), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_2"), - // MinimalTLSVersion: to.Ptr("1.2"), - // PricingModel: to.Ptr(armsql.FreemiumTypeRegular), - // ProvisioningState: to.Ptr(armsql.ProvisioningStateSucceeded), - // 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/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/subnet2"), - // VCores: to.Ptr[int32](16), - // VirtualClusterID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/virtualClusters/vc-5555555-6666-7777-8888-444444444444"), - // }, - // 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-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/00000000-1111-2222-3333-444444444444/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"), - // AuthenticationMetadata: to.Ptr(armsql.AuthMetadataLookupModesWindows), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-01T01:01:01.011Z"); return t}()), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // DatabaseFormat: to.Ptr(armsql.ManagedInstanceDatabaseFormatSQLServer2022), - // DNSZone: to.Ptr("1b4e2caff2530"), - // ExternalGovernanceStatus: to.Ptr(armsql.ExternalGovernanceStatusEnabled), - // FullyQualifiedDomainName: to.Ptr("testinstance.1b4e2caff2530.database.windows.net"), - // HybridSecondaryUsage: to.Ptr(armsql.HybridSecondaryUsagePassive), - // InstancePoolID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/instancePools/instancePool1"), - // LicenseType: to.Ptr(armsql.ManagedInstanceLicenseTypeLicenseIncluded), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_1"), - // MinimalTLSVersion: to.Ptr("1.2"), - // PricingModel: to.Ptr(armsql.FreemiumTypeRegular), - // ProvisioningState: to.Ptr(armsql.ProvisioningStateSucceeded), - // 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/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // VCores: to.Ptr[int32](8), - // VirtualClusterID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/virtualClusters/vc-5555555-6666-7777-8888-999999999999"), - // }, - // 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ManagedInstanceGetWhileUpdating.json -func ExampleManagedInstancesClient_Get_getManagedInstanceWhileResourceIsUpdating() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain 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/00000000-1111-2222-3333-444444444444/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"), - // AuthenticationMetadata: to.Ptr(armsql.AuthMetadataLookupModesWindows), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-01T01:01:01.011Z"); return t}()), - // DatabaseFormat: to.Ptr(armsql.ManagedInstanceDatabaseFormatSQLServer2022), - // DNSZone: to.Ptr("1b4e2caff2530"), - // ExternalGovernanceStatus: to.Ptr(armsql.ExternalGovernanceStatusEnabled), - // FullyQualifiedDomainName: to.Ptr("testinstance.1b4e2caff2530.database.windows.net"), - // InstancePoolID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/instancePools/instancePool1"), - // LicenseType: to.Ptr(armsql.ManagedInstanceLicenseTypeLicenseIncluded), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_1"), - // MinimalTLSVersion: to.Ptr("1.2"), - // PricingModel: to.Ptr(armsql.FreemiumTypeRegular), - // ProvisioningState: to.Ptr(armsql.ProvisioningStateSucceeded), - // ProxyOverride: to.Ptr(armsql.ManagedInstanceProxyOverrideDefault), - // PublicDataEndpointEnabled: to.Ptr(false), - // State: to.Ptr("Ready"), - // StorageSizeInGB: to.Ptr[int32](1024), - // SubnetID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // VCores: to.Ptr[int32](8), - // VirtualClusterID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/virtualClusters/vc-5555555-6666-7777-8888-999999999999"), - // }, - // 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-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/00000000-1111-2222-3333-444444444444/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"), - // }, - // AuthenticationMetadata: to.Ptr(armsql.AuthMetadataLookupModesWindows), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-01T01:01:01.011Z"); return t}()), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // DatabaseFormat: to.Ptr(armsql.ManagedInstanceDatabaseFormatSQLServer2022), - // DNSZone: to.Ptr("1b4e2caff2530"), - // ExternalGovernanceStatus: to.Ptr(armsql.ExternalGovernanceStatusEnabled), - // FullyQualifiedDomainName: to.Ptr("testinstance.1b4e2caff2530.database.windows.net"), - // HybridSecondaryUsage: to.Ptr(armsql.HybridSecondaryUsagePassive), - // InstancePoolID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/instancePools/instancePool1"), - // LicenseType: to.Ptr(armsql.ManagedInstanceLicenseTypeLicenseIncluded), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_1"), - // MinimalTLSVersion: to.Ptr("1.2"), - // PricingModel: to.Ptr(armsql.FreemiumTypeRegular), - // ProvisioningState: to.Ptr(armsql.ProvisioningStateSucceeded), - // 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/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // VCores: to.Ptr[int32](8), - // VirtualClusterID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/virtualClusters/vc-5555555-6666-7777-8888-999999999999"), - // }, - // 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-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"), - DatabaseFormat: to.Ptr(armsql.ManagedInstanceDatabaseFormatAlwaysUpToDate), - DNSZonePartner: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testinstance"), - HybridSecondaryUsage: to.Ptr(armsql.HybridSecondaryUsagePassive), - 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), - // DatabaseFormat: to.Ptr(armsql.ManagedInstanceDatabaseFormatAlwaysUpToDate), - // DNSZone: to.Ptr("1b4e2caff2530"), - // ExternalGovernanceStatus: to.Ptr(armsql.ExternalGovernanceStatusEnabled), - // FullyQualifiedDomainName: to.Ptr("testinstance.1b4e2caff2530.database.windows.net"), - // HybridSecondaryUsage: to.Ptr(armsql.HybridSecondaryUsagePassive), - // 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.ProvisioningStateSucceeded), - // 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-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_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{ - // }, - // Properties: &armsql.ManagedInstanceProperties{ - // AdministratorLogin: to.Ptr("dummylogin"), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // DatabaseFormat: to.Ptr(armsql.ManagedInstanceDatabaseFormatSQLServer2022), - // DNSZone: to.Ptr("1b4e2caff2530"), - // ExternalGovernanceStatus: to.Ptr(armsql.ExternalGovernanceStatusEnabled), - // FullyQualifiedDomainName: to.Ptr("testinstance.1b4e2caff2530.database.windows.net"), - // HybridSecondaryUsage: to.Ptr(armsql.HybridSecondaryUsagePassive), - // LicenseType: to.Ptr(armsql.ManagedInstanceLicenseTypeLicenseIncluded), - // ProvisioningState: to.Ptr(armsql.ProvisioningStateSucceeded), - // 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_Gen5"), - // 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-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/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.ManagedInstance = armsql.ManagedInstance{ - // Name: to.Ptr("testinstance"), - // Type: to.Ptr("Microsoft.Sql/managedInstances"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testinstance"), - // Location: to.Ptr("japaneast"), - // Properties: &armsql.ManagedInstanceProperties{ - // AdministratorLogin: to.Ptr("dummylogin"), - // AuthenticationMetadata: to.Ptr(armsql.AuthMetadataLookupModesWindows), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // DatabaseFormat: to.Ptr(armsql.ManagedInstanceDatabaseFormatSQLServer2022), - // DNSZone: to.Ptr("1b4e2caff2530"), - // ExternalGovernanceStatus: to.Ptr(armsql.ExternalGovernanceStatusEnabled), - // FullyQualifiedDomainName: to.Ptr("testinstance.1b4e2caff2530.database.windows.net"), - // HybridSecondaryUsage: to.Ptr(armsql.HybridSecondaryUsagePassive), - // InstancePoolID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/instancePools/instancePool1"), - // LicenseType: to.Ptr(armsql.ManagedInstanceLicenseTypeLicenseIncluded), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/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/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/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("Gen4"), - // Tier: to.Ptr("GeneralPurpose"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-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"), - AuthenticationMetadata: to.Ptr(armsql.AuthMetadataLookupModesWindows), - Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - DatabaseFormat: to.Ptr(armsql.ManagedInstanceDatabaseFormatAlwaysUpToDate), - HybridSecondaryUsage: to.Ptr(armsql.HybridSecondaryUsagePassive), - LicenseType: to.Ptr(armsql.ManagedInstanceLicenseTypeBasePrice), - MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/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_Gen5"), - 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/00000000-1111-2222-3333-444444444444/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"), - // AuthenticationMetadata: to.Ptr(armsql.AuthMetadataLookupModesWindows), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // DatabaseFormat: to.Ptr(armsql.ManagedInstanceDatabaseFormatAlwaysUpToDate), - // DNSZone: to.Ptr("1b4e2caff2530"), - // ExternalGovernanceStatus: to.Ptr(armsql.ExternalGovernanceStatusEnabled), - // FullyQualifiedDomainName: to.Ptr("testinstance.1b4e2caff2530.database.windows.net"), - // HybridSecondaryUsage: to.Ptr(armsql.HybridSecondaryUsagePassive), - // InstancePoolID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/instancePools/instancePool1"), - // LicenseType: to.Ptr(armsql.ManagedInstanceLicenseTypeBasePrice), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/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/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/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("Gen4"), - // Tier: to.Ptr("GeneralPurpose"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-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/00000000-1111-2222-3333-444444444444/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"), - // AuthenticationMetadata: to.Ptr(armsql.AuthMetadataLookupModesWindows), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // DatabaseFormat: to.Ptr(armsql.ManagedInstanceDatabaseFormatSQLServer2022), - // DNSZone: to.Ptr("1b4e2caff2530"), - // ExternalGovernanceStatus: to.Ptr(armsql.ExternalGovernanceStatusEnabled), - // FullyQualifiedDomainName: to.Ptr("testinstance.1b4e2caff2530.database.windows.net"), - // HybridSecondaryUsage: to.Ptr(armsql.HybridSecondaryUsagePassive), - // InstancePoolID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/instancePools/instancePool1"), - // LicenseType: to.Ptr(armsql.ManagedInstanceLicenseTypeLicenseIncluded), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/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/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/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("Gen4"), - // Tier: to.Ptr("GeneralPurpose"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ManagedInstanceRefreshExternalGovernanceStatus.json -func ExampleManagedInstancesClient_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.NewManagedInstancesClient().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.RefreshExternalGovernanceStatusOperationResultMI = armsql.RefreshExternalGovernanceStatusOperationResultMI{ - // Name: to.Ptr("9d9a794a-5cec-4f23-af70-d29511b522a4"), - // Type: to.Ptr("Microsoft.Sql/locations/refreshExternalGovernanceStatusMIOperationResults"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroup/providers/Microsoft.Sql/locations/japaneast/refreshExternalGovernanceStatusMIOperationResults/9d9a794a-5cec-4f23-af70-d29511b522a4"), - // Properties: &armsql.RefreshExternalGovernanceStatusOperationResultPropertiesMI{ - // ManagedInstanceName: to.Ptr("testsvr.database.windows.net"), - // QueuedTime: to.Ptr("2/12/2022 8:33:27 PM"), - // RequestID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // RequestType: to.Ptr("UpdatePurviewMetadata"), - // Status: to.Ptr("Completed"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-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) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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("mitostart"), - // Type: to.Ptr("Microsoft.Sql/managedInstances"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/startrg/providers/Microsoft.Sql/managedInstances/mitostart"), - // Location: to.Ptr("japaneast"), - // Tags: map[string]*string{ - // "key": to.Ptr("value"), - // }, - // Properties: &armsql.ManagedInstanceProperties{ - // AdministratorLogin: to.Ptr("dummylogin"), - // AuthenticationMetadata: to.Ptr(armsql.AuthMetadataLookupModesWindows), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // DatabaseFormat: to.Ptr(armsql.ManagedInstanceDatabaseFormatSQLServer2022), - // DNSZone: to.Ptr("1234567891234"), - // ExternalGovernanceStatus: to.Ptr(armsql.ExternalGovernanceStatusEnabled), - // FullyQualifiedDomainName: to.Ptr("mitostart.1234567891234.database.windows.net"), - // HybridSecondaryUsage: to.Ptr(armsql.HybridSecondaryUsagePassive), - // InstancePoolID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/startrg/providers/Microsoft.Sql/instancePools/instancePool1"), - // LicenseType: to.Ptr(armsql.ManagedInstanceLicenseTypeLicenseIncluded), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_1"), - // MinimalTLSVersion: to.Ptr("1.2"), - // ProvisioningState: to.Ptr(armsql.ProvisioningStateSucceeded), - // 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/00000000-1111-2222-3333-444444444444/resourceGroups/startrg/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"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-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) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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("mitostop"), - // Type: to.Ptr("Microsoft.Sql/managedInstances"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/stoprg/providers/Microsoft.Sql/managedInstances/mitostop"), - // Location: to.Ptr("japaneast"), - // Tags: map[string]*string{ - // "key": to.Ptr("value"), - // }, - // Properties: &armsql.ManagedInstanceProperties{ - // AdministratorLogin: to.Ptr("dummylogin"), - // AuthenticationMetadata: to.Ptr(armsql.AuthMetadataLookupModesWindows), - // Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - // CurrentBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - // DatabaseFormat: to.Ptr(armsql.ManagedInstanceDatabaseFormatSQLServer2022), - // DNSZone: to.Ptr("1234567891234"), - // ExternalGovernanceStatus: to.Ptr(armsql.ExternalGovernanceStatusEnabled), - // FullyQualifiedDomainName: to.Ptr("mitostop.1234567891234.database.windows.net"), - // HybridSecondaryUsage: to.Ptr(armsql.HybridSecondaryUsagePassive), - // InstancePoolID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/stoprg/providers/Microsoft.Sql/instancePools/instancePool1"), - // LicenseType: to.Ptr(armsql.ManagedInstanceLicenseTypeLicenseIncluded), - // MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_1"), - // MinimalTLSVersion: to.Ptr("1.2"), - // ProvisioningState: to.Ptr(armsql.ProvisioningStateSucceeded), - // 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("Stopped"), - // StorageSizeInGB: to.Ptr[int32](1024), - // SubnetID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/stoprg/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"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-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.QueryStatisticsPropertiesAutoGenerated{ - // { - // DatabaseName: to.Ptr("db1"), - // Intervals: []*armsql.QueryMetricIntervalAutoGenerated{ - // { - // 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.QueryMetricIntervalAutoGenerated{ - // { - // 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.QueryMetricIntervalAutoGenerated{ - // { - // 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.QueryMetricIntervalAutoGenerated{ - // { - // 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.QueryMetricIntervalAutoGenerated{ - // { - // 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-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.QueryStatisticsPropertiesAutoGenerated{ - // { - // DatabaseName: to.Ptr("db1"), - // Intervals: []*armsql.QueryMetricIntervalAutoGenerated{ - // { - // 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.QueryMetricIntervalAutoGenerated{ - // { - // 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.QueryMetricIntervalAutoGenerated{ - // { - // 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.QueryMetricIntervalAutoGenerated{ - // { - // 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.QueryMetricIntervalAutoGenerated{ - // { - // 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-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.QueryStatisticsPropertiesAutoGenerated{ - // }, - // StartTime: to.Ptr("03/10/2020 12:00:00"), - // }}, - // } - } -} 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 50ba01885195..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/managedinstancevulnerabilityassessments_client_example_test.go deleted file mode 100644 index d60140884dad..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/managedledgerdigestuploads_client_example_test.go deleted file mode 100644 index 094676df4fff..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/managedrestorabledroppeddatabasebackupshorttermretentionpolicies_client_example_test.go deleted file mode 100644 index 4b412101ff7f..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/managedserverdnsaliases_client_example_test.go deleted file mode 100644 index c6a55908ec12..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/managedserversecurityalertpolicies_client_example_test.go deleted file mode 100644 index 887ea60d7b27..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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 367b995b1331..3ab5d6d84c1a 100644 --- a/sdk/resourcemanager/sql/armsql/models.go +++ b/sdk/resourcemanager/sql/armsql/models.go @@ -276,15 +276,6 @@ type BenchmarkReference struct { Reference *string } -// CertificateInfo - Certificate information -type CertificateInfo struct { - // READ-ONLY; The certificate name - CertificateName *string - - // READ-ONLY; The certificate expiry date - ExpiryDate *time.Time -} - // ChangeLongTermRetentionBackupAccessTierParameters - Contains the information necessary to change long term retention backup // access tier and related operation mode. type ChangeLongTermRetentionBackupAccessTierParameters struct { @@ -1659,122 +1650,37 @@ type DistributedAvailabilityGroup struct { Type *string } -// DistributedAvailabilityGroupDatabase - Database specific information -type DistributedAvailabilityGroupDatabase struct { - // The name of the database in link - DatabaseName *string - - // READ-ONLY; Link connected state - ConnectedState *ReplicaConnectedState - - // 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; Seeding progress - SeedingProgress *string - - // READ-ONLY; Link health state - SynchronizationHealth *ReplicaSynchronizationHealth -} - // DistributedAvailabilityGroupProperties - The properties of a distributed availability group. type DistributedAvailabilityGroupProperties struct { - // Databases in the distributed availability group - Databases []*DistributedAvailabilityGroupDatabase + // The primary availability group name + PrimaryAvailabilityGroupName *string - // The link failover mode - can be Manual if intended to be used for two-way failover with a supported SQL Server, or None - // for one-way failover to Azure. - FailoverMode *FailoverModeType + // The replication mode of a distributed availability group. Parameter will be ignored during link creation. + ReplicationMode *ReplicationMode - // Managed instance side availability group name - InstanceAvailabilityGroupName *string + // The secondary availability group name + SecondaryAvailabilityGroupName *string - // Managed instance side link role - InstanceLinkRole *LinkRole + // The source endpoint + SourceEndpoint *string - // SQL server side availability group name - PartnerAvailabilityGroupName *string + // The name of the target database + TargetDatabase *string - // SQL server side endpoint - IP or DNS resolvable name - PartnerEndpoint *string - - // Replication mode of the link - ReplicationMode *ReplicationModeType - - // Database seeding mode – can be Automatic (default), or Manual for supported scenarios. - SeedingMode *SeedingModeType - - // READ-ONLY; ID of the distributed availability group + // READ-ONLY; The distributed availability group id DistributedAvailabilityGroupID *string - // READ-ONLY; Name of the distributed availability group - DistributedAvailabilityGroupName *string - - // READ-ONLY; SQL server side link role - PartnerLinkRole *LinkRole -} + // READ-ONLY; The last hardened lsn + LastHardenedLsn *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 link state + LinkState *string - // REQUIRED; The type of the role change, can be Planned or Forced. - RoleChangeType *RoleChangeType -} + // READ-ONLY; The source replica id + SourceReplicaID *string -// DistributedAvailabilityGroupsFailoverRequest - Distributed availability group failover. -type DistributedAvailabilityGroupsFailoverRequest struct { - // REQUIRED; The failover type, can be ForcedAllowDataLoss or Planned. - FailoverType *FailoverType + // READ-ONLY; The target replica id + TargetReplicaID *string } // DistributedAvailabilityGroupsListResult - A list of distributed availability groups in instance. @@ -2677,6 +2583,9 @@ type FailoverGroupProperties struct { // Read-only endpoint of the failover group instance. ReadOnlyEndpoint *FailoverGroupReadOnlyEndpoint + // Databases secondary type on partner server. + SecondaryType *FailoverGroupDatabasesSecondaryType + // READ-ONLY; Local replication role of the failover group instance. ReplicationRole *FailoverGroupReplicationRole @@ -2726,6 +2635,9 @@ type FailoverGroupUpdateProperties struct { // Read-write endpoint of the failover group instance. ReadWriteEndpoint *FailoverGroupReadWriteEndpoint + + // Databases secondary type on partner server. + SecondaryType *FailoverGroupDatabasesSecondaryType } // FirewallRule - A server firewall rule. @@ -4982,28 +4894,15 @@ type ManagedInstanceProperties struct { // individual APIs will need to be used. Administrators *ManagedInstanceExternalAdministrator - // The managed instance's authentication metadata lookup mode. - AuthenticationMetadata *AuthMetadataLookupModes - // Collation of the managed instance. Collation *string // The resource id of another managed instance whose DNS zone this managed instance will share after creation. DNSZonePartner *string - // Specifies the internal format of instance databases specific to the SQL engine version. - DatabaseFormat *ManagedInstanceDatabaseFormat - - // 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 @@ -5023,9 +4922,6 @@ 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 @@ -5049,17 +4945,10 @@ type ManagedInstanceProperties struct { // The resource identifier of the source managed instance associated with create operation of this instance. SourceManagedInstanceID *string - // Storage IOps. Minimum value: 300. Maximum value: 80000. 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 MBps parameter is not supported in the instance create/update operation. - StorageThroughputMBps *int32 - // Subnet resource ID for the managed instance. SubnetID *string @@ -5077,9 +4966,6 @@ 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) @@ -5088,28 +4974,17 @@ 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; Provisioning state of managed instance. - ProvisioningState *ProvisioningState + // READ-ONLY + ProvisioningState *ManagedInstancePropertiesProvisioningState // 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. @@ -5826,21 +5701,6 @@ type QueryMetricInterval struct { IntervalType *QueryTimeGrainType } -// QueryMetricIntervalAutoGenerated - Properties of a query metrics interval. -type QueryMetricIntervalAutoGenerated struct { - // List of metric objects for this interval - Metrics []*QueryMetricProperties - - // READ-ONLY; Execution count of a query in this interval. - ExecutionCount *int64 - - // READ-ONLY; The start time for the metric interval (ISO-8601 format). - IntervalStartTime *string - - // READ-ONLY; Interval type (length). - IntervalType *QueryTimeGrainType -} - // QueryMetricProperties - Properties of a topquery metric in one interval. type QueryMetricProperties struct { // READ-ONLY; Metric value when avg() aggregate function is used over the interval. @@ -5909,24 +5769,6 @@ type QueryStatisticsProperties struct { StartTime *string } -// QueryStatisticsPropertiesAutoGenerated - Properties of a query execution statistics. -type QueryStatisticsPropertiesAutoGenerated struct { - // List of intervals with appropriate metric data - Intervals []*QueryMetricIntervalAutoGenerated - - // READ-ONLY; Database name of the database in which this query was executed. - DatabaseName *string - - // READ-ONLY; The end time for the metric (ISO-8601 format). - EndTime *string - - // READ-ONLY; Unique query id (unique within one database). - QueryID *string - - // READ-ONLY; The start time for the metric (ISO-8601 format). - StartTime *string -} - // ReadScaleCapability - The read scale capability. type ReadScaleCapability struct { // The reason for the capability not being available. @@ -6239,21 +6081,6 @@ 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 { @@ -6276,28 +6103,6 @@ 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. @@ -6339,15 +6144,18 @@ type ReplicationLinkListResult struct { // ReplicationLinkProperties - Properties of a replication link. type ReplicationLinkProperties struct { + // Link type (GEO, NAMED, STANDBY). Update operation does not support NAMED. + LinkType *ReplicationLinkType + // READ-ONLY; Whether the user is currently allowed to terminate the link. IsTerminationAllowed *bool - // READ-ONLY; Link type (GEO, NAMED, STANDBY). - LinkType *ReplicationLinkType - // READ-ONLY; Resource partner database. PartnerDatabase *string + // READ-ONLY; Resource partner database Id. + PartnerDatabaseID *string + // READ-ONLY; Resource partner location. PartnerLocation *string @@ -6373,6 +6181,27 @@ type ReplicationLinkProperties struct { StartTime *time.Time } +// ReplicationLinkUpdate - A replication link update request. +type ReplicationLinkUpdate struct { + // Resource properties. + Properties *ReplicationLinkUpdateProperties + + // READ-ONLY; Resource ID. + ID *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// ReplicationLinkUpdateProperties - Properties of a replication link update. +type ReplicationLinkUpdateProperties struct { + // Link type (GEO, NAMED, STANDBY). Update operation does not support NAMED. + LinkType *ReplicationLinkType +} + // Resource - ARM resource. type Resource struct { // READ-ONLY; Resource ID. @@ -8347,7 +8176,7 @@ type TimeZoneProperties struct { type TopQueries struct { // List of top resource consuming queries with appropriate metric data - Queries []*QueryStatisticsPropertiesAutoGenerated + Queries []*QueryStatisticsProperties // READ-ONLY; Aggregation function used to calculate query metrics. AggregationFunction *string diff --git a/sdk/resourcemanager/sql/armsql/models_serde.go b/sdk/resourcemanager/sql/armsql/models_serde.go index 8cc8f72e5d42..da9db62253ba 100644 --- a/sdk/resourcemanager/sql/armsql/models_serde.go +++ b/sdk/resourcemanager/sql/armsql/models_serde.go @@ -739,37 +739,6 @@ 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, "certificateName", c.CertificateName) - populateDateTimeRFC3339(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 "certificateName": - err = unpopulate(val, "CertificateName", &c.CertificateName) - delete(rawMsg, key) - case "expiryDate": - err = unpopulateDateTimeRFC3339(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 ChangeLongTermRetentionBackupAccessTierParameters. func (c ChangeLongTermRetentionBackupAccessTierParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -3728,127 +3697,19 @@ 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) - populateDateTimeRFC3339(objectMap, "lastBackupTime", d.LastBackupTime) - populate(objectMap, "lastCommitLsn", d.LastCommitLsn) - populateDateTimeRFC3339(objectMap, "lastCommitTime", d.LastCommitTime) - populate(objectMap, "lastHardenedLsn", d.LastHardenedLsn) - populateDateTimeRFC3339(objectMap, "lastHardenedTime", d.LastHardenedTime) - populate(objectMap, "lastReceivedLsn", d.LastReceivedLsn) - populateDateTimeRFC3339(objectMap, "lastReceivedTime", d.LastReceivedTime) - populate(objectMap, "lastSentLsn", d.LastSentLsn) - populateDateTimeRFC3339(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, "seedingProgress", d.SeedingProgress) - 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 = unpopulateDateTimeRFC3339(val, "LastBackupTime", &d.LastBackupTime) - delete(rawMsg, key) - case "lastCommitLsn": - err = unpopulate(val, "LastCommitLsn", &d.LastCommitLsn) - delete(rawMsg, key) - case "lastCommitTime": - err = unpopulateDateTimeRFC3339(val, "LastCommitTime", &d.LastCommitTime) - delete(rawMsg, key) - case "lastHardenedLsn": - err = unpopulate(val, "LastHardenedLsn", &d.LastHardenedLsn) - delete(rawMsg, key) - case "lastHardenedTime": - err = unpopulateDateTimeRFC3339(val, "LastHardenedTime", &d.LastHardenedTime) - delete(rawMsg, key) - case "lastReceivedLsn": - err = unpopulate(val, "LastReceivedLsn", &d.LastReceivedLsn) - delete(rawMsg, key) - case "lastReceivedTime": - err = unpopulateDateTimeRFC3339(val, "LastReceivedTime", &d.LastReceivedTime) - delete(rawMsg, key) - case "lastSentLsn": - err = unpopulate(val, "LastSentLsn", &d.LastSentLsn) - delete(rawMsg, key) - case "lastSentTime": - err = unpopulateDateTimeRFC3339(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 "seedingProgress": - err = unpopulate(val, "SeedingProgress", &d.SeedingProgress) - 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, "distributedAvailabilityGroupName", d.DistributedAvailabilityGroupName) - populate(objectMap, "failoverMode", d.FailoverMode) - 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, "lastHardenedLsn", d.LastHardenedLsn) + populate(objectMap, "linkState", d.LinkState) + populate(objectMap, "primaryAvailabilityGroupName", d.PrimaryAvailabilityGroupName) populate(objectMap, "replicationMode", d.ReplicationMode) - populate(objectMap, "seedingMode", d.SeedingMode) + 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) } @@ -3861,96 +3722,35 @@ 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 "distributedAvailabilityGroupName": - err = unpopulate(val, "DistributedAvailabilityGroupName", &d.DistributedAvailabilityGroupName) - delete(rawMsg, key) - case "failoverMode": - err = unpopulate(val, "FailoverMode", &d.FailoverMode) - delete(rawMsg, key) - case "instanceAvailabilityGroupName": - err = unpopulate(val, "InstanceAvailabilityGroupName", &d.InstanceAvailabilityGroupName) - delete(rawMsg, key) - case "instanceLinkRole": - err = unpopulate(val, "InstanceLinkRole", &d.InstanceLinkRole) - delete(rawMsg, key) - case "partnerAvailabilityGroupName": - err = unpopulate(val, "PartnerAvailabilityGroupName", &d.PartnerAvailabilityGroupName) + case "lastHardenedLsn": + err = unpopulate(val, "LastHardenedLsn", &d.LastHardenedLsn) delete(rawMsg, key) - case "partnerEndpoint": - err = unpopulate(val, "PartnerEndpoint", &d.PartnerEndpoint) + case "linkState": + err = unpopulate(val, "LinkState", &d.LinkState) delete(rawMsg, key) - case "partnerLinkRole": - err = unpopulate(val, "PartnerLinkRole", &d.PartnerLinkRole) + case "primaryAvailabilityGroupName": + err = unpopulate(val, "PrimaryAvailabilityGroupName", &d.PrimaryAvailabilityGroupName) delete(rawMsg, key) case "replicationMode": err = unpopulate(val, "ReplicationMode", &d.ReplicationMode) delete(rawMsg, key) - case "seedingMode": - err = unpopulate(val, "SeedingMode", &d.SeedingMode) + case "secondaryAvailabilityGroupName": + err = unpopulate(val, "SecondaryAvailabilityGroupName", &d.SecondaryAvailabilityGroupName) 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 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) + case "sourceEndpoint": + err = unpopulate(val, "SourceEndpoint", &d.SourceEndpoint) delete(rawMsg, key) - case "roleChangeType": - err = unpopulate(val, "RoleChangeType", &d.RoleChangeType) + case "sourceReplicaId": + err = unpopulate(val, "SourceReplicaID", &d.SourceReplicaID) 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 DistributedAvailabilityGroupsFailoverRequest. -func (d DistributedAvailabilityGroupsFailoverRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "failoverType", d.FailoverType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DistributedAvailabilityGroupsFailoverRequest. -func (d *DistributedAvailabilityGroupsFailoverRequest) 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 "failoverType": - err = unpopulate(val, "FailoverType", &d.FailoverType) + case "targetDatabase": + err = unpopulate(val, "TargetDatabase", &d.TargetDatabase) + delete(rawMsg, key) + case "targetReplicaId": + err = unpopulate(val, "TargetReplicaID", &d.TargetReplicaID) delete(rawMsg, key) } if err != nil { @@ -5788,6 +5588,7 @@ func (f FailoverGroupProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "readWriteEndpoint", f.ReadWriteEndpoint) populate(objectMap, "replicationRole", f.ReplicationRole) populate(objectMap, "replicationState", f.ReplicationState) + populate(objectMap, "secondaryType", f.SecondaryType) return json.Marshal(objectMap) } @@ -5818,6 +5619,9 @@ func (f *FailoverGroupProperties) UnmarshalJSON(data []byte) error { case "replicationState": err = unpopulate(val, "ReplicationState", &f.ReplicationState) delete(rawMsg, key) + case "secondaryType": + err = unpopulate(val, "SecondaryType", &f.SecondaryType) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", f, err) @@ -5926,6 +5730,7 @@ func (f FailoverGroupUpdateProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "partnerServers", f.PartnerServers) populate(objectMap, "readOnlyEndpoint", f.ReadOnlyEndpoint) populate(objectMap, "readWriteEndpoint", f.ReadWriteEndpoint) + populate(objectMap, "secondaryType", f.SecondaryType) return json.Marshal(objectMap) } @@ -5950,6 +5755,9 @@ func (f *FailoverGroupUpdateProperties) UnmarshalJSON(data []byte) error { case "readWriteEndpoint": err = unpopulate(val, "ReadWriteEndpoint", &f.ReadWriteEndpoint) delete(rawMsg, key) + case "secondaryType": + err = unpopulate(val, "SecondaryType", &f.SecondaryType) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", f, err) @@ -11725,25 +11533,17 @@ func (m ManagedInstanceProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "administratorLogin", m.AdministratorLogin) populate(objectMap, "administratorLoginPassword", m.AdministratorLoginPassword) populate(objectMap, "administrators", m.Administrators) - populate(objectMap, "authenticationMetadata", m.AuthenticationMetadata) populate(objectMap, "collation", m.Collation) - populateDateTimeRFC3339(objectMap, "createTime", m.CreateTime) populate(objectMap, "currentBackupStorageRedundancy", m.CurrentBackupStorageRedundancy) populate(objectMap, "dnsZone", m.DNSZone) populate(objectMap, "dnsZonePartner", m.DNSZonePartner) - populate(objectMap, "databaseFormat", m.DatabaseFormat) - 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) @@ -11754,13 +11554,10 @@ 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) } @@ -11783,15 +11580,9 @@ func (m *ManagedInstanceProperties) UnmarshalJSON(data []byte) error { case "administrators": err = unpopulate(val, "Administrators", &m.Administrators) delete(rawMsg, key) - case "authenticationMetadata": - err = unpopulate(val, "AuthenticationMetadata", &m.AuthenticationMetadata) - delete(rawMsg, key) case "collation": err = unpopulate(val, "Collation", &m.Collation) delete(rawMsg, key) - case "createTime": - err = unpopulateDateTimeRFC3339(val, "CreateTime", &m.CreateTime) - delete(rawMsg, key) case "currentBackupStorageRedundancy": err = unpopulate(val, "CurrentBackupStorageRedundancy", &m.CurrentBackupStorageRedundancy) delete(rawMsg, key) @@ -11801,27 +11592,12 @@ func (m *ManagedInstanceProperties) UnmarshalJSON(data []byte) error { case "dnsZonePartner": err = unpopulate(val, "DNSZonePartner", &m.DNSZonePartner) delete(rawMsg, key) - case "databaseFormat": - err = unpopulate(val, "DatabaseFormat", &m.DatabaseFormat) - 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) @@ -11837,9 +11613,6 @@ 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) @@ -11870,15 +11643,9 @@ 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) @@ -11888,9 +11655,6 @@ 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) @@ -13967,45 +13731,6 @@ func (q *QueryMetricInterval) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type QueryMetricIntervalAutoGenerated. -func (q QueryMetricIntervalAutoGenerated) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "executionCount", q.ExecutionCount) - populate(objectMap, "intervalStartTime", q.IntervalStartTime) - populate(objectMap, "intervalType", q.IntervalType) - populate(objectMap, "metrics", q.Metrics) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type QueryMetricIntervalAutoGenerated. -func (q *QueryMetricIntervalAutoGenerated) 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", q, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "executionCount": - err = unpopulate(val, "ExecutionCount", &q.ExecutionCount) - delete(rawMsg, key) - case "intervalStartTime": - err = unpopulate(val, "IntervalStartTime", &q.IntervalStartTime) - delete(rawMsg, key) - case "intervalType": - err = unpopulate(val, "IntervalType", &q.IntervalType) - delete(rawMsg, key) - case "metrics": - err = unpopulate(val, "Metrics", &q.Metrics) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", q, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type QueryMetricProperties. func (q QueryMetricProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -14174,49 +13899,6 @@ func (q *QueryStatisticsProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type QueryStatisticsPropertiesAutoGenerated. -func (q QueryStatisticsPropertiesAutoGenerated) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "databaseName", q.DatabaseName) - populate(objectMap, "endTime", q.EndTime) - populate(objectMap, "intervals", q.Intervals) - populate(objectMap, "queryId", q.QueryID) - populate(objectMap, "startTime", q.StartTime) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type QueryStatisticsPropertiesAutoGenerated. -func (q *QueryStatisticsPropertiesAutoGenerated) 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", q, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "databaseName": - err = unpopulate(val, "DatabaseName", &q.DatabaseName) - delete(rawMsg, key) - case "endTime": - err = unpopulate(val, "EndTime", &q.EndTime) - delete(rawMsg, key) - case "intervals": - err = unpopulate(val, "Intervals", &q.Intervals) - delete(rawMsg, key) - case "queryId": - err = unpopulate(val, "QueryID", &q.QueryID) - delete(rawMsg, key) - case "startTime": - err = unpopulate(val, "StartTime", &q.StartTime) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", q, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type ReadScaleCapability. func (r ReadScaleCapability) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -14951,45 +14633,6 @@ 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) @@ -15037,53 +14680,6 @@ 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) @@ -15199,6 +14795,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) @@ -15228,6 +14825,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) @@ -15260,6 +14860,72 @@ func (r *ReplicationLinkProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ReplicationLinkUpdate. +func (r ReplicationLinkUpdate) 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 ReplicationLinkUpdate. +func (r *ReplicationLinkUpdate) 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 ReplicationLinkUpdateProperties. +func (r ReplicationLinkUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "linkType", r.LinkType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ReplicationLinkUpdateProperties. +func (r *ReplicationLinkUpdateProperties) 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 "linkType": + err = unpopulate(val, "LinkType", &r.LinkType) + 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 Resource. func (r Resource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) diff --git a/sdk/resourcemanager/sql/armsql/options.go b/sdk/resourcemanager/sql/armsql/options.go index 6089a8570b67..bee3c69a8118 100644 --- a/sdk/resourcemanager/sql/armsql/options.go +++ b/sdk/resourcemanager/sql/armsql/options.go @@ -573,20 +573,6 @@ type DistributedAvailabilityGroupsClientBeginDeleteOptions struct { ResumeToken string } -// DistributedAvailabilityGroupsClientBeginFailoverOptions contains the optional parameters for the DistributedAvailabilityGroupsClient.BeginFailover -// method. -type DistributedAvailabilityGroupsClientBeginFailoverOptions struct { - // Resumes the LRO from the provided token. - 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 { @@ -2175,13 +2161,6 @@ 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. @@ -2461,6 +2440,13 @@ type RecoverableManagedDatabasesClientListByInstanceOptions struct { // placeholder for future optional parameters } +// ReplicationLinksClientBeginCreateOrUpdateOptions contains the optional parameters for the ReplicationLinksClient.BeginCreateOrUpdate +// method. +type ReplicationLinksClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // ReplicationLinksClientBeginDeleteOptions contains the optional parameters for the ReplicationLinksClient.BeginDelete method. type ReplicationLinksClientBeginDeleteOptions struct { // Resumes the LRO from the provided token. @@ -2481,6 +2467,12 @@ type ReplicationLinksClientBeginFailoverOptions struct { ResumeToken string } +// ReplicationLinksClientBeginUpdateOptions contains the optional parameters for the ReplicationLinksClient.BeginUpdate method. +type ReplicationLinksClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // ReplicationLinksClientGetOptions contains the optional parameters for the ReplicationLinksClient.Get method. type ReplicationLinksClientGetOptions struct { // placeholder for future optional parameters 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 2085abed263c..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/privateendpointconnections_client_example_test.go deleted file mode 100644 index 4ce39d0e0e4c..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/privatelinkresources_client_example_test.go deleted file mode 100644 index 1f7816c407c7..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/recommendedsensitivitylabels_client_example_test.go deleted file mode 100644 index a272d132cea3..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/recoverabledatabases_client_example_test.go deleted file mode 100644 index 728c0fca5b3e..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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.780Z"); 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.780Z"); 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.780Z"); return t}()), - // ServiceLevelObjective: to.Ptr("Basic"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/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.780Z"); return t}()), - // ServiceLevelObjective: to.Ptr("Basic"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/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.780Z"); return t}()), - // ServiceLevelObjective: to.Ptr("Basic"), - // }, - // } -} 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 cb165666fab2..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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 279bc10c8e18..5c7b0679423c 100644 --- a/sdk/resourcemanager/sql/armsql/replicationlinks_client.go +++ b/sdk/resourcemanager/sql/armsql/replicationlinks_client.go @@ -43,10 +43,99 @@ func NewReplicationLinksClient(subscriptionID string, credential azcore.TokenCre return client, nil } +// BeginCreateOrUpdate - Updates the replication link type. +// 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. +// - databaseName - The name of the database. +// - options - ReplicationLinksClientBeginCreateOrUpdateOptions contains the optional parameters for the ReplicationLinksClient.BeginCreateOrUpdate +// method. +func (client *ReplicationLinksClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string, parameters ReplicationLink, options *ReplicationLinksClientBeginCreateOrUpdateOptions) (*runtime.Poller[ReplicationLinksClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, serverName, databaseName, linkID, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ReplicationLinksClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ReplicationLinksClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// CreateOrUpdate - Updates the replication link type. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01-preview +func (client *ReplicationLinksClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string, parameters ReplicationLink, options *ReplicationLinksClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + const operationName = "ReplicationLinksClient.BeginCreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, linkID, 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 +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *ReplicationLinksClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string, parameters ReplicationLink, options *ReplicationLinksClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}" + 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 linkID == "" { + return nil, errors.New("parameter linkID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{linkId}", url.PathEscape(linkID)) + 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", "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 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. @@ -73,7 +162,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 const operationName = "ReplicationLinksClient.BeginDelete" @@ -123,7 +212,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 } @@ -131,7 +220,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. @@ -159,7 +248,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 const operationName = "ReplicationLinksClient.BeginFailover" @@ -209,7 +298,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 @@ -218,7 +307,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. @@ -246,7 +335,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 const operationName = "ReplicationLinksClient.BeginFailoverAllowDataLoss" @@ -296,7 +385,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 @@ -305,7 +394,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. @@ -362,7 +451,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 @@ -379,7 +468,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. @@ -433,7 +522,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 @@ -450,7 +539,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. @@ -499,7 +588,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 @@ -513,3 +602,92 @@ func (client *ReplicationLinksClient) listByServerHandleResponse(resp *http.Resp } return result, nil } + +// BeginUpdate - Updates the replication link type. +// 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. +// - databaseName - The name of the database. +// - options - ReplicationLinksClientBeginUpdateOptions contains the optional parameters for the ReplicationLinksClient.BeginUpdate +// method. +func (client *ReplicationLinksClient) BeginUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string, parameters ReplicationLinkUpdate, options *ReplicationLinksClientBeginUpdateOptions) (*runtime.Poller[ReplicationLinksClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, resourceGroupName, serverName, databaseName, linkID, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ReplicationLinksClientUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ReplicationLinksClientUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Update - Updates the replication link type. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01-preview +func (client *ReplicationLinksClient) update(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string, parameters ReplicationLinkUpdate, options *ReplicationLinksClientBeginUpdateOptions) (*http.Response, error) { + var err error + const operationName = "ReplicationLinksClient.BeginUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.updateCreateRequest(ctx, resourceGroupName, serverName, databaseName, linkID, 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 +} + +// updateCreateRequest creates the Update request. +func (client *ReplicationLinksClient) updateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string, parameters ReplicationLinkUpdate, options *ReplicationLinksClientBeginUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}" + 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 linkID == "" { + return nil, errors.New("parameter linkID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{linkId}", url.PathEscape(linkID)) + 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.MethodPatch, 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 +} 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 58151e6473e0..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/responses.go b/sdk/resourcemanager/sql/armsql/responses.go index a2717a49769f..1d9412cc5988 100644 --- a/sdk/resourcemanager/sql/armsql/responses.go +++ b/sdk/resourcemanager/sql/armsql/responses.go @@ -547,12 +547,6 @@ type DistributedAvailabilityGroupsClientDeleteResponse struct { // placeholder for future response values } -// DistributedAvailabilityGroupsClientFailoverResponse contains the response from method DistributedAvailabilityGroupsClient.BeginFailover. -type DistributedAvailabilityGroupsClientFailoverResponse struct { - // Distributed availability group between box and Sql Managed Instance. - DistributedAvailabilityGroup -} - // DistributedAvailabilityGroupsClientGetResponse contains the response from method DistributedAvailabilityGroupsClient.Get. type DistributedAvailabilityGroupsClientGetResponse struct { // Distributed availability group between box and Sql Managed Instance. @@ -565,12 +559,6 @@ type DistributedAvailabilityGroupsClientListByInstanceResponse struct { DistributedAvailabilityGroupsListResult } -// DistributedAvailabilityGroupsClientSetRoleResponse contains the response from method DistributedAvailabilityGroupsClient.BeginSetRole. -type DistributedAvailabilityGroupsClientSetRoleResponse struct { - // Distributed availability group between box and Sql Managed Instance. - DistributedAvailabilityGroup -} - // DistributedAvailabilityGroupsClientUpdateResponse contains the response from method DistributedAvailabilityGroupsClient.BeginUpdate. type DistributedAvailabilityGroupsClientUpdateResponse struct { // Distributed availability group between box and Sql Managed Instance. @@ -1949,22 +1937,14 @@ 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 { - // An Azure SQL managed instance. - ManagedInstance + // placeholder for future response values } // ManagedInstancesClientStopResponse contains the response from method ManagedInstancesClient.BeginStop. type ManagedInstancesClientStopResponse struct { - // An Azure SQL managed instance. - ManagedInstance + // placeholder for future response values } // ManagedInstancesClientUpdateResponse contains the response from method ManagedInstancesClient.BeginUpdate. @@ -2164,6 +2144,12 @@ type RecoverableManagedDatabasesClientListByInstanceResponse struct { RecoverableManagedDatabaseListResult } +// ReplicationLinksClientCreateOrUpdateResponse contains the response from method ReplicationLinksClient.BeginCreateOrUpdate. +type ReplicationLinksClientCreateOrUpdateResponse struct { + // A replication link. + ReplicationLink +} + // ReplicationLinksClientDeleteResponse contains the response from method ReplicationLinksClient.BeginDelete. type ReplicationLinksClientDeleteResponse struct { // placeholder for future response values @@ -2199,6 +2185,12 @@ type ReplicationLinksClientListByServerResponse struct { ReplicationLinkListResult } +// ReplicationLinksClientUpdateResponse contains the response from method ReplicationLinksClient.BeginUpdate. +type ReplicationLinksClientUpdateResponse struct { + // A replication link. + ReplicationLink +} + // RestorableDroppedDatabasesClientGetResponse contains the response from method RestorableDroppedDatabasesClient.Get. type RestorableDroppedDatabasesClientGetResponse struct { // A restorable dropped database resource. 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 2388f2541723..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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.690Z"); 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.690Z"); 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/33c4457b1d13f83965f4fe3367dca4a6df898100/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.690Z"); 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/33c4457b1d13f83965f4fe3367dca4a6df898100/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.690Z"); 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_example_test.go b/sdk/resourcemanager/sql/armsql/restorabledroppedmanageddatabases_client_example_test.go deleted file mode 100644 index 246592460a4a..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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.690Z"); 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.690Z"); return t}()), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/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.690Z"); return t}()), - // }, - // } -} 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 874ae82fd162..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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:00.000Z"); return t}()), - // RestorePointType: to.Ptr(armsql.RestorePointTypeCONTINUOUS), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/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:00.000Z"); 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:14.000Z"); 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:55.000Z"); return t}()), - // RestorePointType: to.Ptr(armsql.RestorePointTypeDISCRETE), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/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:00.000Z"); return t}()), - // RestorePointLabel: to.Ptr("mylabel"), - // RestorePointType: to.Ptr(armsql.RestorePointTypeDISCRETE), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/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:00.000Z"); return t}()), - // RestorePointType: to.Ptr(armsql.RestorePointTypeCONTINUOUS), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/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:00.000Z"); return t}()), - // RestorePointLabel: to.Ptr("mylabel"), - // RestorePointType: to.Ptr(armsql.RestorePointTypeDISCRETE), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/sensitivitylabels_client_example_test.go deleted file mode 100644 index ee113ddff9d0..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/serveradvancedthreatprotectionsettings_client_example_test.go deleted file mode 100644 index 2fdc53718c99..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/serveradvisors_client_example_test.go deleted file mode 100644 index dbaf7bac812b..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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:04.000Z"); 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:40.000Z"); return t}()), - // }, - // TimeSeries: []*armsql.RecommendedActionMetricInfo{ - // }, - // ValidSince: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:04.000Z"); 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:05.000Z"); 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:05.000Z"); return t}()), - // }, - // TimeSeries: []*armsql.RecommendedActionMetricInfo{ - // }, - // ValidSince: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05.000Z"); 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:05.000Z"); return t}()), - // ExecuteActionStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05.000Z"); 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:05.000Z"); 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:05.000Z"); return t}()), - // }, - // TimeSeries: []*armsql.RecommendedActionMetricInfo{ - // }, - // ValidSince: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05.000Z"); 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:05.000Z"); 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:05.000Z"); 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:05.000Z"); return t}()), - // }, - // TimeSeries: []*armsql.RecommendedActionMetricInfo{ - // }, - // ValidSince: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05.000Z"); 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:05.000Z"); return t}()), - // ExecuteActionStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05.000Z"); 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:05.000Z"); 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:05.000Z"); return t}()), - // }, - // TimeSeries: []*armsql.RecommendedActionMetricInfo{ - // }, - // ValidSince: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05.000Z"); 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:05.000Z"); return t}()), - // ExecuteActionStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05.000Z"); 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:05.000Z"); 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:05.000Z"); return t}()), - // }, - // TimeSeries: []*armsql.RecommendedActionMetricInfo{ - // }, - // ValidSince: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05.000Z"); 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:35.000Z"); 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:05.000Z"); 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:35.000Z"); return t}()), - // }, - // TimeSeries: []*armsql.RecommendedActionMetricInfo{ - // }, - // ValidSince: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:38:05.000Z"); 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:31.000Z"); 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:44.000Z"); 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:31.000Z"); return t}()), - // }, - // TimeSeries: []*armsql.RecommendedActionMetricInfo{ - // }, - // ValidSince: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:37:44.000Z"); 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:53.000Z"); 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:48.000Z"); return t}()), - // }, - // TimeSeries: []*armsql.RecommendedActionMetricInfo{ - // }, - // ValidSince: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T14:37:48.000Z"); 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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/serverautomatictuning_client_example_test.go deleted file mode 100644 index ca2d55e44e11..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/serverazureadadministrators_client_example_test.go deleted file mode 100644 index 3b4822520b4e..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/serverazureadonlyauthentications_client_example_test.go deleted file mode 100644 index 55c61979569f..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/serverblobauditingpolicies_client_example_test.go deleted file mode 100644 index 61a3a7149200..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/servercommunicationlinks_client_example_test.go deleted file mode 100644 index 40d7337cf254..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/serverconfigurationoptions_client_example_test.go deleted file mode 100644 index dc33edae029e..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/serverconnectionpolicies_client_example_test.go deleted file mode 100644 index 5899202469f8..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/serverdevopsauditsettings_client_example_test.go deleted file mode 100644 index f636914c20cb..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/serverdnsaliases_client_example_test.go deleted file mode 100644 index 1f4c6e45caee..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/serverkeys_client_example_test.go deleted file mode 100644 index abc93506af43..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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:00.000Z"); 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:00.000Z"); 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/33c4457b1d13f83965f4fe3367dca4a6df898100/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:00.000Z"); return t}()), - // Thumbprint: to.Ptr("00112233445566778899AABBCCDDEEFFAABBCCDD"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/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:00.000Z"); return t}()), - // Thumbprint: to.Ptr("00112233445566778899AABBCCDDEEFFAABBCCDD"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/serveroperations_client_example_test.go deleted file mode 100644 index 165b50f9cbe0..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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.100Z"); 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.100Z"); return t}()), - // State: to.Ptr(armsql.ManagementOperationStateSucceeded), - // }, - // }}, - // } - } -} 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 f259a60e0d26..000000000000 --- a/sdk/resourcemanager/sql/armsql/servers_client_example_test.go +++ /dev/null @@ -1,925 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-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"), - // IsIPv6Enabled: to.Ptr(armsql.ServerNetworkAccessFlagEnabled), - // 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"), - // IsIPv6Enabled: to.Ptr(armsql.ServerNetworkAccessFlagEnabled), - // 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-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"), - // IsIPv6Enabled: to.Ptr(armsql.ServerNetworkAccessFlagEnabled), - // 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"), - // IsIPv6Enabled: to.Ptr(armsql.ServerNetworkAccessFlagEnabled), - // 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-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"), - // IsIPv6Enabled: to.Ptr(armsql.ServerNetworkAccessFlagEnabled), - // 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"), - // IsIPv6Enabled: to.Ptr(armsql.ServerNetworkAccessFlagEnabled), - // 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-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"), - // IsIPv6Enabled: to.Ptr(armsql.ServerNetworkAccessFlagEnabled), - // 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"), - // IsIPv6Enabled: to.Ptr(armsql.ServerNetworkAccessFlagEnabled), - // 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-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"), - // FullyQualifiedDomainName: to.Ptr("sqlcrudtest-4645.database.windows.net"), - // IsIPv6Enabled: to.Ptr(armsql.ServerNetworkAccessFlagEnabled), - // 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-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"), - // IsIPv6Enabled: to.Ptr(armsql.ServerNetworkAccessFlagEnabled), - // 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-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"), - }, - IsIPv6Enabled: to.Ptr(armsql.ServerNetworkAccessFlagEnabled), - 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"), - // IsIPv6Enabled: to.Ptr(armsql.ServerNetworkAccessFlagEnabled), - // 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-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"), - IsIPv6Enabled: to.Ptr(armsql.ServerNetworkAccessFlagEnabled), - 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"), - // IsIPv6Enabled: to.Ptr(armsql.ServerNetworkAccessFlagEnabled), - // 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-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_example_test.go b/sdk/resourcemanager/sql/armsql/serversecurityalertpolicies_client_example_test.go deleted file mode 100644 index 7f19bebbb08e..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/servertrustcertificates_client_example_test.go deleted file mode 100644 index 8750ddbc5ccb..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/servertrustgroups_client_example_test.go deleted file mode 100644 index ebc6060e87f9..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/serverusages_client_example_test.go deleted file mode 100644 index 66b5870db37b..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/servervulnerabilityassessments_client_example_test.go deleted file mode 100644 index aec5ca2cb182..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/serviceobjectives_client_example_test.go deleted file mode 100644 index 71b2645289dc..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/startstopmanagedinstanceschedules_client_example_test.go deleted file mode 100644 index af45122ac2bc..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/subscriptionusages_client_example_test.go deleted file mode 100644 index 1fb482bdb822..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/synapselinkworkspaces_client_example_test.go deleted file mode 100644 index 962aa3cb3a0d..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/syncagents_client_example_test.go deleted file mode 100644 index 54cbf96d6499..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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.999Z"); 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/33c4457b1d13f83965f4fe3367dca4a6df898100/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.999Z"); 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/33c4457b1d13f83965f4fe3367dca4a6df898100/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.999Z"); 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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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.999Z"); 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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/syncgroups_client_example_test.go deleted file mode 100644 index 80f61a5f5595..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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.210Z"); 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/33c4457b1d13f83965f4fe3367dca4a6df898100/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.250Z"); 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.573Z"); 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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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, "1-01-01T08:00:00.000Z"); 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/33c4457b1d13f83965f4fe3367dca4a6df898100/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, "1-01-01T08:00:00.000Z"); 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/33c4457b1d13f83965f4fe3367dca4a6df898100/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, "1-01-01T08:00:00.000Z"); 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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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, "1-01-01T08:00:00.000Z"); 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/33c4457b1d13f83965f4fe3367dca4a6df898100/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, "1-01-01T08:00:00.000Z"); 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, "1-01-01T08:00:00.000Z"); 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_example_test.go b/sdk/resourcemanager/sql/armsql/syncmembers_client_example_test.go deleted file mode 100644 index 498596d16104..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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.210Z"); 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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/tdecertificates_client_example_test.go deleted file mode 100644 index ba53658369ef..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/timezones_client_example_test.go deleted file mode 100644 index 56df251583ac..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/transparentdataencryptions_client_example_test.go deleted file mode 100644 index 880f93ada0b9..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/usages_client_example_test.go deleted file mode 100644 index 2533496d7f8e..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/virtualclusters_client_example_test.go deleted file mode 100644 index e803752ea8a9..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/virtualnetworkrules_client_example_test.go deleted file mode 100644 index 13967154f7de..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentbaseline_client_example_test.go deleted file mode 100644 index 61506f171c8f..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentbaselines_client_example_test.go deleted file mode 100644 index bd858d33ce24..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentexecutescan_client_example_test.go deleted file mode 100644 index dea991a4db23..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentrulebaseline_client_example_test.go deleted file mode 100644 index 616c533c783e..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentrulebaselines_client_example_test.go deleted file mode 100644 index 34484df09928..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/vulnerabilityassessments_client_example_test.go deleted file mode 100644 index 1f121ac95a33..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentscanresult_client_example_test.go deleted file mode 100644 index 3422fae39e72..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentscans_client_example_test.go deleted file mode 100644 index 86045ead7a2c..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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.723Z"); return t}()), - // HighSeverityFailedRulesCount: to.Ptr[int32](3), - // IsBaselineApplied: to.Ptr(false), - // LastScanTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-23T06:49:00.645Z"); 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-23T06:49:00.645Z"); 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.723Z"); return t}()), - // HighSeverityFailedRulesCount: to.Ptr[int32](3), - // IsBaselineApplied: to.Ptr(false), - // LastScanTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-23T06:49:00.645Z"); 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-23T06:49:00.645Z"); 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.723Z"); return t}()), - // HighSeverityFailedRulesCount: to.Ptr[int32](0), - // IsBaselineApplied: to.Ptr(true), - // LastScanTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-23T06:49:00.645Z"); 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-23T06:49:00.645Z"); 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/33c4457b1d13f83965f4fe3367dca4a6df898100/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.723Z"); return t}()), - // HighSeverityFailedRulesCount: to.Ptr[int32](3), - // IsBaselineApplied: to.Ptr(false), - // LastScanTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-23T06:49:00.645Z"); 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-23T06:49:00.645Z"); 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_example_test.go b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentssettings_client_example_test.go deleted file mode 100644 index 1fbe37c1eab4..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/workloadclassifiers_client_example_test.go deleted file mode 100644 index 2dc976983f41..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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_example_test.go b/sdk/resourcemanager/sql/armsql/workloadgroups_client_example_test.go deleted file mode 100644 index 924d45a02993..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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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/33c4457b1d13f83965f4fe3367dca4a6df898100/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), - // }, - // }}, - // } - } -}