Skip to content
Merged
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
9 changes: 3 additions & 6 deletions sdk/nginx/Azure.ResourceManager.Nginx/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
# Release History

## 1.1.0-beta.4 (Unreleased)
## 1.1.0-beta.4 (2025-12-16)

### Features Added

### Breaking Changes

### Bugs Fixed

### Other Changes
- Upgraded api-version 2025-03-01-preview.
- Make `Azure.ResourceManager.Nginx` AOT compatible.

## 1.1.0-beta.3 (2025-02-14)

Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion sdk/nginx/Azure.ResourceManager.Nginx/assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "net",
"TagPrefix": "net/nginx/Azure.ResourceManager.Nginx",
"Tag": "net/nginx/Azure.ResourceManager.Nginx_a74a2ec3bb"
"Tag": "net/nginx/Azure.ResourceManager.Nginx_9bb317f9e4"
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<Version>1.1.0-beta.4</Version>
<!--The ApiCompatVersion is managed automatically and should not generally be modified manually.-->
<!-- <ApiCompatVersion>1.0.0</ApiCompatVersion> -->
<ApiCompatVersion>1.0.0</ApiCompatVersion>
<PackageId>Azure.ResourceManager.Nginx</PackageId>
<Description>Microsoft Azure Resource Manager client SDK for Azure resource provider Nginx.NginxPlus.</Description>
<PackageTags>azure;management;arm;resource manager;nginx</PackageTags>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

#nullable disable

using System;
using System.Collections.Generic;
using System.Linq;
using Azure;
using Azure.Core;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Nginx;
using Azure.ResourceManager.Resources.Models;

namespace Azure.ResourceManager.Nginx.Models
{
/// <summary> A factory class for creating instances of the models for mocking. </summary>
public static partial class ArmNginxModelFactory
{
/// <summary> Initializes a new instance of <see cref="Nginx.NginxConfigurationData"/>. </summary>
/// <param name="id"> The id. </param>
/// <param name="name"> The name. </param>
/// <param name="resourceType"> The resourceType. </param>
/// <param name="systemData"> The systemData. </param>
/// <param name="properties"></param>
/// <param name="location"></param>
/// <returns> A new <see cref="Nginx.NginxConfigurationData"/> instance for mocking. </returns>
public static NginxConfigurationData NginxConfigurationData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, NginxConfigurationProperties properties, AzureLocation? location)
=> NginxConfigurationData(id, name, resourceType, systemData, properties);

/// <summary> Initializes a new instance of <see cref="Nginx.NginxDeploymentData"/>. </summary>
/// <param name="id"> The id. </param>
/// <param name="name"> The name. </param>
/// <param name="resourceType"> The resourceType. </param>
/// <param name="systemData"> The systemData. </param>
/// <param name="tags"> The tags. </param>
/// <param name="location"> The location. </param>
/// <param name="identity"> Gets or sets the identity. </param>
/// <param name="properties"></param>
/// <param name="skuName"></param>
/// <returns> A new <see cref="Nginx.NginxDeploymentData"/> instance for mocking. </returns>
public static NginxDeploymentData NginxDeploymentData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary<string, string> tags, AzureLocation location, ManagedServiceIdentity identity, NginxDeploymentProperties properties = default, string skuName = default)
=> NginxDeploymentData(id, name, resourceType, systemData, tags, location, properties, identity, skuName);

/// <summary> Initializes a new instance of <see cref="Models.NginxCertificateProperties"/>. </summary>
/// <param name="provisioningState"></param>
/// <param name="keyVirtualPath"></param>
/// <param name="certificateVirtualPath"></param>
/// <param name="keyVaultSecretId"></param>
/// <returns> A new <see cref="Models.NginxCertificateProperties"/> instance for mocking. </returns>
public static NginxCertificateProperties NginxCertificateProperties(NginxProvisioningState? provisioningState, string keyVirtualPath, string certificateVirtualPath, string keyVaultSecretId)
=> NginxCertificateProperties(provisioningState, keyVirtualPath, certificateVirtualPath, keyVaultSecretId, null, null, null, null);

