Skip to content

Commit 5d3192d

Browse files
authored
Merge pull request Azure#2 from t-anssingh102/anssingh/autogen
Added SAPHANA manifest and examples for GetBackupPolicy
2 parents 464db57 + ff770f4 commit 5d3192d

File tree

5 files changed

+194
-19
lines changed

5 files changed

+194
-19
lines changed

src/RecoveryServices/RecoveryServices.Backup.Autorest/README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ AutoRest does not generate authentication code for the module. Authentication is
2626
For information on how to develop for `Az.RecoveryServices`, see [how-to.md](how-to.md).
2727
<!-- endregion -->
2828

29-
# My API
29+
# My API
3030

3131
This file contains the configuration for generating My API from the OpenAPI specification.
3232

@@ -41,7 +41,6 @@ input-file:
4141
- $(repo)/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-02-01/bms.json
4242
title: RecoveryServices
4343
directive:
44-
4544
- where:
4645
verb: Remove
4746
subject: ProtectionPolicy
@@ -52,6 +51,11 @@ directive:
5251
subject: ProtectedItem
5352
variant: GetViaIdentity
5453
remove: true
54+
- where:
55+
verb: Get
56+
subject: ProtectionPolicy
57+
variant: GetViaIdentity
58+
remove: true
5559
- where:
5660
subject: ProtectionPolicy
5761
set:
@@ -71,7 +75,7 @@ directive:
7175
transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServices.Models.Api20230201.IRetentionPolicy RetentionPolicy', 'public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServices.Models.Api20230201.IRetentionPolicy RetentionPolicy');
7276
- from: source-file-csharp
7377
where: $
74-
transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServices.Models.Api20230201.ISchedulePolicy SchedulePolicy', 'public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServices.Models.Api20230201.ISchedulePolicy SchedulePolicy');
78+
transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServices.Models.Api20230201.ISchedulePolicy SchedulePolicy', 'public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServices.Models.Api20230201.ISchedulePolicy SchedulePolicy');
7579
```
7680
7781
## Alternate settings
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
{
2+
"datasourcePermissions": [ "Storage Account Backup Contributor" ],
3+
"snapshotRGPermissions": [],
4+
"keyVaultPermissions": [],
5+
"dataSourceOverSnapshotRGPermissions": [],
6+
"isProxyResource": false,
7+
"enableDataSourceSetInfo": false,
8+
"resourceType": "Microsoft.Storage/storageAccounts",
9+
"parentResourceType": "Microsoft.Storage/storageAccounts",
10+
"datasourceType": "Microsoft.Storage/storageAccounts/blobServices",
11+
"allowedRestoreModes": [ "PointInTimeBased", "RecoveryPointBased" ],
12+
"allowedRestoreTargetTypes": [ "OriginalLocation", "AlternateLocation" ],
13+
"itemLevelRecoveyEnabled": true,
14+
"addBackupDatasourceParametersList": true,
15+
"backupConfigurationRequired": false,
16+
"addDataStoreParametersList": false,
17+
"friendlyNameRequired": false,
18+
"supportSecretStoreAuthentication": false,
19+
"policySettings": {
20+
"supportedRetentionTags": [ "Weekly", "Monthly", "Yearly" ],
21+
"supportedDatastoreTypes": [ "OperationalStore", "VaultStore" ],
22+
"disableAddRetentionRule": false,
23+
"disableCustomRetentionTag": false,
24+
"backupScheduleSupported": true,
25+
"supportedBackupFrequency": [ "Daily", "Weekly" ],
26+
"defaultPolicy": {
27+
"backupManagementType": "AzureWorkload",
28+
"workLoadType": "SAPHanaDatabase",
29+
"settings": {
30+
"timeZone": "UTC",
31+
"issqlcompression": false,
32+
"isCompression": false
33+
},
34+
"subProtectionPolicy": [
35+
{
36+
"policyType": "Full",
37+
"schedulePolicy": {
38+
"schedulePolicyType": "SimpleSchedulePolicy",
39+
"scheduleRunFrequency": "Daily",
40+
"scheduleRunTimes": [
41+
"2020-09-30T19:30:00Z"
42+
],
43+
"scheduleWeeklyFrequency": 0
44+
},
45+
"retentionPolicy": {
46+
"retentionPolicyType": "LongTermRetentionPolicy",
47+
"dailySchedule": {
48+
"retentionTimes": [
49+
"2020-09-30T19:30:00Z"
50+
],
51+
"retentionDuration": {
52+
"count": 180,
53+
"durationType": "Days"
54+
}
55+
},
56+
"weeklySchedule": {
57+
"daysOfTheWeek": [
58+
"Sunday"
59+
],
60+
"retentionTimes": [
61+
"2020-09-30T19:30:00Z"
62+
],
63+
"retentionDuration": {
64+
"count": 104,
65+
"durationType": "Weeks"
66+
}
67+
},
68+
"monthlySchedule": {
69+
"retentionScheduleFormatType": "Weekly",
70+
"retentionScheduleWeekly": {
71+
"daysOfTheWeek": [
72+
"Sunday"
73+
],
74+
"weeksOfTheMonth": [
75+
"First"
76+
]
77+
},
78+
"retentionTimes": [
79+
"2020-09-30T19:30:00Z"
80+
],
81+
"retentionDuration": {
82+
"count": 60,
83+
"durationType": "Months"
84+
}
85+
},
86+
"yearlySchedule": {
87+
"retentionScheduleFormatType": "Weekly",
88+
"monthsOfYear": [
89+
"January"
90+
],
91+
"retentionScheduleWeekly": {
92+
"daysOfTheWeek": [
93+
"Sunday"
94+
],
95+
"weeksOfTheMonth": [
96+
"First"
97+
]
98+
},
99+
"retentionTimes": [
100+
"2020-09-30T19:30:00Z"
101+
],
102+
"retentionDuration": {
103+
"count": 10,
104+
"durationType": "Years"
105+
}
106+
}
107+
},
108+
"tieringPolicy": {
109+
"ArchivedRP": {
110+
"tieringMode": "DoNotTier",
111+
"duration": 0,
112+
"durationType": "Invalid"
113+
}
114+
}
115+
},
116+
{
117+
"policyType": "Log",
118+
"schedulePolicy": {
119+
"schedulePolicyType": "LogSchedulePolicy",
120+
"scheduleFrequencyInMins": 120
121+
},
122+
"retentionPolicy": {
123+
"retentionPolicyType": "SimpleRetentionPolicy",
124+
"retentionDuration": {
125+
"count": 15,
126+
"durationType": "Days"
127+
}
128+
}
129+
}
130+
],
131+
"protectedItemsCount": 0
132+
}
133+
}
134+
}

src/RecoveryServices/RecoveryServices.Backup.Autorest/docs/Get-AzRecoveryServicesBackupPolicy.md

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,28 @@ schema: 2.0.0
88
# Get-AzRecoveryServicesBackupPolicy
99

1010
## SYNOPSIS
11-
Lists of backup policies associated with Recovery Services Vault.
12-
API provides pagination parameters to fetch\r\nscoped results.
11+
Provides the details of the backup policies associated to Recovery Services Vault.
12+
This is an asynchronous\r\noperation.
13+
Status of the operation can be fetched using GetPolicyOperationResult API.
1314

1415
## SYNTAX
1516

17+
### List (Default)
1618
```
1719
Get-AzRecoveryServicesBackupPolicy -ResourceGroupName <String> -VaultName <String>
1820
[-SubscriptionId <String[]>] [-Filter <String>] [-DefaultProfile <PSObject>] [<CommonParameters>]
1921
```
2022

23+
### Get
24+
```
25+
Get-AzRecoveryServicesBackupPolicy -PolicyName <String> -ResourceGroupName <String> -VaultName <String>
26+
[-SubscriptionId <String[]>] [-DefaultProfile <PSObject>] [<CommonParameters>]
27+
```
28+
2129
## DESCRIPTION
22-
Lists of backup policies associated with Recovery Services Vault.
23-
API provides pagination parameters to fetch\r\nscoped results.
30+
Provides the details of the backup policies associated to Recovery Services Vault.
31+
This is an asynchronous\r\noperation.
32+
Status of the operation can be fetched using GetPolicyOperationResult API.
2433

2534
## EXAMPLES
2635

@@ -69,7 +78,7 @@ OData filter options.
6978
7079
```yaml
7180
Type: System.String
72-
Parameter Sets: (All)
81+
Parameter Sets: List
7382
Aliases:
7483

