Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Release History

## 1.2.0-beta.1 (Unreleased)
## 1.0.0-beta.1 (2023-08-28)

- Azure Resource Manager DataProtection client library for Java. This package contains Microsoft Azure SDK for DataProtection Management SDK. Open API 2.0 Specs for Azure Data Protection service. Package tag package-preview-2023-06. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).

### Features Added

Expand Down
39 changes: 37 additions & 2 deletions sdk/dataprotection/azure-resourcemanager-dataprotection/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Azure Resource Manager DataProtection client library for Java.

This package contains Microsoft Azure SDK for DataProtection Management SDK. Open API 2.0 Specs for Azure Data Protection service. Package tag package-2023-05. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
This package contains Microsoft Azure SDK for DataProtection Management SDK. Open API 2.0 Specs for Azure Data Protection service. Package tag package-preview-2023-06. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).

## We'd love to hear your feedback

Expand Down Expand Up @@ -32,7 +32,7 @@ Various documentation is available to help you get started
<dependency>
<groupId>com.azure.resourcemanager</groupId>
<artifactId>azure-resourcemanager-dataprotection</artifactId>
<version>1.1.0</version>
<version>1.2.0-beta.1</version>
</dependency>
```
[//]: # ({x-version-update-end})
Expand Down Expand Up @@ -74,6 +74,41 @@ See [API design][design] for general introduction on design and key concepts on

## Examples

```java
resource = dataProtectionManager
.backupVaults()
.define(vaultName)
.withRegion(REGION)
.withExistingResourceGroup(resourceGroupName)
.withProperties(
new BackupVault()
.withMonitoringSettings(
new MonitoringSettings()
.withAzureMonitorAlertSettings(
new AzureMonitorAlertSettings()
.withAlertsForAllJobFailures(AlertsState.ENABLED)))
.withSecuritySettings(
new SecuritySettings()
.withSoftDeleteSettings(
new SoftDeleteSettings()
.withState(SoftDeleteState.ALWAYS_ON)
.withRetentionDurationInDays(14.0D))
.withImmutabilitySettings(
new ImmutabilitySettings()
.withState(ImmutabilityState.LOCKED)))
.withStorageSettings(
Collections.singletonList(
new StorageSetting()
.withDatastoreType(StorageSettingStoreTypes.VAULT_STORE)
.withType(StorageSettingTypes.LOCALLY_REDUNDANT)))
.withFeatureSettings(
new FeatureSettings()
.withCrossSubscriptionRestoreSettings(
new CrossSubscriptionRestoreSettings()
.withState(CrossSubscriptionRestoreState.ENABLED))))
.withIdentity(new DppIdentityDetails().withType("systemAssigned"))
.create();
```
[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/dataprotection/azure-resourcemanager-dataprotection/SAMPLE.md)


Expand Down
492 changes: 422 additions & 70 deletions sdk/dataprotection/azure-resourcemanager-dataprotection/SAMPLE.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<packaging>jar</packaging>

<name>Microsoft Azure SDK for DataProtection Management</name>
<description>This package contains Microsoft Azure SDK for DataProtection Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Open API 2.0 Specs for Azure Data Protection service. Package tag package-2023-05.</description>
<description>This package contains Microsoft Azure SDK for DataProtection Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Open API 2.0 Specs for Azure Data Protection service. Package tag package-preview-2023-06.</description>
<url>https://github.com/Azure/azure-sdk-for-java</url>

<licenses>
Expand All @@ -45,6 +45,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jacoco.min.linecoverage>0</jacoco.min.linecoverage>
<jacoco.min.branchcoverage>0</jacoco.min.branchcoverage>
<revapi.skip>true</revapi.skip>
</properties>
<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,13 @@
import com.azure.core.util.Configuration;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.dataprotection.fluent.DataProtectionClient;
import com.azure.resourcemanager.dataprotection.implementation.BackupInstancesExtensionRoutingsImpl;
import com.azure.resourcemanager.dataprotection.implementation.BackupInstancesImpl;
import com.azure.resourcemanager.dataprotection.implementation.BackupPoliciesImpl;
import com.azure.resourcemanager.dataprotection.implementation.BackupVaultOperationResultsImpl;
import com.azure.resourcemanager.dataprotection.implementation.BackupVaultsImpl;
import com.azure.resourcemanager.dataprotection.implementation.CrossRegionRestoreJobsImpl;
import com.azure.resourcemanager.dataprotection.implementation.CrossRegionRestoreJobsOperationsImpl;
import com.azure.resourcemanager.dataprotection.implementation.DataProtectionClientBuilder;
import com.azure.resourcemanager.dataprotection.implementation.DataProtectionOperationsImpl;
import com.azure.resourcemanager.dataprotection.implementation.DataProtectionsImpl;
Expand All @@ -43,10 +46,14 @@
import com.azure.resourcemanager.dataprotection.implementation.RecoveryPointsImpl;
import com.azure.resourcemanager.dataprotection.implementation.ResourceGuardsImpl;
import com.azure.resourcemanager.dataprotection.implementation.RestorableTimeRangesImpl;
import com.azure.resourcemanager.dataprotection.implementation.SecondaryRPsImpl;
import com.azure.resourcemanager.dataprotection.models.BackupInstances;
import com.azure.resourcemanager.dataprotection.models.BackupInstancesExtensionRoutings;
import com.azure.resourcemanager.dataprotection.models.BackupPolicies;
import com.azure.resourcemanager.dataprotection.models.BackupVaultOperationResults;
import com.azure.resourcemanager.dataprotection.models.BackupVaults;
import com.azure.resourcemanager.dataprotection.models.CrossRegionRestoreJobs;
import com.azure.resourcemanager.dataprotection.models.CrossRegionRestoreJobsOperations;
import com.azure.resourcemanager.dataprotection.models.DataProtectionOperations;
import com.azure.resourcemanager.dataprotection.models.DataProtections;
import com.azure.resourcemanager.dataprotection.models.DeletedBackupInstances;
Expand All @@ -61,6 +68,7 @@
import com.azure.resourcemanager.dataprotection.models.RecoveryPoints;
import com.azure.resourcemanager.dataprotection.models.ResourceGuards;
import com.azure.resourcemanager.dataprotection.models.RestorableTimeRanges;
import com.azure.resourcemanager.dataprotection.models.SecondaryRPs;
import java.time.Duration;
import java.time.temporal.ChronoUnit;
import java.util.ArrayList;
Expand Down Expand Up @@ -92,6 +100,14 @@ public final class DataProtectionManager {

private RecoveryPoints recoveryPoints;

private SecondaryRPs secondaryRPs;

private CrossRegionRestoreJobs crossRegionRestoreJobs;

private CrossRegionRestoreJobsOperations crossRegionRestoreJobsOperations;

private BackupInstancesExtensionRoutings backupInstancesExtensionRoutings;

private Jobs jobs;

private RestorableTimeRanges restorableTimeRanges;
Expand Down Expand Up @@ -271,7 +287,7 @@ public DataProtectionManager authenticate(TokenCredential credential, AzureProfi
.append("-")
.append("com.azure.resourcemanager.dataprotection")
.append("/")
.append("1.1.0");
.append("1.0.0-beta.1");
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
userAgentBuilder
.append(" (")
Expand Down Expand Up @@ -465,6 +481,57 @@ public RecoveryPoints recoveryPoints() {
return recoveryPoints;
}

/**
* Gets the resource collection API of SecondaryRPs.
*
* @return Resource collection API of SecondaryRPs.
*/
public SecondaryRPs secondaryRPs() {
if (this.secondaryRPs == null) {
this.secondaryRPs = new SecondaryRPsImpl(clientObject.getSecondaryRPs(), this);
}
return secondaryRPs;
}

/**
* Gets the resource collection API of CrossRegionRestoreJobs.
*
* @return Resource collection API of CrossRegionRestoreJobs.
*/
public CrossRegionRestoreJobs crossRegionRestoreJobs() {
if (this.crossRegionRestoreJobs == null) {
this.crossRegionRestoreJobs =
new CrossRegionRestoreJobsImpl(clientObject.getCrossRegionRestoreJobs(), this);
}
return crossRegionRestoreJobs;
}

/**
* Gets the resource collection API of CrossRegionRestoreJobsOperations.
*
* @return Resource collection API of CrossRegionRestoreJobsOperations.
*/
public CrossRegionRestoreJobsOperations crossRegionRestoreJobsOperations() {
if (this.crossRegionRestoreJobsOperations == null) {
this.crossRegionRestoreJobsOperations =
new CrossRegionRestoreJobsOperationsImpl(clientObject.getCrossRegionRestoreJobsOperations(), this);
}
return crossRegionRestoreJobsOperations;
}

/**
* Gets the resource collection API of BackupInstancesExtensionRoutings.
*
* @return Resource collection API of BackupInstancesExtensionRoutings.
*/
public BackupInstancesExtensionRoutings backupInstancesExtensionRoutings() {
if (this.backupInstancesExtensionRoutings == null) {
this.backupInstancesExtensionRoutings =
new BackupInstancesExtensionRoutingsImpl(clientObject.getBackupInstancesExtensionRoutings(), this);
}
return backupInstancesExtensionRoutings;
}

/**
* Gets the resource collection API of Jobs.
*
Expand Down Expand Up @@ -553,8 +620,10 @@ public DppResourceGuardProxies dppResourceGuardProxies() {
}

/**
* @return Wrapped service client DataProtectionClient providing direct access to the underlying auto-generated API
* implementation, based on Azure REST API.
* Gets wrapped service client DataProtectionClient providing direct access to the underlying auto-generated API
* implementation, based on Azure REST API.
*
* @return Wrapped service client DataProtectionClient.
*/
public DataProtectionClient serviceClient() {
return this.clientObject;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
import com.azure.resourcemanager.dataprotection.fluent.models.OperationJobExtendedInfoInner;
import com.azure.resourcemanager.dataprotection.models.AzureBackupRehydrationRequest;
import com.azure.resourcemanager.dataprotection.models.AzureBackupRestoreRequest;
import com.azure.resourcemanager.dataprotection.models.CrossRegionRestoreRequestObject;
import com.azure.resourcemanager.dataprotection.models.SyncBackupInstanceRequest;
import com.azure.resourcemanager.dataprotection.models.TriggerBackupRequest;
import com.azure.resourcemanager.dataprotection.models.ValidateCrossRegionRestoreRequestObject;
import com.azure.resourcemanager.dataprotection.models.ValidateForBackupRequest;
import com.azure.resourcemanager.dataprotection.models.ValidateRestoreRequestObject;

Expand Down Expand Up @@ -380,6 +382,135 @@ Response<BackupInstanceResourceInner> getBackupInstanceOperationResultWithRespon
BackupInstanceResourceInner getBackupInstanceOperationResult(
String resourceGroupName, String vaultName, String backupInstanceName, String operationId);

/**
* The triggerCrossRegionRestore operation.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The location parameter.
* @param parameters Request body for trigger CRR operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of operationJobExtendedInfo.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<OperationJobExtendedInfoInner>, OperationJobExtendedInfoInner> beginTriggerCrossRegionRestore(
String resourceGroupName, String location, CrossRegionRestoreRequestObject parameters);

/**
* The triggerCrossRegionRestore operation.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The location parameter.
* @param parameters Request body for trigger CRR operation.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of operationJobExtendedInfo.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<OperationJobExtendedInfoInner>, OperationJobExtendedInfoInner> beginTriggerCrossRegionRestore(
String resourceGroupName, String location, CrossRegionRestoreRequestObject parameters, Context context);

/**
* The triggerCrossRegionRestore operation.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The location parameter.
* @param parameters Request body for trigger CRR operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return operationJobExtendedInfo.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
OperationJobExtendedInfoInner triggerCrossRegionRestore(
String resourceGroupName, String location, CrossRegionRestoreRequestObject parameters);

/**
* The triggerCrossRegionRestore operation.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The location parameter.
* @param parameters Request body for trigger CRR operation.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return operationJobExtendedInfo.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
OperationJobExtendedInfoInner triggerCrossRegionRestore(
String resourceGroupName, String location, CrossRegionRestoreRequestObject parameters, Context context);

/**
* The validateCrossRegionRestore operation.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The location parameter.
* @param parameters Request body for operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of operationJobExtendedInfo.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<OperationJobExtendedInfoInner>, OperationJobExtendedInfoInner>
beginValidateCrossRegionRestore(
String resourceGroupName, String location, ValidateCrossRegionRestoreRequestObject parameters);

/**
* The validateCrossRegionRestore operation.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The location parameter.
* @param parameters Request body for operation.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of operationJobExtendedInfo.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<OperationJobExtendedInfoInner>, OperationJobExtendedInfoInner>
beginValidateCrossRegionRestore(
String resourceGroupName,
String location,
ValidateCrossRegionRestoreRequestObject parameters,
Context context);

/**
* The validateCrossRegionRestore operation.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The location parameter.
* @param parameters Request body for operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return operationJobExtendedInfo.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
OperationJobExtendedInfoInner validateCrossRegionRestore(
String resourceGroupName, String location, ValidateCrossRegionRestoreRequestObject parameters);

/**
* The validateCrossRegionRestore operation.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The location parameter.
* @param parameters Request body for operation.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return operationJobExtendedInfo.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
OperationJobExtendedInfoInner validateCrossRegionRestore(
String resourceGroupName, String location, ValidateCrossRegionRestoreRequestObject parameters, Context context);

/**
* rehydrate recovery point for restore for a BackupInstance.
*
Expand Down
Loading