/// <summary> Initializes a new instance of <see cref="Models.NginxDeploymentProperties"/>. </summary>
/// <param name="provisioningState"></param>
/// <param name="nginxVersion"></param>
/// <param name="managedResourceGroup"> The managed resource group to deploy VNet injection related network resources. </param>
/// <param name="networkProfile"></param>
/// <param name="ipAddress"> The IP address of the deployment. </param>
/// <param name="enableDiagnosticsSupport"></param>
/// <param name="loggingStorageAccount"></param>
/// <param name="scalingCapacity"></param>
/// <param name="userPreferredEmail"></param>
/// <returns> A new <see cref="Models.NginxDeploymentProperties"/> instance for mocking. </returns>
public static NginxDeploymentProperties NginxDeploymentProperties(NginxProvisioningState? provisioningState, string nginxVersion, string managedResourceGroup, NginxNetworkProfile networkProfile, string ipAddress, bool? enableDiagnosticsSupport, NginxStorageAccount loggingStorageAccount, int? scalingCapacity, string userPreferredEmail = default)
=> NginxDeploymentProperties(provisioningState, nginxVersion, networkProfile, ipAddress, enableDiagnosticsSupport, loggingStorageAccount, null, null, userPreferredEmail, null, null);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

#nullable disable

namespace Azure.ResourceManager.Nginx.Models
{
/// <summary> Nginx Configuration File. </summary>
[Microsoft.TypeSpec.Generator.Customizations.CodeGenSerialization(nameof(ContentHash), "contentHash")]
public partial class NginxConfigurationFile
{
/// <summary> Gets or sets the Content. </summary>
public string ContentHash { get; set; } // The service returns a "contentHash" field that is missing from the spec
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

#nullable disable

using System.ComponentModel;

namespace Azure.ResourceManager.Nginx.Models
{
/// <summary> Nginx Deployment Properties. </summary>
public partial class NginxDeploymentProperties
{
/// <summary> The managed resource group to deploy VNet injection related network resources. </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public string ManagedResourceGroup { get; set; } // This was a spec breaking change, so we’re adding the property back to restore backward compatibility.

/// <summary> Gets or sets the scaling capacity. </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public int? ScalingCapacity
Comment thread
ArthurMa1978 marked this conversation as resolved.
{
get => ScalingProperties is null ? default : ScalingProperties.Capacity;
set
{
if (ScalingProperties is null)
ScalingProperties = new NginxDeploymentScalingProperties();
ScalingProperties.Capacity = value;
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

#nullable disable

using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Text.Json;
using Azure.Core;
using Azure.ResourceManager.Resources.Models;

namespace Azure.ResourceManager.Nginx.Models
{
/// <summary> Nginx Frontend IP Configuration. </summary>
[Microsoft.TypeSpec.Generator.Customizations.CodeGenSerialization(nameof(PublicIPAddresses), DeserializationValueHook = nameof(DeserializePublicIPAddresses))] // CodeGen issue, should be removed when fixed
public partial class NginxFrontendIPConfiguration
{
internal static WritableSubResource DeserializeWritableSubResource(JsonElement element)
{
ResourceIdentifier id = null;
foreach (JsonProperty item in element.EnumerateObject())
{
if (item.NameEquals("id") && item.Value.ValueKind != JsonValueKind.Null)
{
id = new ResourceIdentifier(item.Value.GetString());
}
}

return new WritableSubResource() { Id = id };
}
Comment thread
ArcturusZhang marked this conversation as resolved.

[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static void DeserializePublicIPAddresses(JsonProperty property, ref IList<WritableSubResource> publicIPAddresses)
{
if (property.Value.ValueKind == JsonValueKind.Null)
{
return;
}
List<WritableSubResource> array = new List<WritableSubResource>();
foreach (var item in property.Value.EnumerateArray())
{
array.Add(DeserializeWritableSubResource(item));
}
publicIPAddresses = array;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

#nullable disable

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Azure.ResourceManager.Nginx.Models;

namespace Azure.ResourceManager.Nginx
{
/// <summary>
/// A class representing a collection of <see cref="NginxConfigurationResource"/> and their operations.
/// Each <see cref="NginxConfigurationResource"/> in the collection will belong to the same instance of <see cref="NginxDeploymentResource"/>.
/// To get a <see cref="NginxConfigurationCollection"/> instance call the GetNginxConfigurations method from an instance of <see cref="NginxDeploymentResource"/>.
/// </summary>
public partial class NginxConfigurationCollection : ArmCollection, IEnumerable<NginxConfigurationResource>, IAsyncEnumerable<NginxConfigurationResource>
{
/// <summary>
/// Create or update the NGINX configuration for given NGINX deployment
/// <list type="bullet">
/// <item>
/// <term>Request Path</term>
/// <description>/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations/{configurationName}</description>
/// </item>
/// <item>
/// <term>Operation Id</term>
/// <description>Configurations_CreateOrUpdate</description>
/// </item>
/// </list>
/// </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="configurationName"> The name of configuration, only 'default' is supported value due to the singleton of NGINX conf. </param>
/// <param name="data"> The NGINX configuration. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
/// <exception cref="ArgumentException"> <paramref name="configurationName"/> is an empty string, and was expected to be non-empty. </exception>
/// <exception cref="ArgumentNullException"> <paramref name="configurationName"/> or <paramref name="data"/> is null. </exception>
public virtual async Task<ArmOperation<NginxConfigurationResource>> CreateOrUpdateAsync(WaitUntil waitUntil, string configurationName, NginxConfigurationData data, CancellationToken cancellationToken = default)
=> await CreateOrUpdateAsync(waitUntil, configurationName,
new NginxConfigurationCreateOrUpdateContent(data.Id, data.Name, data.ResourceType,
new NginxConfigurationCreateOrUpdateProperties(data.Properties.ProvisioningState, data.Properties.Files,
data.Properties.ProtectedFiles?.Select(file => new NginxConfigurationContentProtectedFile(null, file.VirtualPath, file.ContentHash, null)).ToList(),
data.Properties.Package, data.Properties.RootFile, null),
data.SystemData, null),
cancellationToken).ConfigureAwait(false);

/// <summary>
/// Create or update the NGINX configuration for given NGINX deployment
/// <list type="bullet">
/// <item>
/// <term>Request Path</term>
/// <description>/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations/{configurationName}</description>
/// </item>
/// <item>
/// <term>Operation Id</term>
/// <description>Configurations_CreateOrUpdate</description>
/// </item>
/// </list>
/// </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="configurationName"> The name of configuration, only 'default' is supported value due to the singleton of NGINX conf. </param>
/// <param name="data"> The NGINX configuration. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
/// <exception cref="ArgumentException"> <paramref name="configurationName"/> is an empty string, and was expected to be non-empty. </exception>
/// <exception cref="ArgumentNullException"> <paramref name="configurationName"/> or <paramref name="data"/> is null. </exception>
public virtual ArmOperation<NginxConfigurationResource> CreateOrUpdate(WaitUntil waitUntil, string configurationName, NginxConfigurationData data, CancellationToken cancellationToken = default)
=> CreateOrUpdate(waitUntil, configurationName,
new NginxConfigurationCreateOrUpdateContent(data.Id, data.Name, data.ResourceType,
new NginxConfigurationCreateOrUpdateProperties(data.Properties.ProvisioningState, data.Properties.Files,
data.Properties.ProtectedFiles?.Select(file => new NginxConfigurationContentProtectedFile(null, file.VirtualPath, file.ContentHash, null)).ToList(),
data.Properties.Package, data.Properties.RootFile, null),
data.SystemData, null),
cancellationToken);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

#nullable disable

using System.ComponentModel;
using Azure.Core;
using Azure.ResourceManager.Models;

namespace Azure.ResourceManager.Nginx
{
/// <summary> A class representing the NginxConfiguration data model. </summary>
public partial class NginxConfigurationData : ResourceData
{
/// <summary> Gets or sets the location. </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public AzureLocation? Location { get; set; } // This was a spec breaking change, so we’re adding the property back to restore backward compatibility.
}
}
Loading