Skip to content
Merged
4 changes: 4 additions & 0 deletions src/azure-cli/azure/cli/command_modules/vm/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -2993,6 +2993,10 @@
az restore-point create --exclude-disks "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/disk123" \
--resource-group "myResourceGroup" --collection-name "rpcName" --name "rpName"
- name: Create a restore point with instant-access-duration-minutes
text: |-
az restore-point create --exclude-disks "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/disk123" \
--resource-group "myResourceGroup" --collection-name "rpcName" --name "rpName" --instant-access-duration-minutes 120
"""

helps['restore-point wait'] = """
Expand Down
5 changes: 4 additions & 1 deletion src/azure-cli/azure/cli/command_modules/vm/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ def load_arguments(self, _):
c.argument('bandwidth_copy_speed', min_api='2023-10-02',
help='If this field is set on a snapshot and createOption is CopyStart, the snapshot will be copied at a quicker speed.',
arg_type=get_enum_type(["None", "Enhanced"]))
c.argument('instant_access_duration_minutes', options_list=['--instant-access-duration-minutes', '--ia-duration'], type=int, help='For snapshots created from Premium SSD v2 or Ultra disk, this property determines the time in minutes the snapshot is retained for instant access to enable faster restore. The disk sku should be UltraSSD_LRS or PremiumV2_LRS')
c.argument('instant_access_duration_minutes', options_list=['--instant-access-duration-minutes', '--instant-access-duration', '--ia-duration'], type=int, help='For snapshots created from Premium SSD v2 or Ultra disk, this property determines the time in minutes the snapshot is retained for instant access to enable faster restore. The disk sku should be UltraSSD_LRS or PremiumV2_LRS.')
# endregion

# region Images
Expand Down Expand Up @@ -1584,6 +1584,9 @@ def load_arguments(self, _):
c.argument('source_data_disk_resource', nargs='+', help='Resource Id of the source data disk')
c.argument('data_disk_restore_point_encryption_set', nargs='+', help='Customer managed data disk encryption set resource id')
c.argument('data_disk_restore_point_encryption_type', nargs='+', arg_type=get_enum_type(self.get_models('RestorePointEncryptionType')), help='The type of key used to encrypt the data of the data disk restore point.')
c.argument('instant_access_duration_minutes', options_list=['--instant-access-duration-minutes', '--instant-access-duration', '--ia-duration'], type=int,
help='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.')

with self.argument_context('restore-point show') as c:
c.argument('restore_point_name', options_list=['--name', '-n', '--restore-point-name'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,14 @@
from azure.cli.core.aaz import *


@register_command(
"restore-point create",
)
class Create(AAZCommand):
"""Create the restore point. Updating properties of an existing restore point is not allowed.

:example: Create a restore point
az restore-point create --exclude-disks "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/disk123" --resource-group "myResourceGroup" --collection-name "rpcName" --name "rpName"
az restore-point create --exclude-disks "/subscriptions/{subscription-id}/resourceGroups/myResour ceGroup/providers/Microsoft.Compute/disks/disk123" --resource-group "myResourceGroup" --collection-name "rpcName" --name "rpName" --instant-access-duration-minutes 120

:example: Create a restore point with --consistency-mode CrashConsistent
az vm create -n vm -g rg --image UbuntuLTS --tag EnableCrashConsistentRestorePoint=True
Expand All @@ -24,9 +27,9 @@ class Create(AAZCommand):
"""

_aaz_info = {
"version": "2024-11-01",
"version": "2025-04-01",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.compute/restorepointcollections/{}/restorepoints/{}", "2024-11-01"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.compute/restorepointcollections/{}/restorepoints/{}", "2025-04-01"],
]
}

Expand Down Expand Up @@ -82,6 +85,11 @@ def _build_arguments_schema(cls, *args, **kwargs):
# define Arg Group "Properties"

_args_schema = cls._args_schema
_args_schema.instant_access_duration_minutes = AAZIntArg(
options=["--instant-access-duration", "--instant-access-duration-minutes"],
arg_group="Properties",
help="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. Range is between 60 and 300. Default is 300.",
)
_args_schema.source_metadata = AAZObjectArg(
options=["--source-metadata"],
arg_group="Properties",
Expand Down Expand Up @@ -340,7 +348,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-11-01",
"api-version", "2025-04-01",
required=True,
),
}
Expand Down Expand Up @@ -371,6 +379,7 @@ def content(self):
if properties is not None:
properties.set_prop("consistencyMode", AAZStrType, ".consistency_mode")
properties.set_prop("excludeDisks", AAZListType, ".exclude_disks")
properties.set_prop("instantAccessDurationMinutes", AAZIntType, ".instant_access_duration_minutes")
properties.set_prop("sourceMetadata", AAZObjectType, ".source_metadata")
_CreateHelper._build_schema_api_entity_reference_create(properties.set_prop("sourceRestorePoint", AAZObjectType, ".source_restore_point"))

