From 0004fc363b60481b12a896d764099a79b69825d6 Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 25 Mar 2024 16:14:59 +0000 Subject: [PATCH] Autogen code --- src/Compute/Compute/ChangeLog.md | 6 ++++ .../Disk/Config/SetAzDiskSecurityProfile.cs | 36 ++++--------------- .../Compute/Generated/Models/PSDisk.cs | 26 ++------------ 3 files changed, 15 insertions(+), 53 deletions(-) diff --git a/src/Compute/Compute/ChangeLog.md b/src/Compute/Compute/ChangeLog.md index c9aee39449a1..1868810c6718 100644 --- a/src/Compute/Compute/ChangeLog.md +++ b/src/Compute/Compute/ChangeLog.md @@ -20,6 +20,12 @@ --> ## Upcoming Release +* Updated `Set-AzDiskSecurityProfile` cmdlet + - Added new business logic to set the SecurityType property to null by default unless the user specifies a value. If a user specifies a value, that value is assigned to SecurityType. + - This change affects all parameter sets on the cmdlet. + - Link to API tests for this feature: `{ ENTER LINK HERE }` +* Fixed `New-AzVmss` to correctly work when using `-EdgeZone` by creating the Load Balancer in the correct edge zone. +* Removed references to image aliases in `New-AzVM` and `New-AzVmss` to images that were removed. * Fixed `New-AzVmss` to correctly work when using `-EdgeZone` by creating the Load Balancer in the correct edge zone. * Removed references to image aliases in `New-AzVM` and `New-AzVmss` to images that were removed. diff --git a/src/Compute/Compute/Generated/Disk/Config/SetAzDiskSecurityProfile.cs b/src/Compute/Compute/Generated/Disk/Config/SetAzDiskSecurityProfile.cs index 47e72f79c7d6..8a7494a78aa2 100644 --- a/src/Compute/Compute/Generated/Disk/Config/SetAzDiskSecurityProfile.cs +++ b/src/Compute/Compute/Generated/Disk/Config/SetAzDiskSecurityProfile.cs @@ -1,17 +1,4 @@ -// ---------------------------------------------------------------------------------- -// -// Copyright Microsoft Corporation -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ---------------------------------------------------------------------------------- - + using System; using System.Collections.Generic; @@ -41,12 +28,12 @@ public class SetAzDiskSecurityProfile : Microsoft.Azure.Commands.ResourceManager public PSDisk Disk { get; set; } [Parameter( - Mandatory = true, + Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Gets or sets the SecurityType property. Possible values include: TrustedLaunch, ConfidentialVM_DiskEncryptedWithCustomerKey, ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey, ConfidentialVM_DiskEncryptedWithPlatformKey")] [PSArgumentCompleter("Standard", "TrustedLaunch", "ConfidentialVM_DiskEncryptedWithCustomerKey", "ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey", "ConfidentialVM_DiskEncryptedWithPlatformKey")] - public string SecurityType { get; set; } + public string SecurityType { get; set; } = null; [Parameter( Mandatory = false, @@ -64,9 +51,7 @@ protected override void ProcessRecord() private void Run() { - // At this time, it is impossible to set SecurityType to Standard ("") as it is a mandatory property on the backend. - // If Standard is used, then there should be no securityProfile at all for now. - if (SecurityType.ToLower() != ConstantValues.StandardSecurityType) + if (SecurityType != null) { if(this.Disk.SecurityProfile == null) { @@ -75,16 +60,6 @@ private void Run() this.Disk.SecurityProfile.SecurityType = SecurityType; } - // Allow the Standard scenario, which will be nulled out just before the .Net SDK create call for disks. - if (SecurityType.ToLower() == ConstantValues.StandardSecurityType) - { - if (this.Disk.SecurityProfile == null) - { - this.Disk.SecurityProfile = new DiskSecurityProfile(); - } - this.Disk.SecurityProfile.SecurityType = SecurityType; - } - if (this.IsParameterBound(c => c.SecureVMDiskEncryptionSet)) { if (this.Disk.SecurityProfile == null) @@ -98,4 +73,5 @@ private void Run() } } -} \ No newline at end of file +} + diff --git a/src/Compute/Compute/Generated/Models/PSDisk.cs b/src/Compute/Compute/Generated/Models/PSDisk.cs index d257855adaae..3c8fe4e4c4e8 100644 --- a/src/Compute/Compute/Generated/Models/PSDisk.cs +++ b/src/Compute/Compute/Generated/Models/PSDisk.cs @@ -1,23 +1,4 @@ -// -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// - -// Warning: This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if the -// code is regenerated. + using System; using System.Collections.Generic; @@ -28,7 +9,6 @@ namespace Microsoft.Azure.Commands.Compute.Automation.Models { public partial class PSDisk { - // Gets or sets the property of 'ResourceGroupName' public string ResourceGroupName { get @@ -73,11 +53,11 @@ public string ResourceGroupName public bool? BurstingEnabled { get; set; } public PSPurchasePlan PurchasePlan { get; set; } public bool? SupportsHibernation { get; set; } - public DiskSecurityProfile SecurityProfile { get; set; } + public DiskSecurityProfile SecurityProfile { get; set; } = null; public string PublicNetworkAccess { get; set; } public SupportedCapabilities SupportedCapabilities { get; set; } public string DataAccessAuthMode { get; set; } public double? CompletionPercent { get; set; } public bool? OptimizedForFrequentAttach { get; set; } } -} +} \ No newline at end of file