From f69f254077ee9e0c2ffa7bb373f21e37e7c86eba Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 13 Mar 2023 21:05:58 +0000 Subject: [PATCH] CodeGen from PR 22677 in Azure/azure-rest-api-specs Merge 29ce73f2afb55bee32c5397d107daabdd4a8e297 into 6b921fdde7c1806efca2b5aa41ca46ec65f3092e --- .../Azure.ResourceManager.Sql.sln | 65 +++++++++++++++ .../Azure.ResourceManager.Sql/CHANGELOG.md | 17 ++++ .../Directory.Build.props | 6 ++ sdk/sql/Azure.ResourceManager.Sql/README.md | 80 +++++++++++++++++++ .../Azure.ResourceManager.Sql.Samples.csproj | 10 +++ .../samples/autorest.tests.md | 13 +++ .../src/Azure.ResourceManager.Sql.csproj | 8 ++ .../src/Properties/AssemblyInfo.cs | 9 +++ .../Azure.ResourceManager.Sql/src/autorest.md | 49 ++++++++++++ .../Azure.ResourceManager.Sql.Tests.csproj | 5 ++ .../tests/sqlManagementTestBase.cs | 43 ++++++++++ .../tests/sqlManagementTestEnvironment.cs | 11 +++ sdk/sql/ci.mgmt.yml | 24 ++++++ 13 files changed, 340 insertions(+) create mode 100644 sdk/sql/Azure.ResourceManager.Sql/Azure.ResourceManager.Sql.sln create mode 100644 sdk/sql/Azure.ResourceManager.Sql/CHANGELOG.md create mode 100644 sdk/sql/Azure.ResourceManager.Sql/Directory.Build.props create mode 100644 sdk/sql/Azure.ResourceManager.Sql/README.md create mode 100644 sdk/sql/Azure.ResourceManager.Sql/samples/Azure.ResourceManager.Sql.Samples.csproj create mode 100644 sdk/sql/Azure.ResourceManager.Sql/samples/autorest.tests.md create mode 100644 sdk/sql/Azure.ResourceManager.Sql/src/Azure.ResourceManager.Sql.csproj create mode 100644 sdk/sql/Azure.ResourceManager.Sql/src/Properties/AssemblyInfo.cs create mode 100644 sdk/sql/Azure.ResourceManager.Sql/src/autorest.md create mode 100644 sdk/sql/Azure.ResourceManager.Sql/tests/Azure.ResourceManager.Sql.Tests.csproj create mode 100644 sdk/sql/Azure.ResourceManager.Sql/tests/sqlManagementTestBase.cs create mode 100644 sdk/sql/Azure.ResourceManager.Sql/tests/sqlManagementTestEnvironment.cs create mode 100644 sdk/sql/ci.mgmt.yml diff --git a/sdk/sql/Azure.ResourceManager.Sql/Azure.ResourceManager.Sql.sln b/sdk/sql/Azure.ResourceManager.Sql/Azure.ResourceManager.Sql.sln new file mode 100644 index 0000000000000..a0d709f526c6e --- /dev/null +++ b/sdk/sql/Azure.ResourceManager.Sql/Azure.ResourceManager.Sql.sln @@ -0,0 +1,65 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30309.148 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{F4F7D199-40D3-4BFE-8314-78BA5E031A69}") = "Azure.ResourceManager.Sql", "src\Azure.ResourceManager.Sql.csproj", "{E9F93C38-D0EC-438E-A156-A6B3F32DEBB5}" +EndProject +Project("{F4F7D199-40D3-4BFE-8314-78BA5E031A69}") = "Azure.ResourceManager.Sql.Tests", "tests\Azure.ResourceManager.Sql.Tests.csproj", "{FBE70F36-EAB7-43C9-9D0A-A6E73D18F8C4}" +EndProject +Project("{F4F7D199-40D3-4BFE-8314-78BA5E031A69}") = "Azure.ResourceManager.Sql.Samples", "samples\Azure.ResourceManager.Sql.Samples.csproj", "{B55A53F7-E1A9-43B0-BF0B-CCF633F2158B}" +EndProject +Global + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {F7293ABB-9C0A-42B7-BF70-5557534D86C7} + EndGlobalSection + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {E9F93C38-D0EC-438E-A156-A6B3F32DEBB5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E9F93C38-D0EC-438E-A156-A6B3F32DEBB5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E9F93C38-D0EC-438E-A156-A6B3F32DEBB5}.Debug|x64.ActiveCfg = Debug|Any CPU + {E9F93C38-D0EC-438E-A156-A6B3F32DEBB5}.Debug|x64.Build.0 = Debug|Any CPU + {E9F93C38-D0EC-438E-A156-A6B3F32DEBB5}.Debug|x86.ActiveCfg = Debug|Any CPU + {E9F93C38-D0EC-438E-A156-A6B3F32DEBB5}.Debug|x86.Build.0 = Debug|Any CPU + {E9F93C38-D0EC-438E-A156-A6B3F32DEBB5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E9F93C38-D0EC-438E-A156-A6B3F32DEBB5}.Release|Any CPU.Build.0 = Release|Any CPU + {E9F93C38-D0EC-438E-A156-A6B3F32DEBB5}.Release|x64.ActiveCfg = Release|Any CPU + {E9F93C38-D0EC-438E-A156-A6B3F32DEBB5}.Release|x64.Build.0 = Release|Any CPU + {E9F93C38-D0EC-438E-A156-A6B3F32DEBB5}.Release|x86.ActiveCfg = Release|Any CPU + {E9F93C38-D0EC-438E-A156-A6B3F32DEBB5}.Release|x86.Build.0 = Release|Any CPU + {FBE70F36-EAB7-43C9-9D0A-A6E73D18F8C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FBE70F36-EAB7-43C9-9D0A-A6E73D18F8C4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FBE70F36-EAB7-43C9-9D0A-A6E73D18F8C4}.Debug|x64.ActiveCfg = Debug|Any CPU + {FBE70F36-EAB7-43C9-9D0A-A6E73D18F8C4}.Debug|x64.Build.0 = Debug|Any CPU + {FBE70F36-EAB7-43C9-9D0A-A6E73D18F8C4}.Debug|x86.ActiveCfg = Debug|Any CPU + {FBE70F36-EAB7-43C9-9D0A-A6E73D18F8C4}.Debug|x86.Build.0 = Debug|Any CPU + {FBE70F36-EAB7-43C9-9D0A-A6E73D18F8C4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FBE70F36-EAB7-43C9-9D0A-A6E73D18F8C4}.Release|Any CPU.Build.0 = Release|Any CPU + {FBE70F36-EAB7-43C9-9D0A-A6E73D18F8C4}.Release|x64.ActiveCfg = Release|Any CPU + {FBE70F36-EAB7-43C9-9D0A-A6E73D18F8C4}.Release|x64.Build.0 = Release|Any CPU + {FBE70F36-EAB7-43C9-9D0A-A6E73D18F8C4}.Release|x86.ActiveCfg = Release|Any CPU + {FBE70F36-EAB7-43C9-9D0A-A6E73D18F8C4}.Release|x86.Build.0 = Release|Any CPU + {B55A53F7-E1A9-43B0-BF0B-CCF633F2158B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B55A53F7-E1A9-43B0-BF0B-CCF633F2158B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B55A53F7-E1A9-43B0-BF0B-CCF633F2158B}.Debug|x64.ActiveCfg = Debug|Any CPU + {B55A53F7-E1A9-43B0-BF0B-CCF633F2158B}.Debug|x64.Build.0 = Debug|Any CPU + {B55A53F7-E1A9-43B0-BF0B-CCF633F2158B}.Debug|x86.ActiveCfg = Debug|Any CPU + {B55A53F7-E1A9-43B0-BF0B-CCF633F2158B}.Debug|x86.Build.0 = Debug|Any CPU + {B55A53F7-E1A9-43B0-BF0B-CCF633F2158B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B55A53F7-E1A9-43B0-BF0B-CCF633F2158B}.Release|Any CPU.Build.0 = Release|Any CPU + {B55A53F7-E1A9-43B0-BF0B-CCF633F2158B}.Release|x64.ActiveCfg = Release|Any CPU + {B55A53F7-E1A9-43B0-BF0B-CCF633F2158B}.Release|x64.Build.0 = Release|Any CPU + {B55A53F7-E1A9-43B0-BF0B-CCF633F2158B}.Release|x86.ActiveCfg = Release|Any CPU + {B55A53F7-E1A9-43B0-BF0B-CCF633F2158B}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/sdk/sql/Azure.ResourceManager.Sql/CHANGELOG.md b/sdk/sql/Azure.ResourceManager.Sql/CHANGELOG.md new file mode 100644 index 0000000000000..23f86d1e896ee --- /dev/null +++ b/sdk/sql/Azure.ResourceManager.Sql/CHANGELOG.md @@ -0,0 +1,17 @@ +# Release History + +## 1.0.0-beta.1 (Unreleased) + +### General New Features + +This package follows the [new Azure SDK guidelines](https://azure.github.io/azure-sdk/general_introduction.html), and provides many core capabilities: + + - Support MSAL.NET, Azure.Identity is out of box for supporting MSAL.NET. + - Support [OpenTelemetry](https://opentelemetry.io/) for distributed tracing. + - HTTP pipeline with custom policies. + - Better error-handling. + - Support uniform telemetry across all languages. + +This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). + +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). \ No newline at end of file diff --git a/sdk/sql/Azure.ResourceManager.Sql/Directory.Build.props b/sdk/sql/Azure.ResourceManager.Sql/Directory.Build.props new file mode 100644 index 0000000000000..1a9611bd49242 --- /dev/null +++ b/sdk/sql/Azure.ResourceManager.Sql/Directory.Build.props @@ -0,0 +1,6 @@ + + + + diff --git a/sdk/sql/Azure.ResourceManager.Sql/README.md b/sdk/sql/Azure.ResourceManager.Sql/README.md new file mode 100644 index 0000000000000..82747f464778e --- /dev/null +++ b/sdk/sql/Azure.ResourceManager.Sql/README.md @@ -0,0 +1,80 @@ +# Microsoft Azure sql management client library for .NET + +**[Describe the service briefly first.]** + +This library follows the [new Azure SDK guidelines](https://azure.github.io/azure-sdk/general_introduction.html), and provides many core capabilities: + + - Support MSAL.NET, Azure.Identity is out of box for supporting MSAL.NET. + - Support [OpenTelemetry](https://opentelemetry.io/) for distributed tracing. + - HTTP pipeline with custom policies. + - Better error-handling. + - Support uniform telemetry across all languages. + +## Getting started + +### Install the package + +Install the Microsoft Azure sql management library for .NET with [NuGet](https://www.nuget.org/): + +```dotnetcli +dotnet add package Azure.ResourceManager.Sql --prerelease +``` + +### Prerequisites + +* You must have an [Microsoft Azure subscription](https://azure.microsoft.com/free/dotnet/). + +### Authenticate the Client + +To create an authenticated client and start interacting with Microsoft Azure resources, see the [quickstart guide here](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). + +## Key concepts + +Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azure.github.io/azure-sdk/dotnet_introduction.html) + +## Documentation + +Documentation is available to help you learn how to use this package: + +- [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). +- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). + +## Examples + +Code samples for using the management library for .NET can be found in the following locations +- [.NET Management Library Code Samples](https://aka.ms/azuresdk-net-mgmt-samples) + +## Troubleshooting + +- File an issue via [GitHub Issues](https://github.com/Azure/azure-sdk-for-net/issues). +- Check [previous questions](https://stackoverflow.com/questions/tagged/azure+.net) or ask new ones on Stack Overflow using Azure and .NET tags. + +## Next steps + +For more information about Microsoft Azure SDK, see [this website](https://azure.github.io/azure-sdk/). + +## Contributing + +For details on contributing to this repository, see the [contributing +guide][cg]. + +This project welcomes contributions and suggestions. Most contributions +require you to agree to a Contributor License Agreement (CLA) declaring +that you have the right to, and actually do, grant us the rights to use +your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine +whether you need to provide a CLA and decorate the PR appropriately +(for example, label, comment). Follow the instructions provided by the +bot. You'll only need to do this action once across all repositories +using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For +more information, see the [Code of Conduct FAQ][coc_faq] or contact + with any other questions or comments. + + +[cg]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/resourcemanager/Azure.ResourceManager/docs/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ \ No newline at end of file diff --git a/sdk/sql/Azure.ResourceManager.Sql/samples/Azure.ResourceManager.Sql.Samples.csproj b/sdk/sql/Azure.ResourceManager.Sql/samples/Azure.ResourceManager.Sql.Samples.csproj new file mode 100644 index 0000000000000..3c20915432a7f --- /dev/null +++ b/sdk/sql/Azure.ResourceManager.Sql/samples/Azure.ResourceManager.Sql.Samples.csproj @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/sdk/sql/Azure.ResourceManager.Sql/samples/autorest.tests.md b/sdk/sql/Azure.ResourceManager.Sql/samples/autorest.tests.md new file mode 100644 index 0000000000000..c7d30104f3d7a --- /dev/null +++ b/sdk/sql/Azure.ResourceManager.Sql/samples/autorest.tests.md @@ -0,0 +1,13 @@ +# Generated code configuration + +Run `dotnet build /t:GenerateTests` to generate code. + +# Azure.ResourceManager.sql.Tests + +> see https://aka.ms/autorest +``` yaml +require: ../src/autorest.md +include-x-ms-examples-original-file: true +testgen: + sample: true +``` \ No newline at end of file diff --git a/sdk/sql/Azure.ResourceManager.Sql/src/Azure.ResourceManager.Sql.csproj b/sdk/sql/Azure.ResourceManager.Sql/src/Azure.ResourceManager.Sql.csproj new file mode 100644 index 0000000000000..07edd9cb0eeea --- /dev/null +++ b/sdk/sql/Azure.ResourceManager.Sql/src/Azure.ResourceManager.Sql.csproj @@ -0,0 +1,8 @@ + + + 1.0.0-beta.1 + Azure.ResourceManager.Sql + Azure Resource Manager client SDK for Azure resource provider sql. + azure;management;arm;resource manager;sql + + diff --git a/sdk/sql/Azure.ResourceManager.Sql/src/Properties/AssemblyInfo.cs b/sdk/sql/Azure.ResourceManager.Sql/src/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000000..5acd428a4b94d --- /dev/null +++ b/sdk/sql/Azure.ResourceManager.Sql/src/Properties/AssemblyInfo.cs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.CompilerServices; + +[assembly: Azure.Core.AzureResourceProviderNamespace("sql")] + +[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")] +[assembly: InternalsVisibleTo("Azure.ResourceManager.Sql.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4")] diff --git a/sdk/sql/Azure.ResourceManager.Sql/src/autorest.md b/sdk/sql/Azure.ResourceManager.Sql/src/autorest.md new file mode 100644 index 0000000000000..326ef6fc40bcb --- /dev/null +++ b/sdk/sql/Azure.ResourceManager.Sql/src/autorest.md @@ -0,0 +1,49 @@ +# Generated code configuration + +Run `dotnet build /t:GenerateCode` to generate code. + +``` yaml +azure-arm: true +csharp: true +library-name: sql +namespace: Azure.ResourceManager.sql +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/sql/resource-manager/readme.md +output-folder: $(this-folder)/Generated +clear-output-folder: true +skip-csproj: true +modelerfour: + flatten-payloads: false + + + +format-by-name-rules: + 'tenantId': 'uuid' + 'ETag': 'etag' + 'location': 'azure-location' + '*Uri': 'Uri' + '*Uris': 'Uri' + +rename-rules: + CPU: Cpu + CPUs: Cpus + Os: OS + Ip: IP + Ips: IPs|ips + ID: Id + IDs: Ids + VM: Vm + VMs: Vms + Vmos: VmOS + VMScaleSet: VmScaleSet + DNS: Dns + VPN: Vpn + NAT: Nat + WAN: Wan + Ipv4: IPv4|ipv4 + Ipv6: IPv6|ipv6 + Ipsec: IPsec|ipsec + SSO: Sso + URI: Uri + Etag: ETag|etag + +``` diff --git a/sdk/sql/Azure.ResourceManager.Sql/tests/Azure.ResourceManager.Sql.Tests.csproj b/sdk/sql/Azure.ResourceManager.Sql/tests/Azure.ResourceManager.Sql.Tests.csproj new file mode 100644 index 0000000000000..41322cc398d94 --- /dev/null +++ b/sdk/sql/Azure.ResourceManager.Sql/tests/Azure.ResourceManager.Sql.Tests.csproj @@ -0,0 +1,5 @@ + + + + + diff --git a/sdk/sql/Azure.ResourceManager.Sql/tests/sqlManagementTestBase.cs b/sdk/sql/Azure.ResourceManager.Sql/tests/sqlManagementTestBase.cs new file mode 100644 index 0000000000000..3783b1fbf73f4 --- /dev/null +++ b/sdk/sql/Azure.ResourceManager.Sql/tests/sqlManagementTestBase.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core; +using Azure.Core.TestFramework; +using Azure.ResourceManager.Resources; +using Azure.ResourceManager.TestFramework; +using NUnit.Framework; +using System.Threading.Tasks; + +namespace Azure.ResourceManager.Sql.Tests +{ + public class sqlManagementTestBase : ManagementRecordedTestBase + { + protected ArmClient Client { get; private set; } + protected SubscriptionResource DefaultSubscription { get; private set; } + + protected sqlManagementTestBase(bool isAsync, RecordedTestMode mode) + : base(isAsync, mode) + { + } + + protected sqlManagementTestBase(bool isAsync) + : base(isAsync) + { + } + + [SetUp] + public async Task CreateCommonClient() + { + Client = GetArmClient(); + DefaultSubscription = await Client.GetDefaultSubscriptionAsync().ConfigureAwait(false); + } + + protected async Task CreateResourceGroup(SubscriptionResource subscription, string rgNamePrefix, AzureLocation location) + { + string rgName = Recording.GenerateAssetName(rgNamePrefix); + ResourceGroupData input = new ResourceGroupData(location); + var lro = await subscription.GetResourceGroups().CreateOrUpdateAsync(WaitUntil.Completed, rgName, input); + return lro.Value; + } + } +} diff --git a/sdk/sql/Azure.ResourceManager.Sql/tests/sqlManagementTestEnvironment.cs b/sdk/sql/Azure.ResourceManager.Sql/tests/sqlManagementTestEnvironment.cs new file mode 100644 index 0000000000000..dd237f334bc76 --- /dev/null +++ b/sdk/sql/Azure.ResourceManager.Sql/tests/sqlManagementTestEnvironment.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core.TestFramework; + +namespace Azure.ResourceManager.Sql.Tests +{ + public class sqlManagementTestEnvironment : TestEnvironment + { + } +} \ No newline at end of file diff --git a/sdk/sql/ci.mgmt.yml b/sdk/sql/ci.mgmt.yml new file mode 100644 index 0000000000000..fc64723280b52 --- /dev/null +++ b/sdk/sql/ci.mgmt.yml @@ -0,0 +1,24 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: none + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/sql/ci.mgmt.yml + - sdk/sql/Azure.ResourceManager.Sql/ + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: sql + LimitForPullRequest: true + Artifacts: + - name: Azure.ResourceManager.Sql + safeName: AzureResourceManagerSql