Skip to content

Commit 83f4f87

Browse files
authored
[Az.ElasticSan] Added support for soft delete and backup/restore validation (#27556)
1 parent a66da29 commit 83f4f87

File tree

73 files changed

+7159
-1861
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+7159
-1861
lines changed

src/ElasticSan/ElasticSan.Autorest/README.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ For information on how to develop for `Az.ElasticSan`, see [how-to.md](how-to.md
2828
2929
``` yaml
3030
# Please specify the commit id that includes your features to make sure generated codes stable.
31-
commit: 3ca7edabc2edf1117b7d912ba34f2694721e3ff3
31+
commit: 3db6867b8e524ea6d1bc7a3bbb989fe50dd2f184
3232
require:
3333
- $(this-folder)/../../readme.azure.noprofile.md
3434
input-file:
35-
- $(repo)/specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-06-01-preview/elasticsan.json
35+
- $(repo)/specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2024-07-01-preview/elasticsan.json
3636

3737
# Normally, title is the service name
3838
title: ElasticSan
@@ -109,6 +109,22 @@ directive:
109109
subject: VolumeSnapshot
110110
verb: Update
111111
remove: true
112+
- where:
113+
verb: Backup
114+
subject: VolumePre
115+
set:
116+
verb: Test
117+
subject: VolumeBackup
118+
- where:
119+
verb: Restore
120+
subject: VolumePre
121+
set:
122+
verb: Test
123+
subject: VolumeRestore
124+
- where:
125+
parameter-name: ^XmsAccessSoftDeletedResource$
126+
set:
127+
parameter-name: AccessSoftDeletedResource
112128
- where:
113129
parameter-name: EncryptionIdentityEncryptionUserAssignedIdentity
114130
set:

src/ElasticSan/ElasticSan.Autorest/UX/Microsoft.ElasticSan/elasticSans-volumegroups-snapshots.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"resourceType": "elasticSans/volumegroups/snapshots",
3-
"apiVersion": "2024-06-01-preview",
3+
"apiVersion": "2024-07-01-preview",
44
"learnMore": {
55
"url": "https://learn.microsoft.com/powershell/module/az.elasticsan"
66
},

src/ElasticSan/ElasticSan.Autorest/UX/Microsoft.ElasticSan/elasticSans-volumegroups-volumes.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"resourceType": "elasticSans/volumegroups/volumes",
3-
"apiVersion": "2024-06-01-preview",
3+
"apiVersion": "2024-07-01-preview",
44
"learnMore": {
55
"url": "https://learn.microsoft.com/powershell/module/az.elasticsan"
66
},
@@ -54,12 +54,12 @@
5454
]
5555
},
5656
{
57-
"name": "Remove-AzElasticSanVolume",
58-
"description": "Delete an Volume.",
59-
"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}",
57+
"name": "Restore-AzElasticSanVolume",
58+
"description": "Restore Soft Deleted Volumes.\nThe volume name is obtained by using the API to list soft deleted volumes by volume group",
59+
"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}/restore",
6060
"help": {
6161
"learnMore": {
62-
"url": "https://learn.microsoft.com/powershell/module/az.elasticsan/remove-azelasticsanvolume"
62+
"url": "https://learn.microsoft.com/powershell/module/az.elasticsan/restore-azelasticsanvolume"
6363
},
6464
"parameterSets": [
6565
{
@@ -75,7 +75,7 @@
7575
},
7676
"examples": [
7777
{
78-
"description": "Delete an Volume.",
78+
"description": "Restore Soft Deleted Volumes. The volume name is obtained by using the API to list soft deleted volumes by volume group",
7979
"parameters": [
8080
{
8181
"name": "-ElasticSanName",

src/ElasticSan/ElasticSan.Autorest/UX/Microsoft.ElasticSan/elasticSans-volumegroups.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"resourceType": "elasticSans/volumegroups",
3-
"apiVersion": "2024-06-01-preview",
3+
"apiVersion": "2024-07-01-preview",
44
"learnMore": {
55
"url": "https://learn.microsoft.com/powershell/module/az.elasticsan"
66
},

src/ElasticSan/ElasticSan.Autorest/UX/Microsoft.ElasticSan/elasticSans.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"resourceType": "elasticSans",
3-
"apiVersion": "2024-06-01-preview",
3+
"apiVersion": "2024-07-01-preview",
44
"learnMore": {
55
"url": "https://learn.microsoft.com/powershell/module/az.elasticsan"
66
},

src/ElasticSan/ElasticSan.Autorest/custom/New-AzElasticSanVolumeGroup.ps1

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,19 @@ function New-AzElasticSanVolumeGroup {
9797
# Identity Parameter
9898
# To construct, see NOTES section for ELASTICSANINPUTOBJECT properties and create a hash table.
9999
${ElasticSanInputObject},
100+
101+
[Parameter()]
102+
[Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')]
103+
[System.Int32]
104+
# The number of days to retain the resources after deletion.
105+
${DeleteRetentionPolicyRetentionPeriodDay},
106+
107+
[Parameter()]
108+
[Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Enabled", "Disabled")]
109+
[Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')]
110+
[System.String]
111+
# .
112+
${DeleteRetentionPolicyState},
100113

101114
[Parameter(ParameterSetName='CreateViaIdentityExpanded', Mandatory, ValueFromPipeline)]
102115
[Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Path')]

src/ElasticSan/ElasticSan.Autorest/custom/Update-AzElasticSanVolumeGroup.ps1

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,19 @@ function Update-AzElasticSanVolumeGroup {
105105
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
106106
${InputObject},
107107

108+
[Parameter()]
109+
[Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')]
110+
[System.Int32]
111+
# The number of days to retain the resources after deletion.
112+
${DeleteRetentionPolicyRetentionPeriodDay},
113+
114+
[Parameter()]
115+
[Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Enabled", "Disabled")]
116+
[Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')]
117+
[System.String]
118+
# .
119+
${DeleteRetentionPolicyState},
120+
108121
[Parameter()]
109122
[Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')]
110123
[System.Boolean]

src/ElasticSan/ElasticSan.Autorest/docs/Az.ElasticSan.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
Module Name: Az.ElasticSan
3-
Module Guid: ed90c36c-f150-4ad2-96ae-57e0ebb0a376
3+
Module Guid: 3e5cf2f0-9988-4c0d-9161-6b9b49729845
44
Download Help Link: https://learn.microsoft.com/powershell/module/az.elasticsan
55
Help Version: 1.0.0.0
66
Locale: en-US
@@ -59,6 +59,16 @@ Remove a list of virtual network rules from a VolumeGroup
5959
### [Remove-AzElasticSanVolumeSnapshot](Remove-AzElasticSanVolumeSnapshot.md)
6060
Delete a Volume Snapshot.
6161

62+
### [Restore-AzElasticSanVolume](Restore-AzElasticSanVolume.md)
63+
Restore Soft Deleted Volumes.
64+
The volume name is obtained by using the API to list soft deleted volumes by volume group
65+
66+
### [Test-AzElasticSanVolumeBackup](Test-AzElasticSanVolumeBackup.md)
67+
Validate whether a disk snapshot backup can be taken for list of volumes.
68+
69+
### [Test-AzElasticSanVolumeRestore](Test-AzElasticSanVolumeRestore.md)
70+
Validate whether a list of backed up disk snapshots can be restored into ElasticSan volumes.
71+
6272
### [Update-AzElasticSan](Update-AzElasticSan.md)
6373
update a Elastic San.
6474

src/ElasticSan/ElasticSan.Autorest/docs/Get-AzElasticSanVolume.md

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ Get either a list of all volumes from a volume group or get a single volume from
1515
### List (Default)
1616
```
1717
Get-AzElasticSanVolume -ElasticSanName <String> -ResourceGroupName <String> -VolumeGroupName <String>
18-
[-SubscriptionId <String[]>] [-DefaultProfile <PSObject>] [<CommonParameters>]
18+
[-SubscriptionId <String[]>] [-AccessSoftDeletedResource <String>] [-DefaultProfile <PSObject>]
19+
[<CommonParameters>]
1920
```
2021

2122
### Get
@@ -124,8 +125,54 @@ VolumeId : abababab-abab-abab-abab-abababababab
124125

125126
This command gets a specific volume.
126127

128+
### Example 3: List soft deleted volumes in a volume group
129+
```powershell
130+
Get-AzElasticSanVolume -ResourceGroupName myresourcegroup -ElasticSanName myelasticsan -VolumeGroupName myvolumegroup -AccessSoftDeletedResource true
131+
```
132+
133+
```output
134+
CreationDataCreateSource :
135+
CreationDataSourceUri :
136+
Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myresourcegroup/providers/Microsoft.ElasticSan/elasticSans/myelasticsan/volumegroups/myvolumegroup/volumes/namefordeletedvolume
137+
ManagedByResourceId : None
138+
Name : namefordeletedvolume
139+
SizeGiB : 100
140+
StorageTargetIqn : iqn.2022-09.net.windows.core.blob.ElasticSan.es-3ibot5m2r3y0:myvolume
141+
StorageTargetPortalHostname : es-3ibot5m2r3y0.z1.blob.storage.azure.net
142+
StorageTargetPortalPort : 3260
143+
StorageTargetProvisioningState : Succeeded
144+
StorageTargetStatus : Running
145+
SystemDataCreatedAt : 9/19/2022 2:39:28 AM
146+
SystemDataCreatedBy : yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy
147+
SystemDataCreatedByType : Application
148+
SystemDataLastModifiedAt : 9/19/2022 2:39:28 AM
149+
SystemDataLastModifiedBy : yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy
150+
SystemDataLastModifiedByType : Application
151+
Tag : Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.Api20211120Preview.ResourceTags
152+
Type : Microsoft.ElasticSan/ElasticSans
153+
VolumeId : abababab-abab-abab-abab-abababababab
154+
```
155+
156+
This command gets soft deleted volumes in a volume group.
157+
127158
## PARAMETERS
128159

160+
### -AccessSoftDeletedResource
161+
Optional, returns only soft deleted volumes if set to true.
162+
If set to false or if not specified, returns only active volumes.
163+
164+
```yaml
165+
Type: System.String
166+
Parameter Sets: List
167+
Aliases:
168+
169+
Required: False
170+
Position: Named
171+
Default value: None
172+
Accept pipeline input: False
173+
Accept wildcard characters: False
174+
```
175+
129176
### -DefaultProfile
130177
The DefaultProfile parameter is not functional.
131178
Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.

src/ElasticSan/ElasticSan.Autorest/docs/Get-AzElasticSanVolumeGroup.md

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Get either a list of all volume groups from an Elastic SAN or get a single volum
1515
### List (Default)
1616
```
1717
Get-AzElasticSanVolumeGroup -ElasticSanName <String> -ResourceGroupName <String> [-SubscriptionId <String[]>]
18-
[-DefaultProfile <PSObject>] [<CommonParameters>]
18+
[-AccessSoftDeletedResource <String>] [-DefaultProfile <PSObject>] [<CommonParameters>]
1919
```
2020

2121
### Get
@@ -105,8 +105,64 @@ Type : Microsoft.ElasticSan/ElasticSans
105105

106106
This command gets a specific volume group.
107107

108+
### Example 3: Get soft deleted volume groups in an Elastic SAN
109+
```powershell
110+
Get-AzElasticSanVolumeGroup -ResourceGroupName myresourcegroup -ElasticSanName myelasticsan -AccessSoftDeletedResource true
111+
```
112+
113+
```output
114+
DeleteRetentionPolicyRetentionPeriodDay : 7
115+
DeleteRetentionPolicyState : Enabled
116+
Encryption : EncryptionAtRestWithPlatformKey
117+
EncryptionIdentityEncryptionUserAssignedIdentity :
118+
EnforceDataIntegrityCheckForIscsi : True
119+
Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myresourcegroup/providers/Microsoft.ElasticSan/elasticSans/myelasticsan/volumeGroups/myvolumegroup
120+
IdentityPrincipalId :
121+
IdentityTenantId :
122+
IdentityType :
123+
IdentityUserAssignedIdentity : {
124+
}
125+
KeyVaultPropertyCurrentVersionedKeyExpirationTimestamp :
126+
KeyVaultPropertyCurrentVersionedKeyIdentifier :
127+
KeyVaultPropertyKeyName :
128+
KeyVaultPropertyKeyVaultUri :
129+
KeyVaultPropertyKeyVersion :
130+
KeyVaultPropertyLastKeyRotationTimestamp :
131+
Name : myvolumegroup
132+
NetworkAclsVirtualNetworkRule :
133+
PrivateEndpointConnection :
134+
ProtocolType : iSCSI
135+
ProvisioningState : Deleted
136+
ResourceGroupName : myresourcegroup
137+
SystemDataCreatedAt : 4/8/2025 2:31:52 AM
138+
SystemDataCreatedBy : yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy
139+
SystemDataCreatedByType : User
140+
SystemDataLastModifiedAt : 4/9/2025 3:22:04 AM
141+
SystemDataLastModifiedBy : yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy
142+
SystemDataLastModifiedByType : User
143+
Type : Microsoft.ElasticSan/elasticSans/volumeGroups
144+
```
145+
146+
This command gets soft deleted volume groups in the Elastic SAN myelasticsan.
147+
108148
## PARAMETERS
109149

150+
### -AccessSoftDeletedResource
151+
Optional, returns only soft deleted volume groups if set to true.
152+
If set to false or if not specified, returns only active volume groups.
153+
154+
```yaml
155+
Type: System.String
156+
Parameter Sets: List
157+
Aliases:
158+
159+
Required: False
160+
Position: Named
161+
Default value: None
162+
Accept pipeline input: False
163+
Accept wildcard characters: False
164+
```
165+
110166
### -DefaultProfile
111167
The DefaultProfile parameter is not functional.
112168
Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.

0 commit comments

Comments
 (0)