@azure/keyvault-admin 4.6.1-alpha.20250225.1 → 4.7.0-alpha.20250227.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commonjs/backupClient.d.ts +130 -3
- package/dist/commonjs/backupClient.d.ts.map +1 -1
- package/dist/commonjs/backupClient.js +123 -30
- package/dist/commonjs/backupClient.js.map +1 -1
- package/dist/commonjs/backupClientModels.d.ts +15 -3
- package/dist/commonjs/backupClientModels.d.ts.map +1 -1
- package/dist/commonjs/backupClientModels.js.map +1 -1
- package/dist/commonjs/constants.d.ts +2 -2
- package/dist/commonjs/constants.d.ts.map +1 -1
- package/dist/commonjs/constants.js +2 -2
- package/dist/commonjs/constants.js.map +1 -1
- package/dist/commonjs/generated/api/index.d.ts +2 -2
- package/dist/commonjs/generated/api/index.d.ts.map +1 -1
- package/dist/commonjs/generated/api/index.js +11 -10
- package/dist/commonjs/generated/api/index.js.map +1 -1
- package/dist/commonjs/generated/api/keyVaultContext.d.ts +4 -1
- package/dist/commonjs/generated/api/keyVaultContext.d.ts.map +1 -1
- package/dist/commonjs/generated/api/keyVaultContext.js +4 -4
- package/dist/commonjs/generated/api/keyVaultContext.js.map +1 -1
- package/dist/commonjs/generated/api/operations.d.ts +42 -38
- package/dist/commonjs/generated/api/operations.d.ts.map +1 -1
- package/dist/commonjs/generated/api/operations.js +188 -145
- package/dist/commonjs/generated/api/operations.js.map +1 -1
- package/dist/commonjs/generated/api/options.d.ts +34 -42
- package/dist/commonjs/generated/api/options.d.ts.map +1 -1
- package/dist/commonjs/generated/api/options.js.map +1 -1
- package/dist/commonjs/generated/api/roleAssignments/index.d.ts +12 -12
- package/dist/commonjs/generated/api/roleAssignments/index.d.ts.map +1 -1
- package/dist/commonjs/generated/api/roleAssignments/index.js +66 -51
- package/dist/commonjs/generated/api/roleAssignments/index.js.map +1 -1
- package/dist/commonjs/generated/api/roleDefinitions/index.d.ts +12 -12
- package/dist/commonjs/generated/api/roleDefinitions/index.d.ts.map +1 -1
- package/dist/commonjs/generated/api/roleDefinitions/index.js +66 -51
- package/dist/commonjs/generated/api/roleDefinitions/index.js.map +1 -1
- package/dist/commonjs/generated/classic/roleAssignments/index.d.ts +8 -14
- package/dist/commonjs/generated/classic/roleAssignments/index.d.ts.map +1 -1
- package/dist/commonjs/generated/classic/roleAssignments/index.js +7 -8
- package/dist/commonjs/generated/classic/roleAssignments/index.js.map +1 -1
- package/dist/commonjs/generated/classic/roleDefinitions/index.d.ts +8 -14
- package/dist/commonjs/generated/classic/roleDefinitions/index.d.ts.map +1 -1
- package/dist/commonjs/generated/classic/roleDefinitions/index.js +7 -8
- package/dist/commonjs/generated/classic/roleDefinitions/index.js.map +1 -1
- package/dist/commonjs/generated/index.d.ts +2 -2
- package/dist/commonjs/generated/index.d.ts.map +1 -1
- package/dist/commonjs/generated/index.js +2 -2
- package/dist/commonjs/generated/index.js.map +1 -1
- package/dist/commonjs/generated/keyVaultClient.d.ts +27 -25
- package/dist/commonjs/generated/keyVaultClient.d.ts.map +1 -1
- package/dist/commonjs/generated/keyVaultClient.js +39 -35
- package/dist/commonjs/generated/keyVaultClient.js.map +1 -1
- package/dist/commonjs/generated/models/index.d.ts +1 -1
- package/dist/commonjs/generated/models/index.d.ts.map +1 -1
- package/dist/commonjs/generated/models/index.js +2 -2
- package/dist/commonjs/generated/models/index.js.map +1 -1
- package/dist/commonjs/generated/models/models.d.ts +90 -78
- package/dist/commonjs/generated/models/models.d.ts.map +1 -1
- package/dist/commonjs/generated/models/models.js +78 -70
- package/dist/commonjs/generated/models/models.js.map +1 -1
- package/dist/commonjs/generated/restorePollerHelpers.js +8 -8
- package/dist/commonjs/generated/restorePollerHelpers.js.map +1 -1
- package/dist/commonjs/lro/shim.d.ts +7 -0
- package/dist/commonjs/lro/shim.d.ts.map +1 -1
- package/dist/commonjs/lro/shim.js +17 -1
- package/dist/commonjs/lro/shim.js.map +1 -1
- package/dist/esm/backupClient.d.ts +130 -3
- package/dist/esm/backupClient.d.ts.map +1 -1
- package/dist/esm/backupClient.js +124 -31
- package/dist/esm/backupClient.js.map +1 -1
- package/dist/esm/backupClientModels.d.ts +15 -3
- package/dist/esm/backupClientModels.d.ts.map +1 -1
- package/dist/esm/backupClientModels.js.map +1 -1
- package/dist/esm/constants.d.ts +2 -2
- package/dist/esm/constants.d.ts.map +1 -1
- package/dist/esm/constants.js +2 -2
- package/dist/esm/constants.js.map +1 -1
- package/dist/esm/generated/api/index.d.ts +2 -2
- package/dist/esm/generated/api/index.d.ts.map +1 -1
- package/dist/esm/generated/api/index.js +1 -1
- package/dist/esm/generated/api/index.js.map +1 -1
- package/dist/esm/generated/api/keyVaultContext.d.ts +4 -1
- package/dist/esm/generated/api/keyVaultContext.d.ts.map +1 -1
- package/dist/esm/generated/api/keyVaultContext.js +4 -4
- package/dist/esm/generated/api/keyVaultContext.js.map +1 -1
- package/dist/esm/generated/api/operations.d.ts +42 -38
- package/dist/esm/generated/api/operations.d.ts.map +1 -1
- package/dist/esm/generated/api/operations.js +159 -119
- package/dist/esm/generated/api/operations.js.map +1 -1
- package/dist/esm/generated/api/options.d.ts +34 -42
- package/dist/esm/generated/api/options.d.ts.map +1 -1
- package/dist/esm/generated/api/options.js.map +1 -1
- package/dist/esm/generated/api/roleAssignments/index.d.ts +12 -12
- package/dist/esm/generated/api/roleAssignments/index.d.ts.map +1 -1
- package/dist/esm/generated/api/roleAssignments/index.js +58 -43
- package/dist/esm/generated/api/roleAssignments/index.js.map +1 -1
- package/dist/esm/generated/api/roleDefinitions/index.d.ts +12 -12
- package/dist/esm/generated/api/roleDefinitions/index.d.ts.map +1 -1
- package/dist/esm/generated/api/roleDefinitions/index.js +58 -43
- package/dist/esm/generated/api/roleDefinitions/index.js.map +1 -1
- package/dist/esm/generated/classic/roleAssignments/index.d.ts +8 -14
- package/dist/esm/generated/classic/roleAssignments/index.d.ts.map +1 -1
- package/dist/esm/generated/classic/roleAssignments/index.js +7 -7
- package/dist/esm/generated/classic/roleAssignments/index.js.map +1 -1
- package/dist/esm/generated/classic/roleDefinitions/index.d.ts +8 -14
- package/dist/esm/generated/classic/roleDefinitions/index.d.ts.map +1 -1
- package/dist/esm/generated/classic/roleDefinitions/index.js +7 -7
- package/dist/esm/generated/classic/roleDefinitions/index.js.map +1 -1
- package/dist/esm/generated/index.d.ts +2 -2
- package/dist/esm/generated/index.d.ts.map +1 -1
- package/dist/esm/generated/index.js +1 -1
- package/dist/esm/generated/index.js.map +1 -1
- package/dist/esm/generated/keyVaultClient.d.ts +27 -25
- package/dist/esm/generated/keyVaultClient.d.ts.map +1 -1
- package/dist/esm/generated/keyVaultClient.js +42 -38
- package/dist/esm/generated/keyVaultClient.js.map +1 -1
- package/dist/esm/generated/models/index.d.ts +1 -1
- package/dist/esm/generated/models/index.d.ts.map +1 -1
- package/dist/esm/generated/models/index.js +1 -1
- package/dist/esm/generated/models/index.js.map +1 -1
- package/dist/esm/generated/models/models.d.ts +90 -78
- package/dist/esm/generated/models/models.d.ts.map +1 -1
- package/dist/esm/generated/models/models.js +69 -61
- package/dist/esm/generated/models/models.js.map +1 -1
- package/dist/esm/generated/restorePollerHelpers.js +9 -9
- package/dist/esm/generated/restorePollerHelpers.js.map +1 -1
- package/dist/esm/lro/shim.d.ts +7 -0
- package/dist/esm/lro/shim.d.ts.map +1 -1
- package/dist/esm/lro/shim.js +16 -1
- package/dist/esm/lro/shim.js.map +1 -1
- package/package.json +1 -1
- package/dist/commonjs/generated/helpers/serializerHelpers.d.ts +0 -3
- package/dist/commonjs/generated/helpers/serializerHelpers.d.ts.map +0 -1
- package/dist/commonjs/generated/helpers/serializerHelpers.js +0 -28
- package/dist/commonjs/generated/helpers/serializerHelpers.js.map +0 -1
- package/dist/esm/generated/helpers/serializerHelpers.d.ts +0 -3
- package/dist/esm/generated/helpers/serializerHelpers.d.ts.map +0 -1
- package/dist/esm/generated/helpers/serializerHelpers.js +0 -25
- package/dist/esm/generated/helpers/serializerHelpers.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shim.js","sourceRoot":"","sources":["../../../src/lro/shim.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;
|
|
1
|
+
{"version":3,"file":"shim.js","sourceRoot":"","sources":["../../../src/lro/shim.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AA8DlC,gCA0EC;AAOD,kCAcC;AA/FM,KAAK,UAAU,UAAU,CAC9B,UAA2C;;IAE3C,MAAM,eAAe,GAAG,IAAI,eAAe,EAAE,CAAC;IAC9C,MAAM,YAAY,GAAgC;QAChD,MAAM;YACJ,OAAO,UAAU,CAAC,MAAM,CAAC;QAC3B,CAAC;QACD,SAAS;YACP,OAAO,eAAe,CAAC,MAAM,CAAC,OAAO,CAAC;QACxC,CAAC;QACD,iBAAiB;YACf,IAAI,CAAC,UAAU,CAAC,cAAc,EAAE,CAAC;gBAC/B,MAAM,IAAI,KAAK,CACb,4IAA4I,CAC7I,CAAC;YACJ,CAAC;YACD,MAAM,WAAW,iDACZ,UAAU,CAAC,cAAc,GACzB,UAAU,CAAC,cAAc,CAAC,MAAM,KACnC,SAAS,EAAE,UAAU,CAAC,cAAc,CAAC,MAAM,KAAK,YAAY,EAC5D,WAAW,EACT,UAAU,CAAC,cAAc,CAAC,MAAM,KAAK,WAAW;oBAChD,UAAU,CAAC,cAAc,CAAC,MAAM,KAAK,QAAQ;oBAC7C,UAAU,CAAC,cAAc,CAAC,MAAM,KAAK,UAAU,GAClD,CAAC;YACF,IAAI,WAAW,CAAC,KAAK,KAAK,IAAI,EAAE,CAAC;gBAC/B,WAAW,CAAC,KAAK,GAAG,SAAS,CAAC;YAChC,CAAC;YACD,OAAO,WAAW,CAAC;QACrB,CAAC;QACD,SAAS;YACP,OAAO,UAAU,CAAC,MAAM,CAAC;QAC3B,CAAC;QACD,QAAQ;YACN,IAAI,CAAC,UAAU,CAAC,cAAc,EAAE,CAAC;gBAC/B,MAAM,IAAI,K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C;IACD,OAAO,YAAY,CAAC;AACtB,CAAC;AAED;;;;GAIG;AACH,SAAgB,WAAW,CAAC,KAA6D;;;IACvF,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;QACjB,KAAK,CAAC,MAAM,mCACP,KAAK,CAAC,MAAM,KACf,OAAO,EAAE,MAAA,KAAK,CAAC,MAAM,CAAC,OAAO,mCAAI,SAAS,EAC1C,SAAS,EAAE,MAAA,KAAK,CAAC,MAAM,CAAC,SAAS,mCAAI,SAAS,EAC9C,KAAK,EAAE,MAAA,KAAK,CAAC,MAAM,CAAC,KAAK,mCAAI,SAAS,EACtC,aAAa,EAAE,MAAA,KAAK,CAAC,MAAM,CAAC,aAAa,mCAAI,SAAS,GACvD,CAAC;QAEF,IAAI,WAAW,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;YAChC,YAAA,KAAK,CAAC,MAAM,EAAC,SAAS,uCAAT,SAAS,GAAK,SAAS,EAAC;QACvC,CAAC;IACH,CAAC;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { AbortSignalLike } from \"@azure/abort-controller\";\nimport type {\n CancelOnProgress,\n OperationState,\n PollerLike as CorePollerLike,\n} from \"@azure/core-lro\";\nimport type { KeyVaultAdminPollOperationState } from \"./models.js\";\nimport { FullBackupOperation, RestoreOperation } from \"../generated/index.js\";\n\n/**\n * A simple poller that can be used to poll a long running operation.\n */\nexport interface PollerLike<TState extends KeyVaultAdminPollOperationState<TResult>, TResult> {\n /**\n * Returns true if the poller has finished polling.\n */\n isDone(): boolean;\n /**\n * Returns true if the poller is stopped.\n */\n isStopped(): boolean;\n /**\n * Returns the state of the operation.\n */\n getOperationState(): TState;\n /**\n * Returns the result value of the operation,\n * regardless of the state of the poller.\n * It can return undefined or an incomplete form of the final TResult value\n * depending on the implementation.\n */\n getResult(): TResult | undefined;\n /**\n * Returns a promise that will resolve once a single polling request finishes.\n * It does this by calling the update method of the Poller's operation.\n */\n poll(options?: { abortSignal?: AbortSignalLike }): Promise<void>;\n /**\n * Returns a promise that will resolve once the underlying operation is completed.\n */\n pollUntilDone(pollOptions?: { abortSignal?: AbortSignalLike }): Promise<TResult>;\n /**\n * Invokes the provided callback after each polling is completed,\n * sending the current state of the poller's operation.\n *\n * It returns a method that can be used to stop receiving updates on the given callback function.\n */\n onProgress(callback: (state: TState) => void): CancelOnProgress;\n\n /**\n * Returns a string representation of the poller's operation. Similar to serialize but returns a string.\n */\n toString(): string;\n\n /**\n * Stops the poller from continuing to poll. Please note this will only stop the client-side polling\n */\n stopPolling(): void;\n}\n\nexport async function wrapPoller<TState extends OperationState<TResult>, TResult>(\n httpPoller: CorePollerLike<TState, TResult>,\n): Promise<PollerLike<TState, TResult>> {\n const abortController = new AbortController();\n const simplePoller: PollerLike<TState, TResult> = {\n isDone() {\n return httpPoller.isDone;\n },\n isStopped() {\n return abortController.signal.aborted;\n },\n getOperationState() {\n if (!httpPoller.operationState) {\n throw new Error(\n \"Operation state is not available. The poller may not have been started and you could await submitted() before calling getOperationState().\",\n );\n }\n const mergedState = {\n ...httpPoller.operationState,\n ...httpPoller.operationState.result,\n isStarted: httpPoller.operationState.status !== \"notStarted\", // Shim for isStarted\n isCompleted:\n httpPoller.operationState.status === \"succeeded\" ||\n httpPoller.operationState.status === \"failed\" ||\n httpPoller.operationState.status === \"canceled\",\n };\n if (mergedState.error === null) {\n mergedState.error = undefined;\n }\n return mergedState;\n },\n getResult() {\n return httpPoller.result;\n },\n toString() {\n if (!httpPoller.operationState) {\n throw new Error(\n \"Operation state is not available. The poller may not have been started and you could await submitted() before calling getOperationState().\",\n );\n }\n return JSON.stringify({\n state: httpPoller.operationState,\n });\n },\n stopPolling() {\n abortController.abort();\n },\n onProgress: httpPoller.onProgress,\n async poll(options) {\n await httpPoller.poll(options);\n },\n pollUntilDone(pollOptions?: { abortSignal?: AbortSignalLike }) {\n function abortListener(): void {\n abortController.abort();\n }\n const inputAbortSignal = pollOptions?.abortSignal;\n const abortSignal = abortController.signal;\n if (inputAbortSignal?.aborted) {\n abortController.abort();\n } else if (!abortSignal.aborted) {\n inputAbortSignal?.addEventListener(\"abort\", abortListener, {\n once: true,\n });\n }\n return httpPoller.pollUntilDone({ abortSignal: abortController.signal });\n },\n };\n await httpPoller.submitted();\n // clean up the final GET path so that we could skip final GET\n // Workaround for https://github.com/Azure/azure-sdk-for-js/issues/32142\n if ((httpPoller.operationState as any)?.config?.resourceLocation) {\n (httpPoller.operationState as any).config.resourceLocation = undefined;\n }\n return simplePoller;\n}\n\n/**\n * A helper that standardizes the shape of the result of a long-running operation.\n *\n * smoothing over the differences between `null` and `undefined` sent over the wire in responses.\n */\nexport function updateState(state: OperationState<RestoreOperation | FullBackupOperation>): void {\n if (state.result) {\n state.result = {\n ...state.result,\n endTime: state.result.endTime ?? undefined,\n startTime: state.result.startTime ?? undefined,\n error: state.result.error ?? undefined,\n statusDetails: state.result.statusDetails ?? undefined,\n };\n\n if (\"folderUri\" in state.result) {\n state.result.folderUri ??= undefined;\n }\n }\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { KeyVaultBackupClientOptions, KeyVaultBackupResult, KeyVaultBeginBackupOptions, KeyVaultBeginRestoreOptions, KeyVaultBeginSelectiveKeyRestoreOptions, KeyVaultRestoreResult, KeyVaultSelectiveKeyRestoreResult } from "./backupClientModels.js";
|
|
1
|
+
import type { KeyVaultBackupClientOptions, KeyVaultBackupResult, KeyVaultBeginBackupOptions, KeyVaultBeginPreBackupOptions, KeyVaultBeginPreRestoreOptions, KeyVaultBeginRestoreOptions, KeyVaultBeginSelectiveKeyRestoreOptions, KeyVaultRestoreResult, KeyVaultSelectiveKeyRestoreResult } from "./backupClientModels.js";
|
|
2
2
|
import type { TokenCredential } from "@azure/core-auth";
|
|
3
3
|
import type { PollerLike } from "./lro/shim.js";
|
|
4
4
|
import { KeyVaultAdminPollOperationState, KeyVaultBackupOperationState, KeyVaultRestoreOperationState, KeyVaultSelectiveKeyRestoreOperationState } from "./lro/models.js";
|
|
@@ -35,6 +35,134 @@ export declare class KeyVaultBackupClient {
|
|
|
35
35
|
* @param options - options used to configure Key Vault API requests.
|
|
36
36
|
*/
|
|
37
37
|
constructor(vaultUrl: string, credential: TokenCredential, options?: KeyVaultBackupClientOptions);
|
|
38
|
+
/**
|
|
39
|
+
* Starts a pre-backup operation which can be used to check whether the customer can perform a {@link beginBackup} operation using the provided SAS token.
|
|
40
|
+
*
|
|
41
|
+
* This function returns a Long Running Operation poller that allows you to wait indefinitely until the operation completes.
|
|
42
|
+
*
|
|
43
|
+
* Example usage:
|
|
44
|
+
* ```ts snippet:ReadmeSampleBeginPreBackup_SAS
|
|
45
|
+
* import { DefaultAzureCredential } from "@azure/identity";
|
|
46
|
+
* import { KeyVaultBackupClient } from "@azure/keyvault-admin";
|
|
47
|
+
*
|
|
48
|
+
* const vaultUrl = `https://<MY KEY VAULT HERE>.vault.azure.net`;
|
|
49
|
+
* const credentials = new DefaultAzureCredential();
|
|
50
|
+
* const client = new KeyVaultBackupClient(vaultUrl, credentials);
|
|
51
|
+
*
|
|
52
|
+
* const blobStorageUri = "<blob-storage-uri>"; // <Blob storage URL>/<folder name>
|
|
53
|
+
* const sasToken = "<sas-token>";
|
|
54
|
+
* const poller = await client.beginPreBackup(blobStorageUri, sasToken);
|
|
55
|
+
*
|
|
56
|
+
* // Serializing the poller
|
|
57
|
+
* const serialized = poller.toString();
|
|
58
|
+
*
|
|
59
|
+
* // A new poller can be created with:
|
|
60
|
+
* await client.beginPreBackup(blobStorageUri, sasToken, { resumeFrom: serialized });
|
|
61
|
+
*
|
|
62
|
+
* // Waiting until it's done
|
|
63
|
+
* const result = await poller.pollUntilDone();
|
|
64
|
+
* console.log(result);
|
|
65
|
+
* ```
|
|
66
|
+
* @param blobStorageUri - The URL of the blob storage resource, including the path to the container where the backup will end up being stored.
|
|
67
|
+
* @param sasToken - The SAS token used to access the blob storage resource.
|
|
68
|
+
* @param options - The optional parameters.
|
|
69
|
+
*/
|
|
70
|
+
beginPreBackup(blobStorageUri: string, sasToken: string, options?: KeyVaultBeginPreBackupOptions): Promise<PollerLike<KeyVaultBackupOperationState, KeyVaultBackupResult>>;
|
|
71
|
+
/**
|
|
72
|
+
* Starts a pre-backup operation which can be used to check whether the customer can perform a {@link beginBackup} operation using the Managed HSM's configured user-assigned managed identity to authenticate with Azure Storage.
|
|
73
|
+
*
|
|
74
|
+
* This function returns a Long Running Operation poller that allows you to wait indefinitely until the operation completes.
|
|
75
|
+
*
|
|
76
|
+
* Example usage:
|
|
77
|
+
* ```ts snippet:ReadmeSampleBeginPreBackup_NonSAS
|
|
78
|
+
* import { DefaultAzureCredential } from "@azure/identity";
|
|
79
|
+
* import { KeyVaultBackupClient } from "@azure/keyvault-admin";
|
|
80
|
+
*
|
|
81
|
+
* const vaultUrl = `https://<MY KEY VAULT HERE>.vault.azure.net`;
|
|
82
|
+
* const credentials = new DefaultAzureCredential();
|
|
83
|
+
* const client = new KeyVaultBackupClient(vaultUrl, credentials);
|
|
84
|
+
*
|
|
85
|
+
* const blobStorageUri = "<blob-storage-uri>"; // <Blob storage URL>/<folder name>
|
|
86
|
+
* const poller = await client.beginPreBackup(blobStorageUri);
|
|
87
|
+
*
|
|
88
|
+
* // Serializing the poller
|
|
89
|
+
* const serialized = poller.toString();
|
|
90
|
+
*
|
|
91
|
+
* // A new poller can be created with:
|
|
92
|
+
* await client.beginPreBackup(blobStorageUri, { resumeFrom: serialized });
|
|
93
|
+
*
|
|
94
|
+
* // Waiting until it's done
|
|
95
|
+
* const result = await poller.pollUntilDone();
|
|
96
|
+
* console.log(result);
|
|
97
|
+
* ```
|
|
98
|
+
* @param blobStorageUri - The URL of the blob storage resource, including the path to the container where the backup will end up being stored.
|
|
99
|
+
* @param options - The optional parameters.
|
|
100
|
+
*/
|
|
101
|
+
beginPreBackup(blobStorageUri: string, options?: KeyVaultBeginPreBackupOptions): Promise<PollerLike<KeyVaultBackupOperationState, KeyVaultBackupResult>>;
|
|
102
|
+
/**
|
|
103
|
+
* Starts a pre-restore operation which can be used to check whether the customer can perform a {@link beginRestore} operation using the provided SAS token.
|
|
104
|
+
*
|
|
105
|
+
* This function returns a Long Running Operation poller that allows you to wait indefinitely until the operation completes.
|
|
106
|
+
*
|
|
107
|
+
* Example usage:
|
|
108
|
+
* ```ts snippet:ReadmeSampleBeginPreRestore_SAS
|
|
109
|
+
* import { DefaultAzureCredential } from "@azure/identity";
|
|
110
|
+
* import { KeyVaultBackupClient } from "@azure/keyvault-admin";
|
|
111
|
+
*
|
|
112
|
+
* const vaultUrl = `https://<MY KEY VAULT HERE>.vault.azure.net`;
|
|
113
|
+
* const credentials = new DefaultAzureCredential();
|
|
114
|
+
* const client = new KeyVaultBackupClient(vaultUrl, credentials);
|
|
115
|
+
*
|
|
116
|
+
* const blobStorageUri = "<blob-storage-uri>"; // <Blob storage URL>/<folder name>
|
|
117
|
+
* const sasToken = "<sas-token>";
|
|
118
|
+
* const poller = await client.beginPreRestore(blobStorageUri, sasToken);
|
|
119
|
+
*
|
|
120
|
+
* // The poller can be serialized with:
|
|
121
|
+
* const serialized = poller.toString();
|
|
122
|
+
*
|
|
123
|
+
* // A new poller can be created with:
|
|
124
|
+
* await client.beginPreRestore(blobStorageUri, sasToken, { resumeFrom: serialized });
|
|
125
|
+
*
|
|
126
|
+
* // Waiting until it's done
|
|
127
|
+
* await poller.pollUntilDone();
|
|
128
|
+
* ```
|
|
129
|
+
* @param folderUri - The URL of the blob storage resource where the previous successful full backup was stored.
|
|
130
|
+
* @param sasToken - The SAS token. If no SAS token is provided, user-assigned Managed Identity will be used to access the blob storage resource.
|
|
131
|
+
* @param options - The optional parameters.
|
|
132
|
+
*/
|
|
133
|
+
beginPreRestore(folderUri: string, sasToken: string, options?: KeyVaultBeginPreRestoreOptions): Promise<PollerLike<KeyVaultRestoreOperationState, KeyVaultRestoreResult>>;
|
|
134
|
+
/**
|
|
135
|
+
* Starts a pre-restore operation which can be used to check whether the customer can perform a {@link beginRestore} operation using the provided SAS token.
|
|
136
|
+
*
|
|
137
|
+
* This function returns a Long Running Operation poller that allows you to wait indefinitely until the operation completes.
|
|
138
|
+
*
|
|
139
|
+
* Example usage:
|
|
140
|
+
* ```ts snippet:ReadmeSampleBeginPreRestore_SAS
|
|
141
|
+
* import { DefaultAzureCredential } from "@azure/identity";
|
|
142
|
+
* import { KeyVaultBackupClient } from "@azure/keyvault-admin";
|
|
143
|
+
*
|
|
144
|
+
* const vaultUrl = `https://<MY KEY VAULT HERE>.vault.azure.net`;
|
|
145
|
+
* const credentials = new DefaultAzureCredential();
|
|
146
|
+
* const client = new KeyVaultBackupClient(vaultUrl, credentials);
|
|
147
|
+
*
|
|
148
|
+
* const blobStorageUri = "<blob-storage-uri>"; // <Blob storage URL>/<folder name>
|
|
149
|
+
* const sasToken = "<sas-token>";
|
|
150
|
+
* const poller = await client.beginPreRestore(blobStorageUri, sasToken);
|
|
151
|
+
*
|
|
152
|
+
* // The poller can be serialized with:
|
|
153
|
+
* const serialized = poller.toString();
|
|
154
|
+
*
|
|
155
|
+
* // A new poller can be created with:
|
|
156
|
+
* await client.beginPreRestore(blobStorageUri, sasToken, { resumeFrom: serialized });
|
|
157
|
+
*
|
|
158
|
+
* // Waiting until it's done
|
|
159
|
+
* await poller.pollUntilDone();
|
|
160
|
+
* ```
|
|
161
|
+
* @param folderUri - The URL of the blob storage resource where the previous successful full backup was stored.
|
|
162
|
+
* @param sasToken - The SAS token. If no SAS token is provided, user-assigned Managed Identity will be used to access the blob storage resource.
|
|
163
|
+
* @param options - The optional parameters.
|
|
164
|
+
*/
|
|
165
|
+
beginPreRestore(folderUri: string, options?: KeyVaultBeginPreRestoreOptions): Promise<PollerLike<KeyVaultRestoreOperationState, KeyVaultRestoreResult>>;
|
|
38
166
|
/**
|
|
39
167
|
* Starts generating a backup of an Azure Key Vault on the specified Storage Blob account.
|
|
40
168
|
*
|
|
@@ -162,8 +290,7 @@ export declare class KeyVaultBackupClient {
|
|
|
162
290
|
* await client.beginRestore(blobStorageUri, { resumeFrom: serialized });
|
|
163
291
|
*
|
|
164
292
|
* // Waiting until it's done
|
|
165
|
-
*
|
|
166
|
-
* console.log(backupUri);
|
|
293
|
+
* await poller.pollUntilDone();
|
|
167
294
|
* ```
|
|
168
295
|
* Starts a full restore operation.
|
|
169
296
|
* @param folderUri - The URL of the blob storage resource where the previous successful full backup was stored.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backupClient.d.ts","sourceRoot":"","sources":["../../src/backupClient.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,2BAA2B,EAC3B,oBAAoB,EACpB,0BAA0B,EAC1B,2BAA2B,EAC3B,uCAAuC,EACvC,qBAAqB,EACrB,iCAAiC,EAClC,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAGxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,OAAO,EACL,+BAA+B,EAC/B,4BAA4B,EAC5B,6BAA6B,EAC7B,yCAAyC,EAC1C,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EACL,4BAA4B,EAC5B,6BAA6B,EAC7B,yCAAyC,EACzC,+BAA+B,GAChC,CAAC;AAEF;;;;;GAKG;AACH,qBAAa,oBAAoB;IAC/B;;OAEG;IACH,SAAgB,QAAQ,EAAE,MAAM,CAAC;IAEjC;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAiB;IAExC;;;;;;;;;;;;;;;OAeG;gBAED,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,eAAe,EAC3B,OAAO,GAAE,2BAAgC;IAO3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACU,WAAW,CACtB,cAAc,EAAE,MAAM,EACtB,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,0BAA0B,GACnC,OAAO,CAAC,UAAU,CAAC,4BAA4B,EAAE,oBAA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SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,2BAA2B,GACpC,OAAO,CAAC,UAAU,CAAC,6BAA6B,EAAE,qBAAqB,CAAC,CAAC;IA6C5E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAoCG;IACU,wBAAwB,CACnC,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,uCAAuC,GAChD,OAAO,CACR,UAAU,CAAC,yCAAyC,EAAE,iCAAiC,CAAC,CACzF;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiCG;IACU,wBAAwB,CACnC,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,uCAAuC,GAChD,OAAO,CACR,UAAU,CAAC,yCAAyC,EAAE,iCAAiC,CAAC,CACzF;CAgDF"}
|
package/dist/esm/backupClient.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
import { mappings } from "./mappings.js";
|
|
4
4
|
import { createKeyVaultClient } from "./createKeyVaultClient.js";
|
|
5
|
-
import { wrapPoller } from "./lro/shim.js";
|
|
5
|
+
import { wrapPoller, updateState } from "./lro/shim.js";
|
|
6
6
|
import { restorePoller } from "./generated/restorePollerHelpers.js";
|
|
7
7
|
/**
|
|
8
8
|
* The KeyVaultBackupClient provides methods to generate backups
|
|
@@ -31,70 +31,163 @@ export class KeyVaultBackupClient {
|
|
|
31
31
|
this.vaultUrl = vaultUrl;
|
|
32
32
|
this.client = createKeyVaultClient(vaultUrl, credential, options);
|
|
33
33
|
}
|
|
34
|
+
async beginPreBackup(blobStorageUri, sasTokenOrOptions = {}, optionsWhenSasTokenSpecified = {}) {
|
|
35
|
+
const sasToken = typeof sasTokenOrOptions === "string" ? sasTokenOrOptions : undefined;
|
|
36
|
+
const options = typeof sasTokenOrOptions === "string" ? optionsWhenSasTokenSpecified : sasTokenOrOptions;
|
|
37
|
+
let poller;
|
|
38
|
+
if (options.resumeFrom) {
|
|
39
|
+
poller = restorePoller(this.client, options.resumeFrom, this.client.preFullBackup, options);
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
poller = this.client.preFullBackup({
|
|
43
|
+
storageResourceUri: blobStorageUri,
|
|
44
|
+
token: sasToken,
|
|
45
|
+
useManagedIdentity: sasToken === undefined,
|
|
46
|
+
}, {
|
|
47
|
+
abortSignal: options.abortSignal,
|
|
48
|
+
requestOptions: options.requestOptions,
|
|
49
|
+
onResponse: options.onResponse,
|
|
50
|
+
tracingOptions: options.tracingOptions,
|
|
51
|
+
updateIntervalInMs: options.intervalInMs,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
poller.onProgress(updateState);
|
|
55
|
+
return wrapPoller(poller);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Starts a pre-restore operation which can be used to check whether the customer can perform a {@link beginRestore} operation using the Managed HSM's configured user-assigned managed identity to authenticate with Azure Storage.
|
|
59
|
+
*
|
|
60
|
+
* This function returns a Long Running Operation poller that allows you to wait indefinitely until the operation completes.
|
|
61
|
+
*
|
|
62
|
+
* Example usage:
|
|
63
|
+
* ```ts snippet:ReadmeSampleBeginPreRestore_SAS
|
|
64
|
+
* import { DefaultAzureCredential } from "@azure/identity";
|
|
65
|
+
* import { KeyVaultBackupClient } from "@azure/keyvault-admin";
|
|
66
|
+
*
|
|
67
|
+
* const vaultUrl = `https://<MY KEY VAULT HERE>.vault.azure.net`;
|
|
68
|
+
* const credentials = new DefaultAzureCredential();
|
|
69
|
+
* const client = new KeyVaultBackupClient(vaultUrl, credentials);
|
|
70
|
+
*
|
|
71
|
+
* const blobStorageUri = "<blob-storage-uri>"; // <Blob storage URL>/<folder name>
|
|
72
|
+
* const sasToken = "<sas-token>";
|
|
73
|
+
* const poller = await client.beginPreRestore(blobStorageUri, sasToken);
|
|
74
|
+
*
|
|
75
|
+
* // The poller can be serialized with:
|
|
76
|
+
* const serialized = poller.toString();
|
|
77
|
+
*
|
|
78
|
+
* // A new poller can be created with:
|
|
79
|
+
* await client.beginPreRestore(blobStorageUri, sasToken, { resumeFrom: serialized });
|
|
80
|
+
*
|
|
81
|
+
* // Waiting until it's done
|
|
82
|
+
* await poller.pollUntilDone();
|
|
83
|
+
* ```
|
|
84
|
+
* @param folderUri - The URL of the blob storage resource where the previous successful full backup was stored.
|
|
85
|
+
* @param sasToken - The SAS token. If no SAS token is provided, user-assigned Managed Identity will be used to access the blob storage resource.
|
|
86
|
+
* @param options - The optional parameters.
|
|
87
|
+
*/
|
|
88
|
+
async beginPreRestore(folderUri, sasTokenOrOptions = {}, optionsWhenSasTokenSpecified = {}) {
|
|
89
|
+
const sasToken = typeof sasTokenOrOptions === "string" ? sasTokenOrOptions : undefined;
|
|
90
|
+
const options = typeof sasTokenOrOptions === "string" ? optionsWhenSasTokenSpecified : sasTokenOrOptions;
|
|
91
|
+
const folderUriParts = mappings.folderUriParts(folderUri);
|
|
92
|
+
let poller;
|
|
93
|
+
if (options.resumeFrom) {
|
|
94
|
+
poller = restorePoller(this.client, options.resumeFrom, this.client.preFullRestoreOperation, options);
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
poller = this.client.preFullRestoreOperation({
|
|
98
|
+
folderToRestore: folderUriParts.folderName,
|
|
99
|
+
sasTokenParameters: {
|
|
100
|
+
storageResourceUri: folderUriParts.folderUri,
|
|
101
|
+
token: sasToken,
|
|
102
|
+
useManagedIdentity: sasToken === undefined,
|
|
103
|
+
},
|
|
104
|
+
}, {
|
|
105
|
+
abortSignal: options.abortSignal,
|
|
106
|
+
requestOptions: options.requestOptions,
|
|
107
|
+
onResponse: options.onResponse,
|
|
108
|
+
tracingOptions: options.tracingOptions,
|
|
109
|
+
updateIntervalInMs: options.intervalInMs,
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
poller.onProgress(updateState);
|
|
113
|
+
return wrapPoller(poller);
|
|
114
|
+
}
|
|
34
115
|
async beginBackup(blobStorageUri, sasTokenOrOptions = {}, optionsWhenSasTokenSpecified = {}) {
|
|
35
116
|
const sasToken = typeof sasTokenOrOptions === "string" ? sasTokenOrOptions : undefined;
|
|
36
117
|
const options = typeof sasTokenOrOptions === "string" ? optionsWhenSasTokenSpecified : sasTokenOrOptions;
|
|
118
|
+
let poller;
|
|
37
119
|
if (options.resumeFrom) {
|
|
38
|
-
|
|
120
|
+
poller = restorePoller(this.client, options.resumeFrom, this.client.fullBackup, options);
|
|
39
121
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
requestOptions: options.requestOptions,
|
|
43
|
-
azureStorageBlobContainerUri: {
|
|
122
|
+
else {
|
|
123
|
+
poller = this.client.fullBackup({
|
|
44
124
|
storageResourceUri: blobStorageUri,
|
|
45
125
|
token: sasToken,
|
|
46
126
|
useManagedIdentity: sasToken === undefined,
|
|
47
|
-
},
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
127
|
+
}, {
|
|
128
|
+
abortSignal: options.abortSignal,
|
|
129
|
+
requestOptions: options.requestOptions,
|
|
130
|
+
onResponse: options.onResponse,
|
|
131
|
+
tracingOptions: options.tracingOptions,
|
|
132
|
+
updateIntervalInMs: options.intervalInMs,
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
poller.onProgress(updateState);
|
|
136
|
+
return wrapPoller(poller);
|
|
52
137
|
}
|
|
53
138
|
async beginRestore(folderUri, sasTokenOrOptions = {}, optionsWhenSasTokenSpecified = {}) {
|
|
54
139
|
const sasToken = typeof sasTokenOrOptions === "string" ? sasTokenOrOptions : undefined;
|
|
55
140
|
const options = typeof sasTokenOrOptions === "string" ? optionsWhenSasTokenSpecified : sasTokenOrOptions;
|
|
56
141
|
const folderUriParts = mappings.folderUriParts(folderUri);
|
|
142
|
+
let poller;
|
|
57
143
|
if (options.resumeFrom) {
|
|
58
|
-
|
|
144
|
+
poller = restorePoller(this.client, options.resumeFrom, this.client.fullRestoreOperation, options);
|
|
59
145
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
requestOptions: options.requestOptions,
|
|
63
|
-
restoreBlobDetails: {
|
|
146
|
+
else {
|
|
147
|
+
poller = this.client.fullRestoreOperation({
|
|
64
148
|
folderToRestore: folderUriParts.folderName,
|
|
65
149
|
sasTokenParameters: {
|
|
66
150
|
storageResourceUri: folderUriParts.folderUri,
|
|
67
151
|
token: sasToken,
|
|
68
152
|
useManagedIdentity: sasToken === undefined,
|
|
69
153
|
},
|
|
70
|
-
},
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
154
|
+
}, {
|
|
155
|
+
abortSignal: options.abortSignal,
|
|
156
|
+
requestOptions: options.requestOptions,
|
|
157
|
+
onResponse: options.onResponse,
|
|
158
|
+
tracingOptions: options.tracingOptions,
|
|
159
|
+
updateIntervalInMs: options.intervalInMs,
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
poller.onProgress(updateState);
|
|
163
|
+
return wrapPoller(poller);
|
|
75
164
|
}
|
|
76
165
|
async beginSelectiveKeyRestore(keyName, folderUri, sasTokenOrOptions = {}, optionsWhenSasTokenSpecified = {}) {
|
|
77
166
|
const sasToken = typeof sasTokenOrOptions === "string" ? sasTokenOrOptions : undefined;
|
|
78
167
|
const options = typeof sasTokenOrOptions === "string" ? optionsWhenSasTokenSpecified : sasTokenOrOptions;
|
|
79
168
|
const folderUriParts = mappings.folderUriParts(folderUri);
|
|
169
|
+
let poller;
|
|
80
170
|
if (options.resumeFrom) {
|
|
81
|
-
|
|
171
|
+
poller = restorePoller(this.client, options.resumeFrom, this.client.selectiveKeyRestoreOperation, options);
|
|
82
172
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
requestOptions: options.requestOptions,
|
|
86
|
-
onResponse: options.onResponse,
|
|
87
|
-
restoreBlobDetails: {
|
|
173
|
+
else {
|
|
174
|
+
poller = this.client.selectiveKeyRestoreOperation(keyName, {
|
|
88
175
|
folder: folderUriParts.folderName,
|
|
89
176
|
sasTokenParameters: {
|
|
90
177
|
storageResourceUri: folderUriParts.folderUri,
|
|
91
178
|
token: sasToken,
|
|
92
179
|
useManagedIdentity: sasToken === undefined,
|
|
93
180
|
},
|
|
94
|
-
},
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
181
|
+
}, {
|
|
182
|
+
abortSignal: options.abortSignal,
|
|
183
|
+
requestOptions: options.requestOptions,
|
|
184
|
+
onResponse: options.onResponse,
|
|
185
|
+
tracingOptions: options.tracingOptions,
|
|
186
|
+
updateIntervalInMs: options.intervalInMs,
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
poller.onProgress(updateState);
|
|
190
|
+
return wrapPoller(poller);
|
|
98
191
|
}
|
|
99
192
|
}
|
|
100
193
|
//# sourceMappingURL=backupClient.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backupClient.js","sourceRoot":"","sources":["../../src/backupClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAalC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAO3C,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AASpE;;;;;GAKG;AACH,MAAM,OAAO,oBAAoB;IAW/B;;;;;;;;;;;;;;;OAeG;IACH,YACE,QAAgB,EAChB,UAA2B,EAC3B,UAAuC,EAAE;QAEzC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAEzB,IAAI,CAAC,MAAM,GAAG,oBAAoB,CAAC,QAAQ,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;IACpE,CAAC;IA8EM,KAAK,CAAC,WAAW,CACtB,cAAsB,EACtB,oBAAyD,EAAE,EAC3D,+BAA2D,EAAE;QAE7D,M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,CAAC,MAAM,CAAC,4BAA4B,CAAC,OAAO,EAAE;YAChD,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,cAAc,EAAE,OAAO,CAAC,cAAc;YACtC,UAAU,EAAE,OAAO,CAAC,UAAU;YAC9B,kBAAkB,EAAE;gBAClB,MAAM,EAAE,cAAc,CAAC,UAAU;gBACjC,kBAAkB,EAAE;oBAClB,kBAAkB,EAAE,cAAc,CAAC,SAAS;oBAC5C,KAAK,EAAE,QAAQ;oBACf,kBAAkB,EAAE,QAAQ,KAAK,SAAS;iBAC3C;aACF;YACD,cAAc,EAAE,OAAO,CAAC,cAAc;YACtC,kBAAkB,EAAE,OAAO,CAAC,YAAY;SACzC,CAAC,CACH,CAAC;IACJ,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n KeyVaultBackupClientOptions,\n KeyVaultBackupResult,\n KeyVaultBeginBackupOptions,\n KeyVaultBeginRestoreOptions,\n KeyVaultBeginSelectiveKeyRestoreOptions,\n KeyVaultRestoreResult,\n KeyVaultSelectiveKeyRestoreResult,\n} from \"./backupClientModels.js\";\nimport type { KeyVaultClient } from \"./generated/keyVaultClient.js\";\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport { mappings } from \"./mappings.js\";\nimport { createKeyVaultClient } from \"./createKeyVaultClient.js\";\nimport type { PollerLike } from \"./lro/shim.js\";\nimport { wrapPoller } from \"./lro/shim.js\";\nimport {\n KeyVaultAdminPollOperationState,\n KeyVaultBackupOperationState,\n KeyVaultRestoreOperationState,\n KeyVaultSelectiveKeyRestoreOperationState,\n} from \"./lro/models.js\";\nimport { restorePoller } from \"./generated/restorePollerHelpers.js\";\n\nexport {\n KeyVaultBackupOperationState,\n KeyVaultRestoreOperationState,\n KeyVaultSelectiveKeyRestoreOperationState,\n KeyVaultAdminPollOperationState,\n};\n\n/**\n * The KeyVaultBackupClient provides methods to generate backups\n * and restore backups of any given Azure Key Vault instance.\n * This client supports generating full backups, selective restores of specific keys\n * and full restores of Key Vault instances.\n */\nexport class KeyVaultBackupClient {\n /**\n * The base URL to the vault\n */\n public readonly vaultUrl: string;\n\n /**\n * A reference to the auto-generated Key Vault HTTP client.\n */\n private readonly client: KeyVaultClient;\n\n /**\n * Creates an instance of the KeyVaultBackupClient.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleCreateBackupClient\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyVaultBackupClient } from \"@azure/keyvault-admin\";\n *\n * const vaultUrl = `https://<MY KEY VAULT HERE>.vault.azure.net`;\n * const credentials = new DefaultAzureCredential();\n * const client = new KeyVaultBackupClient(vaultUrl, credentials);\n * ```\n * @param vaultUrl - the URL of the Key Vault. It should have this shape: `https://${your-key-vault-name}.vault.azure.net`. You should validate that this URL references a valid Key Vault or Managed HSM resource. See https://aka.ms/azsdk/blog/vault-uri for details.\n * @param credential - An object that implements the `TokenCredential` interface used to authenticate requests to the service. Use the \\@azure/identity package to create a credential that suits your needs.\n * @param options - options used to configure Key Vault API requests.\n */\n constructor(\n vaultUrl: string,\n credential: TokenCredential,\n options: KeyVaultBackupClientOptions = {},\n ) {\n this.vaultUrl = vaultUrl;\n\n this.client = createKeyVaultClient(vaultUrl, credential, options);\n }\n\n /**\n * Starts generating a backup of an Azure Key Vault on the specified Storage Blob account.\n *\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the Key Vault backup is generated.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleBeginBackup_SAS\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyVaultBackupClient } from \"@azure/keyvault-admin\";\n *\n * const vaultUrl = `https://<MY KEY VAULT HERE>.vault.azure.net`;\n * const credentials = new DefaultAzureCredential();\n * const client = new KeyVaultBackupClient(vaultUrl, credentials);\n *\n * const blobStorageUri = \"<blob-storage-uri>\"; // <Blob storage URL>/<folder name>\n * const sasToken = \"<sas-token>\";\n * const poller = await client.beginBackup(blobStorageUri, sasToken);\n *\n * // Serializing the poller\n * const serialized = poller.toString();\n *\n * // A new poller can be created with:\n * await client.beginBackup(blobStorageUri, sasToken, { resumeFrom: serialized });\n *\n * // Waiting until it's done\n * const backupUri = await poller.pollUntilDone();\n * console.log(backupUri);\n * ```\n * Starts a full backup operation.\n * @param blobStorageUri - The URL of the blob storage resource, including the path to the container where the backup will end up being stored.\n * @param sasToken - The SAS token used to access the blob storage resource.\n * @param options - The optional parameters.\n */\n public async beginBackup(\n blobStorageUri: string,\n sasToken: string,\n options?: KeyVaultBeginBackupOptions,\n ): Promise<PollerLike<KeyVaultBackupOperationState, KeyVaultBackupResult>>;\n\n /**\n * Starts generating a backup of an Azure Key Vault on the specified Storage Blob account, using a user-assigned Managed Identity\n * to access the Storage account.\n *\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the Key Vault backup is generated.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleBeginBackup_NonSAS\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyVaultBackupClient } from \"@azure/keyvault-admin\";\n *\n * const vaultUrl = `https://<MY KEY VAULT HERE>.vault.azure.net`;\n * const credentials = new DefaultAzureCredential();\n * const client = new KeyVaultBackupClient(vaultUrl, credentials);\n *\n * const blobStorageUri = \"<blob-storage-uri>\"; // <Blob storage URL>/<folder name>\n * const poller = await client.beginBackup(blobStorageUri);\n *\n * // Serializing the poller\n * const serialized = poller.toString();\n *\n * // A new poller can be created with:\n * await client.beginBackup(blobStorageUri, { resumeFrom: serialized });\n *\n * // Waiting until it's done\n * const backupUri = await poller.pollUntilDone();\n * console.log(backupUri);\n * ```\n * Starts a full backup operation.\n * @param blobStorageUri - The URL of the blob storage resource, including the path to the container where the backup will end up being stored.\n * @param options - The optional parameters.\n */\n public async beginBackup(\n blobStorageUri: string,\n options?: KeyVaultBeginBackupOptions,\n ): Promise<PollerLike<KeyVaultBackupOperationState, KeyVaultBackupResult>>;\n\n public async beginBackup(\n blobStorageUri: string,\n sasTokenOrOptions: string | KeyVaultBeginBackupOptions = {},\n optionsWhenSasTokenSpecified: KeyVaultBeginBackupOptions = {},\n ): Promise<PollerLike<KeyVaultBackupOperationState, KeyVaultBackupResult>> {\n const sasToken = typeof sasTokenOrOptions === \"string\" ? sasTokenOrOptions : undefined;\n const options =\n typeof sasTokenOrOptions === \"string\" ? optionsWhenSasTokenSpecified : sasTokenOrOptions;\n\n if (options.resumeFrom) {\n return wrapPoller(\n restorePoller(this.client, options.resumeFrom, this.client.fullBackup, options),\n );\n }\n\n return wrapPoller(\n this.client.fullBackup({\n abortSignal: options.abortSignal,\n requestOptions: options.requestOptions,\n azureStorageBlobContainerUri: {\n storageResourceUri: blobStorageUri,\n token: sasToken,\n useManagedIdentity: sasToken === undefined,\n },\n onResponse: options.onResponse,\n tracingOptions: options.tracingOptions,\n updateIntervalInMs: options.intervalInMs,\n }),\n );\n }\n\n /**\n * Starts restoring all key materials using the SAS token pointing to a previously stored Azure Blob storage\n * backup folder.\n *\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the Key Vault restore operation is complete.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleBeginRestore_SAS\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyVaultBackupClient } from \"@azure/keyvault-admin\";\n *\n * const vaultUrl = `https://<MY KEY VAULT HERE>.vault.azure.net`;\n * const credentials = new DefaultAzureCredential();\n * const client = new KeyVaultBackupClient(vaultUrl, credentials);\n *\n * const blobStorageUri = \"<blob-storage-uri>\"; // <Blob storage URL>/<folder name>\n * const sasToken = \"<sas-token>\";\n * const poller = await client.beginRestore(blobStorageUri, sasToken);\n *\n * // The poller can be serialized with:\n * const serialized = poller.toString();\n *\n * // A new poller can be created with:\n * await client.beginRestore(blobStorageUri, sasToken, { resumeFrom: serialized });\n *\n * // Waiting until it's done\n * const backupUri = await poller.pollUntilDone();\n * console.log(backupUri);\n * ```\n * Starts a full restore operation.\n * @param folderUri - The URL of the blob storage resource where the previous successful full backup was stored.\n * @param sasToken - The SAS token. If no SAS token is provided, user-assigned Managed Identity will be used to access the blob storage resource.\n * @param options - The optional parameters.\n */\n public async beginRestore(\n folderUri: string,\n sasToken: string,\n options?: KeyVaultBeginRestoreOptions,\n ): Promise<PollerLike<KeyVaultRestoreOperationState, KeyVaultRestoreResult>>;\n\n /**\n * Starts restoring all key materials using the SAS token pointing to a previously stored Azure Blob storage\n * backup folder, using a user-assigned Managed Identity to access the storage account.\n *\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the Key Vault restore operation is complete.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleBeginRestore_NonSAS\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyVaultBackupClient } from \"@azure/keyvault-admin\";\n *\n * const vaultUrl = `https://<MY KEY VAULT HERE>.vault.azure.net`;\n * const credentials = new DefaultAzureCredential();\n * const client = new KeyVaultBackupClient(vaultUrl, credentials);\n *\n * const blobStorageUri = \"<blob-storage-uri>\"; // <Blob storage URL>/<folder name>\n * const poller = await client.beginRestore(blobStorageUri);\n *\n * // The poller can be serialized with:\n * const serialized = poller.toString();\n *\n * // A new poller can be created with:\n * await client.beginRestore(blobStorageUri, { resumeFrom: serialized });\n *\n * // Waiting until it's done\n * const backupUri = await poller.pollUntilDone();\n * console.log(backupUri);\n * ```\n * Starts a full restore operation.\n * @param folderUri - The URL of the blob storage resource where the previous successful full backup was stored.\n * @param sasToken - The SAS token. If no SAS token is provided, user-assigned Managed Identity will be used to access the blob storage resource.\n * @param options - The optional parameters.\n */\n public async beginRestore(\n folderUri: string,\n options?: KeyVaultBeginRestoreOptions,\n ): Promise<PollerLike<KeyVaultRestoreOperationState, KeyVaultRestoreResult>>;\n\n public async beginRestore(\n folderUri: string,\n sasTokenOrOptions: string | KeyVaultBeginRestoreOptions = {},\n optionsWhenSasTokenSpecified: KeyVaultBeginRestoreOptions = {},\n ): Promise<PollerLike<KeyVaultRestoreOperationState, KeyVaultRestoreResult>> {\n const sasToken = typeof sasTokenOrOptions === \"string\" ? sasTokenOrOptions : undefined;\n const options =\n typeof sasTokenOrOptions === \"string\" ? optionsWhenSasTokenSpecified : sasTokenOrOptions;\n\n const folderUriParts = mappings.folderUriParts(folderUri);\n\n if (options.resumeFrom) {\n return wrapPoller(\n restorePoller(this.client, options.resumeFrom, this.client.fullRestoreOperation, options),\n );\n }\n\n return wrapPoller(\n this.client.fullRestoreOperation({\n abortSignal: options.abortSignal,\n requestOptions: options.requestOptions,\n restoreBlobDetails: {\n folderToRestore: folderUriParts.folderName,\n sasTokenParameters: {\n storageResourceUri: folderUriParts.folderUri,\n token: sasToken,\n useManagedIdentity: sasToken === undefined,\n },\n },\n onResponse: options.onResponse,\n tracingOptions: options.tracingOptions,\n updateIntervalInMs: options.intervalInMs,\n }),\n );\n }\n\n /**\n * Starts restoring all key versions of a given key using user supplied SAS token pointing to a previously\n * stored Azure Blob storage backup folder.\n *\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the Key Vault selective restore is complete.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleBeginSelectiveKeyRestore_SAS\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyVaultBackupClient } from \"@azure/keyvault-admin\";\n *\n * const vaultUrl = `https://<MY KEY VAULT HERE>.vault.azure.net`;\n * const credentials = new DefaultAzureCredential();\n * const client = new KeyVaultBackupClient(vaultUrl, credentials);\n *\n * const blobStorageUri = \"<blob-storage-uri>\";\n * const sasToken = \"<sas-token>\";\n * const keyName = \"<key-name>\";\n * const poller = await client.beginSelectiveKeyRestore(keyName, blobStorageUri, sasToken);\n *\n * // Serializing the poller\n * const serialized = poller.toString();\n *\n * // A new poller can be created with:\n * await client.beginSelectiveKeyRestore(keyName, blobStorageUri, sasToken, {\n * resumeFrom: serialized,\n * });\n *\n * // Waiting until it's done\n * await poller.pollUntilDone();\n * ```\n * Creates a new role assignment.\n * @param keyName - The name of the key that wants to be restored.\n * @param folderUri - The URL of the blob storage resource, with the folder name of the blob where the previous successful full backup was stored.\n * @param sasToken - The SAS token. If no SAS token is provided, user-assigned Managed Identity will be used to access the blob storage resource.\n * @param options - The optional parameters.\n */\n public async beginSelectiveKeyRestore(\n keyName: string,\n folderUri: string,\n sasToken: string,\n options?: KeyVaultBeginSelectiveKeyRestoreOptions,\n ): Promise<\n PollerLike<KeyVaultSelectiveKeyRestoreOperationState, KeyVaultSelectiveKeyRestoreResult>\n >;\n\n /**\n * Starts restoring all key versions of a given key using to a previously\n * stored Azure Blob storage backup folder. The Blob storage backup folder will be accessed using user-assigned Managed Identity.\n *\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the Key Vault selective restore is complete.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleBeginSelectiveKeyRestore_NonSAS\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyVaultBackupClient } from \"@azure/keyvault-admin\";\n *\n * const vaultUrl = `https://<MY KEY VAULT HERE>.vault.azure.net`;\n * const credentials = new DefaultAzureCredential();\n * const client = new KeyVaultBackupClient(vaultUrl, credentials);\n *\n * const blobStorageUri = \"<blob-storage-uri>\";\n * const keyName = \"<key-name>\";\n * const poller = await client.beginSelectiveKeyRestore(keyName, blobStorageUri);\n *\n * // Serializing the poller\n * const serialized = poller.toString();\n *\n * // A new poller can be created with:\n * await client.beginSelectiveKeyRestore(keyName, blobStorageUri, { resumeFrom: serialized });\n *\n * // Waiting until it's done\n * await poller.pollUntilDone();\n * ```\n * Creates a new role assignment.\n * @param keyName - The name of the key that wants to be restored.\n * @param folderUri - The URL of the blob storage resource, with the folder name of the blob where the previous successful full backup was stored.\n * @param sasToken - The SAS token. If no SAS token is provided, user-assigned Managed Identity will be used to access the blob storage resource.\n * @param options - The optional parameters.\n */\n public async beginSelectiveKeyRestore(\n keyName: string,\n folderUri: string,\n options?: KeyVaultBeginSelectiveKeyRestoreOptions,\n ): Promise<\n PollerLike<KeyVaultSelectiveKeyRestoreOperationState, KeyVaultSelectiveKeyRestoreResult>\n >;\n\n public async beginSelectiveKeyRestore(\n keyName: string,\n folderUri: string,\n sasTokenOrOptions: string | KeyVaultBeginSelectiveKeyRestoreOptions = {},\n optionsWhenSasTokenSpecified: KeyVaultBeginSelectiveKeyRestoreOptions = {},\n ): Promise<\n PollerLike<KeyVaultSelectiveKeyRestoreOperationState, KeyVaultSelectiveKeyRestoreResult>\n > {\n const sasToken = typeof sasTokenOrOptions === \"string\" ? sasTokenOrOptions : undefined;\n const options =\n typeof sasTokenOrOptions === \"string\" ? optionsWhenSasTokenSpecified : sasTokenOrOptions;\n\n const folderUriParts = mappings.folderUriParts(folderUri);\n\n if (options.resumeFrom) {\n return wrapPoller(\n restorePoller(\n this.client,\n options.resumeFrom,\n this.client.selectiveKeyRestoreOperation,\n options,\n ),\n );\n }\n\n return wrapPoller(\n this.client.selectiveKeyRestoreOperation(keyName, {\n abortSignal: options.abortSignal,\n requestOptions: options.requestOptions,\n onResponse: options.onResponse,\n restoreBlobDetails: {\n folder: folderUriParts.folderName,\n sasTokenParameters: {\n storageResourceUri: folderUriParts.folderUri,\n token: sasToken,\n useManagedIdentity: sasToken === undefined,\n },\n },\n tracingOptions: options.tracingOptions,\n updateIntervalInMs: options.intervalInMs,\n }),\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"backupClient.js","sourceRoot":"","sources":["../../src/backupClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAelC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAOxD,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AASpE;;;;;GAKG;AACH,MAAM,OAAO,oBAAoB;IAW/B;;;;;;;;;;;;;;;OAeG;IACH,YACE,QAAgB,EAChB,UAA2B,EAC3B,UAAuC,EAAE;QAEzC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAEzB,IAAI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IAAI,CAAC,MAAM,EACX,OAAO,CAAC,UAAU,EAClB,IAAI,CAAC,MAAM,CAAC,4BAA4B,EACxC,OAAO,CACR,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,4BAA4B,CAC/C,OAAO,EACP;gBACE,MAAM,EAAE,cAAc,CAAC,UAAU;gBACjC,kBAAkB,EAAE;oBAClB,kBAAkB,EAAE,cAAc,CAAC,SAAS;oBAC5C,KAAK,EAAE,QAAQ;oBACf,kBAAkB,EAAE,QAAQ,KAAK,SAAS;iBAC3C;aACF,EACD;gBACE,WAAW,EAAE,OAAO,CAAC,WAAW;gBAChC,cAAc,EAAE,OAAO,CAAC,cAAc;gBACtC,UAAU,EAAE,OAAO,CAAC,UAAU;gBAC9B,cAAc,EAAE,OAAO,CAAC,cAAc;gBACtC,kBAAkB,EAAE,OAAO,CAAC,YAAY;aACzC,CACF,CAAC;QACJ,CAAC;QACD,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QAE/B,OAAO,UAAU,CAAC,MAAM,CAAqD,CAAC;IAChF,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n KeyVaultBackupClientOptions,\n KeyVaultBackupResult,\n KeyVaultBeginBackupOptions,\n KeyVaultBeginPreBackupOptions,\n KeyVaultBeginPreRestoreOptions,\n KeyVaultBeginRestoreOptions,\n KeyVaultBeginSelectiveKeyRestoreOptions,\n KeyVaultRestoreResult,\n KeyVaultSelectiveKeyRestoreResult,\n} from \"./backupClientModels.js\";\nimport type { KeyVaultClient } from \"./generated/keyVaultClient.js\";\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport { mappings } from \"./mappings.js\";\nimport { createKeyVaultClient } from \"./createKeyVaultClient.js\";\nimport type { PollerLike } from \"./lro/shim.js\";\nimport { wrapPoller, updateState } from \"./lro/shim.js\";\nimport {\n KeyVaultAdminPollOperationState,\n KeyVaultBackupOperationState,\n KeyVaultRestoreOperationState,\n KeyVaultSelectiveKeyRestoreOperationState,\n} from \"./lro/models.js\";\nimport { restorePoller } from \"./generated/restorePollerHelpers.js\";\n\nexport {\n KeyVaultBackupOperationState,\n KeyVaultRestoreOperationState,\n KeyVaultSelectiveKeyRestoreOperationState,\n KeyVaultAdminPollOperationState,\n};\n\n/**\n * The KeyVaultBackupClient provides methods to generate backups\n * and restore backups of any given Azure Key Vault instance.\n * This client supports generating full backups, selective restores of specific keys\n * and full restores of Key Vault instances.\n */\nexport class KeyVaultBackupClient {\n /**\n * The base URL to the vault\n */\n public readonly vaultUrl: string;\n\n /**\n * A reference to the auto-generated Key Vault HTTP client.\n */\n private readonly client: KeyVaultClient;\n\n /**\n * Creates an instance of the KeyVaultBackupClient.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleCreateBackupClient\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyVaultBackupClient } from \"@azure/keyvault-admin\";\n *\n * const vaultUrl = `https://<MY KEY VAULT HERE>.vault.azure.net`;\n * const credentials = new DefaultAzureCredential();\n * const client = new KeyVaultBackupClient(vaultUrl, credentials);\n * ```\n * @param vaultUrl - the URL of the Key Vault. It should have this shape: `https://${your-key-vault-name}.vault.azure.net`. You should validate that this URL references a valid Key Vault or Managed HSM resource. See https://aka.ms/azsdk/blog/vault-uri for details.\n * @param credential - An object that implements the `TokenCredential` interface used to authenticate requests to the service. Use the \\@azure/identity package to create a credential that suits your needs.\n * @param options - options used to configure Key Vault API requests.\n */\n constructor(\n vaultUrl: string,\n credential: TokenCredential,\n options: KeyVaultBackupClientOptions = {},\n ) {\n this.vaultUrl = vaultUrl;\n\n this.client = createKeyVaultClient(vaultUrl, credential, options);\n }\n\n /**\n * Starts a pre-backup operation which can be used to check whether the customer can perform a {@link beginBackup} operation using the provided SAS token.\n *\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the operation completes.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleBeginPreBackup_SAS\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyVaultBackupClient } from \"@azure/keyvault-admin\";\n *\n * const vaultUrl = `https://<MY KEY VAULT HERE>.vault.azure.net`;\n * const credentials = new DefaultAzureCredential();\n * const client = new KeyVaultBackupClient(vaultUrl, credentials);\n *\n * const blobStorageUri = \"<blob-storage-uri>\"; // <Blob storage URL>/<folder name>\n * const sasToken = \"<sas-token>\";\n * const poller = await client.beginPreBackup(blobStorageUri, sasToken);\n *\n * // Serializing the poller\n * const serialized = poller.toString();\n *\n * // A new poller can be created with:\n * await client.beginPreBackup(blobStorageUri, sasToken, { resumeFrom: serialized });\n *\n * // Waiting until it's done\n * const result = await poller.pollUntilDone();\n * console.log(result);\n * ```\n * @param blobStorageUri - The URL of the blob storage resource, including the path to the container where the backup will end up being stored.\n * @param sasToken - The SAS token used to access the blob storage resource.\n * @param options - The optional parameters.\n */\n public async beginPreBackup(\n blobStorageUri: string,\n sasToken: string,\n options?: KeyVaultBeginPreBackupOptions,\n ): Promise<PollerLike<KeyVaultBackupOperationState, KeyVaultBackupResult>>;\n /**\n * Starts a pre-backup operation which can be used to check whether the customer can perform a {@link beginBackup} operation using the Managed HSM's configured user-assigned managed identity to authenticate with Azure Storage.\n *\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the operation completes.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleBeginPreBackup_NonSAS\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyVaultBackupClient } from \"@azure/keyvault-admin\";\n *\n * const vaultUrl = `https://<MY KEY VAULT HERE>.vault.azure.net`;\n * const credentials = new DefaultAzureCredential();\n * const client = new KeyVaultBackupClient(vaultUrl, credentials);\n *\n * const blobStorageUri = \"<blob-storage-uri>\"; // <Blob storage URL>/<folder name>\n * const poller = await client.beginPreBackup(blobStorageUri);\n *\n * // Serializing the poller\n * const serialized = poller.toString();\n *\n * // A new poller can be created with:\n * await client.beginPreBackup(blobStorageUri, { resumeFrom: serialized });\n *\n * // Waiting until it's done\n * const result = await poller.pollUntilDone();\n * console.log(result);\n * ```\n * @param blobStorageUri - The URL of the blob storage resource, including the path to the container where the backup will end up being stored.\n * @param options - The optional parameters.\n */\n public async beginPreBackup(\n blobStorageUri: string,\n options?: KeyVaultBeginPreBackupOptions,\n ): Promise<PollerLike<KeyVaultBackupOperationState, KeyVaultBackupResult>>;\n public async beginPreBackup(\n blobStorageUri: string,\n sasTokenOrOptions: string | KeyVaultBeginPreBackupOptions = {},\n optionsWhenSasTokenSpecified: KeyVaultBeginPreBackupOptions = {},\n ): Promise<PollerLike<KeyVaultBackupOperationState, KeyVaultBackupResult>> {\n const sasToken = typeof sasTokenOrOptions === \"string\" ? sasTokenOrOptions : undefined;\n const options =\n typeof sasTokenOrOptions === \"string\" ? optionsWhenSasTokenSpecified : sasTokenOrOptions;\n\n let poller;\n if (options.resumeFrom) {\n poller = restorePoller(this.client, options.resumeFrom, this.client.preFullBackup, options);\n } else {\n poller = this.client.preFullBackup(\n {\n storageResourceUri: blobStorageUri,\n token: sasToken,\n useManagedIdentity: sasToken === undefined,\n },\n {\n abortSignal: options.abortSignal,\n requestOptions: options.requestOptions,\n onResponse: options.onResponse,\n tracingOptions: options.tracingOptions,\n updateIntervalInMs: options.intervalInMs,\n },\n );\n }\n\n poller.onProgress(updateState);\n\n return wrapPoller(poller) as ReturnType<typeof this.beginPreBackup>;\n }\n\n /**\n * Starts a pre-restore operation which can be used to check whether the customer can perform a {@link beginRestore} operation using the provided SAS token.\n *\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the operation completes.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleBeginPreRestore_SAS\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyVaultBackupClient } from \"@azure/keyvault-admin\";\n *\n * const vaultUrl = `https://<MY KEY VAULT HERE>.vault.azure.net`;\n * const credentials = new DefaultAzureCredential();\n * const client = new KeyVaultBackupClient(vaultUrl, credentials);\n *\n * const blobStorageUri = \"<blob-storage-uri>\"; // <Blob storage URL>/<folder name>\n * const sasToken = \"<sas-token>\";\n * const poller = await client.beginPreRestore(blobStorageUri, sasToken);\n *\n * // The poller can be serialized with:\n * const serialized = poller.toString();\n *\n * // A new poller can be created with:\n * await client.beginPreRestore(blobStorageUri, sasToken, { resumeFrom: serialized });\n *\n * // Waiting until it's done\n * await poller.pollUntilDone();\n * ```\n * @param folderUri - The URL of the blob storage resource where the previous successful full backup was stored.\n * @param sasToken - The SAS token. If no SAS token is provided, user-assigned Managed Identity will be used to access the blob storage resource.\n * @param options - The optional parameters.\n */\n public async beginPreRestore(\n folderUri: string,\n sasToken: string,\n options?: KeyVaultBeginPreRestoreOptions,\n ): Promise<PollerLike<KeyVaultRestoreOperationState, KeyVaultRestoreResult>>;\n /**\n * Starts a pre-restore operation which can be used to check whether the customer can perform a {@link beginRestore} operation using the provided SAS token.\n *\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the operation completes.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleBeginPreRestore_SAS\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyVaultBackupClient } from \"@azure/keyvault-admin\";\n *\n * const vaultUrl = `https://<MY KEY VAULT HERE>.vault.azure.net`;\n * const credentials = new DefaultAzureCredential();\n * const client = new KeyVaultBackupClient(vaultUrl, credentials);\n *\n * const blobStorageUri = \"<blob-storage-uri>\"; // <Blob storage URL>/<folder name>\n * const sasToken = \"<sas-token>\";\n * const poller = await client.beginPreRestore(blobStorageUri, sasToken);\n *\n * // The poller can be serialized with:\n * const serialized = poller.toString();\n *\n * // A new poller can be created with:\n * await client.beginPreRestore(blobStorageUri, sasToken, { resumeFrom: serialized });\n *\n * // Waiting until it's done\n * await poller.pollUntilDone();\n * ```\n * @param folderUri - The URL of the blob storage resource where the previous successful full backup was stored.\n * @param sasToken - The SAS token. If no SAS token is provided, user-assigned Managed Identity will be used to access the blob storage resource.\n * @param options - The optional parameters.\n */\n public async beginPreRestore(\n folderUri: string,\n options?: KeyVaultBeginPreRestoreOptions,\n ): Promise<PollerLike<KeyVaultRestoreOperationState, KeyVaultRestoreResult>>;\n /**\n * Starts a pre-restore operation which can be used to check whether the customer can perform a {@link beginRestore} operation using the Managed HSM's configured user-assigned managed identity to authenticate with Azure Storage.\n *\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the operation completes.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleBeginPreRestore_SAS\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyVaultBackupClient } from \"@azure/keyvault-admin\";\n *\n * const vaultUrl = `https://<MY KEY VAULT HERE>.vault.azure.net`;\n * const credentials = new DefaultAzureCredential();\n * const client = new KeyVaultBackupClient(vaultUrl, credentials);\n *\n * const blobStorageUri = \"<blob-storage-uri>\"; // <Blob storage URL>/<folder name>\n * const sasToken = \"<sas-token>\";\n * const poller = await client.beginPreRestore(blobStorageUri, sasToken);\n *\n * // The poller can be serialized with:\n * const serialized = poller.toString();\n *\n * // A new poller can be created with:\n * await client.beginPreRestore(blobStorageUri, sasToken, { resumeFrom: serialized });\n *\n * // Waiting until it's done\n * await poller.pollUntilDone();\n * ```\n * @param folderUri - The URL of the blob storage resource where the previous successful full backup was stored.\n * @param sasToken - The SAS token. If no SAS token is provided, user-assigned Managed Identity will be used to access the blob storage resource.\n * @param options - The optional parameters.\n */\n public async beginPreRestore(\n folderUri: string,\n sasTokenOrOptions: string | KeyVaultBeginPreRestoreOptions = {},\n optionsWhenSasTokenSpecified: KeyVaultBeginPreRestoreOptions = {},\n ): Promise<PollerLike<KeyVaultRestoreOperationState, KeyVaultRestoreResult>> {\n const sasToken = typeof sasTokenOrOptions === \"string\" ? sasTokenOrOptions : undefined;\n const options =\n typeof sasTokenOrOptions === \"string\" ? optionsWhenSasTokenSpecified : sasTokenOrOptions;\n\n const folderUriParts = mappings.folderUriParts(folderUri);\n\n let poller;\n if (options.resumeFrom) {\n poller = restorePoller(\n this.client,\n options.resumeFrom,\n this.client.preFullRestoreOperation,\n options,\n );\n } else {\n poller = this.client.preFullRestoreOperation(\n {\n folderToRestore: folderUriParts.folderName,\n sasTokenParameters: {\n storageResourceUri: folderUriParts.folderUri,\n token: sasToken,\n useManagedIdentity: sasToken === undefined,\n },\n },\n {\n abortSignal: options.abortSignal,\n requestOptions: options.requestOptions,\n onResponse: options.onResponse,\n tracingOptions: options.tracingOptions,\n updateIntervalInMs: options.intervalInMs,\n },\n );\n }\n poller.onProgress(updateState);\n\n return wrapPoller(poller) as ReturnType<typeof this.beginPreRestore>;\n }\n\n /**\n * Starts generating a backup of an Azure Key Vault on the specified Storage Blob account.\n *\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the Key Vault backup is generated.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleBeginBackup_SAS\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyVaultBackupClient } from \"@azure/keyvault-admin\";\n *\n * const vaultUrl = `https://<MY KEY VAULT HERE>.vault.azure.net`;\n * const credentials = new DefaultAzureCredential();\n * const client = new KeyVaultBackupClient(vaultUrl, credentials);\n *\n * const blobStorageUri = \"<blob-storage-uri>\"; // <Blob storage URL>/<folder name>\n * const sasToken = \"<sas-token>\";\n * const poller = await client.beginBackup(blobStorageUri, sasToken);\n *\n * // Serializing the poller\n * const serialized = poller.toString();\n *\n * // A new poller can be created with:\n * await client.beginBackup(blobStorageUri, sasToken, { resumeFrom: serialized });\n *\n * // Waiting until it's done\n * const backupUri = await poller.pollUntilDone();\n * console.log(backupUri);\n * ```\n * Starts a full backup operation.\n * @param blobStorageUri - The URL of the blob storage resource, including the path to the container where the backup will end up being stored.\n * @param sasToken - The SAS token used to access the blob storage resource.\n * @param options - The optional parameters.\n */\n public async beginBackup(\n blobStorageUri: string,\n sasToken: string,\n options?: KeyVaultBeginBackupOptions,\n ): Promise<PollerLike<KeyVaultBackupOperationState, KeyVaultBackupResult>>;\n\n /**\n * Starts generating a backup of an Azure Key Vault on the specified Storage Blob account, using a user-assigned Managed Identity\n * to access the Storage account.\n *\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the Key Vault backup is generated.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleBeginBackup_NonSAS\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyVaultBackupClient } from \"@azure/keyvault-admin\";\n *\n * const vaultUrl = `https://<MY KEY VAULT HERE>.vault.azure.net`;\n * const credentials = new DefaultAzureCredential();\n * const client = new KeyVaultBackupClient(vaultUrl, credentials);\n *\n * const blobStorageUri = \"<blob-storage-uri>\"; // <Blob storage URL>/<folder name>\n * const poller = await client.beginBackup(blobStorageUri);\n *\n * // Serializing the poller\n * const serialized = poller.toString();\n *\n * // A new poller can be created with:\n * await client.beginBackup(blobStorageUri, { resumeFrom: serialized });\n *\n * // Waiting until it's done\n * const backupUri = await poller.pollUntilDone();\n * console.log(backupUri);\n * ```\n * Starts a full backup operation.\n * @param blobStorageUri - The URL of the blob storage resource, including the path to the container where the backup will end up being stored.\n * @param options - The optional parameters.\n */\n public async beginBackup(\n blobStorageUri: string,\n options?: KeyVaultBeginBackupOptions,\n ): Promise<PollerLike<KeyVaultBackupOperationState, KeyVaultBackupResult>>;\n\n public async beginBackup(\n blobStorageUri: string,\n sasTokenOrOptions: string | KeyVaultBeginBackupOptions = {},\n optionsWhenSasTokenSpecified: KeyVaultBeginBackupOptions = {},\n ): Promise<PollerLike<KeyVaultBackupOperationState, KeyVaultBackupResult>> {\n const sasToken = typeof sasTokenOrOptions === \"string\" ? sasTokenOrOptions : undefined;\n const options =\n typeof sasTokenOrOptions === \"string\" ? optionsWhenSasTokenSpecified : sasTokenOrOptions;\n\n let poller;\n if (options.resumeFrom) {\n poller = restorePoller(this.client, options.resumeFrom, this.client.fullBackup, options);\n } else {\n poller = this.client.fullBackup(\n {\n storageResourceUri: blobStorageUri,\n token: sasToken,\n useManagedIdentity: sasToken === undefined,\n },\n {\n abortSignal: options.abortSignal,\n requestOptions: options.requestOptions,\n onResponse: options.onResponse,\n tracingOptions: options.tracingOptions,\n updateIntervalInMs: options.intervalInMs,\n },\n );\n }\n\n poller.onProgress(updateState);\n\n return wrapPoller(poller) as ReturnType<typeof this.beginBackup>;\n }\n\n /**\n * Starts restoring all key materials using the SAS token pointing to a previously stored Azure Blob storage\n * backup folder.\n *\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the Key Vault restore operation is complete.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleBeginRestore_SAS\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyVaultBackupClient } from \"@azure/keyvault-admin\";\n *\n * const vaultUrl = `https://<MY KEY VAULT HERE>.vault.azure.net`;\n * const credentials = new DefaultAzureCredential();\n * const client = new KeyVaultBackupClient(vaultUrl, credentials);\n *\n * const blobStorageUri = \"<blob-storage-uri>\"; // <Blob storage URL>/<folder name>\n * const sasToken = \"<sas-token>\";\n * const poller = await client.beginRestore(blobStorageUri, sasToken);\n *\n * // The poller can be serialized with:\n * const serialized = poller.toString();\n *\n * // A new poller can be created with:\n * await client.beginRestore(blobStorageUri, sasToken, { resumeFrom: serialized });\n *\n * // Waiting until it's done\n * const backupUri = await poller.pollUntilDone();\n * console.log(backupUri);\n * ```\n * Starts a full restore operation.\n * @param folderUri - The URL of the blob storage resource where the previous successful full backup was stored.\n * @param sasToken - The SAS token. If no SAS token is provided, user-assigned Managed Identity will be used to access the blob storage resource.\n * @param options - The optional parameters.\n */\n public async beginRestore(\n folderUri: string,\n sasToken: string,\n options?: KeyVaultBeginRestoreOptions,\n ): Promise<PollerLike<KeyVaultRestoreOperationState, KeyVaultRestoreResult>>;\n\n /**\n * Starts restoring all key materials using the SAS token pointing to a previously stored Azure Blob storage\n * backup folder, using a user-assigned Managed Identity to access the storage account.\n *\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the Key Vault restore operation is complete.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleBeginRestore_NonSAS\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyVaultBackupClient } from \"@azure/keyvault-admin\";\n *\n * const vaultUrl = `https://<MY KEY VAULT HERE>.vault.azure.net`;\n * const credentials = new DefaultAzureCredential();\n * const client = new KeyVaultBackupClient(vaultUrl, credentials);\n *\n * const blobStorageUri = \"<blob-storage-uri>\"; // <Blob storage URL>/<folder name>\n * const poller = await client.beginRestore(blobStorageUri);\n *\n * // The poller can be serialized with:\n * const serialized = poller.toString();\n *\n * // A new poller can be created with:\n * await client.beginRestore(blobStorageUri, { resumeFrom: serialized });\n *\n * // Waiting until it's done\n * await poller.pollUntilDone();\n * ```\n * Starts a full restore operation.\n * @param folderUri - The URL of the blob storage resource where the previous successful full backup was stored.\n * @param sasToken - The SAS token. If no SAS token is provided, user-assigned Managed Identity will be used to access the blob storage resource.\n * @param options - The optional parameters.\n */\n public async beginRestore(\n folderUri: string,\n options?: KeyVaultBeginRestoreOptions,\n ): Promise<PollerLike<KeyVaultRestoreOperationState, KeyVaultRestoreResult>>;\n\n public async beginRestore(\n folderUri: string,\n sasTokenOrOptions: string | KeyVaultBeginRestoreOptions = {},\n optionsWhenSasTokenSpecified: KeyVaultBeginRestoreOptions = {},\n ): Promise<PollerLike<KeyVaultRestoreOperationState, KeyVaultRestoreResult>> {\n const sasToken = typeof sasTokenOrOptions === \"string\" ? sasTokenOrOptions : undefined;\n const options =\n typeof sasTokenOrOptions === \"string\" ? optionsWhenSasTokenSpecified : sasTokenOrOptions;\n\n const folderUriParts = mappings.folderUriParts(folderUri);\n\n let poller;\n if (options.resumeFrom) {\n poller = restorePoller(\n this.client,\n options.resumeFrom,\n this.client.fullRestoreOperation,\n options,\n );\n } else {\n poller = this.client.fullRestoreOperation(\n {\n folderToRestore: folderUriParts.folderName,\n sasTokenParameters: {\n storageResourceUri: folderUriParts.folderUri,\n token: sasToken,\n useManagedIdentity: sasToken === undefined,\n },\n },\n {\n abortSignal: options.abortSignal,\n requestOptions: options.requestOptions,\n onResponse: options.onResponse,\n tracingOptions: options.tracingOptions,\n updateIntervalInMs: options.intervalInMs,\n },\n );\n }\n poller.onProgress(updateState);\n\n return wrapPoller(poller) as ReturnType<typeof this.beginRestore>;\n }\n\n /**\n * Starts restoring all key versions of a given key using user supplied SAS token pointing to a previously\n * stored Azure Blob storage backup folder.\n *\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the Key Vault selective restore is complete.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleBeginSelectiveKeyRestore_SAS\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyVaultBackupClient } from \"@azure/keyvault-admin\";\n *\n * const vaultUrl = `https://<MY KEY VAULT HERE>.vault.azure.net`;\n * const credentials = new DefaultAzureCredential();\n * const client = new KeyVaultBackupClient(vaultUrl, credentials);\n *\n * const blobStorageUri = \"<blob-storage-uri>\";\n * const sasToken = \"<sas-token>\";\n * const keyName = \"<key-name>\";\n * const poller = await client.beginSelectiveKeyRestore(keyName, blobStorageUri, sasToken);\n *\n * // Serializing the poller\n * const serialized = poller.toString();\n *\n * // A new poller can be created with:\n * await client.beginSelectiveKeyRestore(keyName, blobStorageUri, sasToken, {\n * resumeFrom: serialized,\n * });\n *\n * // Waiting until it's done\n * await poller.pollUntilDone();\n * ```\n * Creates a new role assignment.\n * @param keyName - The name of the key that wants to be restored.\n * @param folderUri - The URL of the blob storage resource, with the folder name of the blob where the previous successful full backup was stored.\n * @param sasToken - The SAS token. If no SAS token is provided, user-assigned Managed Identity will be used to access the blob storage resource.\n * @param options - The optional parameters.\n */\n public async beginSelectiveKeyRestore(\n keyName: string,\n folderUri: string,\n sasToken: string,\n options?: KeyVaultBeginSelectiveKeyRestoreOptions,\n ): Promise<\n PollerLike<KeyVaultSelectiveKeyRestoreOperationState, KeyVaultSelectiveKeyRestoreResult>\n >;\n\n /**\n * Starts restoring all key versions of a given key using to a previously\n * stored Azure Blob storage backup folder. The Blob storage backup folder will be accessed using user-assigned Managed Identity.\n *\n * This function returns a Long Running Operation poller that allows you to wait indefinitely until the Key Vault selective restore is complete.\n *\n * Example usage:\n * ```ts snippet:ReadmeSampleBeginSelectiveKeyRestore_NonSAS\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { KeyVaultBackupClient } from \"@azure/keyvault-admin\";\n *\n * const vaultUrl = `https://<MY KEY VAULT HERE>.vault.azure.net`;\n * const credentials = new DefaultAzureCredential();\n * const client = new KeyVaultBackupClient(vaultUrl, credentials);\n *\n * const blobStorageUri = \"<blob-storage-uri>\";\n * const keyName = \"<key-name>\";\n * const poller = await client.beginSelectiveKeyRestore(keyName, blobStorageUri);\n *\n * // Serializing the poller\n * const serialized = poller.toString();\n *\n * // A new poller can be created with:\n * await client.beginSelectiveKeyRestore(keyName, blobStorageUri, { resumeFrom: serialized });\n *\n * // Waiting until it's done\n * await poller.pollUntilDone();\n * ```\n * Creates a new role assignment.\n * @param keyName - The name of the key that wants to be restored.\n * @param folderUri - The URL of the blob storage resource, with the folder name of the blob where the previous successful full backup was stored.\n * @param sasToken - The SAS token. If no SAS token is provided, user-assigned Managed Identity will be used to access the blob storage resource.\n * @param options - The optional parameters.\n */\n public async beginSelectiveKeyRestore(\n keyName: string,\n folderUri: string,\n options?: KeyVaultBeginSelectiveKeyRestoreOptions,\n ): Promise<\n PollerLike<KeyVaultSelectiveKeyRestoreOperationState, KeyVaultSelectiveKeyRestoreResult>\n >;\n\n public async beginSelectiveKeyRestore(\n keyName: string,\n folderUri: string,\n sasTokenOrOptions: string | KeyVaultBeginSelectiveKeyRestoreOptions = {},\n optionsWhenSasTokenSpecified: KeyVaultBeginSelectiveKeyRestoreOptions = {},\n ): Promise<\n PollerLike<KeyVaultSelectiveKeyRestoreOperationState, KeyVaultSelectiveKeyRestoreResult>\n > {\n const sasToken = typeof sasTokenOrOptions === \"string\" ? sasTokenOrOptions : undefined;\n const options =\n typeof sasTokenOrOptions === \"string\" ? optionsWhenSasTokenSpecified : sasTokenOrOptions;\n\n const folderUriParts = mappings.folderUriParts(folderUri);\n\n let poller;\n if (options.resumeFrom) {\n poller = restorePoller(\n this.client,\n options.resumeFrom,\n this.client.selectiveKeyRestoreOperation,\n options,\n );\n } else {\n poller = this.client.selectiveKeyRestoreOperation(\n keyName,\n {\n folder: folderUriParts.folderName,\n sasTokenParameters: {\n storageResourceUri: folderUriParts.folderUri,\n token: sasToken,\n useManagedIdentity: sasToken === undefined,\n },\n },\n {\n abortSignal: options.abortSignal,\n requestOptions: options.requestOptions,\n onResponse: options.onResponse,\n tracingOptions: options.tracingOptions,\n updateIntervalInMs: options.intervalInMs,\n },\n );\n }\n poller.onProgress(updateState);\n\n return wrapPoller(poller) as ReturnType<typeof this.beginSelectiveKeyRestore>;\n }\n}\n"]}
|
|
@@ -32,19 +32,31 @@ export interface KeyVaultBackupPollerOptions extends OperationOptions {
|
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
34
|
* An interface representing the optional parameters that can be
|
|
35
|
-
* passed to {@link
|
|
35
|
+
* passed to {@link KeyVaultBackupClient.beginPreBackup}
|
|
36
|
+
*/
|
|
37
|
+
export interface KeyVaultBeginPreBackupOptions extends KeyVaultBackupPollerOptions {
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* An interface representing the optional parameters that can be
|
|
41
|
+
* passed to {@link KeyVaultBackupClient.beginBackup}
|
|
36
42
|
*/
|
|
37
43
|
export interface KeyVaultBeginBackupOptions extends KeyVaultBackupPollerOptions {
|
|
38
44
|
}
|
|
39
45
|
/**
|
|
40
46
|
* An interface representing the optional parameters that can be
|
|
41
|
-
* passed to {@link beginRestore}
|
|
47
|
+
* passed to {@link KeyVaultBackupClient.beginRestore}
|
|
42
48
|
*/
|
|
43
49
|
export interface KeyVaultBeginRestoreOptions extends KeyVaultBackupPollerOptions {
|
|
44
50
|
}
|
|
45
51
|
/**
|
|
46
52
|
* An interface representing the optional parameters that can be
|
|
47
|
-
* passed to {@link
|
|
53
|
+
* passed to {@link KeyVaultBackupClient.beginPreRestore}
|
|
54
|
+
*/
|
|
55
|
+
export interface KeyVaultBeginPreRestoreOptions extends KeyVaultBackupPollerOptions {
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* An interface representing the optional parameters that can be
|
|
59
|
+
* passed to {@link KeyVaultBackupClient.beginSelectiveKeyRestore}
|
|
48
60
|
*/
|
|
49
61
|
export interface KeyVaultBeginSelectiveKeyRestoreOptions extends KeyVaultBackupPollerOptions {
|
|
50
62
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backupClientModels.d.ts","sourceRoot":"","sources":["../../src/backupClientModels.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC/E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"backupClientModels.d.ts","sourceRoot":"","sources":["../../src/backupClientModels.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC/E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAG7D,YAAY,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D;;GAEG;AACH,MAAM,WAAW,2BAA4B,SAAQ,aAAa;IAChE;;OAEG;IACH,cAAc,CAAC,EAAE,sBAAsB,CAAC;IAExC;;;OAGG;IACH,oCAAoC,CAAC,EAAE,OAAO,CAAC;CAChD;AAED;;;GAGG;AACH,MAAM,WAAW,2BAA4B,SAAQ,gBAAgB;IACnE;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,WAAW,6BAA8B,SAAQ,2BAA2B;CAAG;AAErF;;;GAGG;AACH,MAAM,WAAW,0BAA2B,SAAQ,2BAA2B;CAAG;AAElF;;;GAGG;AACH,MAAM,WAAW,2BAA4B,SAAQ,2BAA2B;CAAG;AAEnF;;;GAGG;AACH,MAAM,WAAW,8BAA+B,SAAQ,2BAA2B;CAAG;AAEtF;;;GAGG;AACH,MAAM,WAAW,uCAAwC,SAAQ,2BAA2B;CAAG;AAE/F;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,SAAS,CAAC,EAAE,IAAI,CAAC;IAEjB;;OAEG;IACH,OAAO,CAAC,EAAE,IAAI,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,SAAS,CAAC,EAAE,IAAI,CAAC;IAEjB;;OAEG;IACH,OAAO,CAAC,EAAE,IAAI,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,iCAAiC;IAChD;;OAEG;IACH,SAAS,CAAC,EAAE,IAAI,CAAC;IAEjB;;OAEG;IACH,OAAO,CAAC,EAAE,IAAI,CAAC;CAChB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backupClientModels.js","sourceRoot":"","sources":["../../src/backupClientModels.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { ClientOptions, OperationOptions } from \"@azure-rest/core-client\";\nimport type { SUPPORTED_API_VERSIONS } from \"./constants.js\";\n\nexport type { PollerLike } from \"./lro/shim.js\";\nexport type { OperationStatus } from \"./generated/index.js\";\n\n/**\n * The optional parameters accepted by the KeyVaultBackupClient\n */\nexport interface KeyVaultBackupClientOptions extends ClientOptions {\n /**\n * The accepted versions of the Key Vault's service API.\n */\n serviceVersion?: SUPPORTED_API_VERSIONS;\n\n /**\n * Whether to disable verification that the authentication challenge resource matches the Key Vault or Managed HSM domain.\n * Defaults to false.\n */\n disableChallengeResourceVerification?: boolean;\n}\n\n/**\n * An interface representing the optional parameters that can be\n * passed to {@link beginBackup}\n */\nexport interface KeyVaultBackupPollerOptions extends OperationOptions {\n /**\n * Time between each polling\n */\n intervalInMs?: number;\n /**\n * A serialized poller, used to resume an existing operation\n */\n resumeFrom?: string;\n}\n\n/**\n * An interface representing the optional parameters that can be\n * passed to {@link beginBackup}\n */\nexport interface KeyVaultBeginBackupOptions extends KeyVaultBackupPollerOptions {}\n\n/**\n * An interface representing the optional parameters that can be\n * passed to {@link beginRestore}\n */\nexport interface KeyVaultBeginRestoreOptions extends KeyVaultBackupPollerOptions {}\n\n/**\n * An interface representing the optional parameters that can be\n * passed to {@link beginSelectiveKeyRestore}\n */\nexport interface KeyVaultBeginSelectiveKeyRestoreOptions extends KeyVaultBackupPollerOptions {}\n\n/**\n * An interface representing the result of a backup operation.\n */\nexport interface KeyVaultBackupResult {\n /**\n * The location of the full backup.\n */\n folderUri?: string;\n\n /**\n * The start time of the backup operation.\n */\n startTime?: Date;\n\n /**\n * The end time of the backup operation.\n */\n endTime?: Date;\n}\n\n/**\n * An interface representing the result of a restore operation.\n */\nexport interface KeyVaultRestoreResult {\n /**\n * The start time of the restore operation.\n */\n startTime?: Date;\n\n /**\n * The end time of the restore operation.\n */\n endTime?: Date;\n}\n\n/**\n * An interface representing the result of a selective key restore operation.\n */\nexport interface KeyVaultSelectiveKeyRestoreResult {\n /**\n * The start time of the selective key restore operation.\n */\n startTime?: Date;\n\n /**\n * The end time of the selective key restore operation.\n */\n endTime?: Date;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"backupClientModels.js","sourceRoot":"","sources":["../../src/backupClientModels.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { ClientOptions, OperationOptions } from \"@azure-rest/core-client\";\nimport type { SUPPORTED_API_VERSIONS } from \"./constants.js\";\nimport { KeyVaultBackupClient } from \"./backupClient.js\";\n\nexport type { PollerLike } from \"./lro/shim.js\";\nexport type { OperationStatus } from \"./generated/index.js\";\n\n/**\n * The optional parameters accepted by the KeyVaultBackupClient\n */\nexport interface KeyVaultBackupClientOptions extends ClientOptions {\n /**\n * The accepted versions of the Key Vault's service API.\n */\n serviceVersion?: SUPPORTED_API_VERSIONS;\n\n /**\n * Whether to disable verification that the authentication challenge resource matches the Key Vault or Managed HSM domain.\n * Defaults to false.\n */\n disableChallengeResourceVerification?: boolean;\n}\n\n/**\n * An interface representing the optional parameters that can be\n * passed to {@link beginBackup}\n */\nexport interface KeyVaultBackupPollerOptions extends OperationOptions {\n /**\n * Time between each polling\n */\n intervalInMs?: number;\n /**\n * A serialized poller, used to resume an existing operation\n */\n resumeFrom?: string;\n}\n\n/**\n * An interface representing the optional parameters that can be\n * passed to {@link KeyVaultBackupClient.beginPreBackup}\n */\nexport interface KeyVaultBeginPreBackupOptions extends KeyVaultBackupPollerOptions {}\n\n/**\n * An interface representing the optional parameters that can be\n * passed to {@link KeyVaultBackupClient.beginBackup}\n */\nexport interface KeyVaultBeginBackupOptions extends KeyVaultBackupPollerOptions {}\n\n/**\n * An interface representing the optional parameters that can be\n * passed to {@link KeyVaultBackupClient.beginRestore}\n */\nexport interface KeyVaultBeginRestoreOptions extends KeyVaultBackupPollerOptions {}\n\n/**\n * An interface representing the optional parameters that can be\n * passed to {@link KeyVaultBackupClient.beginPreRestore}\n */\nexport interface KeyVaultBeginPreRestoreOptions extends KeyVaultBackupPollerOptions {}\n\n/**\n * An interface representing the optional parameters that can be\n * passed to {@link KeyVaultBackupClient.beginSelectiveKeyRestore}\n */\nexport interface KeyVaultBeginSelectiveKeyRestoreOptions extends KeyVaultBackupPollerOptions {}\n\n/**\n * An interface representing the result of a backup operation.\n */\nexport interface KeyVaultBackupResult {\n /**\n * The location of the full backup.\n */\n folderUri?: string;\n\n /**\n * The start time of the backup operation.\n */\n startTime?: Date;\n\n /**\n * The end time of the backup operation.\n */\n endTime?: Date;\n}\n\n/**\n * An interface representing the result of a restore operation.\n */\nexport interface KeyVaultRestoreResult {\n /**\n * The start time of the restore operation.\n */\n startTime?: Date;\n\n /**\n * The end time of the restore operation.\n */\n endTime?: Date;\n}\n\n/**\n * An interface representing the result of a selective key restore operation.\n */\nexport interface KeyVaultSelectiveKeyRestoreResult {\n /**\n * The start time of the selective key restore operation.\n */\n startTime?: Date;\n\n /**\n * The end time of the selective key restore operation.\n */\n endTime?: Date;\n}\n"]}
|
package/dist/esm/constants.d.ts
CHANGED
|
@@ -5,9 +5,9 @@ export declare const SDK_VERSION: string;
|
|
|
5
5
|
/**
|
|
6
6
|
* The latest supported Key Vault service API version.
|
|
7
7
|
*/
|
|
8
|
-
export declare const LATEST_API_VERSION = "7.
|
|
8
|
+
export declare const LATEST_API_VERSION = "7.6-preview.2";
|
|
9
9
|
/**
|
|
10
10
|
* Supported API versions
|
|
11
11
|
*/
|
|
12
|
-
export type SUPPORTED_API_VERSIONS = "7.2" | "7.3" | "7.4" | "7.5";
|
|
12
|
+
export type SUPPORTED_API_VERSIONS = "7.2" | "7.3" | "7.4" | "7.5" | "7.6-preview.2";
|
|
13
13
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,MAAuB,CAAC;AAElD;;GAEG;AACH,eAAO,MAAM,kBAAkB,kBAAkB,CAAC;AAElD;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,eAAe,CAAC"}
|