Expand Down Expand Up @@ -449,6 +458,9 @@ def _build_schema_on_201(cls):
serialized_name="instanceView",
flags={"read_only": True},
)
properties.instant_access_duration_minutes = AAZIntType(
serialized_name="instantAccessDurationMinutes",
)
properties.provisioning_state = AAZStrType(
serialized_name="provisioningState",
flags={"read_only": True},
Expand Down Expand Up @@ -482,6 +494,9 @@ def _build_schema_on_201(cls):
_element.replication_status = AAZObjectType(
serialized_name="replicationStatus",
)
_element.snapshot_access_state = AAZStrType(
serialized_name="snapshotAccessState",
)

replication_status = cls._schema_on_201.properties.instance_view.disk_restore_points.Element.replication_status
replication_status.completion_percent = AAZIntType(
Expand Down Expand Up @@ -756,6 +771,9 @@ def _build_schema_on_201(cls):
)

proxy_agent_settings = cls._schema_on_201.properties.source_metadata.security_profile.proxy_agent_settings
proxy_agent_settings.add_proxy_agent_extension = AAZBoolType(
serialized_name="addProxyAgentExtension",
)
proxy_agent_settings.enabled = AAZBoolType()
proxy_agent_settings.imds = AAZObjectType()
_CreateHelper._build_schema_host_endpoint_settings_read(proxy_agent_settings.imds)
Expand Down Expand Up @@ -803,9 +821,6 @@ def _build_schema_on_201(cls):
serialized_name="diskSizeGB",
flags={"read_only": True},
)
_element.lun = AAZIntType(
flags={"read_only": True},
)
_element.managed_disk = AAZObjectType(
serialized_name="managedDisk",
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
from azure.cli.core.aaz import *


@register_command(
"restore-point show",
)
class Show(AAZCommand):
"""Get the restore point.

Expand All @@ -19,9 +22,9 @@ class Show(AAZCommand):
"""

_aaz_info = {
"version": "2024-11-01",
"version": "2025-04-01",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.compute/restorepointcollections/{}/restorepoints/{}", "2024-11-01"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.compute/restorepointcollections/{}/restorepoints/{}", "2025-04-01"],
]
}

Expand Down Expand Up @@ -135,7 +138,7 @@ def query_parameters(self):
"$expand", self.ctx.args.expand,
),
**self.serialize_query_param(
"api-version", "2024-11-01",
"api-version", "2025-04-01",
required=True,
),
}
Expand Down Expand Up @@ -196,6 +199,9 @@ def _build_schema_on_200(cls):
serialized_name="instanceView",
flags={"read_only": True},
)
properties.instant_access_duration_minutes = AAZIntType(
serialized_name="instantAccessDurationMinutes",
)
properties.provisioning_state = AAZStrType(
serialized_name="provisioningState",
flags={"read_only": True},
Expand Down Expand Up @@ -229,6 +235,9 @@ def _build_schema_on_200(cls):
_element.replication_status = AAZObjectType(
serialized_name="replicationStatus",
)
_element.snapshot_access_state = AAZStrType(
serialized_name="snapshotAccessState",
)

replication_status = cls._schema_on_200.properties.instance_view.disk_restore_points.Element.replication_status
replication_status.completion_percent = AAZIntType(
Expand Down Expand Up @@ -503,6 +512,9 @@ def _build_schema_on_200(cls):
)

proxy_agent_settings = cls._schema_on_200.properties.source_metadata.security_profile.proxy_agent_settings
proxy_agent_settings.add_proxy_agent_extension = AAZBoolType(
serialized_name="addProxyAgentExtension",
)
proxy_agent_settings.enabled = AAZBoolType()
proxy_agent_settings.imds = AAZObjectType()
_ShowHelper._build_schema_host_endpoint_settings_read(proxy_agent_settings.imds)
Expand Down Expand Up @@ -550,9 +562,6 @@ def _build_schema_on_200(cls):
serialized_name="diskSizeGB",
flags={"read_only": True},
)
_element.lun = AAZIntType(
flags={"read_only": True},
)
_element.managed_disk = AAZObjectType(
serialized_name="managedDisk",
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ class Create(AAZCommand):
"""Create operation to create or update the restore point collection. Please refer to https://aka.ms/RestorePoints for more details. When updating a restore point collection, only tags may be modified.

:example: Create or update a restore point collection.
az restore-point collection create --location "norwayeast" --source-id "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM" --tags myTag1="tagValue1" --resource-group "myResourceGroup" --collection-name "myRpc"
az restore-point collection create --location "norwayeast" --source-id "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM" --tags myTag1="tagValue1" --resource-group "myResourceGroup" --collection-name "myRpc" --instant-access true
"""

_aaz_info = {
"version": "2024-11-01",
"version": "2025-04-01",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.compute/restorepointcollections/{}", "2024-11-01"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.compute/restorepointcollections/{}", "2025-04-01"],
]
}

Expand Down Expand Up @@ -67,6 +67,15 @@ def _build_arguments_schema(cls, *args, **kwargs):
tags = cls._args_schema.tags
tags.Element = AAZStrArg()

# define Arg Group "Properties"

_args_schema = cls._args_schema
_args_schema.instant_access = AAZBoolArg(
options=["--instant-access"],
arg_group="Properties",
help="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.",
)

