diff --git a/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/KeyVaultAdministrationServiceVersion.java b/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/KeyVaultAdministrationServiceVersion.java
index f816b886c8cbb..9da3c1ae7476c 100644
--- a/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/KeyVaultAdministrationServiceVersion.java
+++ b/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/KeyVaultAdministrationServiceVersion.java
@@ -27,12 +27,7 @@ public enum KeyVaultAdministrationServiceVersion implements ServiceVersion {
/**
* Service version {@code 7.5}.
*/
- V7_5("7.5"),
-
- /**
- * Service version {@code 7.6-preview.1}.
- */
- V7_6_PREVIEW_1("7.6-preview.1");
+ V7_5("7.5");
private final String version;
@@ -51,6 +46,6 @@ public String getVersion() {
* @return The latest {@link KeyVaultAdministrationServiceVersion}.
*/
public static KeyVaultAdministrationServiceVersion getLatest() {
- return V7_6_PREVIEW_1;
+ return V7_5;
}
}
diff --git a/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/KeyVaultBackupAsyncClient.java b/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/KeyVaultBackupAsyncClient.java
index e49ae353a98b4..d4ed2f1d1f926 100644
--- a/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/KeyVaultBackupAsyncClient.java
+++ b/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/KeyVaultBackupAsyncClient.java
@@ -18,8 +18,6 @@
import com.azure.core.util.polling.PollingContext;
import com.azure.security.keyvault.administration.implementation.KeyVaultBackupClientImpl;
import com.azure.security.keyvault.administration.implementation.KeyVaultErrorCodeStrings;
-import com.azure.security.keyvault.administration.implementation.models.PreBackupOperationParameters;
-import com.azure.security.keyvault.administration.implementation.models.PreRestoreOperationParameters;
import com.azure.security.keyvault.administration.implementation.models.RestoreOperation;
import com.azure.security.keyvault.administration.implementation.models.RestoreOperationParameters;
import com.azure.security.keyvault.administration.implementation.models.SASTokenParameter;
@@ -91,7 +89,8 @@
*
*
* String blobStorageUrl = "https://myaccount.blob.core.windows.net/myContainer";
- * String sasToken = "<sas-token>";
+ * String sasToken = "sv=2020-02-10&ss=b&srt=o&sp=rwdlactfx&se=2021-06-17T07:13:07Z&st=2021-06-16T23:13:07Z"
+ * + "&spr=https&sig=n5V6fnlkViEF9b7ij%2FttTHNwO2BdFIHKHppRxGAyJdc%3D";
*
* client.beginBackup(blobStorageUrl, sasToken)
* .setPollInterval(Duration.ofSeconds(1)) // You can set a custom polling interval.
@@ -121,7 +120,8 @@
*
*
* String folderUrl = "https://myaccount.blob.core.windows.net/myContainer/mhsm-myaccount-2020090117323313";
- * String sasToken = "<sas-token>";
+ * String sasToken = "sv=2020-02-10&ss=b&srt=o&sp=rwdlactfx&se=2021-06-17T07:13:07Z&st=2021-06-16T23:13:07Z"
+ * + "&spr=https&sig=n5V6fnlkViEF9b7ij%2FttTHNwO2BdFIHKHppRxGAyJdc%3D";
*
* client.beginRestore(folderUrl, sasToken)
* .setPollInterval(Duration.ofSeconds(1)) // You can set a custom polling interval.
@@ -150,7 +150,8 @@
*
*
* String folderUrl = "https://myaccount.blob.core.windows.net/myContainer/mhsm-myaccount-2020090117323313";
- * String sasToken = "<sas-token>";
+ * String sasToken = "sv=2020-02-10&ss=b&srt=o&sp=rwdlactfx&se=2021-06-17T07:13:07Z&st=2021-06-16T23:13:07Z"
+ * + "&spr=https&sig=n5V6fnlkViEF9b7ij%2FttTHNwO2BdFIHKHppRxGAyJdc%3D";
* String keyName = "myKey";
*
* client.beginSelectiveKeyRestore(folderUrl, sasToken, keyName)
@@ -248,7 +249,8 @@ HttpPipeline getHttpPipeline() {
*
*
* String blobStorageUrl = "https://myaccount.blob.core.windows.net/myContainer";
- * String sasToken = "<sas-token>";
+ * String sasToken = "sv=2020-02-10&ss=b&srt=o&sp=rwdlactfx&se=2021-06-17T07:13:07Z&st=2021-06-16T23:13:07Z"
+ * + "&spr=https&sig=n5V6fnlkViEF9b7ij%2FttTHNwO2BdFIHKHppRxGAyJdc%3D";
*
* client.beginBackup(blobStorageUrl, sasToken)
* .setPollInterval(Duration.ofSeconds(1)) // You can set a custom polling interval.
@@ -398,101 +400,6 @@ private static Mono> processBackupOperatio
toLongRunningOperationStatus(operationStatus.toLowerCase(Locale.US)), response.getValue()));
}
- /**
- * Initiates a pre-backup check on the Key Vault. This operation checks if it is possible to back up the entire
- * collection of keys from a key vault.
- *
- * Code Samples
- * Starts a {@link KeyVaultBackupOperation pre-backup operation}, polls for its status and waits for it to
- * complete. Prints out the details of the operation's final result in case of success or prints out details of an
- * error in case the operation fails.
- *
- *
- * String blobStorageUrl = "https://myaccount.blob.core.windows.net/myContainer";
- * String sasToken = "<sas-token>";
- *
- * client.beginPreBackup(blobStorageUrl, sasToken)
- * .setPollInterval(Duration.ofSeconds(1)) // You can set a custom polling interval.
- * .doOnError(e -> System.out.printf("Pre-backup check failed with error: %s.%n", e.getMessage()))
- * .doOnNext(pollResponse ->
- * System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus()))
- * .filter(pollResponse -> pollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED)
- * .flatMap(AsyncPollResponse::getFinalResult)
- * .subscribe(unused -> System.out.printf("Pre-backup check completed successfully.%n"));
- *
- *
- *
- * @param blobStorageUrl The URL for the Blob Storage resource where the backup will be located.
- * @param sasToken Optional Shared Access Signature (SAS) token to authorize access to the blob. If {@code null},
- * Managed Identity will be used to authenticate instead.
- *
- * @return A {@link PollerFlux} polling on the {@link KeyVaultBackupOperation pre-backup operation} status.
- *
- * @throws KeyVaultAdministrationException If the given {@code blobStorageUrl} or {@code sasToken} are invalid.
- * @throws NullPointerException If the {@code blobStorageUrl} is {@code null}.
- */
- @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
- public PollerFlux beginPreBackup(String blobStorageUrl, String sasToken) {
- if (blobStorageUrl == null) {
- throw LOGGER.logExceptionAsError(
- new NullPointerException(
- String.format(KeyVaultErrorCodeStrings.PARAMETER_REQUIRED, "'blobStorageUrl'")));
- }
-
- return new PollerFlux<>(getDefaultPollingInterval(),
- preBackupActivationOperation(blobStorageUrl, sasToken),
- backupPollOperation(),
- (pollingContext, firstResponse) ->
- Mono.error(LOGGER.logExceptionAsError(new RuntimeException("Cancellation is not supported"))),
- backupFetchOperation());
- }
-
- /**
- * Initiates a pre-backup check on the Key Vault. This operation checks if it is possible to back up the entire
- * collection of keys from a key vault.
- *
- * @param blobStorageUrl The URL for the Blob Storage resource where the backup will be located.
- * @param sasToken Optional Shared Access Signature (SAS) token to authorize access to the blob. If {@code null},
- * Managed Identity will be used to authenticate instead.
- * @param context Additional context that is passed through the HTTP pipeline during the service call.
- *
- * @return A {@link PollerFlux} polling on the {@link KeyVaultBackupOperation pre-backup operation} status.
- *
- * @throws KeyVaultAdministrationException If the given {@code blobStorageUrl} or {@code sasToken} are invalid.
- */
- Mono> preBackupWithResponse(String blobStorageUrl, String sasToken,
- Context context) {
- PreBackupOperationParameters preBackupOperationParameters = new PreBackupOperationParameters()
- .setStorageResourceUri(blobStorageUrl)
- .setToken(sasToken)
- .setUseManagedIdentity(sasToken == null);
-
- try {
- return clientImpl.preFullBackupWithResponseAsync(vaultUrl, preBackupOperationParameters, context)
- .doOnRequest(ignored -> LOGGER.verbose("Backing up at URL - {}", blobStorageUrl))
- .doOnSuccess(response -> LOGGER.verbose("Backed up at URL - {}",
- response.getValue().getAzureStorageBlobContainerUri()))
- .doOnError(error -> LOGGER.warning("Failed to backup at URL - {}", blobStorageUrl, error))
- .map(backupOperationResponse ->
- new SimpleResponse<>(backupOperationResponse.getRequest(), backupOperationResponse.getStatusCode(),
- backupOperationResponse.getHeaders(),
- (KeyVaultBackupOperation) transformToLongRunningOperation(backupOperationResponse.getValue())));
- } catch (RuntimeException e) {
- return monoError(LOGGER, e);
- }
- }
-
- private Function, Mono> preBackupActivationOperation(String blobStorageUrl, String sasToken) {
- return (pollingContext) -> {
- try {
- return withContext(context -> preBackupWithResponse(blobStorageUrl, sasToken, context))
- .flatMap(backupResponse -> Mono.just(backupResponse.getValue()));
- } catch (RuntimeException e) {
- return monoError(LOGGER, e);
- }
- };
- }
-
/**
* Initiates a full restore of the Key Vault.
*
@@ -502,7 +409,8 @@ private Function, Mono
*
* String folderUrl = "https://myaccount.blob.core.windows.net/myContainer/mhsm-myaccount-2020090117323313";
- * String sasToken = "<sas-token>";
+ * String sasToken = "sv=2020-02-10&ss=b&srt=o&sp=rwdlactfx&se=2021-06-17T07:13:07Z&st=2021-06-16T23:13:07Z"
+ * + "&spr=https&sig=n5V6fnlkViEF9b7ij%2FttTHNwO2BdFIHKHppRxGAyJdc%3D";
*
* client.beginRestore(folderUrl, sasToken)
* .setPollInterval(Duration.ofSeconds(1)) // You can set a custom polling interval.
@@ -646,116 +554,6 @@ static Mono> processRestoreOperationRespo
toLongRunningOperationStatus(operationStatus.toLowerCase(Locale.US)), response.getValue()));
}
- /**
- * Initiates a pre-restore check on the Key Vault. This operation checks if it is possible to restore an entire
- * collection of keys from a backup.
- *
- * Code Samples
- * Starts a {@link KeyVaultRestoreOperation pre-restore operation}, polls for its status and waits for it to
- * complete. Prints out error details in case the operation fails.
- *
- *
- * String folderUrl = "https://myaccount.blob.core.windows.net/myContainer/mhsm-myaccount-2020090117323313";
- * String sasToken = "<sas-token>";
- *
- * client.beginPreRestore(folderUrl, sasToken)
- * .setPollInterval(Duration.ofSeconds(1)) // You can set a custom polling interval.
- * .doOnError(e -> System.out.printf("Pre-restore check failed with error: %s.%n", e.getMessage()))
- * .doOnNext(pollResponse ->
- * System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus()))
- * .filter(pollResponse -> pollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED)
- * .flatMap(AsyncPollResponse::getFinalResult)
- * .subscribe(unused -> System.out.printf("Pre-restore check completed successfully.%n"));
- *
- *
- *
- * @param folderUrl The URL for the Blob Storage resource where the backup is located, including the path to
- * the blob container where the backup resides. This would be the exact value that is returned as the result of a
- * backup operation. An example of such a URL may look like the following:
- * {@code https://contoso.blob.core.windows.net/backup/mhsm-contoso-2020090117323313}.
- * @param sasToken Optional Shared Access Signature (SAS) token to authorize access to the blob. If {@code null},
- * Managed Identity will be used to authenticate instead.
- *
- * @return A {@link PollerFlux} polling on the {@link KeyVaultRestoreOperation restore operation} status.
- *
- * @throws KeyVaultAdministrationException If the given {@code folderUrl} or {@code sasToken} are invalid.
- * @throws NullPointerException If the {@code folderUrl} is {@code null}.
- */
- @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
- public PollerFlux beginPreRestore(String folderUrl,
- String sasToken) {
- if (folderUrl == null) {
- throw LOGGER.logExceptionAsError(
- new NullPointerException(String.format(KeyVaultErrorCodeStrings.PARAMETER_REQUIRED, "'folderUrl'")));
- }
-
- return new PollerFlux<>(getDefaultPollingInterval(),
- preRestoreActivationOperation(folderUrl, sasToken),
- restorePollOperation(),
- (pollingContext, firstResponse) ->
- Mono.error(LOGGER.logExceptionAsError(new RuntimeException("Cancellation is not supported"))),
- (pollingContext) -> Mono.just(new KeyVaultRestoreResult()));
- }
-
- /**
- * Initiates a pre-restore check on the Key Vault. This operation checks if it is possible to restore an entire
- * collection of keys from a backup.
- *
- * @param folderUrl The URL for the Blob Storage resource where the backup is located, including the path to
- * the blob container where the backup resides. This would be the exact value that is returned as the result of a
- * backup operation. An example of such a URL may look like the following:
- * {@code https://contoso.blob.core.windows.net/backup/mhsm-contoso-2020090117323313}.
- * @param sasToken Optional Shared Access Signature (SAS) token to authorize access to the blob. If {@code null},
- * Managed Identity will be used to authenticate instead.
- * @param context Additional context that is passed through the HTTP pipeline during the service call.
- *
- * @return A {@link PollerFlux} polling on the {@link KeyVaultRestoreOperation backup operation} status.
- *
- * @throws KeyVaultAdministrationException If the given {@code folderUrl} or {@code sasToken} are invalid.
- */
- Mono> preRestoreWithResponse(String folderUrl, String sasToken,
- Context context) {
- String[] segments = folderUrl.split("/");
- String folderName = segments[segments.length - 1];
- String containerUrl = folderUrl.substring(0, folderUrl.length() - folderName.length());
-
- SASTokenParameter sasTokenParameter = new SASTokenParameter(containerUrl)
- .setToken(sasToken)
- .setUseManagedIdentity(sasToken == null);
-
- PreRestoreOperationParameters preRestoreOperationParameters =
- new PreRestoreOperationParameters()
- .setFolderToRestore(folderName)
- .setSasTokenParameters(sasTokenParameter);
-
- try {
- return clientImpl.preFullRestoreOperationWithResponseAsync(vaultUrl, preRestoreOperationParameters, context)
- .doOnRequest(ignored -> LOGGER.verbose("Restoring from location - {}", folderUrl))
- .doOnSuccess(response -> LOGGER.verbose("Restored from location - {}", folderUrl))
- .doOnError(error ->
- LOGGER.warning("Failed to restore from location - {}", folderUrl, error))
- .map(restoreOperationResponse ->
- new SimpleResponse<>(restoreOperationResponse.getRequest(),
- restoreOperationResponse.getStatusCode(),
- restoreOperationResponse.getHeaders(),
- (KeyVaultRestoreOperation) transformToLongRunningOperation(
- restoreOperationResponse.getValue())));
- } catch (RuntimeException e) {
- return monoError(LOGGER, e);
- }
- }
-
- private Function, Mono> preRestoreActivationOperation(String folderUrl, String sasToken) {
- return (pollingContext) -> {
- try {
- return withContext(context -> preRestoreWithResponse(folderUrl, sasToken, context))
- .flatMap(restoreResponse -> Mono.just(restoreResponse.getValue()));
- } catch (RuntimeException e) {
- return monoError(LOGGER, e);
- }
- };
- }
-
/**
* Restores all versions of a given key using the supplied SAS token pointing to a previously stored Azure Blob
* storage backup folder.
@@ -766,7 +564,8 @@ private Function, Mono
*
* String folderUrl = "https://myaccount.blob.core.windows.net/myContainer/mhsm-myaccount-2020090117323313";
- * String sasToken = "<sas-token>";
+ * String sasToken = "sv=2020-02-10&ss=b&srt=o&sp=rwdlactfx&se=2021-06-17T07:13:07Z&st=2021-06-16T23:13:07Z"
+ * + "&spr=https&sig=n5V6fnlkViEF9b7ij%2FttTHNwO2BdFIHKHppRxGAyJdc%3D";
* String keyName = "myKey";
*
* client.beginSelectiveKeyRestore(folderUrl, sasToken, keyName)
diff --git a/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/KeyVaultBackupClient.java b/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/KeyVaultBackupClient.java
index 52bb3f35d5a8b..3dafe20bf84aa 100644
--- a/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/KeyVaultBackupClient.java
+++ b/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/KeyVaultBackupClient.java
@@ -22,10 +22,6 @@
import com.azure.security.keyvault.administration.implementation.models.FullBackupHeaders;
import com.azure.security.keyvault.administration.implementation.models.FullBackupOperation;
import com.azure.security.keyvault.administration.implementation.models.FullRestoreOperationHeaders;
-import com.azure.security.keyvault.administration.implementation.models.PreBackupOperationParameters;
-import com.azure.security.keyvault.administration.implementation.models.PreFullBackupHeaders;
-import com.azure.security.keyvault.administration.implementation.models.PreFullRestoreOperationHeaders;
-import com.azure.security.keyvault.administration.implementation.models.PreRestoreOperationParameters;
import com.azure.security.keyvault.administration.implementation.models.RestoreOperation;
import com.azure.security.keyvault.administration.implementation.models.RestoreOperationParameters;
import com.azure.security.keyvault.administration.implementation.models.SASTokenParameter;
@@ -96,9 +92,11 @@
*
*
* String blobStorageUrl = "https://myaccount.blob.core.windows.net/myContainer";
- * String sasToken = "<sas-token>";
+ * String sasToken = "sv=2020-02-10&ss=b&srt=o&sp=rwdlactfx&se=2021-06-17T07:13:07Z&st=2021-06-16T23:13:07Z"
+ * + "&spr=https&sig=n5V6fnlkViEF9b7ij%2FttTHNwO2BdFIHKHppRxGAyJdc%3D";
*
* SyncPoller<KeyVaultBackupOperation, String> backupPoller = client.beginBackup(blobStorageUrl, sasToken);
+ *
* PollResponse<KeyVaultBackupOperation> pollResponse = backupPoller.poll();
*
* System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus());
@@ -133,20 +131,22 @@
*
*
* String folderUrl = "https://myaccount.blob.core.windows.net/myContainer/mhsm-myaccount-2020090117323313";
- * String sasToken = "<sas-token>";
+ * String sasToken = "sv=2020-02-10&ss=b&srt=o&sp=rwdlactfx&se=2021-06-17T07:13:07Z&st=2021-06-16T23:13:07Z"
+ * + "&spr=https&sig=n5V6fnlkViEF9b7ij%2FttTHNwO2BdFIHKHppRxGAyJdc%3D";
*
- * SyncPoller<KeyVaultRestoreOperation, KeyVaultRestoreResult> restorePoller =
+ * SyncPoller<KeyVaultRestoreOperation, KeyVaultRestoreResult> backupPoller =
* client.beginRestore(folderUrl, sasToken);
- * PollResponse<KeyVaultRestoreOperation> pollResponse = restorePoller.poll();
+ *
+ * PollResponse<KeyVaultRestoreOperation> pollResponse = backupPoller.poll();
*
* System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus());
*
- * PollResponse<KeyVaultRestoreOperation> finalPollResponse = restorePoller.waitForCompletion();
+ * PollResponse<KeyVaultRestoreOperation> finalPollResponse = backupPoller.waitForCompletion();
*
* if (finalPollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) {
* System.out.printf("Backup restored successfully.%n");
* } else {
- * KeyVaultRestoreOperation operation = restorePoller.poll().getValue();
+ * KeyVaultRestoreOperation operation = backupPoller.poll().getValue();
*
* System.out.printf("Restore failed with error: %s.%n", operation.getError().getMessage());
* }
@@ -169,21 +169,23 @@
*
*
* String folderUrl = "https://myaccount.blob.core.windows.net/myContainer/mhsm-myaccount-2020090117323313";
- * String sasToken = "<sas-token>";
+ * String sasToken = "sv=2020-02-10&ss=b&srt=o&sp=rwdlactfx&se=2021-06-17T07:13:07Z&st=2021-06-16T23:13:07Z"
+ * + "&spr=https&sig=n5V6fnlkViEF9b7ij%2FttTHNwO2BdFIHKHppRxGAyJdc%3D";
* String keyName = "myKey";
*
- * SyncPoller<KeyVaultSelectiveKeyRestoreOperation, KeyVaultSelectiveKeyRestoreResult> restorePoller =
+ * SyncPoller<KeyVaultSelectiveKeyRestoreOperation, KeyVaultSelectiveKeyRestoreResult> backupPoller =
* client.beginSelectiveKeyRestore(folderUrl, sasToken, keyName);
- * PollResponse<KeyVaultSelectiveKeyRestoreOperation> pollResponse = restorePoller.poll();
+ *
+ * PollResponse<KeyVaultSelectiveKeyRestoreOperation> pollResponse = backupPoller.poll();
*
* System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus());
*
- * PollResponse<KeyVaultSelectiveKeyRestoreOperation> finalPollResponse = restorePoller.waitForCompletion();
+ * PollResponse<KeyVaultSelectiveKeyRestoreOperation> finalPollResponse = backupPoller.waitForCompletion();
*
* if (finalPollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) {
* System.out.printf("Key restored successfully.%n");
* } else {
- * KeyVaultSelectiveKeyRestoreOperation operation = restorePoller.poll().getValue();
+ * KeyVaultSelectiveKeyRestoreOperation operation = backupPoller.poll().getValue();
*
* System.out.printf("Key restore failed with error: %s.%n", operation.getError().getMessage());
* }
@@ -269,9 +271,11 @@ public String getVaultUrl() {
*
*
* String blobStorageUrl = "https://myaccount.blob.core.windows.net/myContainer";
- * String sasToken = "<sas-token>";
+ * String sasToken = "sv=2020-02-10&ss=b&srt=o&sp=rwdlactfx&se=2021-06-17T07:13:07Z&st=2021-06-16T23:13:07Z"
+ * + "&spr=https&sig=n5V6fnlkViEF9b7ij%2FttTHNwO2BdFIHKHppRxGAyJdc%3D";
*
* SyncPoller<KeyVaultBackupOperation, String> backupPoller = client.beginBackup(blobStorageUrl, sasToken);
+ *
* PollResponse<KeyVaultBackupOperation> pollResponse = backupPoller.poll();
*
* System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus());
@@ -410,112 +414,6 @@ private static PollResponse processBackupOperationRespo
toLongRunningOperationStatus(operationStatus.toLowerCase(Locale.US)), response.getValue());
}
- /**
- * Initiates a pre-backup check on the Key Vault. This operation checks if it is possible to back up the entire
- * collection of keys from a key vault.
- *
- * Code Samples
- * Starts a {@link KeyVaultBackupOperation pre-backup operation}, polls for its status and waits for it to
- * complete. Prints out the details of the operation's final result in case of success or prints out error details
- * in case the operation fails.
- *
- *
- * String blobStorageUrl = "https://myaccount.blob.core.windows.net/myContainer";
- * String sasToken = "<sas-token>";
- *
- * SyncPoller<KeyVaultBackupOperation, String> preBackupPoller = client.beginPreBackup(blobStorageUrl, sasToken);
- * PollResponse<KeyVaultBackupOperation> pollResponse = preBackupPoller.poll();
- *
- * System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus());
- *
- * PollResponse<KeyVaultBackupOperation> finalPollResponse = preBackupPoller.waitForCompletion();
- *
- * if (finalPollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) {
- * System.out.printf("Pre-backup check completed successfully.%n");
- * } else {
- * KeyVaultBackupOperation operation = preBackupPoller.poll().getValue();
- *
- * System.out.printf("Pre-backup check failed with error: %s.%n", operation.getError().getMessage());
- * }
- *
- *
- *
- * @param blobStorageUrl The URL for the Blob Storage resource where the backup will be located.
- * @param sasToken Optional Shared Access Signature (SAS) token to authorize access to the blob. If {@code null},
- * Managed Identity will be used to authenticate instead.
- *
- * @return A {@link SyncPoller} polling on the {@link KeyVaultBackupOperation pre-backup operation} status.
- *
- * @throws KeyVaultAdministrationException If the given {@code blobStorageUrl} or {@code sasToken} are invalid.
- * @throws NullPointerException If the {@code blobStorageUrl} is {@code null}.
- */
- @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
- public SyncPoller beginPreBackup(String blobStorageUrl, String sasToken) {
- if (blobStorageUrl == null) {
- throw LOGGER.logExceptionAsError(
- new NullPointerException(
- String.format(KeyVaultErrorCodeStrings.PARAMETER_REQUIRED, "'blobStorageUrl'")));
- }
-
- Context context = Context.NONE;
-
- return SyncPoller.createPoller(
- getDefaultPollingInterval(),
- cxt ->
- new PollResponse<>(LongRunningOperationStatus.NOT_STARTED,
- preBackupActivationOperation(blobStorageUrl, sasToken, context)
- .apply(cxt)),
- backupPollOperation(context),
- (pollingContext, firstResponse) -> {
- throw LOGGER.logExceptionAsError(new RuntimeException("Cancellation is not supported"));
- },
- backupFetchOperation());
- }
-
- private Function, KeyVaultBackupOperation> preBackupActivationOperation(
- String blobStorageUrl, String sasToken, Context context) {
-
- return (pollingContext) -> {
- try {
- return preBackupWithResponse(blobStorageUrl, sasToken, context).getValue();
- } catch (RuntimeException e) {
- throw LOGGER.logExceptionAsError(e);
- }
- };
- }
-
- /**
- * Initiates a pre-backup check on the Key Vault. This operation checks if it is possible to back up the entire
- * collection of keys from a key vault.
- *
- * @param blobStorageUrl The URL for the Blob Storage resource where the backup will be located.
- * @param sasToken Optional Shared Access Signature (SAS) token to authorize access to the blob. If {@code null},
- * Managed Identity will be used to authenticate instead.
- * @param context Additional context that is passed through the HTTP pipeline during the service call.
- *
- * @return A {@link Response} containing the {@link KeyVaultBackupOperation pre-backup operation} status.
- *
- * @throws KeyVaultAdministrationException If the given {@code blobStorageUrl} or {@code sasToken} are invalid.
- */
- Response preBackupWithResponse(String blobStorageUrl, String sasToken, Context context) {
- PreBackupOperationParameters preBackupOperationParameters = new PreBackupOperationParameters()
- .setStorageResourceUri(blobStorageUrl)
- .setToken(sasToken)
- .setUseManagedIdentity(sasToken == null);
- context = enableSyncRestProxy(context);
-
- try {
- ResponseBase backupOperationResponse =
- clientImpl.preFullBackupWithResponse(vaultUrl, preBackupOperationParameters, context);
-
- return new SimpleResponse<>(backupOperationResponse.getRequest(), backupOperationResponse.getStatusCode(),
- backupOperationResponse.getHeaders(),
- (KeyVaultBackupOperation) transformToLongRunningOperation(backupOperationResponse.getValue()));
- } catch (RuntimeException e) {
- throw LOGGER.logExceptionAsError(e);
- }
- }
-
/**
* Initiates a full restore of the Key Vault.
*
@@ -525,9 +423,11 @@ Response preBackupWithResponse(String blobStorageUrl, S
*
*
* String blobStorageUrl = "https://myaccount.blob.core.windows.net/myContainer";
- * String sasToken = "<sas-token>";
+ * String sasToken = "sv=2020-02-10&ss=b&srt=o&sp=rwdlactfx&se=2021-06-17T07:13:07Z&st=2021-06-16T23:13:07Z"
+ * + "&spr=https&sig=n5V6fnlkViEF9b7ij%2FttTHNwO2BdFIHKHppRxGAyJdc%3D";
*
* SyncPoller<KeyVaultBackupOperation, String> backupPoller = client.beginBackup(blobStorageUrl, sasToken);
+ *
* PollResponse<KeyVaultBackupOperation> pollResponse = backupPoller.poll();
*
* System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus());
@@ -669,121 +569,6 @@ private static PollResponse processRestoreOperationRes
toLongRunningOperationStatus(operationStatus.toLowerCase(Locale.US)), response.getValue());
}
- /**
- * Initiates a pre-restore check on the Key Vault. This operation checks if it is possible to restore an entire
- * collection of keys from a backup.
- *
- * Code Samples
- * Starts a {@link KeyVaultRestoreOperation pre-restore operation}, polls for its status and waits for it to
- * complete. Prints out error details in case the operation fails.
- *
- *
- * String folderUrl = "https://myaccount.blob.core.windows.net/myContainer/mhsm-myaccount-2020090117323313";
- * String sasToken = "<sas-token>";
- *
- * SyncPoller<KeyVaultRestoreOperation, KeyVaultRestoreResult> preRestorePoller =
- * client.beginPreRestore(folderUrl, sasToken);
- * PollResponse<KeyVaultRestoreOperation> pollResponse = preRestorePoller.poll();
- *
- * System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus());
- *
- * PollResponse<KeyVaultRestoreOperation> finalPollResponse = preRestorePoller.waitForCompletion();
- *
- * if (finalPollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) {
- * System.out.printf("Pre-restore check completed successfully.%n");
- * } else {
- * KeyVaultRestoreOperation operation = preRestorePoller.poll().getValue();
- *
- * System.out.printf("Pre-restore check failed with error: %s.%n", operation.getError().getMessage());
- * }
- *
- *
- *
- * @param folderUrl The URL for the Blob Storage resource where the backup is located, including the path to
- * the blob container where the backup resides. This would be the exact value that is returned as the result of a
- * backup operation. An example of such a URL may look like the following:
- * {@code https://contoso.blob.core.windows.net/backup/mhsm-contoso-2020090117323313}.
- * @param sasToken Optional Shared Access Signature (SAS) token to authorize access to the blob. If {@code null},
- * Managed Identity will be used to authenticate instead.
- *
- * @return A {@link SyncPoller} to poll on the {@link KeyVaultRestoreOperation restore operation} status.
- *
- * @throws KeyVaultAdministrationException If the given {@code folderUrl} or {@code sasToken} are invalid.
- * @throws NullPointerException If the {@code folderUrl} is {@code null}.
- */
- @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
- public SyncPoller beginPreRestore(String folderUrl, String sasToken) {
- if (folderUrl == null) {
- throw LOGGER.logExceptionAsError(
- new NullPointerException(String.format(KeyVaultErrorCodeStrings.PARAMETER_REQUIRED, "'folderUrl'")));
- }
-
- Context context = Context.NONE;
-
- return SyncPoller.createPoller(getDefaultPollingInterval(),
- cxt ->
- new PollResponse<>(LongRunningOperationStatus.NOT_STARTED,
- preRestoreActivationOperation(folderUrl, sasToken, context)
- .apply(cxt)),
- restorePollOperation(context),
- (pollingContext, firstResponse) -> {
- throw LOGGER.logExceptionAsError(new RuntimeException("Cancellation is not supported"));
- },
- (pollingContext) -> new KeyVaultRestoreResult());
- }
-
- /**
- * Initiates a pre-restore check on the Key Vault. This operation checks if it is possible to restore an entire
- * collection of keys from a backup.
- *
- * @param folderUrl The URL for the Blob Storage resource where the backup is located, including the path to
- * the blob container where the backup resides. This would be the exact value that is returned as the result of a
- * backup operation. An example of such a URL may look like the following:
- * {@code https://contoso.blob.core.windows.net/backup/mhsm-contoso-2020090117323313}.
- * @param sasToken Optional Shared Access Signature (SAS) token to authorize access to the blob. If {@code null},
- * Managed Identity will be used to authenticate instead.
- * @param context Additional context that is passed through the HTTP pipeline during the service call.
- *
- * @return A {@link Response} containing the {@link KeyVaultRestoreOperation backup operation} status.
- *
- * @throws KeyVaultAdministrationException If the given {@code folderUrl} or {@code sasToken} are invalid.
- */
- Response preRestoreWithResponse(String folderUrl, String sasToken, Context context) {
- String[] segments = folderUrl.split("/");
- String folderName = segments[segments.length - 1];
- String containerUrl = folderUrl.substring(0, folderUrl.length() - folderName.length());
-
- SASTokenParameter sasTokenParameter = new SASTokenParameter(containerUrl)
- .setToken(sasToken)
- .setUseManagedIdentity(sasToken == null);
- PreRestoreOperationParameters restoreOperationParameters =
- new PreRestoreOperationParameters()
- .setFolderToRestore(folderName)
- .setSasTokenParameters(sasTokenParameter);
- context = enableSyncRestProxy(context);
-
- try {
- ResponseBase restoreOperationResponse =
- clientImpl.preFullRestoreOperationWithResponse(vaultUrl, restoreOperationParameters, context);
- return new SimpleResponse<>(restoreOperationResponse.getRequest(),
- restoreOperationResponse.getStatusCode(),
- restoreOperationResponse.getHeaders(),
- (KeyVaultRestoreOperation) transformToLongRunningOperation(restoreOperationResponse.getValue()));
- } catch (RuntimeException e) {
- throw LOGGER.logExceptionAsError(e);
- }
- }
-
- private Function, KeyVaultRestoreOperation> preRestoreActivationOperation(String folderUrl, String sasToken, Context context) {
- return (pollingContext) -> {
- try {
- return preRestoreWithResponse(folderUrl, sasToken, context).getValue();
- } catch (RuntimeException e) {
- throw LOGGER.logExceptionAsError(e);
- }
- };
- }
-
/**
* Restores all versions of a given key using the supplied SAS token pointing to a previously stored Azure Blob
* storage backup folder.
@@ -794,21 +579,23 @@ private Function, KeyVaultRestoreOperat
*
*
* String folderUrl = "https://myaccount.blob.core.windows.net/myContainer/mhsm-myaccount-2020090117323313";
- * String sasToken = "<sas-token>";
+ * String sasToken = "sv=2020-02-10&ss=b&srt=o&sp=rwdlactfx&se=2021-06-17T07:13:07Z&st=2021-06-16T23:13:07Z"
+ * + "&spr=https&sig=n5V6fnlkViEF9b7ij%2FttTHNwO2BdFIHKHppRxGAyJdc%3D";
* String keyName = "myKey";
*
- * SyncPoller<KeyVaultSelectiveKeyRestoreOperation, KeyVaultSelectiveKeyRestoreResult> restorePoller =
+ * SyncPoller<KeyVaultSelectiveKeyRestoreOperation, KeyVaultSelectiveKeyRestoreResult> backupPoller =
* client.beginSelectiveKeyRestore(folderUrl, sasToken, keyName);
- * PollResponse<KeyVaultSelectiveKeyRestoreOperation> pollResponse = restorePoller.poll();
+ *
+ * PollResponse<KeyVaultSelectiveKeyRestoreOperation> pollResponse = backupPoller.poll();
*
* System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus());
*
- * PollResponse<KeyVaultSelectiveKeyRestoreOperation> finalPollResponse = restorePoller.waitForCompletion();
+ * PollResponse<KeyVaultSelectiveKeyRestoreOperation> finalPollResponse = backupPoller.waitForCompletion();
*
* if (finalPollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) {
* System.out.printf("Key restored successfully.%n");
* } else {
- * KeyVaultSelectiveKeyRestoreOperation operation = restorePoller.poll().getValue();
+ * KeyVaultSelectiveKeyRestoreOperation operation = backupPoller.poll().getValue();
*
* System.out.printf("Key restore failed with error: %s.%n", operation.getError().getMessage());
* }
diff --git a/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/implementation/KeyVaultBackupClientImpl.java b/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/implementation/KeyVaultBackupClientImpl.java
index 88a7c6f61f0dd..4cf02ee63d5f2 100644
--- a/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/implementation/KeyVaultBackupClientImpl.java
+++ b/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/implementation/KeyVaultBackupClientImpl.java
@@ -33,10 +33,6 @@
import com.azure.security.keyvault.administration.implementation.models.FullBackupOperation;
import com.azure.security.keyvault.administration.implementation.models.FullRestoreOperationHeaders;
import com.azure.security.keyvault.administration.implementation.models.KeyVaultErrorException;
-import com.azure.security.keyvault.administration.implementation.models.PreBackupOperationParameters;
-import com.azure.security.keyvault.administration.implementation.models.PreFullBackupHeaders;
-import com.azure.security.keyvault.administration.implementation.models.PreFullRestoreOperationHeaders;
-import com.azure.security.keyvault.administration.implementation.models.PreRestoreOperationParameters;
import com.azure.security.keyvault.administration.implementation.models.RestoreOperation;
import com.azure.security.keyvault.administration.implementation.models.RestoreOperationParameters;
import com.azure.security.keyvault.administration.implementation.models.SASTokenParameter;
@@ -61,7 +57,7 @@ public final class KeyVaultBackupClientImpl {
/**
* Gets Api Version.
- *
+ *
* @return the apiVersion value.
*/
public String getApiVersion() {
@@ -75,7 +71,7 @@ public String getApiVersion() {
/**
* Gets The HTTP pipeline to send requests through.
- *
+ *
* @return the httpPipeline value.
*/
public HttpPipeline getHttpPipeline() {
@@ -89,7 +85,7 @@ public HttpPipeline getHttpPipeline() {
/**
* Gets The serializer to serialize an object into a string.
- *
+ *
* @return the serializerAdapter value.
*/
public SerializerAdapter getSerializerAdapter() {
@@ -98,7 +94,7 @@ public SerializerAdapter getSerializerAdapter() {
/**
* Initializes an instance of KeyVaultBackupClient client.
- *
+ *
* @param apiVersion Api Version.
*/
public KeyVaultBackupClientImpl(String apiVersion) {
@@ -108,7 +104,7 @@ public KeyVaultBackupClientImpl(String apiVersion) {
/**
* Initializes an instance of KeyVaultBackupClient client.
- *
+ *
* @param httpPipeline The HTTP pipeline to send requests through.
* @param apiVersion Api Version.
*/
@@ -118,7 +114,7 @@ public KeyVaultBackupClientImpl(HttpPipeline httpPipeline, String apiVersion) {
/**
* Initializes an instance of KeyVaultBackupClient client.
- *
+ *
* @param httpPipeline The HTTP pipeline to send requests through.
* @param serializerAdapter The serializer to serialize an object into a string.
* @param apiVersion Api Version.
@@ -154,22 +150,6 @@ ResponseBase fullBackupSync(
@BodyParam("application/json") SASTokenParameter azureStorageBlobContainerUri,
@HeaderParam("Accept") String accept, Context context);
- @Post("/prebackup")
- @ExpectedResponses({ 202 })
- @UnexpectedResponseExceptionType(KeyVaultErrorException.class)
- Mono> preFullBackup(
- @HostParam("vaultBaseUrl") String vaultBaseUrl, @QueryParam("api-version") String apiVersion,
- @BodyParam("application/json") PreBackupOperationParameters preBackupOperationParameters,
- @HeaderParam("Accept") String accept, Context context);
-
- @Post("/prebackup")
- @ExpectedResponses({ 202 })
- @UnexpectedResponseExceptionType(KeyVaultErrorException.class)
- ResponseBase preFullBackupSync(
- @HostParam("vaultBaseUrl") String vaultBaseUrl, @QueryParam("api-version") String apiVersion,
- @BodyParam("application/json") PreBackupOperationParameters preBackupOperationParameters,
- @HeaderParam("Accept") String accept, Context context);
-
@Get("/backup/{jobId}/pending")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(KeyVaultErrorException.class)
@@ -184,22 +164,6 @@ Response fullBackupStatusSync(@HostParam("vaultBaseUrl") St
@PathParam("jobId") String jobId, @QueryParam("api-version") String apiVersion,
@HeaderParam("Accept") String accept, Context context);
- @Put("/prerestore")
- @ExpectedResponses({ 202 })
- @UnexpectedResponseExceptionType(KeyVaultErrorException.class)
- Mono> preFullRestoreOperation(
- @HostParam("vaultBaseUrl") String vaultBaseUrl, @QueryParam("api-version") String apiVersion,
- @BodyParam("application/json") PreRestoreOperationParameters preRestoreOperationParameters,
- @HeaderParam("Accept") String accept, Context context);
-
- @Put("/prerestore")
- @ExpectedResponses({ 202 })
- @UnexpectedResponseExceptionType(KeyVaultErrorException.class)
- ResponseBase preFullRestoreOperationSync(
- @HostParam("vaultBaseUrl") String vaultBaseUrl, @QueryParam("api-version") String apiVersion,
- @BodyParam("application/json") PreRestoreOperationParameters preRestoreOperationParameters,
- @HeaderParam("Accept") String accept, Context context);
-
@Put("/restore")
@ExpectedResponses({ 202 })
@UnexpectedResponseExceptionType(KeyVaultErrorException.class)
@@ -251,7 +215,7 @@ Response restoreStatusSync(@HostParam("vaultBaseUrl") String v
/**
* Creates a full backup using a user-provided SAS token to an Azure blob storage container.
- *
+ *
* @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
* @param azureStorageBlobContainerUri Azure blob shared access signature token pointing to a valid Azure blob
* container where full backup needs to be stored. This token needs to be valid for at least next 24 hours from the
@@ -271,7 +235,7 @@ public Mono> fullBackupWith
/**
* Creates a full backup using a user-provided SAS token to an Azure blob storage container.
- *
+ *
* @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
* @param azureStorageBlobContainerUri Azure blob shared access signature token pointing to a valid Azure blob
* container where full backup needs to be stored. This token needs to be valid for at least next 24 hours from the
@@ -291,7 +255,7 @@ public Mono> fullBackupWith
/**
* Creates a full backup using a user-provided SAS token to an Azure blob storage container.
- *
+ *
* @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
* @param azureStorageBlobContainerUri Azure blob shared access signature token pointing to a valid Azure blob
* container where full backup needs to be stored. This token needs to be valid for at least next 24 hours from the
@@ -310,7 +274,7 @@ public Mono fullBackupAsync(String vaultBaseUrl,
/**
* Creates a full backup using a user-provided SAS token to an Azure blob storage container.
- *
+ *
* @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
* @param azureStorageBlobContainerUri Azure blob shared access signature token pointing to a valid Azure blob
* container where full backup needs to be stored. This token needs to be valid for at least next 24 hours from the
@@ -330,7 +294,7 @@ public Mono fullBackupAsync(String vaultBaseUrl,
/**
* Creates a full backup using a user-provided SAS token to an Azure blob storage container.
- *
+ *
* @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
* @param azureStorageBlobContainerUri Azure blob shared access signature token pointing to a valid Azure blob
* container where full backup needs to be stored. This token needs to be valid for at least next 24 hours from the
@@ -351,7 +315,7 @@ public ResponseBase fullBackupWithRespon
/**
* Creates a full backup using a user-provided SAS token to an Azure blob storage container.
- *
+ *
* @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
* @param azureStorageBlobContainerUri Azure blob shared access signature token pointing to a valid Azure blob
* container where full backup needs to be stored. This token needs to be valid for at least next 24 hours from the
@@ -366,115 +330,9 @@ public FullBackupOperation fullBackup(String vaultBaseUrl, SASTokenParameter azu
return fullBackupWithResponse(vaultBaseUrl, azureStorageBlobContainerUri, Context.NONE).getValue();
}
- /**
- * Pre-backup operation for checking whether the customer can perform a full backup operation.
- *
- * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
- * @param preBackupOperationParameters Optional parameters to validate prior to performing a full backup operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws KeyVaultErrorException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return full backup operation along with {@link ResponseBase} on successful completion of {@link Mono}.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- public Mono>
- preFullBackupWithResponseAsync(String vaultBaseUrl, PreBackupOperationParameters preBackupOperationParameters) {
- final String accept = "application/json";
- return FluxUtil.withContext(context -> service.preFullBackup(vaultBaseUrl, this.getApiVersion(),
- preBackupOperationParameters, accept, context));
- }
-
- /**
- * Pre-backup operation for checking whether the customer can perform a full backup operation.
- *
- * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
- * @param preBackupOperationParameters Optional parameters to validate prior to performing a full backup operation.
- * @param context The context to associate with this operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws KeyVaultErrorException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return full backup operation along with {@link ResponseBase} on successful completion of {@link Mono}.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- public Mono> preFullBackupWithResponseAsync(
- String vaultBaseUrl, PreBackupOperationParameters preBackupOperationParameters, Context context) {
- final String accept = "application/json";
- return service.preFullBackup(vaultBaseUrl, this.getApiVersion(), preBackupOperationParameters, accept, context);
- }
-
- /**
- * Pre-backup operation for checking whether the customer can perform a full backup operation.
- *
- * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
- * @param preBackupOperationParameters Optional parameters to validate prior to performing a full backup operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws KeyVaultErrorException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return full backup operation on successful completion of {@link Mono}.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- public Mono preFullBackupAsync(String vaultBaseUrl,
- PreBackupOperationParameters preBackupOperationParameters) {
- return preFullBackupWithResponseAsync(vaultBaseUrl, preBackupOperationParameters)
- .flatMap(res -> Mono.justOrEmpty(res.getValue()));
- }
-
- /**
- * Pre-backup operation for checking whether the customer can perform a full backup operation.
- *
- * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
- * @param preBackupOperationParameters Optional parameters to validate prior to performing a full backup operation.
- * @param context The context to associate with this operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws KeyVaultErrorException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return full backup operation on successful completion of {@link Mono}.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- public Mono preFullBackupAsync(String vaultBaseUrl,
- PreBackupOperationParameters preBackupOperationParameters, Context context) {
- return preFullBackupWithResponseAsync(vaultBaseUrl, preBackupOperationParameters, context)
- .flatMap(res -> Mono.justOrEmpty(res.getValue()));
- }
-
- /**
- * Pre-backup operation for checking whether the customer can perform a full backup operation.
- *
- * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
- * @param preBackupOperationParameters Optional parameters to validate prior to performing a full backup operation.
- * @param context The context to associate with this operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws KeyVaultErrorException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return full backup operation along with {@link ResponseBase}.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- public ResponseBase preFullBackupWithResponse(String vaultBaseUrl,
- PreBackupOperationParameters preBackupOperationParameters, Context context) {
- final String accept = "application/json";
- return service.preFullBackupSync(vaultBaseUrl, this.getApiVersion(), preBackupOperationParameters, accept,
- context);
- }
-
- /**
- * Pre-backup operation for checking whether the customer can perform a full backup operation.
- *
- * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
- * @param preBackupOperationParameters Optional parameters to validate prior to performing a full backup operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws KeyVaultErrorException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return full backup operation.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- public FullBackupOperation preFullBackup(String vaultBaseUrl,
- PreBackupOperationParameters preBackupOperationParameters) {
- return preFullBackupWithResponse(vaultBaseUrl, preBackupOperationParameters, Context.NONE).getValue();
- }
-
/**
* Returns the status of full backup operation.
- *
+ *
* @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
* @param jobId The id returned as part of the backup request.
* @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -491,7 +349,7 @@ public Mono> fullBackupStatusWithResponseAsync(Str
/**
* Returns the status of full backup operation.
- *
+ *
* @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
* @param jobId The id returned as part of the backup request.
* @param context The context to associate with this operation.
@@ -509,7 +367,7 @@ public Mono> fullBackupStatusWithResponseAsync(Str
/**
* Returns the status of full backup operation.
- *
+ *
* @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
* @param jobId The id returned as part of the backup request.
* @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -524,7 +382,7 @@ public Mono fullBackupStatusAsync(String vaultBaseUrl, Stri
/**
* Returns the status of full backup operation.
- *
+ *
* @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
* @param jobId The id returned as part of the backup request.
* @param context The context to associate with this operation.
@@ -541,7 +399,7 @@ public Mono fullBackupStatusAsync(String vaultBaseUrl, Stri
/**
* Returns the status of full backup operation.
- *
+ *
* @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
* @param jobId The id returned as part of the backup request.
* @param context The context to associate with this operation.
@@ -559,7 +417,7 @@ public Response fullBackupStatusWithResponse(String vaultBa
/**
* Returns the status of full backup operation.
- *
+ *
* @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
* @param jobId The id returned as part of the backup request.
* @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -572,125 +430,9 @@ public FullBackupOperation fullBackupStatus(String vaultBaseUrl, String jobId) {
return fullBackupStatusWithResponse(vaultBaseUrl, jobId, Context.NONE).getValue();
}
- /**
- * Pre-restore operation for checking whether the customer can perform a full restore operation.
- *
- * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
- * @param preRestoreOperationParameters Optional pre restore parameters to validate prior to performing a full
- * restore operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws KeyVaultErrorException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return restore operation along with {@link ResponseBase} on successful completion of {@link Mono}.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- public Mono>
- preFullRestoreOperationWithResponseAsync(String vaultBaseUrl,
- PreRestoreOperationParameters preRestoreOperationParameters) {
- final String accept = "application/json";
- return FluxUtil.withContext(context -> service.preFullRestoreOperation(vaultBaseUrl, this.getApiVersion(),
- preRestoreOperationParameters, accept, context));
- }
-
- /**
- * Pre-restore operation for checking whether the customer can perform a full restore operation.
- *
- * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
- * @param preRestoreOperationParameters Optional pre restore parameters to validate prior to performing a full
- * restore operation.
- * @param context The context to associate with this operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws KeyVaultErrorException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return restore operation along with {@link ResponseBase} on successful completion of {@link Mono}.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- public Mono>
- preFullRestoreOperationWithResponseAsync(String vaultBaseUrl,
- PreRestoreOperationParameters preRestoreOperationParameters, Context context) {
- final String accept = "application/json";
- return service.preFullRestoreOperation(vaultBaseUrl, this.getApiVersion(), preRestoreOperationParameters,
- accept, context);
- }
-
- /**
- * Pre-restore operation for checking whether the customer can perform a full restore operation.
- *
- * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
- * @param preRestoreOperationParameters Optional pre restore parameters to validate prior to performing a full
- * restore operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws KeyVaultErrorException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return restore operation on successful completion of {@link Mono}.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- public Mono preFullRestoreOperationAsync(String vaultBaseUrl,
- PreRestoreOperationParameters preRestoreOperationParameters) {
- return preFullRestoreOperationWithResponseAsync(vaultBaseUrl, preRestoreOperationParameters)
- .flatMap(res -> Mono.justOrEmpty(res.getValue()));
- }
-
- /**
- * Pre-restore operation for checking whether the customer can perform a full restore operation.
- *
- * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
- * @param preRestoreOperationParameters Optional pre restore parameters to validate prior to performing a full
- * restore operation.
- * @param context The context to associate with this operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws KeyVaultErrorException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return restore operation on successful completion of {@link Mono}.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- public Mono preFullRestoreOperationAsync(String vaultBaseUrl,
- PreRestoreOperationParameters preRestoreOperationParameters, Context context) {
- return preFullRestoreOperationWithResponseAsync(vaultBaseUrl, preRestoreOperationParameters, context)
- .flatMap(res -> Mono.justOrEmpty(res.getValue()));
- }
-
- /**
- * Pre-restore operation for checking whether the customer can perform a full restore operation.
- *
- * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
- * @param preRestoreOperationParameters Optional pre restore parameters to validate prior to performing a full
- * restore operation.
- * @param context The context to associate with this operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws KeyVaultErrorException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return restore operation along with {@link ResponseBase}.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- public ResponseBase preFullRestoreOperationWithResponse(
- String vaultBaseUrl, PreRestoreOperationParameters preRestoreOperationParameters, Context context) {
- final String accept = "application/json";
- return service.preFullRestoreOperationSync(vaultBaseUrl, this.getApiVersion(), preRestoreOperationParameters,
- accept, context);
- }
-
- /**
- * Pre-restore operation for checking whether the customer can perform a full restore operation.
- *
- * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
- * @param preRestoreOperationParameters Optional pre restore parameters to validate prior to performing a full
- * restore operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws KeyVaultErrorException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return restore operation.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- public RestoreOperation preFullRestoreOperation(String vaultBaseUrl,
- PreRestoreOperationParameters preRestoreOperationParameters) {
- return preFullRestoreOperationWithResponse(vaultBaseUrl, preRestoreOperationParameters, Context.NONE)
- .getValue();
- }
-
/**
* Restores all key materials using the SAS token pointing to a previously stored Azure Blob storage backup folder.
- *
+ *
* @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
* @param restoreBlobDetails The Azure blob SAS token pointing to a folder where the previous successful full backup
* was stored.
@@ -709,7 +451,7 @@ public RestoreOperation preFullRestoreOperation(String vaultBaseUrl,
/**
* Restores all key materials using the SAS token pointing to a previously stored Azure Blob storage backup folder.
- *
+ *
* @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
* @param restoreBlobDetails The Azure blob SAS token pointing to a folder where the previous successful full backup
* was stored.
@@ -728,7 +470,7 @@ public Mono> fullRes
/**
* Restores all key materials using the SAS token pointing to a previously stored Azure Blob storage backup folder.
- *
+ *
* @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
* @param restoreBlobDetails The Azure blob SAS token pointing to a folder where the previous successful full backup
* was stored.
@@ -746,7 +488,7 @@ public Mono fullRestoreOperationAsync(String vaultBaseUrl,
/**
* Restores all key materials using the SAS token pointing to a previously stored Azure Blob storage backup folder.
- *
+ *
* @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
* @param restoreBlobDetails The Azure blob SAS token pointing to a folder where the previous successful full backup
* was stored.
@@ -765,7 +507,7 @@ public Mono fullRestoreOperationAsync(String vaultBaseUrl,
/**
* Restores all key materials using the SAS token pointing to a previously stored Azure Blob storage backup folder.
- *
+ *
* @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
* @param restoreBlobDetails The Azure blob SAS token pointing to a folder where the previous successful full backup
* was stored.
@@ -785,7 +527,7 @@ public ResponseBase fullRestoreOp
/**
* Restores all key materials using the SAS token pointing to a previously stored Azure Blob storage backup folder.
- *
+ *
* @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
* @param restoreBlobDetails The Azure blob SAS token pointing to a folder where the previous successful full backup
* was stored.
@@ -801,7 +543,7 @@ public RestoreOperation fullRestoreOperation(String vaultBaseUrl, RestoreOperati
/**
* Returns the status of restore operation.
- *
+ *
* @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
* @param jobId The Job Id returned part of the restore operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -818,7 +560,7 @@ public Mono> restoreStatusWithResponseAsync(String va
/**
* Returns the status of restore operation.
- *
+ *
* @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
* @param jobId The Job Id returned part of the restore operation.
* @param context The context to associate with this operation.
@@ -836,7 +578,7 @@ public Mono> restoreStatusWithResponseAsync(String va
/**
* Returns the status of restore operation.
- *
+ *
* @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
* @param jobId The Job Id returned part of the restore operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -851,7 +593,7 @@ public Mono restoreStatusAsync(String vaultBaseUrl, String job
/**
* Returns the status of restore operation.
- *
+ *
* @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
* @param jobId The Job Id returned part of the restore operation.
* @param context The context to associate with this operation.
@@ -868,7 +610,7 @@ public Mono restoreStatusAsync(String vaultBaseUrl, String job
/**
* Returns the status of restore operation.
- *
+ *
* @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
* @param jobId The Job Id returned part of the restore operation.
* @param context The context to associate with this operation.
@@ -885,7 +627,7 @@ public Response restoreStatusWithResponse(String vaultBaseUrl,
/**
* Returns the status of restore operation.
- *
+ *
* @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
* @param jobId The Job Id returned part of the restore operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -901,7 +643,7 @@ public RestoreOperation restoreStatus(String vaultBaseUrl, String jobId) {
/**
* Restores all key versions of a given key using user supplied SAS token pointing to a previously stored Azure Blob
* storage backup folder.
- *
+ *
* @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
* @param keyName The name of the key to be restored from the user supplied backup.
* @param restoreBlobDetails The Azure blob SAS token pointing to a folder where the previous successful full backup
@@ -923,7 +665,7 @@ public RestoreOperation restoreStatus(String vaultBaseUrl, String jobId) {
/**
* Restores all key versions of a given key using user supplied SAS token pointing to a previously stored Azure Blob
* storage backup folder.
- *
+ *
* @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
* @param keyName The name of the key to be restored from the user supplied backup.
* @param restoreBlobDetails The Azure blob SAS token pointing to a folder where the previous successful full backup
@@ -946,7 +688,7 @@ public RestoreOperation restoreStatus(String vaultBaseUrl, String jobId) {
/**
* Restores all key versions of a given key using user supplied SAS token pointing to a previously stored Azure Blob
* storage backup folder.
- *
+ *
* @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
* @param keyName The name of the key to be restored from the user supplied backup.
* @param restoreBlobDetails The Azure blob SAS token pointing to a folder where the previous successful full backup
@@ -966,7 +708,7 @@ public Mono selectiveKeyRestoreOperationAsync(Stri
/**
* Restores all key versions of a given key using user supplied SAS token pointing to a previously stored Azure Blob
* storage backup folder.
- *
+ *
* @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
* @param keyName The name of the key to be restored from the user supplied backup.
* @param restoreBlobDetails The Azure blob SAS token pointing to a folder where the previous successful full backup
@@ -987,7 +729,7 @@ public Mono selectiveKeyRestoreOperationAsync(Stri
/**
* Restores all key versions of a given key using user supplied SAS token pointing to a previously stored Azure Blob
* storage backup folder.
- *
+ *
* @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
* @param keyName The name of the key to be restored from the user supplied backup.
* @param restoreBlobDetails The Azure blob SAS token pointing to a folder where the previous successful full backup
@@ -1010,7 +752,7 @@ public Mono selectiveKeyRestoreOperationAsync(Stri
/**
* Restores all key versions of a given key using user supplied SAS token pointing to a previously stored Azure Blob
* storage backup folder.
- *
+ *
* @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
* @param keyName The name of the key to be restored from the user supplied backup.
* @param restoreBlobDetails The Azure blob SAS token pointing to a folder where the previous successful full backup
diff --git a/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/implementation/models/PreBackupOperationParameters.java b/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/implementation/models/PreBackupOperationParameters.java
deleted file mode 100644
index c8a6be3a6278a..0000000000000
--- a/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/implementation/models/PreBackupOperationParameters.java
+++ /dev/null
@@ -1,144 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-// Code generated by Microsoft (R) AutoRest Code Generator.
-
-package com.azure.security.keyvault.administration.implementation.models;
-
-import com.azure.core.annotation.Fluent;
-import com.azure.json.JsonReader;
-import com.azure.json.JsonSerializable;
-import com.azure.json.JsonToken;
-import com.azure.json.JsonWriter;
-import java.io.IOException;
-
-/**
- * The PreBackupOperationParameters model.
- */
-@Fluent
-public final class PreBackupOperationParameters implements JsonSerializable {
- /*
- * Azure Blob storage container Uri
- */
- private String storageResourceUri;
-
- /*
- * The SAS token pointing to an Azure Blob storage container
- */
- private String token;
-
- /*
- * Indicates which authentication method should be used. If set to true, Managed HSM will use the configured
- * user-assigned managed identity to authenticate with Azure Storage. Otherwise, a SAS token has to be specified.
- */
- private Boolean useManagedIdentity;
-
- /**
- * Creates an instance of PreBackupOperationParameters class.
- */
- public PreBackupOperationParameters() {
- }
-
- /**
- * Get the storageResourceUri property: Azure Blob storage container Uri.
- *
- * @return the storageResourceUri value.
- */
- public String getStorageResourceUri() {
- return this.storageResourceUri;
- }
-
- /**
- * Set the storageResourceUri property: Azure Blob storage container Uri.
- *
- * @param storageResourceUri the storageResourceUri value to set.
- * @return the PreBackupOperationParameters object itself.
- */
- public PreBackupOperationParameters setStorageResourceUri(String storageResourceUri) {
- this.storageResourceUri = storageResourceUri;
- return this;
- }
-
- /**
- * Get the token property: The SAS token pointing to an Azure Blob storage container.
- *
- * @return the token value.
- */
- public String getToken() {
- return this.token;
- }
-
- /**
- * Set the token property: The SAS token pointing to an Azure Blob storage container.
- *
- * @param token the token value to set.
- * @return the PreBackupOperationParameters object itself.
- */
- public PreBackupOperationParameters setToken(String token) {
- this.token = token;
- return this;
- }
-
- /**
- * Get the useManagedIdentity property: Indicates which authentication method should be used. If set to true,
- * Managed HSM will use the configured user-assigned managed identity to authenticate with Azure Storage.
- * Otherwise, a SAS token has to be specified.
- *
- * @return the useManagedIdentity value.
- */
- public Boolean isUseManagedIdentity() {
- return this.useManagedIdentity;
- }
-
- /**
- * Set the useManagedIdentity property: Indicates which authentication method should be used. If set to true,
- * Managed HSM will use the configured user-assigned managed identity to authenticate with Azure Storage.
- * Otherwise, a SAS token has to be specified.
- *
- * @param useManagedIdentity the useManagedIdentity value to set.
- * @return the PreBackupOperationParameters object itself.
- */
- public PreBackupOperationParameters setUseManagedIdentity(Boolean useManagedIdentity) {
- this.useManagedIdentity = useManagedIdentity;
- return this;
- }
-
- @Override
- public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
- jsonWriter.writeStartObject();
- jsonWriter.writeStringField("storageResourceUri", this.storageResourceUri);
- jsonWriter.writeStringField("token", this.token);
- jsonWriter.writeBooleanField("useManagedIdentity", this.useManagedIdentity);
- return jsonWriter.writeEndObject();
- }
-
- /**
- * Reads an instance of PreBackupOperationParameters from the JsonReader.
- *
- * @param jsonReader The JsonReader being read.
- * @return An instance of PreBackupOperationParameters if the JsonReader was pointing to an instance of it, or null
- * if it was pointing to JSON null.
- * @throws IOException If an error occurs while reading the PreBackupOperationParameters.
- */
- public static PreBackupOperationParameters fromJson(JsonReader jsonReader) throws IOException {
- return jsonReader.readObject(reader -> {
- PreBackupOperationParameters deserializedPreBackupOperationParameters = new PreBackupOperationParameters();
- while (reader.nextToken() != JsonToken.END_OBJECT) {
- String fieldName = reader.getFieldName();
- reader.nextToken();
-
- if ("storageResourceUri".equals(fieldName)) {
- deserializedPreBackupOperationParameters.storageResourceUri = reader.getString();
- } else if ("token".equals(fieldName)) {
- deserializedPreBackupOperationParameters.token = reader.getString();
- } else if ("useManagedIdentity".equals(fieldName)) {
- deserializedPreBackupOperationParameters.useManagedIdentity
- = reader.getNullable(JsonReader::getBoolean);
- } else {
- reader.skipChildren();
- }
- }
-
- return deserializedPreBackupOperationParameters;
- });
- }
-}
diff --git a/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/implementation/models/PreFullBackupHeaders.java b/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/implementation/models/PreFullBackupHeaders.java
deleted file mode 100644
index 9a2f0a0902ba3..0000000000000
--- a/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/implementation/models/PreFullBackupHeaders.java
+++ /dev/null
@@ -1,81 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-// Code generated by Microsoft (R) AutoRest Code Generator.
-
-package com.azure.security.keyvault.administration.implementation.models;
-
-import com.azure.core.annotation.Fluent;
-import com.azure.core.http.HttpHeaderName;
-import com.azure.core.http.HttpHeaders;
-
-/**
- * The PreFullBackupHeaders model.
- */
-@Fluent
-public final class PreFullBackupHeaders {
- /*
- * The Retry-After property.
- */
- private Long retryAfter;
-
- /*
- * The Azure-AsyncOperation property.
- */
- private String azureAsyncOperation;
-
- private static final HttpHeaderName AZURE_ASYNC_OPERATION = HttpHeaderName.fromString("Azure-AsyncOperation");
-
- // HttpHeaders containing the raw property values.
- /**
- * Creates an instance of PreFullBackupHeaders class.
- *
- * @param rawHeaders The raw HttpHeaders that will be used to create the property values.
- */
- public PreFullBackupHeaders(HttpHeaders rawHeaders) {
- String retryAfter = rawHeaders.getValue(HttpHeaderName.RETRY_AFTER);
- if (retryAfter != null) {
- this.retryAfter = Long.parseLong(retryAfter);
- }
- this.azureAsyncOperation = rawHeaders.getValue(AZURE_ASYNC_OPERATION);
- }
-
- /**
- * Get the retryAfter property: The Retry-After property.
- *
- * @return the retryAfter value.
- */
- public Long getRetryAfter() {
- return this.retryAfter;
- }
-
- /**
- * Set the retryAfter property: The Retry-After property.
- *
- * @param retryAfter the retryAfter value to set.
- * @return the PreFullBackupHeaders object itself.
- */
- public PreFullBackupHeaders setRetryAfter(Long retryAfter) {
- this.retryAfter = retryAfter;
- return this;
- }
-
- /**
- * Get the azureAsyncOperation property: The Azure-AsyncOperation property.
- *
- * @return the azureAsyncOperation value.
- */
- public String getAzureAsyncOperation() {
- return this.azureAsyncOperation;
- }
-
- /**
- * Set the azureAsyncOperation property: The Azure-AsyncOperation property.
- *
- * @param azureAsyncOperation the azureAsyncOperation value to set.
- * @return the PreFullBackupHeaders object itself.
- */
- public PreFullBackupHeaders setAzureAsyncOperation(String azureAsyncOperation) {
- this.azureAsyncOperation = azureAsyncOperation;
- return this;
- }
-}
diff --git a/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/implementation/models/PreFullRestoreOperationHeaders.java b/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/implementation/models/PreFullRestoreOperationHeaders.java
deleted file mode 100644
index 4a44da9e1280a..0000000000000
--- a/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/implementation/models/PreFullRestoreOperationHeaders.java
+++ /dev/null
@@ -1,81 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-// Code generated by Microsoft (R) AutoRest Code Generator.
-
-package com.azure.security.keyvault.administration.implementation.models;
-
-import com.azure.core.annotation.Fluent;
-import com.azure.core.http.HttpHeaderName;
-import com.azure.core.http.HttpHeaders;
-
-/**
- * The PreFullRestoreOperationHeaders model.
- */
-@Fluent
-public final class PreFullRestoreOperationHeaders {
- /*
- * The Retry-After property.
- */
- private Long retryAfter;
-
- /*
- * The Azure-AsyncOperation property.
- */
- private String azureAsyncOperation;
-
- private static final HttpHeaderName AZURE_ASYNC_OPERATION = HttpHeaderName.fromString("Azure-AsyncOperation");
-
- // HttpHeaders containing the raw property values.
- /**
- * Creates an instance of PreFullRestoreOperationHeaders class.
- *
- * @param rawHeaders The raw HttpHeaders that will be used to create the property values.
- */
- public PreFullRestoreOperationHeaders(HttpHeaders rawHeaders) {
- String retryAfter = rawHeaders.getValue(HttpHeaderName.RETRY_AFTER);
- if (retryAfter != null) {
- this.retryAfter = Long.parseLong(retryAfter);
- }
- this.azureAsyncOperation = rawHeaders.getValue(AZURE_ASYNC_OPERATION);
- }
-
- /**
- * Get the retryAfter property: The Retry-After property.
- *
- * @return the retryAfter value.
- */
- public Long getRetryAfter() {
- return this.retryAfter;
- }
-
- /**
- * Set the retryAfter property: The Retry-After property.
- *
- * @param retryAfter the retryAfter value to set.
- * @return the PreFullRestoreOperationHeaders object itself.
- */
- public PreFullRestoreOperationHeaders setRetryAfter(Long retryAfter) {
- this.retryAfter = retryAfter;
- return this;
- }
-
- /**
- * Get the azureAsyncOperation property: The Azure-AsyncOperation property.
- *
- * @return the azureAsyncOperation value.
- */
- public String getAzureAsyncOperation() {
- return this.azureAsyncOperation;
- }
-
- /**
- * Set the azureAsyncOperation property: The Azure-AsyncOperation property.
- *
- * @param azureAsyncOperation the azureAsyncOperation value to set.
- * @return the PreFullRestoreOperationHeaders object itself.
- */
- public PreFullRestoreOperationHeaders setAzureAsyncOperation(String azureAsyncOperation) {
- this.azureAsyncOperation = azureAsyncOperation;
- return this;
- }
-}
diff --git a/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/implementation/models/PreRestoreOperationParameters.java b/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/implementation/models/PreRestoreOperationParameters.java
deleted file mode 100644
index a720ab06700d4..0000000000000
--- a/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/implementation/models/PreRestoreOperationParameters.java
+++ /dev/null
@@ -1,113 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-// Code generated by Microsoft (R) AutoRest Code Generator.
-
-package com.azure.security.keyvault.administration.implementation.models;
-
-import com.azure.core.annotation.Fluent;
-import com.azure.json.JsonReader;
-import com.azure.json.JsonSerializable;
-import com.azure.json.JsonToken;
-import com.azure.json.JsonWriter;
-import java.io.IOException;
-
-/**
- * The PreRestoreOperationParameters model.
- */
-@Fluent
-public final class PreRestoreOperationParameters implements JsonSerializable {
- /*
- * The sasTokenParameters property.
- */
- private SASTokenParameter sasTokenParameters;
-
- /*
- * The Folder name of the blob where the previous successful full backup was stored
- */
- private String folderToRestore;
-
- /**
- * Creates an instance of PreRestoreOperationParameters class.
- */
- public PreRestoreOperationParameters() {
- }
-
- /**
- * Get the sasTokenParameters property: The sasTokenParameters property.
- *
- * @return the sasTokenParameters value.
- */
- public SASTokenParameter getSasTokenParameters() {
- return this.sasTokenParameters;
- }
-
- /**
- * Set the sasTokenParameters property: The sasTokenParameters property.
- *
- * @param sasTokenParameters the sasTokenParameters value to set.
- * @return the PreRestoreOperationParameters object itself.
- */
- public PreRestoreOperationParameters setSasTokenParameters(SASTokenParameter sasTokenParameters) {
- this.sasTokenParameters = sasTokenParameters;
- return this;
- }
-
- /**
- * Get the folderToRestore property: The Folder name of the blob where the previous successful full backup was
- * stored.
- *
- * @return the folderToRestore value.
- */
- public String getFolderToRestore() {
- return this.folderToRestore;
- }
-
- /**
- * Set the folderToRestore property: The Folder name of the blob where the previous successful full backup was
- * stored.
- *
- * @param folderToRestore the folderToRestore value to set.
- * @return the PreRestoreOperationParameters object itself.
- */
- public PreRestoreOperationParameters setFolderToRestore(String folderToRestore) {
- this.folderToRestore = folderToRestore;
- return this;
- }
-
- @Override
- public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
- jsonWriter.writeStartObject();
- jsonWriter.writeJsonField("sasTokenParameters", this.sasTokenParameters);
- jsonWriter.writeStringField("folderToRestore", this.folderToRestore);
- return jsonWriter.writeEndObject();
- }
-
- /**
- * Reads an instance of PreRestoreOperationParameters from the JsonReader.
- *
- * @param jsonReader The JsonReader being read.
- * @return An instance of PreRestoreOperationParameters if the JsonReader was pointing to an instance of it, or null
- * if it was pointing to JSON null.
- * @throws IOException If an error occurs while reading the PreRestoreOperationParameters.
- */
- public static PreRestoreOperationParameters fromJson(JsonReader jsonReader) throws IOException {
- return jsonReader.readObject(reader -> {
- PreRestoreOperationParameters deserializedPreRestoreOperationParameters
- = new PreRestoreOperationParameters();
- while (reader.nextToken() != JsonToken.END_OBJECT) {
- String fieldName = reader.getFieldName();
- reader.nextToken();
-
- if ("sasTokenParameters".equals(fieldName)) {
- deserializedPreRestoreOperationParameters.sasTokenParameters = SASTokenParameter.fromJson(reader);
- } else if ("folderToRestore".equals(fieldName)) {
- deserializedPreRestoreOperationParameters.folderToRestore = reader.getString();
- } else {
- reader.skipChildren();
- }
- }
-
- return deserializedPreRestoreOperationParameters;
- });
- }
-}
diff --git a/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/package-info.java b/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/package-info.java
index b753f047dcb97..1132a91286a5c 100644
--- a/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/package-info.java
+++ b/sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/package-info.java
@@ -312,45 +312,6 @@
* com.azure.security.keyvault.administration.KeyVaultAccessControlAsyncClient}.
*
*
- * Run Pre-Backup Check for a Collection of Keys
- *
- * The {@link com.azure.security.keyvault.administration.KeyVaultBackupClient} can be used to check if it is possible to
- * back up the entire collection of keys from a key vault.
- *
- *
- * Code Sample:
- *
- *
- * The following code sample demonstrates how to synchronously check if it is possible to back up an entire collection
- * of keys, using the
- * {@link com.azure.security.keyvault.administration.KeyVaultBackupClient#beginPreBackup(String, String)} API.
- *
- *
- * String blobStorageUrl = "https://myaccount.blob.core.windows.net/myContainer";
- * String sasToken = "<sas-token>";
- *
- * SyncPoller<KeyVaultBackupOperation, String> preBackupPoller = client.beginPreBackup(blobStorageUrl, sasToken);
- * PollResponse<KeyVaultBackupOperation> pollResponse = preBackupPoller.poll();
- *
- * System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus());
- *
- * PollResponse<KeyVaultBackupOperation> finalPollResponse = preBackupPoller.waitForCompletion();
- *
- * if (finalPollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) {
- * System.out.printf("Pre-backup check completed successfully.%n");
- * } else {
- * KeyVaultBackupOperation operation = preBackupPoller.poll().getValue();
- *
- * System.out.printf("Pre-backup check failed with error: %s.%n", operation.getError().getMessage());
- * }
- *
- *
- *
- *
- * Note: For the asynchronous sample, refer to {@link
- * com.azure.security.keyvault.administration.KeyVaultBackupAsyncClient}.
- *
- *
* Back Up a Collection of Keys
*
* The {@link com.azure.security.keyvault.administration.KeyVaultBackupClient} can be used to back up the entire
@@ -365,9 +326,11 @@
*
*
* String blobStorageUrl = "https://myaccount.blob.core.windows.net/myContainer";
- * String sasToken = "<sas-token>";
+ * String sasToken = "sv=2020-02-10&ss=b&srt=o&sp=rwdlactfx&se=2021-06-17T07:13:07Z&st=2021-06-16T23:13:07Z"
+ * + "&spr=https&sig=n5V6fnlkViEF9b7ij%2FttTHNwO2BdFIHKHppRxGAyJdc%3D";
*
* SyncPoller<KeyVaultBackupOperation, String> backupPoller = client.beginBackup(blobStorageUrl, sasToken);
+ *
* PollResponse<KeyVaultBackupOperation> pollResponse = backupPoller.poll();
*
* System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus());
@@ -391,46 +354,6 @@
* com.azure.security.keyvault.administration.KeyVaultBackupAsyncClient}.
*
*
- * Run Pre-Restore Check for a Collection of Keys
- *
- * The {@link com.azure.security.keyvault.administration.KeyVaultBackupClient} can be used to check if it is possible to
- * restore an entire collection of keys from a backup.
- *
- *
- * Code Sample:
- *
- *
- * The following code sample demonstrates how to synchronously check if it is possible to restore an entire collection
- * of keys from a backup, using the
- * {@link com.azure.security.keyvault.administration.KeyVaultBackupClient#beginPreRestore(String, String)} API.
- *
- *
- * String folderUrl = "https://myaccount.blob.core.windows.net/myContainer/mhsm-myaccount-2020090117323313";
- * String sasToken = "<sas-token>";
- *
- * SyncPoller<KeyVaultRestoreOperation, KeyVaultRestoreResult> preRestorePoller =
- * client.beginPreRestore(folderUrl, sasToken);
- * PollResponse<KeyVaultRestoreOperation> pollResponse = preRestorePoller.poll();
- *
- * System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus());
- *
- * PollResponse<KeyVaultRestoreOperation> finalPollResponse = preRestorePoller.waitForCompletion();
- *
- * if (finalPollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) {
- * System.out.printf("Pre-restore check completed successfully.%n");
- * } else {
- * KeyVaultRestoreOperation operation = preRestorePoller.poll().getValue();
- *
- * System.out.printf("Pre-restore check failed with error: %s.%n", operation.getError().getMessage());
- * }
- *
- *
- *
- *
- * Note: For the asynchronous sample, refer to {@link
- * com.azure.security.keyvault.administration.KeyVaultBackupAsyncClient}.
- *
- *
* Restore a Collection of Keys
*
* The {@link com.azure.security.keyvault.administration.KeyVaultBackupClient} can be used to restore an entire
@@ -445,20 +368,22 @@
*
*
* String folderUrl = "https://myaccount.blob.core.windows.net/myContainer/mhsm-myaccount-2020090117323313";
- * String sasToken = "<sas-token>";
+ * String sasToken = "sv=2020-02-10&ss=b&srt=o&sp=rwdlactfx&se=2021-06-17T07:13:07Z&st=2021-06-16T23:13:07Z"
+ * + "&spr=https&sig=n5V6fnlkViEF9b7ij%2FttTHNwO2BdFIHKHppRxGAyJdc%3D";
*
- * SyncPoller<KeyVaultRestoreOperation, KeyVaultRestoreResult> restorePoller =
+ * SyncPoller<KeyVaultRestoreOperation, KeyVaultRestoreResult> backupPoller =
* client.beginRestore(folderUrl, sasToken);
- * PollResponse<KeyVaultRestoreOperation> pollResponse = restorePoller.poll();
+ *
+ * PollResponse<KeyVaultRestoreOperation> pollResponse = backupPoller.poll();
*
* System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus());
*
- * PollResponse<KeyVaultRestoreOperation> finalPollResponse = restorePoller.waitForCompletion();
+ * PollResponse<KeyVaultRestoreOperation> finalPollResponse = backupPoller.waitForCompletion();
*
* if (finalPollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) {
* System.out.printf("Backup restored successfully.%n");
* } else {
- * KeyVaultRestoreOperation operation = restorePoller.poll().getValue();
+ * KeyVaultRestoreOperation operation = backupPoller.poll().getValue();
*
* System.out.printf("Restore failed with error: %s.%n", operation.getError().getMessage());
* }
diff --git a/sdk/keyvault/azure-security-keyvault-administration/src/samples/java/com/azure/security/keyvault/administration/ReadmeSamples.java b/sdk/keyvault/azure-security-keyvault-administration/src/samples/java/com/azure/security/keyvault/administration/ReadmeSamples.java
index f7d0108edc7a5..7fa3c2c0dad7f 100644
--- a/sdk/keyvault/azure-security-keyvault-administration/src/samples/java/com/azure/security/keyvault/administration/ReadmeSamples.java
+++ b/sdk/keyvault/azure-security-keyvault-administration/src/samples/java/com/azure/security/keyvault/administration/ReadmeSamples.java
@@ -293,44 +293,17 @@ public void createBackupClient() {
// END: readme-sample-createBackupClient
}
- /**
- * Code sample for starting a {@link KeyVaultBackupOperation pre-backup check}.
- */
- public void beginPreBackup() {
- // BEGIN: readme-sample-beginPreBackup
- String blobStorageUrl = "https://myaccount.blob.core.windows.net/myContainer";
- String sasToken = "";
-
- SyncPoller preBackupPoller =
- keyVaultBackupClient.beginPreBackup(blobStorageUrl, sasToken);
- PollResponse pollResponse = preBackupPoller.poll();
-
- System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus());
-
- PollResponse finalPollResponse = preBackupPoller.waitForCompletion();
-
- if (finalPollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) {
- String folderUrl = preBackupPoller.getFinalResult();
-
- System.out.printf("Pre-backup check completed successfully.%n");
- } else {
- KeyVaultBackupOperation operation = preBackupPoller.poll().getValue();
-
- System.out.printf("Pre-backup check failed with error: %s.%n", operation.getError().getMessage());
- }
- // END: readme-sample-beginPreBackup
- }
-
/**
* Code sample for starting a {@link KeyVaultBackupOperation backup operation}.
*/
public void beginBackup() {
// BEGIN: readme-sample-beginBackup
String blobStorageUrl = "https://myaccount.blob.core.windows.net/myContainer";
- String sasToken = "";
+ String sasToken = "sv=2020-02-10&ss=b&srt=o&sp=rwdlactfx&se=2021-06-17T07:13:07Z&st=2021-06-16T23:13:07Z&spr=https&sig=n5V6fnlkViEF9b7ij%2FttTHNwO2BdFIHKHppRxGAyJdc%3D";
SyncPoller backupPoller =
keyVaultBackupClient.beginBackup(blobStorageUrl, sasToken);
+
PollResponse pollResponse = backupPoller.poll();
System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus());
@@ -349,52 +322,27 @@ public void beginBackup() {
// END: readme-sample-beginBackup
}
- /**
- * Code sample for starting a {@link KeyVaultRestoreOperation pre-restore check}.
- */
- public void beginPreRestore() {
- // BEGIN: readme-sample-beginPreRestore
- String folderUrl = "https://myaccount.blob.core.windows.net/myContainer/mhsm-myaccount-2020090117323313";
- String sasToken = "";
-
- SyncPoller preRestorePoller =
- keyVaultBackupClient.beginPreRestore(folderUrl, sasToken);
- PollResponse pollResponse = preRestorePoller.poll();
-
- System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus());
-
- PollResponse finalPollResponse = preRestorePoller.waitForCompletion();
-
- if (finalPollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) {
- System.out.printf("Pre-restore check completed successfully.%n");
- } else {
- KeyVaultRestoreOperation operation = preRestorePoller.poll().getValue();
-
- System.out.printf("Pre-restore check failed with error: %s.%n", operation.getError().getMessage());
- }
- // END: readme-sample-beginPreRestore
- }
-
/**
* Code sample for starting a {@link KeyVaultRestoreOperation restore operation}.
*/
public void beginRestore() {
// BEGIN: readme-sample-beginRestore
String folderUrl = "https://myaccount.blob.core.windows.net/myContainer/mhsm-myaccount-2020090117323313";
- String sasToken = "";
+ String sasToken = "sv=2020-02-10&ss=b&srt=o&sp=rwdlactfx&se=2021-06-17T07:13:07Z&st=2021-06-16T23:13:07Z&spr=https&sig=n5V6fnlkViEF9b7ij%2FttTHNwO2BdFIHKHppRxGAyJdc%3D";
- SyncPoller restorePoller =
+ SyncPoller backupPoller =
keyVaultBackupClient.beginRestore(folderUrl, sasToken);
- PollResponse pollResponse = restorePoller.poll();
+
+ PollResponse pollResponse = backupPoller.poll();
System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus());
- PollResponse finalPollResponse = restorePoller.waitForCompletion();
+ PollResponse finalPollResponse = backupPoller.waitForCompletion();
if (finalPollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) {
System.out.printf("Backup restored successfully.%n");
} else {
- KeyVaultRestoreOperation operation = restorePoller.poll().getValue();
+ KeyVaultRestoreOperation operation = backupPoller.poll().getValue();
System.out.printf("Restore failed with error: %s.%n", operation.getError().getMessage());
}
@@ -407,54 +355,35 @@ public void beginRestore() {
public void beginSelectiveKeyRestore() {
// BEGIN: readme-sample-beginSelectiveKeyRestore
String folderUrl = "https://myaccount.blob.core.windows.net/myContainer/mhsm-myaccount-2020090117323313";
- String sasToken = "";
+ String sasToken = "sv=2020-02-10&ss=b&srt=o&sp=rwdlactfx&se=2021-06-17T07:13:07Z&st=2021-06-16T23:13:07Z&spr=https&sig=n5V6fnlkViEF9b7ij%2FttTHNwO2BdFIHKHppRxGAyJdc%3D";
String keyName = "myKey";
- SyncPoller restorePoller =
+ SyncPoller backupPoller =
keyVaultBackupClient.beginSelectiveKeyRestore(folderUrl, sasToken, keyName);
- PollResponse pollResponse = restorePoller.poll();
+
+ PollResponse pollResponse = backupPoller.poll();
System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus());
- PollResponse finalPollResponse = restorePoller.waitForCompletion();
+ PollResponse finalPollResponse = backupPoller.waitForCompletion();
if (finalPollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) {
System.out.printf("Key restored successfully.%n");
} else {
- KeyVaultSelectiveKeyRestoreOperation operation = restorePoller.poll().getValue();
+ KeyVaultSelectiveKeyRestoreOperation operation = backupPoller.poll().getValue();
System.out.printf("Key restore failed with error: %s.%n", operation.getError().getMessage());
}
// END: readme-sample-beginSelectiveKeyRestore
}
- /**
- * Code sample for starting a {@link KeyVaultBackupOperation pre-backup check} asynchronously.
- */
- public void beginPreBackupAsync() {
- // BEGIN: readme-sample-beginPreBackupAsync
- String blobStorageUrl = "https://myaccount.blob.core.windows.net/myContainer";
- String sasToken = "";
-
- keyVaultBackupAsyncClient.beginPreBackup(blobStorageUrl, sasToken)
- .setPollInterval(Duration.ofSeconds(1)) // You can set a custom polling interval.
- .doOnError(e -> System.out.printf("Pre-backup check failed with error: %s.%n", e.getMessage()))
- .doOnNext(pollResponse ->
- System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus()))
- .filter(pollResponse -> pollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED)
- .flatMap(AsyncPollResponse::getFinalResult)
- .subscribe(folderUrl ->
- System.out.printf("Pre-backup check completed successfully.%n"));
- // END: readme-sample-beginPreBackupAsync
- }
-
/**
* Code sample for starting a {@link KeyVaultBackupOperation backup operation} asynchronously.
*/
public void beginBackupAsync() {
// BEGIN: readme-sample-beginBackupAsync
String blobStorageUrl = "https://myaccount.blob.core.windows.net/myContainer";
- String sasToken = "";
+ String sasToken = "sv=2020-02-10&ss=b&srt=o&sp=rwdlactfx&se=2021-06-17T07:13:07Z&st=2021-06-16T23:13:07Z&spr=https&sig=n5V6fnlkViEF9b7ij%2FttTHNwO2BdFIHKHppRxGAyJdc%3D";
keyVaultBackupAsyncClient.beginBackup(blobStorageUrl, sasToken)
.setPollInterval(Duration.ofSeconds(1)) // You can set a custom polling interval.
@@ -468,32 +397,13 @@ public void beginBackupAsync() {
// END: readme-sample-beginBackupAsync
}
- /**
- * Code sample for starting a {@link KeyVaultRestoreOperation pre-restore check} asynchronously.
- */
- public void beginPreRestoreAsync() {
- // BEGIN: readme-sample-beginPreRestoreAsync
- String folderUrl = "https://myaccount.blob.core.windows.net/myContainer/mhsm-myaccount-2020090117323313";
- String sasToken = "";
-
- keyVaultBackupAsyncClient.beginPreRestore(folderUrl, sasToken)
- .setPollInterval(Duration.ofSeconds(1)) // You can set a custom polling interval.
- .doOnError(e -> System.out.printf("Pre-restore check failed with error: %s.%n", e.getMessage()))
- .doOnNext(pollResponse ->
- System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus()))
- .filter(pollResponse -> pollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED)
- .flatMap(AsyncPollResponse::getFinalResult)
- .subscribe(unused -> System.out.printf("Pre-restore check completed successfully.%n"));
- // END: readme-sample-beginPreRestoreAsync
- }
-
/**
* Code sample for starting a {@link KeyVaultRestoreOperation restore operation} asynchronously.
*/
public void beginRestoreAsync() {
// BEGIN: readme-sample-beginRestoreAsync
String folderUrl = "https://myaccount.blob.core.windows.net/myContainer/mhsm-myaccount-2020090117323313";
- String sasToken = "";
+ String sasToken = "sv=2020-02-10&ss=b&srt=o&sp=rwdlactfx&se=2021-06-17T07:13:07Z&st=2021-06-16T23:13:07Z&spr=https&sig=n5V6fnlkViEF9b7ij%2FttTHNwO2BdFIHKHppRxGAyJdc%3D";
keyVaultBackupAsyncClient.beginRestore(folderUrl, sasToken)
.setPollInterval(Duration.ofSeconds(1)) // You can set a custom polling interval.
@@ -513,7 +423,7 @@ public void beginRestoreAsync() {
public void beginSelectiveKeyRestoreAsync() {
// BEGIN: readme-sample-beginSelectiveKeyRestoreAsync
String folderUrl = "https://myaccount.blob.core.windows.net/myContainer/mhsm-myaccount-2020090117323313";
- String sasToken = "";
+ String sasToken = "sv=2020-02-10&ss=b&srt=o&sp=rwdlactfx&se=2021-06-17T07:13:07Z&st=2021-06-16T23:13:07Z&spr=https&sig=n5V6fnlkViEF9b7ij%2FttTHNwO2BdFIHKHppRxGAyJdc%3D";
String keyName = "myKey";
keyVaultBackupAsyncClient.beginSelectiveKeyRestore(folderUrl, sasToken, keyName)
diff --git a/sdk/keyvault/azure-security-keyvault-administration/src/samples/java/com/azure/security/keyvault/administration/codesnippets/KeyVaultBackupAsyncClientJavaDocCodeSnippets.java b/sdk/keyvault/azure-security-keyvault-administration/src/samples/java/com/azure/security/keyvault/administration/codesnippets/KeyVaultBackupAsyncClientJavaDocCodeSnippets.java
index 158569649064e..57e9b916a1c0c 100644
--- a/sdk/keyvault/azure-security-keyvault-administration/src/samples/java/com/azure/security/keyvault/administration/codesnippets/KeyVaultBackupAsyncClientJavaDocCodeSnippets.java
+++ b/sdk/keyvault/azure-security-keyvault-administration/src/samples/java/com/azure/security/keyvault/administration/codesnippets/KeyVaultBackupAsyncClientJavaDocCodeSnippets.java
@@ -50,27 +50,6 @@ public KeyVaultBackupAsyncClient createAsyncClientWithHttpClient() {
return keyVaultBackupAsyncClient;
}
- /**
- * Generates code samples for using {@link KeyVaultBackupAsyncClient#beginPreBackup(String, String)}.
- */
- public void beginPreBackup() {
- KeyVaultBackupAsyncClient client = createAsyncClient();
-
- // BEGIN: com.azure.security.keyvault.administration.KeyVaultBackupAsyncClient.beginPreBackup#String-String
- String blobStorageUrl = "https://myaccount.blob.core.windows.net/myContainer";
- String sasToken = "";
-
- client.beginPreBackup(blobStorageUrl, sasToken)
- .setPollInterval(Duration.ofSeconds(1)) // You can set a custom polling interval.
- .doOnError(e -> System.out.printf("Pre-backup check failed with error: %s.%n", e.getMessage()))
- .doOnNext(pollResponse ->
- System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus()))
- .filter(pollResponse -> pollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED)
- .flatMap(AsyncPollResponse::getFinalResult)
- .subscribe(unused -> System.out.printf("Pre-backup check completed successfully.%n"));
- // END: com.azure.security.keyvault.administration.KeyVaultBackupAsyncClient.beginPreBackup#String-String
- }
-
/**
* Generates code samples for using {@link KeyVaultBackupAsyncClient#beginBackup(String, String)}.
*/
@@ -79,7 +58,8 @@ public void beginBackup() {
// BEGIN: com.azure.security.keyvault.administration.KeyVaultBackupAsyncClient.beginBackup#String-String
String blobStorageUrl = "https://myaccount.blob.core.windows.net/myContainer";
- String sasToken = "";
+ String sasToken = "sv=2020-02-10&ss=b&srt=o&sp=rwdlactfx&se=2021-06-17T07:13:07Z&st=2021-06-16T23:13:07Z"
+ + "&spr=https&sig=n5V6fnlkViEF9b7ij%2FttTHNwO2BdFIHKHppRxGAyJdc%3D";
client.beginBackup(blobStorageUrl, sasToken)
.setPollInterval(Duration.ofSeconds(1)) // You can set a custom polling interval.
@@ -93,27 +73,6 @@ public void beginBackup() {
// END: com.azure.security.keyvault.administration.KeyVaultBackupAsyncClient.beginBackup#String-String
}
- /**
- * Generates code samples for using {@link KeyVaultBackupAsyncClient#beginPreRestore(String, String)}.
- */
- public void beginPreRestore() {
- KeyVaultBackupAsyncClient client = createAsyncClient();
-
- // BEGIN: com.azure.security.keyvault.administration.KeyVaultBackupAsyncClient.beginPreRestore#String-String
- String folderUrl = "https://myaccount.blob.core.windows.net/myContainer/mhsm-myaccount-2020090117323313";
- String sasToken = "";
-
- client.beginPreRestore(folderUrl, sasToken)
- .setPollInterval(Duration.ofSeconds(1)) // You can set a custom polling interval.
- .doOnError(e -> System.out.printf("Pre-restore check failed with error: %s.%n", e.getMessage()))
- .doOnNext(pollResponse ->
- System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus()))
- .filter(pollResponse -> pollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED)
- .flatMap(AsyncPollResponse::getFinalResult)
- .subscribe(unused -> System.out.printf("Pre-restore check completed successfully.%n"));
- // END: com.azure.security.keyvault.administration.KeyVaultBackupAsyncClient.beginPreRestore#String-String
- }
-
/**
* Generates code samples for using {@link KeyVaultBackupAsyncClient#beginRestore(String, String)}.
*/
@@ -122,7 +81,8 @@ public void beginRestore() {
// BEGIN: com.azure.security.keyvault.administration.KeyVaultBackupAsyncClient.beginRestore#String-String
String folderUrl = "https://myaccount.blob.core.windows.net/myContainer/mhsm-myaccount-2020090117323313";
- String sasToken = "";
+ String sasToken = "sv=2020-02-10&ss=b&srt=o&sp=rwdlactfx&se=2021-06-17T07:13:07Z&st=2021-06-16T23:13:07Z"
+ + "&spr=https&sig=n5V6fnlkViEF9b7ij%2FttTHNwO2BdFIHKHppRxGAyJdc%3D";
client.beginRestore(folderUrl, sasToken)
.setPollInterval(Duration.ofSeconds(1)) // You can set a custom polling interval.
@@ -144,7 +104,8 @@ public void beginSelectiveKeyRestore() {
// BEGIN: com.azure.security.keyvault.administration.KeyVaultBackupAsyncClient.beginSelectiveKeyRestore#String-String-String
String folderUrl = "https://myaccount.blob.core.windows.net/myContainer/mhsm-myaccount-2020090117323313";
- String sasToken = "";
+ String sasToken = "sv=2020-02-10&ss=b&srt=o&sp=rwdlactfx&se=2021-06-17T07:13:07Z&st=2021-06-16T23:13:07Z"
+ + "&spr=https&sig=n5V6fnlkViEF9b7ij%2FttTHNwO2BdFIHKHppRxGAyJdc%3D";
String keyName = "myKey";
client.beginSelectiveKeyRestore(folderUrl, sasToken, keyName)
diff --git a/sdk/keyvault/azure-security-keyvault-administration/src/samples/java/com/azure/security/keyvault/administration/codesnippets/KeyVaultBackupClientJavaDocCodeSnippets.java b/sdk/keyvault/azure-security-keyvault-administration/src/samples/java/com/azure/security/keyvault/administration/codesnippets/KeyVaultBackupClientJavaDocCodeSnippets.java
index 1c0788b0b3c22..a0a0b8f1dab87 100644
--- a/sdk/keyvault/azure-security-keyvault-administration/src/samples/java/com/azure/security/keyvault/administration/codesnippets/KeyVaultBackupClientJavaDocCodeSnippets.java
+++ b/sdk/keyvault/azure-security-keyvault-administration/src/samples/java/com/azure/security/keyvault/administration/codesnippets/KeyVaultBackupClientJavaDocCodeSnippets.java
@@ -34,33 +34,6 @@ public KeyVaultBackupClient createClient() {
return keyVaultBackupClient;
}
- /**
- * Generates code samples for using {@link KeyVaultBackupClient#beginPreBackup(String, String)}.
- */
- public void beginPreBackup() {
- KeyVaultBackupClient client = createClient();
-
- // BEGIN: com.azure.security.keyvault.administration.KeyVaultBackupClient.beginPreBackup#String-String
- String blobStorageUrl = "https://myaccount.blob.core.windows.net/myContainer";
- String sasToken = "";
-
- SyncPoller preBackupPoller = client.beginPreBackup(blobStorageUrl, sasToken);
- PollResponse pollResponse = preBackupPoller.poll();
-
- System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus());
-
- PollResponse finalPollResponse = preBackupPoller.waitForCompletion();
-
- if (finalPollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) {
- System.out.printf("Pre-backup check completed successfully.%n");
- } else {
- KeyVaultBackupOperation operation = preBackupPoller.poll().getValue();
-
- System.out.printf("Pre-backup check failed with error: %s.%n", operation.getError().getMessage());
- }
- // END: com.azure.security.keyvault.administration.KeyVaultBackupClient.beginPreBackup#String-String
- }
-
/**
* Generates code samples for using {@link KeyVaultBackupClient#beginBackup(String, String)}.
*/
@@ -69,9 +42,11 @@ public void beginBackup() {
// BEGIN: com.azure.security.keyvault.administration.KeyVaultBackupClient.beginBackup#String-String
String blobStorageUrl = "https://myaccount.blob.core.windows.net/myContainer";
- String sasToken = "";
+ String sasToken = "sv=2020-02-10&ss=b&srt=o&sp=rwdlactfx&se=2021-06-17T07:13:07Z&st=2021-06-16T23:13:07Z"
+ + "&spr=https&sig=n5V6fnlkViEF9b7ij%2FttTHNwO2BdFIHKHppRxGAyJdc%3D";
SyncPoller backupPoller = client.beginBackup(blobStorageUrl, sasToken);
+
PollResponse pollResponse = backupPoller.poll();
System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus());
@@ -90,34 +65,6 @@ public void beginBackup() {
// END: com.azure.security.keyvault.administration.KeyVaultBackupClient.beginBackup#String-String
}
- /**
- * Generates code samples for using {@link KeyVaultBackupClient#beginPreRestore(String, String)}.
- */
- public void beginPreRestore() {
- KeyVaultBackupClient client = createClient();
-
- // BEGIN: com.azure.security.keyvault.administration.KeyVaultBackupClient.beginPreRestore#String-String
- String folderUrl = "https://myaccount.blob.core.windows.net/myContainer/mhsm-myaccount-2020090117323313";
- String sasToken = "";
-
- SyncPoller preRestorePoller =
- client.beginPreRestore(folderUrl, sasToken);
- PollResponse pollResponse = preRestorePoller.poll();
-
- System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus());
-
- PollResponse finalPollResponse = preRestorePoller.waitForCompletion();
-
- if (finalPollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) {
- System.out.printf("Pre-restore check completed successfully.%n");
- } else {
- KeyVaultRestoreOperation operation = preRestorePoller.poll().getValue();
-
- System.out.printf("Pre-restore check failed with error: %s.%n", operation.getError().getMessage());
- }
- // END: com.azure.security.keyvault.administration.KeyVaultBackupClient.beginPreRestore#String-String
- }
-
/**
* Generates code samples for using {@link KeyVaultBackupClient#beginRestore(String, String)}.
*/
@@ -126,20 +73,22 @@ public void beginRestore() {
// BEGIN: com.azure.security.keyvault.administration.KeyVaultBackupClient.beginRestore#String-String
String folderUrl = "https://myaccount.blob.core.windows.net/myContainer/mhsm-myaccount-2020090117323313";
- String sasToken = "";
+ String sasToken = "sv=2020-02-10&ss=b&srt=o&sp=rwdlactfx&se=2021-06-17T07:13:07Z&st=2021-06-16T23:13:07Z"
+ + "&spr=https&sig=n5V6fnlkViEF9b7ij%2FttTHNwO2BdFIHKHppRxGAyJdc%3D";
- SyncPoller restorePoller =
+ SyncPoller backupPoller =
client.beginRestore(folderUrl, sasToken);
- PollResponse pollResponse = restorePoller.poll();
+
+ PollResponse pollResponse = backupPoller.poll();
System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus());
- PollResponse finalPollResponse = restorePoller.waitForCompletion();
+ PollResponse finalPollResponse = backupPoller.waitForCompletion();
if (finalPollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) {
System.out.printf("Backup restored successfully.%n");
} else {
- KeyVaultRestoreOperation operation = restorePoller.poll().getValue();
+ KeyVaultRestoreOperation operation = backupPoller.poll().getValue();
System.out.printf("Restore failed with error: %s.%n", operation.getError().getMessage());
}
@@ -154,21 +103,23 @@ public void beginSelectiveKeyRestore() {
// BEGIN: com.azure.security.keyvault.administration.KeyVaultBackupClient.beginSelectiveKeyRestore#String-String-String
String folderUrl = "https://myaccount.blob.core.windows.net/myContainer/mhsm-myaccount-2020090117323313";
- String sasToken = "";
+ String sasToken = "sv=2020-02-10&ss=b&srt=o&sp=rwdlactfx&se=2021-06-17T07:13:07Z&st=2021-06-16T23:13:07Z"
+ + "&spr=https&sig=n5V6fnlkViEF9b7ij%2FttTHNwO2BdFIHKHppRxGAyJdc%3D";
String keyName = "myKey";
- SyncPoller restorePoller =
+ SyncPoller backupPoller =
client.beginSelectiveKeyRestore(folderUrl, sasToken, keyName);
- PollResponse pollResponse = restorePoller.poll();
+
+ PollResponse pollResponse = backupPoller.poll();
System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus());
- PollResponse finalPollResponse = restorePoller.waitForCompletion();
+ PollResponse finalPollResponse = backupPoller.waitForCompletion();
if (finalPollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) {
System.out.printf("Key restored successfully.%n");
} else {
- KeyVaultSelectiveKeyRestoreOperation operation = restorePoller.poll().getValue();
+ KeyVaultSelectiveKeyRestoreOperation operation = backupPoller.poll().getValue();
System.out.printf("Key restore failed with error: %s.%n", operation.getError().getMessage());
}
diff --git a/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultAccessControlAsyncClientTest.java b/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultAccessControlAsyncClientTest.java
index 50d4d53a7015e..5f7e65aead11a 100644
--- a/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultAccessControlAsyncClientTest.java
+++ b/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultAccessControlAsyncClientTest.java
@@ -29,11 +29,6 @@ private void getClient(HttpClient httpClient, boolean forCleanup) {
asyncClient = getClientBuilder(buildAsyncAssertingClient(
interceptorManager.isPlaybackMode() ? interceptorManager.getPlaybackClient() : httpClient), forCleanup)
.buildAsyncClient();
-
- if (!interceptorManager.isLiveMode()) {
- // Remove `id` and `name` sanitizers from the list of common sanitizers.
- interceptorManager.removeSanitizers("AZSDK3430", "AZSDK3493");
- }
}
private HttpClient buildAsyncAssertingClient(HttpClient httpClient) {
@@ -222,7 +217,7 @@ public void createRoleAssignment(HttpClient httpClient) {
KeyVaultRoleAssignmentProperties properties = roleAssignment.getProperties();
assertNotNull(properties);
- assertNotNull(properties.getPrincipalId());
+ assertEquals(servicePrincipalId, properties.getPrincipalId());
assertEquals(KeyVaultRoleScope.GLOBAL, properties.getScope());
KeyVaultRoleDefinition roleDefinition = tuple.getT1();
diff --git a/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultAccessControlClientTest.java b/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultAccessControlClientTest.java
index 33822a59c17fc..cae65a605f98d 100644
--- a/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultAccessControlClientTest.java
+++ b/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultAccessControlClientTest.java
@@ -29,10 +29,6 @@ private void getClient(HttpClient httpClient, boolean forCleanup) {
client = getClientBuilder(buildSyncAssertingClient(
interceptorManager.isPlaybackMode() ? interceptorManager.getPlaybackClient() : httpClient), forCleanup)
.buildClient();
- if (!interceptorManager.isLiveMode()) {
- // Remove `id` and `name` sanitizers from the list of common sanitizers.
- interceptorManager.removeSanitizers("AZSDK3430", "AZSDK3493");
- }
}
private HttpClient buildSyncAssertingClient(HttpClient httpClient) {
@@ -215,7 +211,7 @@ public void createRoleAssignment(HttpClient httpClient) {
KeyVaultRoleAssignmentProperties properties = createdRoleAssignment.getProperties();
assertNotNull(properties);
- assertNotNull(properties.getPrincipalId());
+ assertEquals(servicePrincipalId, properties.getPrincipalId());
assertEquals(createdRoleDefinition.getId(), properties.getRoleDefinitionId());
assertEquals(KeyVaultRoleScope.GLOBAL, properties.getScope());
} finally {
diff --git a/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultAccessControlClientTestBase.java b/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultAccessControlClientTestBase.java
index bcddfaf61d1e6..1912b0a0d0839 100644
--- a/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultAccessControlClientTestBase.java
+++ b/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultAccessControlClientTestBase.java
@@ -23,7 +23,7 @@ public abstract class KeyVaultAccessControlClientTestBase extends KeyVaultAdmini
private static final ClientLogger LOGGER = new ClientLogger(KeyVaultAccessControlClientTestBase.class);
protected final String servicePrincipalId =
- Configuration.getGlobalConfiguration().get("CLIENT_OBJECTID", "f84ae8f9-c979-4750-a2fe-b350a00bebff");
+ Configuration.getGlobalConfiguration().get("CLIENT_OBJECTID", "3a107ba6-6cc0-40cf-9fed-22b612269c92");
KeyVaultAccessControlClientBuilder getClientBuilder(HttpClient httpClient, boolean forCleanup) {
return new KeyVaultAccessControlClientBuilder()
diff --git a/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultAdministrationClientTestBase.java b/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultAdministrationClientTestBase.java
index ff488e7ca3d10..a5ffb214a4ad3 100644
--- a/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultAdministrationClientTestBase.java
+++ b/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultAdministrationClientTestBase.java
@@ -24,8 +24,7 @@
import com.azure.core.test.models.TestProxySanitizerType;
import com.azure.core.test.utils.MockTokenCredential;
import com.azure.core.util.Configuration;
-import com.azure.identity.AzurePowerShellCredentialBuilder;
-import com.azure.identity.DefaultAzureCredentialBuilder;
+import com.azure.identity.ClientSecretCredentialBuilder;
import com.azure.security.keyvault.administration.implementation.KeyVaultCredentialPolicy;
import org.junit.jupiter.api.Assumptions;
import org.junit.jupiter.params.provider.Arguments;
@@ -59,13 +58,28 @@ protected String getTestName() {
HttpPipeline getPipeline(HttpClient httpClient, boolean forCleanup) {
TokenCredential credential;
- if (interceptorManager.isLiveMode()) {
- credential = new AzurePowerShellCredentialBuilder().additionallyAllowedTenants("*").build();
- } else if (interceptorManager.isRecordMode()) {
- credential = new DefaultAzureCredentialBuilder().additionallyAllowedTenants("*").build();
- List customSanitizers = new ArrayList<>();
- customSanitizers.add(new TestProxySanitizer("token", null, "REDACTED", TestProxySanitizerType.BODY_KEY));
- interceptorManager.addSanitizers(customSanitizers);
+
+ if (!interceptorManager.isPlaybackMode()) {
+ String clientId = Configuration.getGlobalConfiguration().get("AZURE_KEYVAULT_CLIENT_ID");
+ String clientKey = Configuration.getGlobalConfiguration().get("AZURE_KEYVAULT_CLIENT_SECRET");
+ String tenantId = Configuration.getGlobalConfiguration().get("AZURE_KEYVAULT_TENANT_ID");
+
+ Objects.requireNonNull(clientId, "The client id cannot be null");
+ Objects.requireNonNull(clientKey, "The client key cannot be null");
+ Objects.requireNonNull(tenantId, "The tenant id cannot be null");
+
+ credential = new ClientSecretCredentialBuilder()
+ .clientSecret(clientKey)
+ .clientId(clientId)
+ .tenantId(tenantId)
+ .additionallyAllowedTenants("*")
+ .build();
+
+ if (interceptorManager.isRecordMode()) {
+ List customSanitizers = new ArrayList<>();
+ customSanitizers.add(new TestProxySanitizer("token", null, "REDACTED", TestProxySanitizerType.BODY_KEY));
+ interceptorManager.addSanitizers(customSanitizers);
+ }
} else {
credential = new MockTokenCredential();
diff --git a/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultBackupAsyncClientTest.java b/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultBackupAsyncClientTest.java
index 1e8baaddd8101..6c3be6ed35a8a 100644
--- a/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultBackupAsyncClientTest.java
+++ b/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultBackupAsyncClientTest.java
@@ -5,20 +5,24 @@
import com.azure.core.http.HttpClient;
import com.azure.core.test.http.AssertingHttpClientBuilder;
import com.azure.core.util.polling.AsyncPollResponse;
-import com.azure.security.keyvault.keys.KeyClient;
+import com.azure.core.util.polling.LongRunningOperationStatus;
+import com.azure.security.keyvault.administration.models.KeyVaultBackupOperation;
+import com.azure.security.keyvault.administration.models.KeyVaultRestoreOperation;
+import com.azure.security.keyvault.administration.models.KeyVaultRestoreResult;
+import com.azure.security.keyvault.administration.models.KeyVaultSelectiveKeyRestoreOperation;
+import com.azure.security.keyvault.administration.models.KeyVaultSelectiveKeyRestoreResult;
+import com.azure.security.keyvault.keys.KeyAsyncClient;
import com.azure.security.keyvault.keys.KeyClientBuilder;
+import com.azure.security.keyvault.keys.KeyServiceVersion;
import com.azure.security.keyvault.keys.models.CreateRsaKeyOptions;
import com.azure.security.keyvault.keys.models.KeyVaultKey;
-import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.MethodSource;
-import reactor.test.StepVerifier;
import java.time.OffsetDateTime;
import java.time.ZoneOffset;
import static org.junit.jupiter.api.Assertions.assertNotNull;
-import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
public class KeyVaultBackupAsyncClientTest extends KeyVaultBackupClientTestBase {
@@ -45,34 +49,13 @@ private HttpClient buildAsyncAssertingClient(HttpClient httpClient) {
public void beginBackup(HttpClient httpClient) {
getAsyncClient(httpClient, false);
- StepVerifier.create(setPlaybackPollerFluxPollInterval(asyncClient.beginBackup(blobStorageUrl, sasToken))
- .last()
- .flatMap(AsyncPollResponse::getFinalResult))
- .assertNext(backupBlobUri -> {
- assertNotNull(backupBlobUri);
- assertTrue(backupBlobUri.startsWith(blobStorageUrl));
- })
- .verifyComplete();
- }
-
- /**
- * Tests that a Key Vault or MHSM can be pre-backed up.
- */
- @SuppressWarnings("ConstantConditions")
- @ParameterizedTest(name = DISPLAY_NAME)
- @MethodSource("com.azure.security.keyvault.administration.KeyVaultAdministrationClientTestBase#createHttpClients")
- public void beginPreBackup(HttpClient httpClient) {
- getAsyncClient(httpClient, false);
+ AsyncPollResponse backupPollResponse =
+ setPlaybackPollerFluxPollInterval(asyncClient.beginBackup(blobStorageUrl, sasToken)).blockLast();
- StepVerifier.create(setPlaybackPollerFluxPollInterval(asyncClient.beginPreBackup(blobStorageUrl, sasToken))
- .last()
- .flatMap(AsyncPollResponse::getFinalResult)
- .mapNotNull(backupBlobUri -> {
- assertNull(backupBlobUri);
+ String backupBlobUri = backupPollResponse.getFinalResult().block();
- return backupBlobUri;
- }))
- .verifyComplete();
+ assertNotNull(backupBlobUri);
+ assertTrue(backupBlobUri.startsWith(blobStorageUrl));
}
/**
@@ -84,49 +67,26 @@ public void beginPreBackup(HttpClient httpClient) {
public void beginRestore(HttpClient httpClient) {
getAsyncClient(httpClient, false);
- StepVerifier.create(setPlaybackPollerFluxPollInterval(asyncClient.beginBackup(blobStorageUrl, sasToken))
- .last()
- .flatMap(AsyncPollResponse::getFinalResult)
- .map(backupBlobUri -> {
- assertNotNull(backupBlobUri);
- assertTrue(backupBlobUri.startsWith(blobStorageUrl));
-
- return backupBlobUri;
- })
- .map(backupBlobUri -> asyncClient.beginRestore(backupBlobUri, sasToken)
- .last()
- .map(AsyncPollResponse::getValue)))
- .assertNext(Assertions::assertNotNull)
- .verifyComplete();
+ // Create a backup
+ AsyncPollResponse backupPollResponse =
+ setPlaybackPollerFluxPollInterval(asyncClient.beginBackup(blobStorageUrl, sasToken))
+ .takeUntil(asyncPollResponse ->
+ asyncPollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED)
+ .blockLast();
- // For some reason, the service might still think a restore operation is running even after returning a success
- // signal. This gives it some time to "clear" the operation.
- sleepIfRunningAgainstService(30000);
- }
+ KeyVaultBackupOperation backupOperation = backupPollResponse.getValue();
+ assertNotNull(backupOperation);
- /**
- * Tests that a Key Vault can be pre-restored from a backup.
- */
- @SuppressWarnings("ConstantConditions")
- @ParameterizedTest(name = DISPLAY_NAME)
- @MethodSource("com.azure.security.keyvault.administration.KeyVaultAdministrationClientTestBase#createHttpClients")
- public void beginPreRestore(HttpClient httpClient) {
- getAsyncClient(httpClient, false);
+ // Restore the backup
+ String backupFolderUrl = backupOperation.getAzureStorageBlobContainerUrl();
+ AsyncPollResponse restorePollResponse =
+ setPlaybackPollerFluxPollInterval(asyncClient.beginRestore(backupFolderUrl, sasToken))
+ .takeUntil(asyncPollResponse ->
+ asyncPollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED)
+ .blockLast();
- StepVerifier.create(setPlaybackPollerFluxPollInterval(asyncClient.beginBackup(blobStorageUrl, sasToken))
- .last()
- .flatMap(AsyncPollResponse::getFinalResult)
- .map(backupBlobUri -> {
- assertNotNull(backupBlobUri);
- assertTrue(backupBlobUri.startsWith(blobStorageUrl));
-
- return backupBlobUri;
- })
- .map(backupBlobUri -> asyncClient.beginPreRestore(backupBlobUri, sasToken)
- .last()
- .map(AsyncPollResponse::getValue)))
- .assertNext(Assertions::assertNotNull)
- .verifyComplete();
+ KeyVaultRestoreOperation restoreOperation = restorePollResponse.getValue();
+ assertNotNull(restoreOperation);
// For some reason, the service might still think a restore operation is running even after returning a success
// signal. This gives it some time to "clear" the operation.
@@ -140,35 +100,42 @@ public void beginPreRestore(HttpClient httpClient) {
@ParameterizedTest(name = DISPLAY_NAME)
@MethodSource("com.azure.security.keyvault.administration.KeyVaultAdministrationClientTestBase#createHttpClients")
public void beginSelectiveKeyRestore(HttpClient httpClient) {
- KeyClient keyClient = new KeyClientBuilder()
+ KeyAsyncClient keyClient = new KeyClientBuilder()
.vaultUrl(getEndpoint())
+ .serviceVersion(KeyServiceVersion.V7_2)
.pipeline(getPipeline(httpClient, false))
- .buildClient();
+ .buildAsyncClient();
String keyName = testResourceNamer.randomName("backupKey", 20);
CreateRsaKeyOptions rsaKeyOptions = new CreateRsaKeyOptions(keyName)
.setExpiresOn(OffsetDateTime.of(2050, 1, 30, 0, 0, 0, 0, ZoneOffset.UTC))
.setNotBefore(OffsetDateTime.of(2000, 1, 30, 12, 59, 59, 0, ZoneOffset.UTC));
- KeyVaultKey createdKey = keyClient.createRsaKey(rsaKeyOptions);
+ KeyVaultKey createdKey = keyClient.createRsaKey(rsaKeyOptions).block();
getAsyncClient(httpClient, false);
- StepVerifier.create(setPlaybackPollerFluxPollInterval(asyncClient.beginBackup(blobStorageUrl, sasToken))
- .last()
- .flatMap(AsyncPollResponse::getFinalResult)
- .map(backupBlobUri -> {
- assertNotNull(backupBlobUri);
- assertTrue(backupBlobUri.startsWith(blobStorageUrl));
-
- return backupBlobUri;
- })
- .map(backupBlobUri ->
- asyncClient.beginSelectiveKeyRestore(createdKey.getName(), backupBlobUri, sasToken)
- .last()
- .map(AsyncPollResponse::getValue)))
- .assertNext(Assertions::assertNotNull)
- .verifyComplete();
+ // Create a backup
+ AsyncPollResponse backupPollResponse =
+ setPlaybackPollerFluxPollInterval(asyncClient.beginBackup(blobStorageUrl, sasToken))
+ .takeUntil(asyncPollResponse ->
+ asyncPollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED)
+ .blockLast();
+
+ KeyVaultBackupOperation backupOperation = backupPollResponse.getValue();
+ assertNotNull(backupOperation);
+
+ // Restore the backup
+ String backupFolderUrl = backupOperation.getAzureStorageBlobContainerUrl();
+ AsyncPollResponse restorePollResponse =
+ setPlaybackPollerFluxPollInterval(asyncClient.beginSelectiveKeyRestore(createdKey.getName(),
+ backupFolderUrl, sasToken))
+ .takeUntil(asyncPollResponse ->
+ asyncPollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED)
+ .blockLast();
+
+ KeyVaultSelectiveKeyRestoreOperation restoreOperation = restorePollResponse.getValue();
+ assertNotNull(restoreOperation);
// For some reason, the service might still think a restore operation is running even after returning a success
// signal. This gives it some time to "clear" the operation.
diff --git a/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultBackupClientTest.java b/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultBackupClientTest.java
index 362e36ff1299e..62b4d8e7cf2c3 100644
--- a/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultBackupClientTest.java
+++ b/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultBackupClientTest.java
@@ -14,6 +14,7 @@
import com.azure.security.keyvault.administration.models.KeyVaultSelectiveKeyRestoreResult;
import com.azure.security.keyvault.keys.KeyClient;
import com.azure.security.keyvault.keys.KeyClientBuilder;
+import com.azure.security.keyvault.keys.KeyServiceVersion;
import com.azure.security.keyvault.keys.models.CreateRsaKeyOptions;
import com.azure.security.keyvault.keys.models.KeyVaultKey;
import org.junit.jupiter.params.ParameterizedTest;
@@ -24,7 +25,6 @@
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
-import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
public class KeyVaultBackupClientTest extends KeyVaultBackupClientTestBase {
@@ -52,9 +52,8 @@ public void beginBackup(HttpClient httpClient) {
SyncPoller backupPoller =
setPlaybackSyncPollerPollInterval(client.beginBackup(blobStorageUrl, sasToken));
- PollResponse pollResponse = backupPoller.waitForCompletion();
- assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, pollResponse.getStatus());
+ backupPoller.waitForCompletion();
String backupBlobUri = backupPoller.getFinalResult();
@@ -62,25 +61,6 @@ public void beginBackup(HttpClient httpClient) {
assertTrue(backupBlobUri.startsWith(blobStorageUrl));
}
- /**
- * Tests that a Key Vault can be pre-backed up.
- */
- @ParameterizedTest(name = DISPLAY_NAME)
- @MethodSource("com.azure.security.keyvault.administration.KeyVaultAdministrationClientTestBase#createHttpClients")
- public void beginPreBackup(HttpClient httpClient) {
- getClient(httpClient, false);
-
- SyncPoller backupPoller =
- setPlaybackSyncPollerPollInterval(client.beginPreBackup(blobStorageUrl, sasToken));
- PollResponse pollResponse = backupPoller.waitForCompletion();
-
- assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, pollResponse.getStatus());
-
- String backupBlobUri = backupPoller.getFinalResult();
-
- assertNull(backupBlobUri);
- }
-
/**
* Tests that a Key Vault can be restored from a backup.
*/
@@ -92,9 +72,8 @@ public void beginRestore(HttpClient httpClient) {
// Create a backup
SyncPoller backupPoller =
setPlaybackSyncPollerPollInterval(client.beginBackup(blobStorageUrl, sasToken));
- PollResponse pollResponse = backupPoller.waitForCompletion();
- assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, pollResponse.getStatus());
+ backupPoller.waitForCompletion();
// Restore the backup
String backupFolderUrl = backupPoller.getFinalResult();
@@ -112,34 +91,6 @@ public void beginRestore(HttpClient httpClient) {
sleepIfRunningAgainstService(30000);
}
- /**
- * Tests that a Key Vault can be pre-restored from a backup.
- */
- @ParameterizedTest(name = DISPLAY_NAME)
- @MethodSource("com.azure.security.keyvault.administration.KeyVaultAdministrationClientTestBase#createHttpClients")
- public void beginPreRestore(HttpClient httpClient) {
- getClient(httpClient, false);
-
- // Create a backup
- SyncPoller backupPoller =
- setPlaybackSyncPollerPollInterval(client.beginBackup(blobStorageUrl, sasToken));
- PollResponse backupPollResponse = backupPoller.waitForCompletion();
-
- assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, backupPollResponse.getStatus());
-
- // Restore the backup
- String backupFolderUrl = backupPoller.getFinalResult();
- SyncPoller restorePoller =
- setPlaybackSyncPollerPollInterval(client.beginPreRestore(backupFolderUrl, sasToken));
- PollResponse restorePollResponse = restorePoller.waitForCompletion();
-
- assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, restorePollResponse.getStatus());
-
- // For some reason, the service might still think a restore operation is running even after returning a success
- // signal. This gives it some time to "clear" the operation.
- sleepIfRunningAgainstService(30000);
- }
-
/**
* Tests that a key can be restored from a backup.
*/
@@ -148,6 +99,7 @@ public void beginPreRestore(HttpClient httpClient) {
public void beginSelectiveKeyRestore(HttpClient httpClient) {
KeyClient keyClient = new KeyClientBuilder()
.vaultUrl(getEndpoint())
+ .serviceVersion(KeyServiceVersion.V7_2)
.pipeline(getPipeline(httpClient, false))
.buildClient();
@@ -163,19 +115,20 @@ public void beginSelectiveKeyRestore(HttpClient httpClient) {
// Create a backup
SyncPoller backupPoller =
setPlaybackSyncPollerPollInterval(client.beginBackup(blobStorageUrl, sasToken));
- PollResponse backupPollResponse = backupPoller.waitForCompletion();
- assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, backupPollResponse.getStatus());
+ backupPoller.waitForCompletion();
// Restore one key from said backup
String backupFolderUrl = backupPoller.getFinalResult();
SyncPoller selectiveKeyRestorePoller =
setPlaybackSyncPollerPollInterval(client.beginSelectiveKeyRestore(createdKey.getName(), backupFolderUrl,
sasToken));
- PollResponse restorePollResponse =
- selectiveKeyRestorePoller.waitForCompletion();
- assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, restorePollResponse.getStatus());
+ selectiveKeyRestorePoller.waitForCompletion();
+
+ PollResponse response = selectiveKeyRestorePoller.poll();
+
+ assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, response.getStatus());
// For some reason, the service might still think a restore operation is running even after returning a success
// signal. This gives it some time to "clear" the operation.
diff --git a/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultBackupClientTestBase.java b/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultBackupClientTestBase.java
index 37adff2fc63a7..0b5c5110844b3 100644
--- a/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultBackupClientTestBase.java
+++ b/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultBackupClientTestBase.java
@@ -19,7 +19,7 @@
public abstract class KeyVaultBackupClientTestBase extends KeyVaultAdministrationClientTestBase {
protected final String blobStorageUrl = IS_MANAGED_HSM_DEPLOYED
? getStorageEndpoint() + Configuration.getGlobalConfiguration().get("BLOB_CONTAINER_NAME")
- : "https://tb5d8675f0aa83a18prim.blob.core.windows.net/backup";
+ : "https://ta70c2fe596f0a0dfprim.blob.core.windows.net/backup";
protected final String sasToken = IS_MANAGED_HSM_DEPLOYED ? generateSasToken() : "REDACTED";
KeyVaultBackupClientBuilder getClientBuilder(HttpClient httpClient, boolean forCleanup) {
@@ -31,15 +31,9 @@ KeyVaultBackupClientBuilder getClientBuilder(HttpClient httpClient, boolean forC
@Test
public abstract void beginBackup(HttpClient httpClient);
- @Test
- public abstract void beginPreBackup(HttpClient httpClient);
-
@Test
public abstract void beginRestore(HttpClient httpClient);
- @Test
- public abstract void beginPreRestore(HttpClient httpClient);
-
@Test
public abstract void beginSelectiveKeyRestore(HttpClient httpClient);
diff --git a/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultSettingsAsyncClientTest.java b/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultSettingsAsyncClientTest.java
index ae7a60912ee12..e917be7b12639 100644
--- a/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultSettingsAsyncClientTest.java
+++ b/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultSettingsAsyncClientTest.java
@@ -26,10 +26,6 @@ private void getClient(HttpClient httpClient, boolean forCleanup) {
asyncClient = getClientBuilder(buildAsyncAssertingClient(
interceptorManager.isPlaybackMode() ? interceptorManager.getPlaybackClient() : httpClient), forCleanup)
.buildAsyncClient();
- if (!interceptorManager.isLiveMode()) {
- // Remove `id` and `name` sanitizers from the list of common sanitizers.
- interceptorManager.removeSanitizers("AZSDK3430", "AZSDK3493");
- }
}
@ParameterizedTest(name = DISPLAY_NAME)
diff --git a/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultSettingsClientTest.java b/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultSettingsClientTest.java
index 82caca78a28da..b4dbc2cf3f99e 100644
--- a/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultSettingsClientTest.java
+++ b/sdk/keyvault/azure-security-keyvault-administration/src/test/java/com/azure/security/keyvault/administration/KeyVaultSettingsClientTest.java
@@ -25,10 +25,6 @@ private void getClient(HttpClient httpClient, boolean forCleanup) {
client = getClientBuilder(buildSyncAssertingClient(
interceptorManager.isPlaybackMode() ? interceptorManager.getPlaybackClient() : httpClient), forCleanup)
.buildClient();
- if (!interceptorManager.isLiveMode()) {
- // Remove `id` and `name` sanitizers from the list of common sanitizers.
- interceptorManager.removeSanitizers("AZSDK3430", "AZSDK3493");
- }
}
@ParameterizedTest(name = DISPLAY_NAME)
diff --git a/sdk/keyvault/azure-security-keyvault-administration/swagger/autorest.md b/sdk/keyvault/azure-security-keyvault-administration/swagger/autorest.md
index 7d1eeb09dfb6a..39e47f91030e8 100644
--- a/sdk/keyvault/azure-security-keyvault-administration/swagger/autorest.md
+++ b/sdk/keyvault/azure-security-keyvault-administration/swagger/autorest.md
@@ -65,7 +65,7 @@ partial-update: true
These settings apply only when `--tag=rbac` is specified on the command line.
``` yaml $(tag) == 'rbac'
-input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/8af9817c15d688c941cda106758045b5deb9a069/specification/keyvault/data-plane/Microsoft.KeyVault/preview/7.6-preview.1/rbac.json
+input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/a2f6f742d088dcc712e67cb2745d8271eaa370ff/specification/keyvault/data-plane/Microsoft.KeyVault/preview/7.5-preview.1/rbac.json
title: KeyVaultAccessControlClient
custom-types: KeyVaultDataAction,KeyVaultRoleDefinitionType,KeyVaultRoleScope,KeyVaultRoleType
customization-class: src/main/java/RbacCustomizations.java
@@ -87,7 +87,7 @@ directive:
These settings apply only when `--tag=backuprestore` is specified on the command line.
``` yaml $(tag) == 'backuprestore'
-input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/8af9817c15d688c941cda106758045b5deb9a069/specification/keyvault/data-plane/Microsoft.KeyVault/preview/7.6-preview.1/backuprestore.json
+input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/a2f6f742d088dcc712e67cb2745d8271eaa370ff/specification/keyvault/data-plane/Microsoft.KeyVault/preview/7.5-preview.1/backuprestore.json
title: KeyVaultBackupClient
customization-class: src/main/java/BackupRestoreCustomizations.java
```
@@ -96,7 +96,7 @@ customization-class: src/main/java/BackupRestoreCustomizations.java
These settings apply only when `--tag=settings` is specified on the command line.
``` yaml $(tag) == 'settings'
-input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/8af9817c15d688c941cda106758045b5deb9a069/specification/keyvault/data-plane/Microsoft.KeyVault/preview/7.6-preview.1/settings.json
+input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/a2f6f742d088dcc712e67cb2745d8271eaa370ff/specification/keyvault/data-plane/Microsoft.KeyVault/preview/7.5-preview.1/settings.json
title: KeyVaultSettingsClient
custom-types: KeyVaultSettingType
customization-class: src/main/java/SettingsCustomizations.java
diff --git a/sdk/keyvault/azure-security-keyvault-certificates/CHANGELOG.md b/sdk/keyvault/azure-security-keyvault-certificates/CHANGELOG.md
index 778d15ebb50db..c752765194c8e 100644
--- a/sdk/keyvault/azure-security-keyvault-certificates/CHANGELOG.md
+++ b/sdk/keyvault/azure-security-keyvault-certificates/CHANGELOG.md
@@ -1,14 +1,14 @@
# Release History
-## 4.7.0-beta.1 (Unreleased)
+## 4.6.5 (2024-07-29)
-### Features Added
-
-### Breaking Changes
+### Other Changes
-### Bugs Fixed
+#### Dependency Updates
-### Other Changes
+- Upgraded `azure-core-http-netty` from `1.15.1` to version `1.15.2`.
+- Upgraded `azure-json` from `1.1.0` to version `1.2.0`.
+- Upgraded `azure-core` from `1.49.1` to version `1.50.0`.
## 4.6.4 (2024-06-27)
@@ -555,8 +555,10 @@ Changes when compared to the last stable release (`4.5.9`) include:
- Removed `AdministratorContact` constructor overloads and introduced setters for all parameters.
- Removed `CertificateContact` constructor overloads and introduced setters for all parameters.
+For details on the Azure SDK for Java (December 2019 beta) release refer to the [release announcement](https://aka.ms/azure-sdk-beta7-java).
## 4.0.0-beta.6 (2019-12-04)
+For details on the Azure SDK for Java (November 2019 Preview) release refer to the [release announcement](https://aka.ms/azure-sdk-preview5-java).
### Breaking changes
@@ -588,6 +590,7 @@ Changes when compared to the last stable release (`4.5.9`) include:
## 4.0.0-preview.5 (2019-11-01)
+For details on the Azure SDK for Java (November 2019 Preview) release refer to the [release announcement](https://aka.ms/azure-sdk-preview5-java).
### Breaking changes
- `beginCreateCertificate` method now returns a SyncPoller in `CertificateClient` and a PollerFlux in`CertificateAsyncClient`
@@ -634,7 +637,7 @@ For details on the Azure SDK for Java (September 2019 Preview) release refer to
## 4.0.0-preview.3 (2019-09-10)
For details on the Azure SDK for Java (August 2019 Preview) release refer to the [release announcement](https://aka.ms/azure-sdk-preview3-java).
-This library is not a direct replacement for certificates management operations from [microsoft-azure-keyvault](https://github.com/Azure/azure-sdk-for-java/tree/azure-security-keyvault-keys_4.0.0/sdk/keyvault/microsoft-azure-keyvault). Applications using that library would require code changes to use `azure-keyvault-certificates`.
+This library is not a direct replacement for certificates management operations from [microsoft-azure-keyvault](https://github.com/Azure/azure-sdk-for-java/tree/azure-security-keyvault-keys_4.7.3/sdk/keyvault/microsoft-azure-keyvault). Applications using that library would require code changes to use `azure-keyvault-certificates`.
This package's
[documentation](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/keyvault/azure-security-keyvault-certificates/README.md)
and
diff --git a/sdk/keyvault/azure-security-keyvault-certificates/README.md b/sdk/keyvault/azure-security-keyvault-certificates/README.md
index 895541486ceff..681e70be9ae9d 100644
--- a/sdk/keyvault/azure-security-keyvault-certificates/README.md
+++ b/sdk/keyvault/azure-security-keyvault-certificates/README.md
@@ -43,14 +43,13 @@ If you want to take dependency on a particular version of the library that is no
com.azure
azure-security-keyvault-certificates
- 4.6.3
+ 4.6.5
```
[//]: # ({x-version-update-end})
### Prerequisites
- A [Java Development Kit (JDK)][jdk_link], version 8 or later.
- - Here are details about [Java 8 client compatibility with Azure Certificate Authority](https://learn.microsoft.com/azure/security/fundamentals/azure-ca-details?tabs=root-and-subordinate-cas-list#client-compatibility-for-public-pkis).
- An [Azure Subscription][azure_subscription].
- An existing [Azure Key Vault][azure_keyvault]. If you need to create a key vault, you can do so in the Azure Portal by following the steps in [this document][azure_keyvault_portal]. Alternatively, you can use the Azure CLI by following the steps in [this document][azure_keyvault_cli].
@@ -270,8 +269,6 @@ This project has adopted the [Microsoft Open Source Code of Conduct][microsoft_c
[source_code]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/keyvault/azure-security-keyvault-certificates/src
[api_documentation]: https://azure.github.io/azure-sdk-for-java
[azkeyvault_docs]: https://docs.microsoft.com/azure/key-vault/
-[certificates_samples]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/keyvault/azure-security-keyvault-certificates/src/samples/java/com/azure/security/keyvault/certificates
-[managed_identity]: https://docs.microsoft.com/azure/active-directory/managed-identities-azure-resources/overview
[azure_identity]: https://docs.microsoft.com/java/api/overview/azure/identity-readme?view=azure-java-stable
[azure_subscription]: https://azure.microsoft.com/
[azure_keyvault]: https://docs.microsoft.com/azure/key-vault/general/overview
diff --git a/sdk/keyvault/azure-security-keyvault-certificates/assets.json b/sdk/keyvault/azure-security-keyvault-certificates/assets.json
index 7235a61b39fcb..22243c30c53ec 100644
--- a/sdk/keyvault/azure-security-keyvault-certificates/assets.json
+++ b/sdk/keyvault/azure-security-keyvault-certificates/assets.json
@@ -2,5 +2,5 @@
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "java",
"TagPrefix": "java/keyvault/azure-security-keyvault-certificates",
- "Tag": "java/keyvault/azure-security-keyvault-certificates_e018897fab"
+ "Tag": "java/keyvault/azure-security-keyvault-certificates_2816fc1705"
}
diff --git a/sdk/keyvault/azure-security-keyvault-certificates/pom.xml b/sdk/keyvault/azure-security-keyvault-certificates/pom.xml
index 272956eeedfa8..6596be07f8c59 100644
--- a/sdk/keyvault/azure-security-keyvault-certificates/pom.xml
+++ b/sdk/keyvault/azure-security-keyvault-certificates/pom.xml
@@ -12,7 +12,7 @@
com.azure
azure-security-keyvault-certificates
- 4.7.0-beta.1
+ 4.6.5
Microsoft Azure client library for KeyVault Certificates
This module contains client library for Microsoft Azure KeyVault Certificates.
@@ -98,12 +98,6 @@
1.12.1
test
-