|
2 | 2 |
|
3 | 3 | Azure Resource Manager RecoveryServicesBackup client library for Java.
|
4 | 4 |
|
5 |
| -This package contains Microsoft Azure SDK for RecoveryServicesBackup Management SDK. Open API 2.0 Specs for Azure RecoveryServices Backup service. Package tag package-2023-02. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). |
| 5 | +This package contains Microsoft Azure SDK for RecoveryServicesBackup Management SDK. Open API 2.0 Specs for Azure RecoveryServices Backup service. Package tag package-2023-04. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). |
6 | 6 |
|
7 | 7 | ## We'd love to hear your feedback
|
8 | 8 |
|
@@ -32,7 +32,7 @@ Various documentation is available to help you get started
|
32 | 32 | <dependency>
|
33 | 33 | <groupId>com.azure.resourcemanager</groupId>
|
34 | 34 | <artifactId>azure-resourcemanager-recoveryservicesbackup</artifactId>
|
35 |
| - <version>1.1.0</version> |
| 35 | + <version>1.2.0-beta.1</version> |
36 | 36 | </dependency>
|
37 | 37 | ```
|
38 | 38 | [//]: # ({x-version-update-end})
|
@@ -74,6 +74,103 @@ See [API design][design] for general introduction on design and key concepts on
|
74 | 74 |
|
75 | 75 | ## Examples
|
76 | 76 |
|
| 77 | +```java |
| 78 | +OffsetDateTime scheduleDateTime = OffsetDateTime.parse( |
| 79 | + OffsetDateTime.now(Clock.systemUTC()) |
| 80 | + .withNano(0).withMinute(0).withSecond(0) |
| 81 | + .plusDays(1).format(DateTimeFormatter.ISO_INSTANT)); |
| 82 | + |
| 83 | +List<SubProtectionPolicy> lstSubProtectionPolicy = Arrays.asList( |
| 84 | + new SubProtectionPolicy() |
| 85 | + .withPolicyType(PolicyType.FULL) |
| 86 | + .withSchedulePolicy( |
| 87 | + new SimpleSchedulePolicy() |
| 88 | + .withScheduleRunFrequency(ScheduleRunType.WEEKLY) |
| 89 | + .withScheduleRunDays(Arrays.asList(DayOfWeek.SUNDAY, DayOfWeek.TUESDAY)) |
| 90 | + .withScheduleRunTimes(Arrays.asList(scheduleDateTime))) |
| 91 | + .withRetentionPolicy( |
| 92 | + new LongTermRetentionPolicy() |
| 93 | + .withWeeklySchedule( |
| 94 | + new WeeklyRetentionSchedule() |
| 95 | + .withDaysOfTheWeek(Arrays.asList(DayOfWeek.SUNDAY, DayOfWeek.TUESDAY)) |
| 96 | + .withRetentionTimes(Arrays.asList(scheduleDateTime)) |
| 97 | + .withRetentionDuration( |
| 98 | + new RetentionDuration() |
| 99 | + .withCount(2) |
| 100 | + .withDurationType(RetentionDurationType.WEEKS))) |
| 101 | + .withMonthlySchedule( |
| 102 | + new MonthlyRetentionSchedule() |
| 103 | + .withRetentionScheduleFormatType(RetentionScheduleFormat.WEEKLY) |
| 104 | + .withRetentionScheduleWeekly( |
| 105 | + new WeeklyRetentionFormat() |
| 106 | + .withDaysOfTheWeek(Arrays.asList(DayOfWeek.SUNDAY)) |
| 107 | + .withWeeksOfTheMonth(Arrays.asList(WeekOfMonth.SECOND))) |
| 108 | + .withRetentionTimes(Arrays.asList(scheduleDateTime)) |
| 109 | + .withRetentionDuration( |
| 110 | + new RetentionDuration() |
| 111 | + .withCount(1) |
| 112 | + .withDurationType(RetentionDurationType.MONTHS))) |
| 113 | + .withYearlySchedule( |
| 114 | + new YearlyRetentionSchedule() |
| 115 | + .withRetentionScheduleFormatType(RetentionScheduleFormat.WEEKLY) |
| 116 | + .withMonthsOfYear(Arrays.asList(MonthOfYear.JANUARY, MonthOfYear.JUNE, MonthOfYear.DECEMBER)) |
| 117 | + .withRetentionScheduleWeekly( |
| 118 | + new WeeklyRetentionFormat() |
| 119 | + .withDaysOfTheWeek(Arrays.asList(DayOfWeek.SUNDAY)) |
| 120 | + .withWeeksOfTheMonth(Arrays.asList(WeekOfMonth.LAST))) |
| 121 | + .withRetentionTimes(Arrays.asList(scheduleDateTime)) |
| 122 | + .withRetentionDuration( |
| 123 | + new RetentionDuration() |
| 124 | + .withCount(1) |
| 125 | + .withDurationType(RetentionDurationType.YEARS)))), |
| 126 | + new SubProtectionPolicy() |
| 127 | + .withPolicyType(PolicyType.DIFFERENTIAL) |
| 128 | + .withSchedulePolicy( |
| 129 | + new SimpleSchedulePolicy() |
| 130 | + .withScheduleRunFrequency(ScheduleRunType.WEEKLY) |
| 131 | + .withScheduleRunDays(Arrays.asList(DayOfWeek.FRIDAY)) |
| 132 | + .withScheduleRunTimes(Arrays.asList(scheduleDateTime))) |
| 133 | + .withRetentionPolicy( |
| 134 | + new SimpleRetentionPolicy() |
| 135 | + .withRetentionDuration( |
| 136 | + new RetentionDuration() |
| 137 | + .withCount(8) |
| 138 | + .withDurationType(RetentionDurationType.DAYS))), |
| 139 | + new SubProtectionPolicy() |
| 140 | + .withPolicyType(PolicyType.LOG) |
| 141 | + .withSchedulePolicy(new LogSchedulePolicy().withScheduleFrequencyInMins(60)) |
| 142 | + .withRetentionPolicy( |
| 143 | + new SimpleRetentionPolicy() |
| 144 | + .withRetentionDuration( |
| 145 | + new RetentionDuration() |
| 146 | + .withCount(7) |
| 147 | + .withDurationType(RetentionDurationType.DAYS)))); |
| 148 | + |
| 149 | +vault = recoveryServicesManager.vaults() |
| 150 | + .define(vaultName) |
| 151 | + .withRegion(REGION) |
| 152 | + .withExistingResourceGroup(resourceGroupName) |
| 153 | + .withSku(new Sku().withName(SkuName.RS0).withTier("Standard")) |
| 154 | + .withProperties(new VaultProperties() |
| 155 | + .withPublicNetworkAccess(PublicNetworkAccess.ENABLED) |
| 156 | + .withRestoreSettings(new RestoreSettings() |
| 157 | + .withCrossSubscriptionRestoreSettings( |
| 158 | + new CrossSubscriptionRestoreSettings() |
| 159 | + .withCrossSubscriptionRestoreState(CrossSubscriptionRestoreState.ENABLED)))) |
| 160 | + .create(); |
| 161 | + |
| 162 | +protectionPolicyResource = recoveryServicesBackupManager.protectionPolicies() |
| 163 | + .define(policyName) |
| 164 | + .withRegion(REGION) |
| 165 | + .withExistingVault(vaultName, resourceGroupName) |
| 166 | + .withProperties( |
| 167 | + new AzureVmWorkloadProtectionPolicy() |
| 168 | + .withWorkLoadType(WorkloadType.SQLDATA_BASE) |
| 169 | + .withSettings(new Settings().withTimeZone("Pacific Standard Time").withIssqlcompression(false)) |
| 170 | + .withSubProtectionPolicy(lstSubProtectionPolicy) |
| 171 | + ) |
| 172 | + .create(); |
| 173 | +``` |
77 | 174 | [Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/SAMPLE.md)
|
78 | 175 |
|
79 | 176 |
|
@@ -103,3 +200,5 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m
|
103 | 200 | [cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md
|
104 | 201 | [coc]: https://opensource.microsoft.com/codeofconduct/
|
105 | 202 | [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/
|
| 203 | + |
| 204 | + |
0 commit comments