7584
Required: False
@@ -79,6 +88,21 @@ Accept pipeline input: False
7988
Accept wildcard characters: False
8089
```
8190
91+
### -PolicyName
92+
Name of the backup policy to be fetched
93+
94+
```yaml
95+
Type: System.String
96+
Parameter Sets: Get
97+
Aliases:
98+
99+
Required: True
100+
Position: Named
101+
Default value: None
102+
Accept pipeline input: False
103+
Accept wildcard characters: False
104+
```
105+
82106
### -ResourceGroupName
83107
The name of the resource group where the recovery services vault is present.
84108
Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,35 @@
1-
### Example 1: {{ Add title here }}
1+
### Example 1: Get all backup policies in a recovery services vault
22
```powershell
3-
{{ Add code here }}
4-
```
3+
$pol = Get-AzRecoveryServicesBackupProtectionPolicy -ResourceGroupName "myresourcegroup" -VaultName "myvault"
4+
$pol
5+
```
6+
57
68
```output
7-
{{ Add output here }}
9+
ETag Id Location Name Type
10+
---- -- -------- ---- ----
11+
/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx/resourceGroups/myresourcegroup/providers/Microsoft.RecoveryServices/vaults/myvault/backupPolicies/policy1 policy1 Microsoft.RecoveryServices/vaults/backupPolicies
12+
/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx/resourceGroups/myresourcegroup/providers/Microsoft.RecoveryServices/vaults/myvault/backupPolicies/HourlyLogBackup HourlyLogBackup Microsoft.RecoveryServices/vaults/backupPolicies
13+
/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx/resourceGroups/myresourcegroup/providers/Microsoft.RecoveryServices/vaults/myvault/backupPolicies/DefaultPolicy DefaultPolicy Microsoft.RecoveryServices/vaults/backupPolicies
14+
/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx/resourceGroups/myresourcegroup/providers/Microsoft.RecoveryServices/vaults/myvault/backupPolicies/policy2 policy2 Microsoft.RecoveryServices/vaults/backupPolicies
15+
/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx/resourceGroups/myresourcegroup/providers/Microsoft.RecoveryServices/vaults/myvault/backupPolicies/testPolicy testPolicy Microsoft.RecoveryServices/vaults/backupPolicies
16+
/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx/resourceGroups/myresourcegroup/providers/Microsoft.RecoveryServices/vaults/myvault/backupPolicies/EnhancedPolicy EnhancedPolicy Microsoft.RecoveryServices/vaults/backupPolicies
817
```
918

10-
{{ Add description here }}
1119

12-
### Example 2: {{ Add title here }}
20+
Gets all the backup policies in the specified vault in the specified resource group.
21+
22+
### Example 2: Get info for a specific backup policy
1323
```powershell
14-
{{ Add code here }}
24+
$pol = Get-AzRecoveryServicesBackupProtectionPolicy -ResourceGroupName "myresourcegroup" -VaultName "myvault" -Name "DefaultPolicy"
25+
$pol
1526
```
1627

1728
```output
18-
{{ Add output here }}
19-
```
29+
ETag Id Location Name Type
30+
---- -- -------- ---- ----
31+
/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx/resourceGroups/myresourcegroup/providers/Microsoft.RecoveryServices/vaults/myvault/backupPolicies/testPolicy testPolicy Microsoft.RecoveryServices/vaults/backupPolicies
2032
21-
{{ Add description here }}
33+
```
2234

35+
Gets info for a specific backup policy by its name in the specified vault in the specified resource group.

src/RecoveryServices/RecoveryServices.Backup.Autorest/examples/Remove-AzRecoveryServicesBackupPolicy.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
88
```
99

10-
This command deletes the specified existing policy.
10+
This command deletes the specified existing policy.

0 commit comments

Comments
 (0)