# define Arg Group "Source"

_args_schema = cls._args_schema
Expand Down Expand Up @@ -142,7 +151,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-11-01",
"api-version", "2025-04-01",
required=True,
),
}
Expand Down Expand Up @@ -173,6 +182,7 @@ def content(self):

properties = _builder.get(".properties")
if properties is not None:
properties.set_prop("instantAccess", AAZBoolType, ".instant_access")
properties.set_prop("source", AAZObjectType)

source = _builder.get(".properties.source")
Expand Down Expand Up @@ -226,6 +236,9 @@ def _build_schema_on_200_201(cls):
)

properties = cls._schema_on_200_201.properties
properties.instant_access = AAZBoolType(
serialized_name="instantAccess",
)
properties.provisioning_state = AAZStrType(
serialized_name="provisioningState",
flags={"read_only": True},
Expand Down Expand Up @@ -273,6 +286,9 @@ def _build_schema_on_200_201(cls):
serialized_name="instanceView",
flags={"read_only": True},
)
properties.instant_access_duration_minutes = AAZIntType(
serialized_name="instantAccessDurationMinutes",
)
properties.provisioning_state = AAZStrType(
serialized_name="provisioningState",
flags={"read_only": True},
Expand Down Expand Up @@ -306,6 +322,9 @@ def _build_schema_on_200_201(cls):
_element.replication_status = AAZObjectType(
serialized_name="replicationStatus",
)
_element.snapshot_access_state = AAZStrType(
serialized_name="snapshotAccessState",
)

replication_status = cls._schema_on_200_201.properties.restore_points.Element.properties.instance_view.disk_restore_points.Element.replication_status
replication_status.completion_percent = AAZIntType(
Expand Down Expand Up @@ -580,6 +599,9 @@ def _build_schema_on_200_201(cls):
)

proxy_agent_settings = cls._schema_on_200_201.properties.restore_points.Element.properties.source_metadata.security_profile.proxy_agent_settings
proxy_agent_settings.add_proxy_agent_extension = AAZBoolType(
serialized_name="addProxyAgentExtension",
)
proxy_agent_settings.enabled = AAZBoolType()
proxy_agent_settings.imds = AAZObjectType()
_CreateHelper._build_schema_host_endpoint_settings_read(proxy_agent_settings.imds)
Expand Down Expand Up @@ -627,9 +649,6 @@ def _build_schema_on_200_201(cls):
serialized_name="diskSizeGB",
flags={"read_only": True},
)
_element.lun = AAZIntType(
flags={"read_only": True},
)
_element.managed_disk = AAZObjectType(
serialized_name="managedDisk",
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ class List(AAZCommand):
"""

_aaz_info = {
"version": "2024-11-01",
"version": "2025-04-01",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.compute/restorepointcollections", "2024-11-01"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.compute/restorepointcollections", "2025-04-01"],
]
}

Expand Down Expand Up @@ -112,7 +112,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-11-01",
"api-version", "2025-04-01",
required=True,
),
}
Expand Down Expand Up @@ -179,6 +179,9 @@ def _build_schema_on_200(cls):
)

properties = cls._schema_on_200.value.Element.properties
properties.instant_access = AAZBoolType(
serialized_name="instantAccess",
)
properties.provisioning_state = AAZStrType(
serialized_name="provisioningState",
flags={"read_only": True},
Expand Down Expand Up @@ -226,6 +229,9 @@ def _build_schema_on_200(cls):
serialized_name="instanceView",
flags={"read_only": True},
)
properties.instant_access_duration_minutes = AAZIntType(
serialized_name="instantAccessDurationMinutes",
)
properties.provisioning_state = AAZStrType(
serialized_name="provisioningState",
flags={"read_only": True},
Expand Down Expand Up @@ -259,6 +265,9 @@ def _build_schema_on_200(cls):
_element.replication_status = AAZObjectType(
serialized_name="replicationStatus",
)
_element.snapshot_access_state = AAZStrType(
serialized_name="snapshotAccessState",
)

replication_status = cls._schema_on_200.value.Element.properties.restore_points.Element.properties.instance_view.disk_restore_points.Element.replication_status
replication_status.completion_percent = AAZIntType(
Expand Down Expand Up @@ -533,6 +542,9 @@ def _build_schema_on_200(cls):
)

proxy_agent_settings = cls._schema_on_200.value.Element.properties.restore_points.Element.properties.source_metadata.security_profile.proxy_agent_settings
proxy_agent_settings.add_proxy_agent_extension = AAZBoolType(
serialized_name="addProxyAgentExtension",
)
proxy_agent_settings.enabled = AAZBoolType()
proxy_agent_settings.imds = AAZObjectType()
_ListHelper._build_schema_host_endpoint_settings_read(proxy_agent_settings.imds)
Expand Down Expand Up @@ -580,9 +592,6 @@ def _build_schema_on_200(cls):
serialized_name="diskSizeGB",
flags={"read_only": True},
)
_element.lun = AAZIntType(
flags={"read_only": True},
)
_element.managed_disk = AAZObjectType(
serialized_name="managedDisk",
)
Expand Down
Loading
Loading