Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
# Release History

## 1.1.0-beta.1 (Unreleased)
## 1.1.0-beta.1 (2022-10-11)
Copy link
Member

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

Copy link
Member

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 draft to Ready for review


### Features Added

### Breaking Changes

### Bugs Fixed

### Other Changes
- Use tag flexibleserver-2022-03-privatepreview for PostgreSqlFlexibleServers.
- Added FastCreate custom function for fast provisioning feature.

## 1.0.0 (2022-09-05)

Expand Down

Large diffs are not rendered by default.

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)
{
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;
}
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading