Skip to content

Commit 43262c8

Browse files
authored
[Az.DataProtection] Added support for validate for Modify backup with UAMI (Azure#27445)
1 parent 4160929 commit 43262c8

File tree

147 files changed

+9474
-5067
lines changed

Some content is hidden

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

147 files changed

+9474
-5067
lines changed

src/DataProtection/DataProtection.Autorest/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ generated
55
internal
66
exports
77
tools
8+
custom/*.psm1
9+
custom/autogen-model-cmdlets
810
test/*-TestResults.xml
911
license.txt
1012
/*.ps1
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the Apache License, Version 2.0 (the ""License"");
3+
// you may not use this file except in compliance with the License.
4+
// You may obtain a copy of the License at
5+
// http://www.apache.org/licenses/LICENSE-2.0
6+
// Unless required by applicable law or agreed to in writing, software
7+
// distributed under the License is distributed on an ""AS IS"" BASIS,
8+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9+
// See the License for the specific language governing permissions and
10+
// limitations under the License.
11+
// Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
12+
// is regenerated.
13+
14+
using System;
15+
using System.Reflection;
16+
using System.Runtime.CompilerServices;
17+
using System.Runtime.InteropServices;
18+
19+
[assembly: System.Reflection.AssemblyCompanyAttribute("Microsoft")]
20+
[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")]
21+
[assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")]
22+
[assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - DataProtection")]
23+
[assembly: System.Reflection.AssemblyFileVersionAttribute("2.6.1")]
24+
[assembly: System.Reflection.AssemblyVersionAttribute("2.6.1")]
25+
[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)]
26+
[assembly: System.CLSCompliantAttribute(false)]

src/DataProtection/DataProtection.Autorest/README.md

Lines changed: 36 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ This file contains the configuration for generating My API from the OpenAPI spec
3131
3232
``` yaml
3333
# it's the same options as command line options, just drop the double-dash!
34-
commit: 4aad50a36767f7c36673f2c7982bb4055dbf5ed4
34+
commit: b88b86f58a98ee1569ae6e7cba6f84061e15166b
3535
require:
3636
- $(this-folder)/../../readme.azure.noprofile.md
3737
input-file:
38-
- $(repo)/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2024-04-01/dataprotection.json
38+
- $(repo)/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2025-01-01/dataprotection.json
3939
title: DataProtection
4040
# For new modules, please avoid setting 3.x using the use-extension method and instead, use 4.x as the default option
4141
use-extension:
@@ -310,10 +310,19 @@ directive:
310310
- from: swagger-document
311311
where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/deletedBackupInstances/{backupInstanceName}/undelete"].post
312312
transform: $["description"] = "Undeletes a soft deleted backup instance"
313+
- from: swagger-document
314+
where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/validateForModifyBackup"].post
315+
transform: >
316+
$.responses["200"] = {
317+
"description": "Contains additional information like job Id",
318+
"schema": {
319+
"$ref": "#/definitions/OperationJobExtendedInfo"
320+
}
321+
}
313322
- where:
314323
verb: Test
315324
subject: BackupInstance
316-
variant: ^Validate1$|^ValidateExpanded1$|^ValidateViaIdentity1$|^ValidateViaIdentityExpanded1$
325+
variant: ^Validate2$|^ValidateExpanded2$|^ValidateViaIdentity2$|^ValidateViaIdentityExpanded2$
317326
set:
318327
subject: BackupInstanceRestore
319328
- where:
@@ -322,6 +331,17 @@ directive:
322331
variant: ^Validate$|^ValidateExpanded$|^ValidateViaIdentity$|^ValidateViaIdentityExpanded$
323332
set:
324333
subject: BackupInstanceReadiness
334+
- where:
335+
verb: Test
336+
subject: BackupInstance
337+
variant: ^Validate1$|^ValidateExpanded1$|^ValidateViaIdentity1$|^ValidateViaIdentityExpanded1$
338+
set:
339+
subject: BackupInstanceUpdate
340+
- where:
341+
verb: Test
342+
subject: BackupInstanceUpdate
343+
variant: ^Validate1$|^ValidateViaIdentity1$|^ValidateViaIdentityExpanded1$
344+
hide: true
325345
- where:
326346
verb: Test
327347
subject: BackupInstanceReadiness
@@ -330,12 +350,19 @@ directive:
330350
- where:
331351
verb: Test
332352
subject: BackupInstanceRestore
333-
variant: ^Validate1$|^ValidateExpanded1$|^ValidateViaIdentity1$|^ValidateViaIdentityExpanded1$
353+
variant: ^Validate2$|^ValidateExpanded2$|^ValidateViaIdentity2$|^ValidateViaIdentityExpanded2$
334354
hide: true
335355
- where:
336356
verb: Test
337357
subject: BackupInstanceCrossRegionRestore
338358
hide: true
359+
- where:
360+
verb: Test
361+
subject: BackupInstanceUpdate
362+
parameter-name: Name
363+
set:
364+
alias:
365+
- BackupInstanceName
339366
- where:
340367
subject: FetchCrossRegionRestoreJob
341368
set:
@@ -440,19 +467,19 @@ directive:
440467
- EncryptionSettings
441468
- from: source-file-csharp
442469
where: $
443-
transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20240401.IBaseBackupPolicy Property', 'public Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20240401.IBaseBackupPolicy Property');
470+
transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api202501.IBaseBackupPolicy Property', 'public Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api202501.IBaseBackupPolicy Property');
444471
- from: source-file-csharp
445472
where: $
446-
transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20240401.ITriggerContext Trigger', 'public Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20240401.ITriggerContext Trigger');
473+
transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api202501.ITriggerContext Trigger', 'public Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api202501.ITriggerContext Trigger');
447474
- from: source-file-csharp
448475
where: $
449-
transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20240401.IBackupParameters BackupParameter', 'public Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20240401.IBackupParameters BackupParameter');
476+
transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api202501.IBackupParameters BackupParameter', 'public Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api202501.IBackupParameters BackupParameter');
450477
- from: source-file-csharp
451478
where: $
452-
transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20240401.IAzureBackupRecoveryPoint Property', 'public Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20240401.IAzureBackupRecoveryPoint Property');
479+
transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api202501.IAzureBackupRecoveryPoint Property', 'public Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api202501.IAzureBackupRecoveryPoint Property');
453480
- from: source-file-csharp
454481
where: $
455-
transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20240401.INamespacedNameResource ResourceModifierReference', 'public Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20240401.INamespacedNameResource ResourceModifierReference');
482+
transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api202501.INamespacedNameResource ResourceModifierReference', 'public Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api202501.INamespacedNameResource ResourceModifierReference');
456483
```
457484
458485
## Alternate settings

src/DataProtection/DataProtection.Autorest/UX/Microsoft.DataProtection/backupVaults-backupInstances-recoveryPoints.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"resourceType": "backupVaults/backupInstances/recoveryPoints",
3-
"apiVersion": "2024-04-01",
3+
"apiVersion": "2025-01-01",
44
"learnMore": {
55
"url": "https://learn.microsoft.com/powershell/module/az.dataprotection"
66
},

src/DataProtection/DataProtection.Autorest/UX/Microsoft.DataProtection/backupVaults-backupInstances.json

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"resourceType": "backupVaults/backupInstances",
3-
"apiVersion": "2024-04-01",
3+
"apiVersion": "2025-01-01",
44
"learnMore": {
55
"url": "https://learn.microsoft.com/powershell/module/az.dataprotection"
66
},
@@ -219,6 +219,49 @@
219219
]
220220
}
221221
]
222+
},
223+
{
224+
"name": "Test-AzDataProtectionBackupInstanceUpdate",
225+
"description": "Validate whether update for backup instance will be successful or not",
226+
"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/validateForModifyBackup",
227+
"help": {
228+
"learnMore": {
229+
"url": "https://learn.microsoft.com/powershell/module/az.dataprotection/test-azdataprotectionbackupinstanceupdate"
230+
},
231+
"parameterSets": [
232+
{
233+
"parameters": [
234+
"-Name <String>",
235+
"-ResourceGroupName <String>",
236+
"[-SubscriptionId <String>]",
237+
"-VaultName <String>"
238+
]
239+
}
240+
]
241+
},
242+
"examples": [
243+
{
244+
"description": "Validate whether update for backup instance will be successful or not",
245+
"parameters": [
246+
{
247+
"name": "-Name",
248+
"value": "[Path.backupInstanceName]"
249+
},
250+
{
251+
"name": "-ResourceGroupName",
252+
"value": "[Path.resourceGroupName]"
253+
},
254+
{
255+
"name": "-SubscriptionId",
256+
"value": "[Path.subscriptionId]"
257+
},
258+
{
259+
"name": "-VaultName",
260+
"value": "[Path.vaultName]"
261+
}
262+
]
263+
}
264+
]
222265
}
223266
]
224267
}

src/DataProtection/DataProtection.Autorest/UX/Microsoft.DataProtection/backupVaults-backupJobs.json

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

src/DataProtection/DataProtection.Autorest/UX/Microsoft.DataProtection/backupVaults-backupPolicies.json

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

src/DataProtection/DataProtection.Autorest/UX/Microsoft.DataProtection/backupVaults-backupResourceGuardProxies.json

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

src/DataProtection/DataProtection.Autorest/UX/Microsoft.DataProtection/backupVaults-deletedBackupInstances.json

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

src/DataProtection/DataProtection.Autorest/UX/Microsoft.DataProtection/backupVaults.json

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

0 commit comments

Comments
 (0)