From 1d06b596ce081ccbd8aca3ebdc115e8782f8d35c Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Sat, 8 Nov 2025 02:04:58 +0000 Subject: [PATCH] code and test --- sdk/compute/azure-mgmt-compute/CHANGELOG.md | 4 + sdk/compute/azure-mgmt-compute/_metadata.json | 6 +- .../apiview-properties.json | 2 +- .../mgmt/compute/_utils/serialization.py | 2 +- .../azure/mgmt/compute/_version.py | 2 +- .../operations/_resource_skus_operations.py | 5 +- .../azure/mgmt/compute/models/_models_py3.py | 87 ++++++++++++++++--- .../operations/_resource_skus_operations.py | 5 +- ...store_point_collection_create_or_update.py | 3 +- ...point_collection_update_maximum_set_gen.py | 3 +- .../restore_point_create.py | 3 +- ...al_machine_create_with_fips1403_enabled.py | 83 ++++++++++++++++++ ...nt_restore_point_collections_operations.py | 6 ++ ...tore_point_collections_operations_async.py | 6 ++ ...te_management_restore_points_operations.py | 2 + ...agement_restore_points_operations_async.py | 2 + ...irtual_machine_scale_set_vms_operations.py | 6 +- ..._machine_scale_set_vms_operations_async.py | 6 +- ...t_virtual_machine_scale_sets_operations.py | 12 ++- ...ual_machine_scale_sets_operations_async.py | 12 ++- ..._management_virtual_machines_operations.py | 12 ++- ...ement_virtual_machines_operations_async.py | 12 ++- sdk/compute/azure-mgmt-compute/pyproject.toml | 2 +- 23 files changed, 250 insertions(+), 33 deletions(-) create mode 100644 sdk/compute/azure-mgmt-compute/generated_samples/virtual_machine_examples/virtual_machine_create_with_fips1403_enabled.py diff --git a/sdk/compute/azure-mgmt-compute/CHANGELOG.md b/sdk/compute/azure-mgmt-compute/CHANGELOG.md index 6bcddf970e28..31e66798545a 100644 --- a/sdk/compute/azure-mgmt-compute/CHANGELOG.md +++ b/sdk/compute/azure-mgmt-compute/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History +## 0.0.0 (2025-11-17) + +change log generation was timeout!!! You need to write it manually!!! + ## 37.0.1 (2025-10-09) ### Bugs Fixed diff --git a/sdk/compute/azure-mgmt-compute/_metadata.json b/sdk/compute/azure-mgmt-compute/_metadata.json index 04201508acac..547147e1f0e5 100644 --- a/sdk/compute/azure-mgmt-compute/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/_metadata.json @@ -1,11 +1,11 @@ { - "commit": "3ed4c07ba75ceba9b01d5cf2e4bed0ea988d3c52", + "commit": "a49631915059dad95cfa78cf100c1201e9760b43", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest": "3.10.2", "use": [ - "@autorest/python@6.40.0", + "@autorest/python@6.42.0", "@autorest/modelerfour@4.27.0" ], - "autorest_command": "autorest specification/compute/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --package-mode=azure-mgmt --python --python-sdks-folder=/mnt/vss/_work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.40.0 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False", + "autorest_command": "autorest specification/compute/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --package-mode=azure-mgmt --python --python-sdks-folder=/mnt/vss/_work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.42.0 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False", "readme": "specification/compute/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/compute/azure-mgmt-compute/apiview-properties.json b/sdk/compute/azure-mgmt-compute/apiview-properties.json index 533b7bed8324..ddb55a25ad14 100644 --- a/sdk/compute/azure-mgmt-compute/apiview-properties.json +++ b/sdk/compute/azure-mgmt-compute/apiview-properties.json @@ -553,6 +553,7 @@ "azure.mgmt.compute.models.PatchOperationStatus": null, "azure.mgmt.compute.models.ProximityPlacementGroupType": null, "azure.mgmt.compute.models.RestorePointEncryptionType": null, + "azure.mgmt.compute.models.SnapshotAccessState": null, "azure.mgmt.compute.models.OperatingSystemType": null, "azure.mgmt.compute.models.ConsistencyModeTypes": null, "azure.mgmt.compute.models.DedicatedHostLicenseTypes": null, @@ -593,7 +594,6 @@ "azure.mgmt.compute.models.AvailabilityPolicyDiskDelay": null, "azure.mgmt.compute.models.SnapshotStorageAccountTypes": null, "azure.mgmt.compute.models.CopyCompletionErrorReason": null, - "azure.mgmt.compute.models.SnapshotAccessState": null, "azure.mgmt.compute.models.ExtendedLocationType": null, "azure.mgmt.compute.models.ResourceSkuRestrictionsType": null, "azure.mgmt.compute.models.ResourceSkuRestrictionsReasonCode": null, diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/_utils/serialization.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/_utils/serialization.py index 5f250836cf4b..ff543ed937ff 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/_utils/serialization.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/_utils/serialization.py @@ -787,7 +787,7 @@ def serialize_data(self, data, data_type, **kwargs): # If dependencies is empty, try with current data class # It has to be a subclass of Enum anyway - enum_type = self.dependencies.get(data_type, data.__class__) + enum_type = self.dependencies.get(data_type, cast(type, data.__class__)) if issubclass(enum_type, Enum): return Serializer.serialize_enum(data, enum_obj=enum_type) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/_version.py index 63ccf87806f7..fb6c13e9c00f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/_version.py @@ -5,4 +5,4 @@ # license information. # -------------------------------------------------------------------------- -VERSION = "37.0.1" +VERSION = "0.0.0" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/aio/operations/_resource_skus_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/aio/operations/_resource_skus_operations.py index bb08824c2720..db03a012a131 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/aio/operations/_resource_skus_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/aio/operations/_resource_skus_operations.py @@ -120,7 +120,10 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/models/_models_py3.py index 26282bc24d4b..0677e0d076ba 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/models/_models_py3.py @@ -275,15 +275,25 @@ class AdditionalCapabilities(_serialization.Model): :vartype ultra_ssd_enabled: bool :ivar hibernation_enabled: The flag that enables or disables hibernation capability on the VM. :vartype hibernation_enabled: bool + :ivar enable_fips1403_encryption: The flag enables the usage of FIPS 140-3 compliant + cryptography on the protectedSettings of an extension. Learn more at: + https://aka.ms/linuxagentfipssupport. + :vartype enable_fips1403_encryption: bool """ _attribute_map = { "ultra_ssd_enabled": {"key": "ultraSSDEnabled", "type": "bool"}, "hibernation_enabled": {"key": "hibernationEnabled", "type": "bool"}, + "enable_fips1403_encryption": {"key": "enableFips1403Encryption", "type": "bool"}, } def __init__( - self, *, ultra_ssd_enabled: Optional[bool] = None, hibernation_enabled: Optional[bool] = None, **kwargs: Any + self, + *, + ultra_ssd_enabled: Optional[bool] = None, + hibernation_enabled: Optional[bool] = None, + enable_fips1403_encryption: Optional[bool] = None, + **kwargs: Any ) -> None: """ :keyword ultra_ssd_enabled: The flag that enables or disables a capability to have one or more @@ -294,10 +304,15 @@ def __init__( :keyword hibernation_enabled: The flag that enables or disables hibernation capability on the VM. :paramtype hibernation_enabled: bool + :keyword enable_fips1403_encryption: The flag enables the usage of FIPS 140-3 compliant + cryptography on the protectedSettings of an extension. Learn more at: + https://aka.ms/linuxagentfipssupport. + :paramtype enable_fips1403_encryption: bool """ super().__init__(**kwargs) self.ultra_ssd_enabled = ultra_ssd_enabled self.hibernation_enabled = hibernation_enabled + self.enable_fips1403_encryption = enable_fips1403_encryption class AdditionalReplicaSet(_serialization.Model): @@ -3768,8 +3783,6 @@ def __init__( class DataDisk(_serialization.Model): """Describes a data disk. - Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to server. :ivar lun: Specifies the logical unit number of the data disk. This value is used to identify @@ -3814,12 +3827,10 @@ class DataDisk(_serialization.Model): VirtualMachine/VirtualMachineScaleset. :vartype to_be_detached: bool :ivar disk_iops_read_write: Specifies the Read-Write IOPS for the managed disk when - StorageAccountType is UltraSSD_LRS. Returned only for VirtualMachine ScaleSet VM disks. Can be - updated only via updates to the VirtualMachine Scale Set. + StorageAccountType is UltraSSD_LRS. :vartype disk_iops_read_write: int :ivar disk_m_bps_read_write: Specifies the bandwidth in MB per second for the managed disk when - StorageAccountType is UltraSSD_LRS. Returned only for VirtualMachine ScaleSet VM disks. Can be - updated only via updates to the VirtualMachine Scale Set. + StorageAccountType is UltraSSD_LRS. :vartype disk_m_bps_read_write: int :ivar detach_option: Specifies the detach behavior to be used while detaching a disk or which is already in the process of detachment from the virtual machine. Supported values: @@ -3840,8 +3851,6 @@ class DataDisk(_serialization.Model): _validation = { "lun": {"required": True}, "create_option": {"required": True}, - "disk_iops_read_write": {"readonly": True}, - "disk_m_bps_read_write": {"readonly": True}, } _attribute_map = { @@ -3876,6 +3885,8 @@ def __init__( managed_disk: Optional["_models.ManagedDiskParameters"] = None, source_resource: Optional["_models.ApiEntityReference"] = None, to_be_detached: Optional[bool] = None, + disk_iops_read_write: Optional[int] = None, + disk_m_bps_read_write: Optional[int] = None, detach_option: Optional[Union[str, "_models.DiskDetachOptionTypes"]] = None, delete_option: Optional[Union[str, "_models.DiskDeleteOptionTypes"]] = None, **kwargs: Any @@ -3922,6 +3933,12 @@ def __init__( :keyword to_be_detached: Specifies whether the data disk is in process of detachment from the VirtualMachine/VirtualMachineScaleset. :paramtype to_be_detached: bool + :keyword disk_iops_read_write: Specifies the Read-Write IOPS for the managed disk when + StorageAccountType is UltraSSD_LRS. + :paramtype disk_iops_read_write: int + :keyword disk_m_bps_read_write: Specifies the bandwidth in MB per second for the managed disk + when StorageAccountType is UltraSSD_LRS. + :paramtype disk_m_bps_read_write: int :keyword detach_option: Specifies the detach behavior to be used while detaching a disk or which is already in the process of detachment from the virtual machine. Supported values: **ForceDetach.** detachOption: **ForceDetach** is applicable only for managed data disks. If a @@ -3949,8 +3966,8 @@ def __init__( self.managed_disk = managed_disk self.source_resource = source_resource self.to_be_detached = to_be_detached - self.disk_iops_read_write: Optional[int] = None - self.disk_m_bps_read_write: Optional[int] = None + self.disk_iops_read_write = disk_iops_read_write + self.disk_m_bps_read_write = disk_m_bps_read_write self.detach_option = detach_option self.delete_option = delete_option @@ -6239,12 +6256,17 @@ class DiskRestorePointInstanceView(_serialization.Model): :ivar id: Disk restore point Id. :vartype id: str + :ivar snapshot_access_state: The state of snapshot which determines the access availability of + the snapshot. Known values are: "Unknown", "Pending", "Available", "InstantAccess", and + "AvailableWithInstantAccess". + :vartype snapshot_access_state: str or ~azure.mgmt.compute.models.SnapshotAccessState :ivar replication_status: The disk restore point replication status information. :vartype replication_status: ~azure.mgmt.compute.models.DiskRestorePointReplicationStatus """ _attribute_map = { "id": {"key": "id", "type": "str"}, + "snapshot_access_state": {"key": "snapshotAccessState", "type": "str"}, "replication_status": {"key": "replicationStatus", "type": "DiskRestorePointReplicationStatus"}, } @@ -6252,17 +6274,23 @@ def __init__( self, *, id: Optional[str] = None, # pylint: disable=redefined-builtin + snapshot_access_state: Optional[Union[str, "_models.SnapshotAccessState"]] = None, replication_status: Optional["_models.DiskRestorePointReplicationStatus"] = None, **kwargs: Any ) -> None: """ :keyword id: Disk restore point Id. :paramtype id: str + :keyword snapshot_access_state: The state of snapshot which determines the access availability + of the snapshot. Known values are: "Unknown", "Pending", "Available", "InstantAccess", and + "AvailableWithInstantAccess". + :paramtype snapshot_access_state: str or ~azure.mgmt.compute.models.SnapshotAccessState :keyword replication_status: The disk restore point replication status information. :paramtype replication_status: ~azure.mgmt.compute.models.DiskRestorePointReplicationStatus """ super().__init__(**kwargs) self.id = id + self.snapshot_access_state = snapshot_access_state self.replication_status = replication_status @@ -15558,6 +15586,10 @@ class RestorePoint(ProxyResource): :vartype source_restore_point: ~azure.mgmt.compute.models.ApiEntityReference :ivar instance_view: The restore point instance view. :vartype instance_view: ~azure.mgmt.compute.models.RestorePointInstanceView + :ivar instant_access_duration_minutes: This property determines the time in minutes the + snapshot is retained as instant access for restoring Premium SSD v2 or Ultra disk with fast + restore performance in this restore point. + :vartype instant_access_duration_minutes: int """ _validation = { @@ -15581,6 +15613,7 @@ class RestorePoint(ProxyResource): "time_created": {"key": "properties.timeCreated", "type": "iso-8601"}, "source_restore_point": {"key": "properties.sourceRestorePoint", "type": "ApiEntityReference"}, "instance_view": {"key": "properties.instanceView", "type": "RestorePointInstanceView"}, + "instant_access_duration_minutes": {"key": "properties.instantAccessDurationMinutes", "type": "int"}, } def __init__( @@ -15591,6 +15624,7 @@ def __init__( consistency_mode: Optional[Union[str, "_models.ConsistencyModeTypes"]] = None, time_created: Optional[datetime.datetime] = None, source_restore_point: Optional["_models.ApiEntityReference"] = None, + instant_access_duration_minutes: Optional[int] = None, **kwargs: Any ) -> None: """ @@ -15610,6 +15644,10 @@ def __init__( :keyword source_restore_point: Resource Id of the source restore point from which a copy needs to be created. :paramtype source_restore_point: ~azure.mgmt.compute.models.ApiEntityReference + :keyword instant_access_duration_minutes: This property determines the time in minutes the + snapshot is retained as instant access for restoring Premium SSD v2 or Ultra disk with fast + restore performance in this restore point. + :paramtype instant_access_duration_minutes: int """ super().__init__(**kwargs) self.exclude_disks = exclude_disks @@ -15619,6 +15657,7 @@ def __init__( self.time_created = time_created self.source_restore_point = source_restore_point self.instance_view: Optional["_models.RestorePointInstanceView"] = None + self.instant_access_duration_minutes = instant_access_duration_minutes class RestorePointCollection(TrackedResource): @@ -15653,6 +15692,11 @@ class RestorePointCollection(TrackedResource): :ivar restore_points: A list containing all restore points created under this restore point collection. :vartype restore_points: list[~azure.mgmt.compute.models.RestorePoint] + :ivar instant_access: This property determines whether instant access snapshot is enabled for + restore points created under this restore point collection for Premium SSD v2 or Ultra disk. + Instant access snapshot for Premium SSD v2 or Ultra disk is instantaneously available for + restoring disk with fast restore performance. + :vartype instant_access: bool """ _validation = { @@ -15677,6 +15721,7 @@ class RestorePointCollection(TrackedResource): "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, "restore_point_collection_id": {"key": "properties.restorePointCollectionId", "type": "str"}, "restore_points": {"key": "properties.restorePoints", "type": "[RestorePoint]"}, + "instant_access": {"key": "properties.instantAccess", "type": "bool"}, } def __init__( @@ -15685,6 +15730,7 @@ def __init__( location: str, tags: Optional[dict[str, str]] = None, source: Optional["_models.RestorePointCollectionSourceProperties"] = None, + instant_access: Optional[bool] = None, **kwargs: Any ) -> None: """ @@ -15695,12 +15741,18 @@ def __init__( :keyword source: The properties of the source resource that this restore point collection is created from. :paramtype source: ~azure.mgmt.compute.models.RestorePointCollectionSourceProperties + :keyword instant_access: This property determines whether instant access snapshot is enabled + for restore points created under this restore point collection for Premium SSD v2 or Ultra + disk. Instant access snapshot for Premium SSD v2 or Ultra disk is instantaneously available for + restoring disk with fast restore performance. + :paramtype instant_access: bool """ super().__init__(tags=tags, location=location, **kwargs) self.source = source self.provisioning_state: Optional[str] = None self.restore_point_collection_id: Optional[str] = None self.restore_points: Optional[list["_models.RestorePoint"]] = None + self.instant_access = instant_access class RestorePointCollectionListResult(_serialization.Model): @@ -15786,6 +15838,11 @@ class RestorePointCollectionUpdate(UpdateResource): :ivar restore_points: A list containing all restore points created under this restore point collection. :vartype restore_points: list[~azure.mgmt.compute.models.RestorePoint] + :ivar instant_access: This property determines whether instant access snapshot is enabled for + restore points created under this restore point collection for Premium SSD v2 or Ultra disk. + Instant access snapshot for Premium SSD v2 or Ultra disk is instantaneously available for + restoring disk with fast restore performance. + :vartype instant_access: bool """ _validation = { @@ -15800,6 +15857,7 @@ class RestorePointCollectionUpdate(UpdateResource): "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, "restore_point_collection_id": {"key": "properties.restorePointCollectionId", "type": "str"}, "restore_points": {"key": "properties.restorePoints", "type": "[RestorePoint]"}, + "instant_access": {"key": "properties.instantAccess", "type": "bool"}, } def __init__( @@ -15807,6 +15865,7 @@ def __init__( *, tags: Optional[dict[str, str]] = None, source: Optional["_models.RestorePointCollectionSourceProperties"] = None, + instant_access: Optional[bool] = None, **kwargs: Any ) -> None: """ @@ -15815,12 +15874,18 @@ def __init__( :keyword source: The properties of the source resource that this restore point collection is created from. :paramtype source: ~azure.mgmt.compute.models.RestorePointCollectionSourceProperties + :keyword instant_access: This property determines whether instant access snapshot is enabled + for restore points created under this restore point collection for Premium SSD v2 or Ultra + disk. Instant access snapshot for Premium SSD v2 or Ultra disk is instantaneously available for + restoring disk with fast restore performance. + :paramtype instant_access: bool """ super().__init__(tags=tags, **kwargs) self.source = source self.provisioning_state: Optional[str] = None self.restore_point_collection_id: Optional[str] = None self.restore_points: Optional[list["_models.RestorePoint"]] = None + self.instant_access = instant_access class RestorePointEncryption(_serialization.Model): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/operations/_resource_skus_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/operations/_resource_skus_operations.py index 3e09e6f31b6b..14927fc97dcf 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/operations/_resource_skus_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/operations/_resource_skus_operations.py @@ -158,7 +158,10 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response diff --git a/sdk/compute/azure-mgmt-compute/generated_samples/restore_point_examples/restore_point_collection_create_or_update.py b/sdk/compute/azure-mgmt-compute/generated_samples/restore_point_examples/restore_point_collection_create_or_update.py index a256206c702b..02cf4f2ec7ca 100644 --- a/sdk/compute/azure-mgmt-compute/generated_samples/restore_point_examples/restore_point_collection_create_or_update.py +++ b/sdk/compute/azure-mgmt-compute/generated_samples/restore_point_examples/restore_point_collection_create_or_update.py @@ -37,9 +37,10 @@ def main(): parameters={ "location": "norwayeast", "properties": { + "instantAccess": True, "source": { "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM" - } + }, }, "tags": {"myTag1": "tagValue1"}, }, diff --git a/sdk/compute/azure-mgmt-compute/generated_samples/restore_point_examples/restore_point_collection_update_maximum_set_gen.py b/sdk/compute/azure-mgmt-compute/generated_samples/restore_point_examples/restore_point_collection_update_maximum_set_gen.py index b5694335a71b..437e154f87bd 100644 --- a/sdk/compute/azure-mgmt-compute/generated_samples/restore_point_examples/restore_point_collection_update_maximum_set_gen.py +++ b/sdk/compute/azure-mgmt-compute/generated_samples/restore_point_examples/restore_point_collection_update_maximum_set_gen.py @@ -36,9 +36,10 @@ def main(): restore_point_collection_name="aaaaaaaaaaaaaaaaaaaa", parameters={ "properties": { + "instantAccess": True, "source": { "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM" - } + }, }, "tags": {"key8536": "aaaaaaaaaaaaaaaaaaa"}, }, diff --git a/sdk/compute/azure-mgmt-compute/generated_samples/restore_point_examples/restore_point_create.py b/sdk/compute/azure-mgmt-compute/generated_samples/restore_point_examples/restore_point_create.py index 79df28f277d7..0cfa69f9de90 100644 --- a/sdk/compute/azure-mgmt-compute/generated_samples/restore_point_examples/restore_point_create.py +++ b/sdk/compute/azure-mgmt-compute/generated_samples/restore_point_examples/restore_point_create.py @@ -41,7 +41,8 @@ def main(): { "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/disk123" } - ] + ], + "instantAccessDurationMinutes": 120, } }, ).result() diff --git a/sdk/compute/azure-mgmt-compute/generated_samples/virtual_machine_examples/virtual_machine_create_with_fips1403_enabled.py b/sdk/compute/azure-mgmt-compute/generated_samples/virtual_machine_examples/virtual_machine_create_with_fips1403_enabled.py new file mode 100644 index 000000000000..43b37cead5bf --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/generated_samples/virtual_machine_examples/virtual_machine_create_with_fips1403_enabled.py @@ -0,0 +1,83 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.compute import ComputeManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-compute +# USAGE + python virtual_machine_create_with_fips1403_enabled.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ComputeManagementClient( + credential=DefaultAzureCredential(), + subscription_id="{subscription-id}", + ) + + response = client.virtual_machines.begin_create_or_update( + resource_group_name="myResourceGroup", + vm_name="{vm-name}", + parameters={ + "location": "eastus2euap", + "properties": { + "additionalCapabilities": {"enableFips1403Encryption": True}, + "diagnosticsProfile": { + "bootDiagnostics": { + "enabled": True, + "storageUri": "http://{existing-storage-account-name}.blob.core.windows.net", + } + }, + "hardwareProfile": {"vmSize": "Standard_D2s_v3"}, + "networkProfile": { + "networkInterfaces": [ + { + "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + "properties": {"primary": True}, + } + ] + }, + "osProfile": { + "adminPassword": "{your-password}", + "adminUsername": "{your-username}", + "computerName": "{vm-name}", + }, + "storageProfile": { + "imageReference": { + "offer": "WindowsServer", + "publisher": "MicrosoftWindowsServer", + "sku": "2019-Datacenter", + "version": "latest", + }, + "osDisk": { + "caching": "ReadWrite", + "createOption": "FromImage", + "managedDisk": {"storageAccountType": "Standard_LRS"}, + "name": "vmOSdisk", + }, + }, + }, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithFips1403Enabled.json +if __name__ == "__main__": + main() diff --git a/sdk/compute/azure-mgmt-compute/generated_tests/test_compute_management_restore_point_collections_operations.py b/sdk/compute/azure-mgmt-compute/generated_tests/test_compute_management_restore_point_collections_operations.py index 6a2bca76735c..4f4a0a76368a 100644 --- a/sdk/compute/azure-mgmt-compute/generated_tests/test_compute_management_restore_point_collections_operations.py +++ b/sdk/compute/azure-mgmt-compute/generated_tests/test_compute_management_restore_point_collections_operations.py @@ -60,6 +60,7 @@ def test_restore_point_collections_create_or_update(self, resource_group): parameters={ "location": "str", "id": "str", + "instantAccess": bool, "name": "str", "provisioningState": "str", "restorePointCollectionId": "str", @@ -82,6 +83,7 @@ def test_restore_point_collections_create_or_update(self, resource_group): "time": "2020-02-20 00:00:00", }, }, + "snapshotAccessState": "str", } ], "statuses": [ @@ -94,6 +96,7 @@ def test_restore_point_collections_create_or_update(self, resource_group): } ], }, + "instantAccessDurationMinutes": 0, "name": "str", "provisioningState": "str", "sourceMetadata": { @@ -264,6 +267,7 @@ def test_restore_point_collections_update(self, resource_group): resource_group_name=resource_group.name, restore_point_collection_name="str", parameters={ + "instantAccess": bool, "provisioningState": "str", "restorePointCollectionId": "str", "restorePoints": [ @@ -285,6 +289,7 @@ def test_restore_point_collections_update(self, resource_group): "time": "2020-02-20 00:00:00", }, }, + "snapshotAccessState": "str", } ], "statuses": [ @@ -297,6 +302,7 @@ def test_restore_point_collections_update(self, resource_group): } ], }, + "instantAccessDurationMinutes": 0, "name": "str", "provisioningState": "str", "sourceMetadata": { diff --git a/sdk/compute/azure-mgmt-compute/generated_tests/test_compute_management_restore_point_collections_operations_async.py b/sdk/compute/azure-mgmt-compute/generated_tests/test_compute_management_restore_point_collections_operations_async.py index 6ff7103f15bc..cf09c862123b 100644 --- a/sdk/compute/azure-mgmt-compute/generated_tests/test_compute_management_restore_point_collections_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/generated_tests/test_compute_management_restore_point_collections_operations_async.py @@ -61,6 +61,7 @@ async def test_restore_point_collections_create_or_update(self, resource_group): parameters={ "location": "str", "id": "str", + "instantAccess": bool, "name": "str", "provisioningState": "str", "restorePointCollectionId": "str", @@ -83,6 +84,7 @@ async def test_restore_point_collections_create_or_update(self, resource_group): "time": "2020-02-20 00:00:00", }, }, + "snapshotAccessState": "str", } ], "statuses": [ @@ -95,6 +97,7 @@ async def test_restore_point_collections_create_or_update(self, resource_group): } ], }, + "instantAccessDurationMinutes": 0, "name": "str", "provisioningState": "str", "sourceMetadata": { @@ -265,6 +268,7 @@ async def test_restore_point_collections_update(self, resource_group): resource_group_name=resource_group.name, restore_point_collection_name="str", parameters={ + "instantAccess": bool, "provisioningState": "str", "restorePointCollectionId": "str", "restorePoints": [ @@ -286,6 +290,7 @@ async def test_restore_point_collections_update(self, resource_group): "time": "2020-02-20 00:00:00", }, }, + "snapshotAccessState": "str", } ], "statuses": [ @@ -298,6 +303,7 @@ async def test_restore_point_collections_update(self, resource_group): } ], }, + "instantAccessDurationMinutes": 0, "name": "str", "provisioningState": "str", "sourceMetadata": { diff --git a/sdk/compute/azure-mgmt-compute/generated_tests/test_compute_management_restore_points_operations.py b/sdk/compute/azure-mgmt-compute/generated_tests/test_compute_management_restore_points_operations.py index 511d548739d1..d4a9cfb97877 100644 --- a/sdk/compute/azure-mgmt-compute/generated_tests/test_compute_management_restore_points_operations.py +++ b/sdk/compute/azure-mgmt-compute/generated_tests/test_compute_management_restore_points_operations.py @@ -56,6 +56,7 @@ def test_restore_points_begin_create(self, resource_group): "time": "2020-02-20 00:00:00", }, }, + "snapshotAccessState": "str", } ], "statuses": [ @@ -68,6 +69,7 @@ def test_restore_points_begin_create(self, resource_group): } ], }, + "instantAccessDurationMinutes": 0, "name": "str", "provisioningState": "str", "sourceMetadata": { diff --git a/sdk/compute/azure-mgmt-compute/generated_tests/test_compute_management_restore_points_operations_async.py b/sdk/compute/azure-mgmt-compute/generated_tests/test_compute_management_restore_points_operations_async.py index d1133b905f9c..19843296e763 100644 --- a/sdk/compute/azure-mgmt-compute/generated_tests/test_compute_management_restore_points_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/generated_tests/test_compute_management_restore_points_operations_async.py @@ -58,6 +58,7 @@ async def test_restore_points_begin_create(self, resource_group): "time": "2020-02-20 00:00:00", }, }, + "snapshotAccessState": "str", } ], "statuses": [ @@ -70,6 +71,7 @@ async def test_restore_points_begin_create(self, resource_group): } ], }, + "instantAccessDurationMinutes": 0, "name": "str", "provisioningState": "str", "sourceMetadata": { diff --git a/sdk/compute/azure-mgmt-compute/generated_tests/test_compute_management_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/generated_tests/test_compute_management_virtual_machine_scale_set_vms_operations.py index 38a59c42b091..8cec9b9ed50e 100644 --- a/sdk/compute/azure-mgmt-compute/generated_tests/test_compute_management_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/generated_tests/test_compute_management_virtual_machine_scale_set_vms_operations.py @@ -52,7 +52,11 @@ def test_virtual_machine_scale_set_vms_begin_update(self, resource_group): instance_id="str", parameters={ "location": "str", - "additionalCapabilities": {"hibernationEnabled": bool, "ultraSSDEnabled": bool}, + "additionalCapabilities": { + "enableFips1403Encryption": bool, + "hibernationEnabled": bool, + "ultraSSDEnabled": bool, + }, "availabilitySet": {"id": "str"}, "diagnosticsProfile": {"bootDiagnostics": {"enabled": bool, "storageUri": "str"}}, "etag": "str", diff --git a/sdk/compute/azure-mgmt-compute/generated_tests/test_compute_management_virtual_machine_scale_set_vms_operations_async.py b/sdk/compute/azure-mgmt-compute/generated_tests/test_compute_management_virtual_machine_scale_set_vms_operations_async.py index 0e209ffc96da..e26a92f00692 100644 --- a/sdk/compute/azure-mgmt-compute/generated_tests/test_compute_management_virtual_machine_scale_set_vms_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/generated_tests/test_compute_management_virtual_machine_scale_set_vms_operations_async.py @@ -54,7 +54,11 @@ async def test_virtual_machine_scale_set_vms_begin_update(self, resource_group): instance_id="str", parameters={ "location": "str", - "additionalCapabilities": {"hibernationEnabled": bool, "ultraSSDEnabled": bool}, + "additionalCapabilities": { + "enableFips1403Encryption": bool, + "hibernationEnabled": bool, + "ultraSSDEnabled": bool, + }, "availabilitySet": {"id": "str"}, "diagnosticsProfile": {"bootDiagnostics": {"enabled": bool, "storageUri": "str"}}, "etag": "str", diff --git a/sdk/compute/azure-mgmt-compute/generated_tests/test_compute_management_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/generated_tests/test_compute_management_virtual_machine_scale_sets_operations.py index 3961a22c6a63..657b325a76ad 100644 --- a/sdk/compute/azure-mgmt-compute/generated_tests/test_compute_management_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/generated_tests/test_compute_management_virtual_machine_scale_sets_operations.py @@ -70,7 +70,11 @@ def test_virtual_machine_scale_sets_begin_create_or_update(self, resource_group) vm_scale_set_name="str", parameters={ "location": "str", - "additionalCapabilities": {"hibernationEnabled": bool, "ultraSSDEnabled": bool}, + "additionalCapabilities": { + "enableFips1403Encryption": bool, + "hibernationEnabled": bool, + "ultraSSDEnabled": bool, + }, "automaticRepairsPolicy": {"enabled": bool, "gracePeriod": "str", "repairAction": "str"}, "constrainedMaximumCapacity": bool, "doNotRunExtensionsOnOverprovisionedVMs": bool, @@ -381,7 +385,11 @@ def test_virtual_machine_scale_sets_begin_update(self, resource_group): resource_group_name=resource_group.name, vm_scale_set_name="str", parameters={ - "additionalCapabilities": {"hibernationEnabled": bool, "ultraSSDEnabled": bool}, + "additionalCapabilities": { + "enableFips1403Encryption": bool, + "hibernationEnabled": bool, + "ultraSSDEnabled": bool, + }, "automaticRepairsPolicy": {"enabled": bool, "gracePeriod": "str", "repairAction": "str"}, "doNotRunExtensionsOnOverprovisionedVMs": bool, "identity": { diff --git a/sdk/compute/azure-mgmt-compute/generated_tests/test_compute_management_virtual_machine_scale_sets_operations_async.py b/sdk/compute/azure-mgmt-compute/generated_tests/test_compute_management_virtual_machine_scale_sets_operations_async.py index 55ed2eaf8cfe..d5f8e4568afd 100644 --- a/sdk/compute/azure-mgmt-compute/generated_tests/test_compute_management_virtual_machine_scale_sets_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/generated_tests/test_compute_management_virtual_machine_scale_sets_operations_async.py @@ -72,7 +72,11 @@ async def test_virtual_machine_scale_sets_begin_create_or_update(self, resource_ vm_scale_set_name="str", parameters={ "location": "str", - "additionalCapabilities": {"hibernationEnabled": bool, "ultraSSDEnabled": bool}, + "additionalCapabilities": { + "enableFips1403Encryption": bool, + "hibernationEnabled": bool, + "ultraSSDEnabled": bool, + }, "automaticRepairsPolicy": {"enabled": bool, "gracePeriod": "str", "repairAction": "str"}, "constrainedMaximumCapacity": bool, "doNotRunExtensionsOnOverprovisionedVMs": bool, @@ -388,7 +392,11 @@ async def test_virtual_machine_scale_sets_begin_update(self, resource_group): resource_group_name=resource_group.name, vm_scale_set_name="str", parameters={ - "additionalCapabilities": {"hibernationEnabled": bool, "ultraSSDEnabled": bool}, + "additionalCapabilities": { + "enableFips1403Encryption": bool, + "hibernationEnabled": bool, + "ultraSSDEnabled": bool, + }, "automaticRepairsPolicy": {"enabled": bool, "gracePeriod": "str", "repairAction": "str"}, "doNotRunExtensionsOnOverprovisionedVMs": bool, "identity": { diff --git a/sdk/compute/azure-mgmt-compute/generated_tests/test_compute_management_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/generated_tests/test_compute_management_virtual_machines_operations.py index 25c6522deec9..5b0bee3df3a2 100644 --- a/sdk/compute/azure-mgmt-compute/generated_tests/test_compute_management_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/generated_tests/test_compute_management_virtual_machines_operations.py @@ -71,7 +71,11 @@ def test_virtual_machines_begin_create_or_update(self, resource_group): vm_name="str", parameters={ "location": "str", - "additionalCapabilities": {"hibernationEnabled": bool, "ultraSSDEnabled": bool}, + "additionalCapabilities": { + "enableFips1403Encryption": bool, + "hibernationEnabled": bool, + "ultraSSDEnabled": bool, + }, "applicationProfile": { "galleryApplications": [ { @@ -543,7 +547,11 @@ def test_virtual_machines_begin_update(self, resource_group): resource_group_name=resource_group.name, vm_name="str", parameters={ - "additionalCapabilities": {"hibernationEnabled": bool, "ultraSSDEnabled": bool}, + "additionalCapabilities": { + "enableFips1403Encryption": bool, + "hibernationEnabled": bool, + "ultraSSDEnabled": bool, + }, "applicationProfile": { "galleryApplications": [ { diff --git a/sdk/compute/azure-mgmt-compute/generated_tests/test_compute_management_virtual_machines_operations_async.py b/sdk/compute/azure-mgmt-compute/generated_tests/test_compute_management_virtual_machines_operations_async.py index bb3d4eb95dee..7807f75af2a0 100644 --- a/sdk/compute/azure-mgmt-compute/generated_tests/test_compute_management_virtual_machines_operations_async.py +++ b/sdk/compute/azure-mgmt-compute/generated_tests/test_compute_management_virtual_machines_operations_async.py @@ -73,7 +73,11 @@ async def test_virtual_machines_begin_create_or_update(self, resource_group): vm_name="str", parameters={ "location": "str", - "additionalCapabilities": {"hibernationEnabled": bool, "ultraSSDEnabled": bool}, + "additionalCapabilities": { + "enableFips1403Encryption": bool, + "hibernationEnabled": bool, + "ultraSSDEnabled": bool, + }, "applicationProfile": { "galleryApplications": [ { @@ -550,7 +554,11 @@ async def test_virtual_machines_begin_update(self, resource_group): resource_group_name=resource_group.name, vm_name="str", parameters={ - "additionalCapabilities": {"hibernationEnabled": bool, "ultraSSDEnabled": bool}, + "additionalCapabilities": { + "enableFips1403Encryption": bool, + "hibernationEnabled": bool, + "ultraSSDEnabled": bool, + }, "applicationProfile": { "galleryApplications": [ { diff --git a/sdk/compute/azure-mgmt-compute/pyproject.toml b/sdk/compute/azure-mgmt-compute/pyproject.toml index abcaf586efb9..4fdf653a1cc2 100644 --- a/sdk/compute/azure-mgmt-compute/pyproject.toml +++ b/sdk/compute/azure-mgmt-compute/pyproject.toml @@ -54,8 +54,8 @@ content-type = "text/markdown" [tool.setuptools.packages.find] exclude = [ "tests*", - "samples*", "generated_tests*", + "samples*", "generated_samples*", "doc*", "azure",