-
Notifications
You must be signed in to change notification settings - Fork 5.1k
[PostgreSQL] SDK upgrade for PostgreSQL flexible server to version 2022-03-08-privatepreview #31641
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
alanenriqueo
wants to merge
6
commits into
Azure:main
from
alanenriqueo:fspg-flexibleserver-2022-03-privatepreview
Closed
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
58e3242
Update PostgreSQL flexible version to 2022-03-08-privatepreview
alanenriqueo f907f44
Add fast provisioning flow
alanenriqueo 785cbfa
Change FastProvisioning to FastCreate
alanenriqueo 30331b5
Update CHANGELOG
alanenriqueo 42dbf73
Fix operation names and rename mappings
alanenriqueo 96e7c78
Simplify FastCreate method
alanenriqueo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
...l/Azure.ResourceManager.PostgreSql/api/Azure.ResourceManager.PostgreSql.netstandard2.0.cs
Large diffs are not rendered by default.
Oops, something went wrong.
77 changes: 77 additions & 0 deletions
77
...resql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Custom/FastCreate.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. | ||
|
|
||
| #nullable disable | ||
|
|
||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Text; | ||
| using System.Threading; | ||
| using System.Threading.Tasks; | ||
| using Azure.Core; | ||
| using Azure.Core.Pipeline; | ||
| using Azure.ResourceManager.Resources; | ||
|
|
||
| namespace Azure.ResourceManager.PostgreSql.FlexibleServers | ||
| { | ||
| public partial class PostgreSqlFlexibleServerCollection | ||
| { | ||
| /// <summary> | ||
| /// Creates a new server using fast provisioning method. | ||
| /// </summary> | ||
| /// <param name="waitUntil"> <see cref="WaitUntil.Completed"/> if the method should wait to return until the long-running operation has completed on the service; <see cref="WaitUntil.Started"/> if it should return after starting the operation. For more information on long-running operations, please see <see href="https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/LongRunningOperations.md"> Azure.Core Long-Running Operation samples</see>. </param> | ||
| /// <param name="data"> The required parameters for creating a server. </param> | ||
| /// <param name="cancellationToken"> The cancellation token to use. </param> | ||
| public virtual async Task<ArmOperation<PostgreSqlFlexibleServerResource>> FastCreateAsync(WaitUntil waitUntil, PostgreSqlFlexibleServerData data, CancellationToken cancellationToken = default) | ||
ArcturusZhang marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| { | ||
| Argument.AssertNotNull(data, nameof(data)); | ||
|
|
||
| using var scope = _postgreSqlFlexibleServerServersClientDiagnostics.CreateScope("PostgreSqlFlexibleServerCollection.FastCreate"); | ||
| scope.Start(); | ||
| try | ||
| { | ||
| var rg = Client.GetResourceGroupResource(ResourceGroupResource.CreateResourceIdentifier(Id.SubscriptionId, Id.ResourceGroupName)); | ||
|
|
||
| var cachedServerNameRequest = new Models.PostgreSqlFlexibleServerCachedServerNameContent(data.Version ?? Models.PostgreSqlFlexibleServerVersion.Ver12, data.Storage, data.Sku); | ||
| var cachedServerNameResponse = await rg.GetPostgreSqlFlexibleServerCachedServerNameAsync(data.Location, cachedServerNameRequest, cancellationToken).ConfigureAwait(false); | ||
| var serverName = cachedServerNameResponse.Value.Name; | ||
|
|
||
| return await CreateOrUpdateAsync(waitUntil, serverName, data, cancellationToken).ConfigureAwait(false); | ||
| } | ||
| catch (Exception e) | ||
| { | ||
| scope.Failed(e); | ||
| throw; | ||
| } | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Creates a new server using fast provisioning method. | ||
| /// </summary> | ||
| /// <param name="waitUntil"> <see cref="WaitUntil.Completed"/> if the method should wait to return until the long-running operation has completed on the service; <see cref="WaitUntil.Started"/> if it should return after starting the operation. For more information on long-running operations, please see <see href="https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/LongRunningOperations.md"> Azure.Core Long-Running Operation samples</see>. </param> | ||
| /// <param name="data"> The required parameters for creating a server. </param> | ||
| /// <param name="cancellationToken"> The cancellation token to use. </param> | ||
| public virtual ArmOperation<PostgreSqlFlexibleServerResource> FastCreate(WaitUntil waitUntil, PostgreSqlFlexibleServerData data, CancellationToken cancellationToken = default) | ||
| { | ||
| Argument.AssertNotNull(data, nameof(data)); | ||
|
|
||
| using var scope = _postgreSqlFlexibleServerServersClientDiagnostics.CreateScope("PostgreSqlFlexibleServerCollection.FastCreate"); | ||
| scope.Start(); | ||
| try | ||
| { | ||
| var rg = Client.GetResourceGroupResource(ResourceGroupResource.CreateResourceIdentifier(Id.SubscriptionId, Id.ResourceGroupName)); | ||
|
|
||
| var cachedServerNameRequest = new Models.PostgreSqlFlexibleServerCachedServerNameContent(data.Version ?? Models.PostgreSqlFlexibleServerVersion.Ver12, data.Storage, data.Sku); | ||
| var cachedServerNameResponse = rg.GetPostgreSqlFlexibleServerCachedServerName(data.Location, cachedServerNameRequest, cancellationToken); | ||
| var serverName = cachedServerNameResponse.Value.Name; | ||
|
|
||
| return CreateOrUpdate(waitUntil, serverName, data, cancellationToken); | ||
| } | ||
| catch (Exception e) | ||
| { | ||
| scope.Failed(e); | ||
| throw; | ||
| } | ||
| } | ||
| } | ||
| } | ||
91 changes: 72 additions & 19 deletions
91
...ostgreSql/src/PostgreSqlFlexibleServers/Generated/Extensions/FlexibleServersExtensions.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
60 changes: 60 additions & 0 deletions
60
...rc/PostgreSqlFlexibleServers/Generated/Extensions/ResourceGroupResourceExtensionClient.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update this to a new release day as the swagger has just been merged 20 mins ago
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And please also flip the pr from
drafttoReady for review