From ec7cec421bdc55b65052cfa81f5e4b617011b041 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 15 May 2023 18:12:10 +0000 Subject: [PATCH] CodeGen from PR 23968 in Azure/azure-rest-api-specs Merge 2c1dd6b77062f20101970a62c3ef8a19c236f529 into 9c911b64dbdf410dbd143e625329c03f5a503536 --- common/config/rush/pnpm-lock.yaml | 64 +-- .../arm-dataprotection/CHANGELOG.md | 80 ++- .../arm-dataprotection/README.md | 2 +- .../arm-dataprotection/_meta.json | 10 +- .../arm-dataprotection/package.json | 16 +- .../review/arm-dataprotection.api.md | 304 +++++++++++ .../src/dataProtectionClient.ts | 30 +- .../arm-dataprotection/src/models/index.ts | 383 ++++++++++++-- .../arm-dataprotection/src/models/mappers.ts | 470 +++++++++++++++++- .../src/models/parameters.ts | 84 +++- .../src/operations/backupInstances.ts | 268 +++++++++- .../backupInstancesExtensionRouting.ts | 161 ++++++ .../src/operations/crossRegionRestoreJob.ts | 76 +++ .../src/operations/crossRegionRestoreJobs.ts | 217 ++++++++ .../src/operations/dppResourceGuardProxy.ts | 390 +++++++++++++++ .../src/operations/index.ts | 5 + .../src/operations/resourceGuards.ts | 4 +- .../src/operations/restorableTimeRanges.ts | 2 +- .../src/operations/secondaryRPs.ts | 225 +++++++++ .../operationsInterfaces/backupInstances.ts | 64 +++ .../backupInstancesExtensionRouting.ts | 27 + .../crossRegionRestoreJob.ts | 29 ++ .../crossRegionRestoreJobs.ts | 31 ++ .../dppResourceGuardProxy.ts | 94 ++++ .../src/operationsInterfaces/index.ts | 5 + .../src/operationsInterfaces/secondaryRPs.ts | 33 ++ .../arm-dataprotection/test/sampleTest.ts | 43 ++ .../arm-dataprotection/tsconfig.json | 10 +- 28 files changed, 2987 insertions(+), 140 deletions(-) create mode 100644 sdk/dataprotection/arm-dataprotection/src/operations/backupInstancesExtensionRouting.ts create mode 100644 sdk/dataprotection/arm-dataprotection/src/operations/crossRegionRestoreJob.ts create mode 100644 sdk/dataprotection/arm-dataprotection/src/operations/crossRegionRestoreJobs.ts create mode 100644 sdk/dataprotection/arm-dataprotection/src/operations/dppResourceGuardProxy.ts create mode 100644 sdk/dataprotection/arm-dataprotection/src/operations/secondaryRPs.ts create mode 100644 sdk/dataprotection/arm-dataprotection/src/operationsInterfaces/backupInstancesExtensionRouting.ts create mode 100644 sdk/dataprotection/arm-dataprotection/src/operationsInterfaces/crossRegionRestoreJob.ts create mode 100644 sdk/dataprotection/arm-dataprotection/src/operationsInterfaces/crossRegionRestoreJobs.ts create mode 100644 sdk/dataprotection/arm-dataprotection/src/operationsInterfaces/dppResourceGuardProxy.ts create mode 100644 sdk/dataprotection/arm-dataprotection/src/operationsInterfaces/secondaryRPs.ts create mode 100644 sdk/dataprotection/arm-dataprotection/test/sampleTest.ts diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index a0121f606644..d05259154b84 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -2188,7 +2188,7 @@ packages: resolution: {integrity: sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==} dependencies: '@types/connect': 3.4.35 - '@types/node': 14.18.46 + '@types/node': 16.18.28 dev: false /@types/chai-as-promised/7.1.5: @@ -2210,7 +2210,7 @@ packages: /@types/connect/3.4.35: resolution: {integrity: sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==} dependencies: - '@types/node': 14.18.46 + '@types/node': 16.18.28 dev: false /@types/cookie/0.4.1: @@ -2220,7 +2220,7 @@ packages: /@types/cors/2.8.13: resolution: {integrity: sha512-RG8AStHlUiV5ysZQKq97copd2UmVYw3/pRMLefISZ3S1hK104Cwm7iLQ3fTKx+lsUH2CE8FlLaYeEA2LSeqYUA==} dependencies: - '@types/node': 14.18.46 + '@types/node': 16.18.28 dev: false /@types/debug/4.1.7: @@ -2232,7 +2232,7 @@ packages: /@types/decompress/4.2.4: resolution: {integrity: sha512-/C8kTMRTNiNuWGl5nEyKbPiMv6HA+0RbEXzFhFBEzASM6+oa4tJro9b8nj7eRlOFfuLdzUU+DS/GPDlvvzMOhA==} dependencies: - '@types/node': 14.18.46 + '@types/node': 16.18.28 dev: false /@types/eslint/8.4.10: @@ -2253,7 +2253,7 @@ packages: /@types/express-serve-static-core/4.17.34: resolution: {integrity: sha512-fvr49XlCGoUj2Pp730AItckfjat4WNb0lb3kfrLWffd+RLeoGAMsq7UOy04PAPtoL01uKwcp6u8nhzpgpDYr3w==} dependencies: - '@types/node': 14.18.46 + '@types/node': 16.18.28 '@types/qs': 6.9.7 '@types/range-parser': 1.2.4 '@types/send': 0.17.1 @@ -2271,13 +2271,13 @@ packages: /@types/fs-extra/8.1.2: resolution: {integrity: sha512-SvSrYXfWSc7R4eqnOzbQF4TZmfpNSM9FrSWLU3EUnWBuyZqNBOrv1B1JA3byUDPUl9z4Ab3jeZG2eDdySlgNMg==} dependencies: - '@types/node': 14.18.46 + '@types/node': 16.18.28 dev: false /@types/fs-extra/9.0.13: resolution: {integrity: sha512-nEnwB++1u5lVDM2UI4c1+5R+FYaKfaAzS4OococimjVm3nQw3TuzH5UNsocrcTBbhnerblyHj4A49qXbIiZdpA==} dependencies: - '@types/node': 14.18.46 + '@types/node': 16.18.28 dev: false /@types/inquirer/8.2.6: @@ -2290,7 +2290,7 @@ packages: /@types/is-buffer/2.0.0: resolution: {integrity: sha512-0f7N/e3BAz32qDYvgB4d2cqv1DqUwvGxHkXsrucICn8la1Vb6Yl6Eg8mPScGwUiqHJeE7diXlzaK+QMA9m4Gxw==} dependencies: - '@types/node': 14.18.46 + '@types/node': 16.18.28 dev: false /@types/json-schema/7.0.11: @@ -2304,13 +2304,13 @@ packages: /@types/jsonwebtoken/9.0.2: resolution: {integrity: sha512-drE6uz7QBKq1fYqqoFKTDRdFCPHd5TCub75BM+D+cMx7NU9hUz7SESLfC2fSCXVFMO5Yj8sOWHuGqPgjc+fz0Q==} dependencies: - '@types/node': 14.18.46 + '@types/node': 16.18.28 dev: false /@types/jws/3.2.5: resolution: {integrity: sha512-xGTxZH34xOryaTN8CMsvhh9lfNqFuHiMoRvsLYWQdBJHqiECyfInXVl2eK8Jz2emxZWMIn5RBlmr3oDVPeWujw==} dependencies: - '@types/node': 14.18.46 + '@types/node': 16.18.28 dev: false /@types/linkify-it/3.0.2: @@ -2361,13 +2361,13 @@ packages: /@types/mysql/2.15.19: resolution: {integrity: sha512-wSRg2QZv14CWcZXkgdvHbbV2ACufNy5EgI8mBBxnJIptchv7DBy/h53VMa2jDhyo0C9MO4iowE6z9vF8Ja1DkQ==} dependencies: - '@types/node': 14.18.46 + '@types/node': 16.18.28 dev: false /@types/node-fetch/2.6.3: resolution: {integrity: sha512-ETTL1mOEdq/sxUtgtOhKjyB2Irra4cjxksvcMUR5Zr4n+PxVhsCD9WS46oPbHL3et9Zde7CNRr+WUNlcHvsX+w==} dependencies: - '@types/node': 14.18.46 + '@types/node': 16.18.28 form-data: 3.0.1 dev: false @@ -2392,7 +2392,7 @@ packages: /@types/pg/8.6.1: resolution: {integrity: sha512-1Kc4oAGzAl7uqUStZCDvaLFqZrW9qWSjXOmBfdgyBP5La7Us6Mg4GBvRlSoaZMhQF/zSj1C8CtKMBkoiT8eL8w==} dependencies: - '@types/node': 14.18.46 + '@types/node': 16.18.28 pg-protocol: 1.6.0 pg-types: 2.2.0 dev: false @@ -2420,7 +2420,7 @@ packages: /@types/resolve/1.17.1: resolution: {integrity: sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==} dependencies: - '@types/node': 14.18.46 + '@types/node': 16.18.28 dev: false /@types/semaphore/1.1.1: @@ -2439,14 +2439,14 @@ packages: resolution: {integrity: sha512-Cwo8LE/0rnvX7kIIa3QHCkcuF21c05Ayb0ZfxPiv0W8VRiZiNW/WuRupHKpqqGVGf7SUA44QSOUKaEd9lIrd/Q==} dependencies: '@types/mime': 1.3.2 - '@types/node': 14.18.46 + '@types/node': 16.18.28 dev: false /@types/serve-static/1.15.1: resolution: {integrity: sha512-NUo5XNiAdULrJENtJXZZ3fHtfMolzZwczzBbnAeBbqBwG+LaG6YaJtuwzwGSQZ2wsCrxjEhNNjAkKigy3n8teQ==} dependencies: '@types/mime': 3.0.1 - '@types/node': 14.18.46 + '@types/node': 16.18.28 dev: false /@types/sinon/10.0.14: @@ -2468,13 +2468,13 @@ packages: /@types/stoppable/1.1.1: resolution: {integrity: sha512-b8N+fCADRIYYrGZOcmOR8ZNBOqhktWTB/bMUl5LvGtT201QKJZOOH5UsFyI3qtteM6ZAJbJqZoBcLqqxKIwjhw==} dependencies: - '@types/node': 14.18.46 + '@types/node': 16.18.28 dev: false /@types/through/0.0.30: resolution: {integrity: sha512-FvnCJljyxhPM3gkRgWmxmDZyAQSiBQQWLI0A0VFL0K7W1oRUrPJSqNO0NvTnLkBcotdlp3lKvaT0JrnyRDkzOg==} dependencies: - '@types/node': 14.18.46 + '@types/node': 16.18.28 dev: false /@types/tough-cookie/4.0.2: @@ -2488,7 +2488,7 @@ packages: /@types/tunnel/0.0.3: resolution: {integrity: sha512-sOUTGn6h1SfQ+gbgqC364jLFBw2lnFqkgF3q0WovEHRLMrVD1sd5aufqi/aJObLekJO+Aq5z646U4Oxy6shXMA==} dependencies: - '@types/node': 14.18.46 + '@types/node': 16.18.28 dev: false /@types/underscore/1.11.4: @@ -2506,19 +2506,19 @@ packages: /@types/ws/7.4.7: resolution: {integrity: sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==} dependencies: - '@types/node': 14.18.46 + '@types/node': 16.18.28 dev: false /@types/ws/8.5.4: resolution: {integrity: sha512-zdQDHKUgcX/zBc4GrwsE/7dVdAD8JR4EuiAXiiUhhfyIJXXb2+PrGshFyeXWQPMmmZ2XxgaqclgpIC7eTXc1mg==} dependencies: - '@types/node': 14.18.46 + '@types/node': 16.18.28 dev: false /@types/xml2js/0.4.11: resolution: {integrity: sha512-JdigeAKmCyoJUiQljjr7tQG3if9NkqGUgwEUqBvV0N7LM4HyQk7UXCnusRa1lnvXAEYJ8mw8GtZWioagNztOwA==} dependencies: - '@types/node': 14.18.46 + '@types/node': 16.18.28 dev: false /@types/yargs-parser/21.0.0: @@ -2535,7 +2535,7 @@ packages: resolution: {integrity: sha512-Cn6WYCm0tXv8p6k+A8PvbDG763EDpBoTzHdA+Q/MF6H3sapGjCm9NzoaJncJS9tUKSuCoDs9XHxYYsQDgxR6kw==} requiresBuild: true dependencies: - '@types/node': 14.18.46 + '@types/node': 16.18.28 dev: false optional: true @@ -3540,7 +3540,7 @@ packages: resolution: {integrity: sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==} deprecated: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797) dependencies: - ms: 2.1.1 + ms: 2.1.3 dev: false /debug/3.2.7: @@ -3771,7 +3771,7 @@ packages: dependencies: semver: 7.5.0 shelljs: 0.8.5 - typescript: 5.1.0-dev.20230511 + typescript: 5.1.0-dev.20230515 dev: false /ecdsa-sig-formatter/1.0.11: @@ -3822,7 +3822,7 @@ packages: dependencies: '@types/cookie': 0.4.1 '@types/cors': 2.8.13 - '@types/node': 14.18.46 + '@types/node': 16.18.28 accepts: 1.3.8 base64id: 2.0.0 cookie: 0.4.2 @@ -4746,7 +4746,7 @@ packages: fs.realpath: 1.0.0 inflight: 1.0.6 inherits: 2.0.4 - minimatch: 3.0.4 + minimatch: 3.1.2 once: 1.4.0 path-is-absolute: 1.0.1 dev: false @@ -7043,7 +7043,7 @@ packages: '@protobufjs/path': 1.1.2 '@protobufjs/pool': 1.1.0 '@protobufjs/utf8': 1.1.0 - '@types/node': 14.18.46 + '@types/node': 16.18.28 long: 5.2.3 dev: false @@ -8315,8 +8315,8 @@ packages: hasBin: true dev: false - /typescript/5.1.0-dev.20230511: - resolution: {integrity: sha512-T/GsNgbl4YWUZwSxCrj9uq2aIj7OC/5EyXqj4exIhRbwZEpjPIflv2TEqm6K5fFQhqKQpFATE8OBvY0Qzu8D1A==} + /typescript/5.1.0-dev.20230515: + resolution: {integrity: sha512-yn0MGsy6U0QAVF+lXW6LPupQmuRsyA0xUJetqw2tDqa+49231BpkhTuY6oEwLsc98tiEzCfIw7hzbLsiwVGFaA==} engines: {node: '>=14.17'} hasBin: true dev: false @@ -11089,7 +11089,7 @@ packages: dev: false file:projects/arm-dataprotection.tgz: - resolution: {integrity: sha512-Raa9ZW+0jmFsV4YQ2n0/6f105zjulDnWFUdbWyGNztFDsGECYxjevMqeDB+zImzXbS8ENyzukafHp8mNQXG78w==, tarball: file:projects/arm-dataprotection.tgz} + resolution: {integrity: sha512-6ASaD3dWrrnkoByh3razzXZZil9jqumStplVfo0c1znW0bHQeG0NfR2Z5NB3FHnLdblAObQRtJpxA56kO0IusA==, tarball: file:projects/arm-dataprotection.tgz} name: '@rush-temp/arm-dataprotection' version: 0.0.0 dependencies: @@ -11110,7 +11110,7 @@ packages: rollup: 2.79.1 rollup-plugin-sourcemaps: 0.6.3_m742s5qpci6ulntpyriekwplh4 tslib: 2.5.0 - typescript: 5.0.4 + typescript: 4.8.4 uglify-js: 3.17.4 transitivePeerDependencies: - supports-color diff --git a/sdk/dataprotection/arm-dataprotection/CHANGELOG.md b/sdk/dataprotection/arm-dataprotection/CHANGELOG.md index 9b19ccb98523..bd7e47b60a7f 100644 --- a/sdk/dataprotection/arm-dataprotection/CHANGELOG.md +++ b/sdk/dataprotection/arm-dataprotection/CHANGELOG.md @@ -1,15 +1,75 @@ # Release History + +## 1.1.0-beta.1 (2023-05-15) + +**Features** -## 1.0.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - + - Added operation group BackupInstancesExtensionRouting + - Added operation group CrossRegionRestoreJob + - Added operation group CrossRegionRestoreJobs + - Added operation group DppResourceGuardProxy + - Added operation group SecondaryRPs + - Added operation BackupInstances.beginTriggerCrossRegionRestore + - Added operation BackupInstances.beginTriggerCrossRegionRestoreAndWait + - Added operation BackupInstances.beginValidateCrossRegionRestore + - Added operation BackupInstances.beginValidateCrossRegionRestoreAndWait + - Added Interface BackupInstancesExtensionRoutingListNextOptionalParams + - Added Interface BackupInstancesExtensionRoutingListOptionalParams + - Added Interface BackupInstancesTriggerCrossRegionRestoreHeaders + - Added Interface BackupInstancesTriggerCrossRegionRestoreOptionalParams + - Added Interface BackupInstancesValidateCrossRegionRestoreHeaders + - Added Interface BackupInstancesValidateCrossRegionRestoreOptionalParams + - Added Interface CrossRegionRestoreDetails + - Added Interface CrossRegionRestoreJobGetOptionalParams + - Added Interface CrossRegionRestoreJobRequest + - Added Interface CrossRegionRestoreJobsListNextOptionalParams + - Added Interface CrossRegionRestoreJobsListOptionalParams + - Added Interface CrossRegionRestoreJobsRequest + - Added Interface CrossRegionRestoreRequestObject + - Added Interface CrossRegionRestoreSettings + - Added Interface DppResourceGuardProxyCreateOrUpdateOptionalParams + - Added Interface DppResourceGuardProxyDeleteOptionalParams + - Added Interface DppResourceGuardProxyGetOptionalParams + - Added Interface DppResourceGuardProxyListNextOptionalParams + - Added Interface DppResourceGuardProxyListOptionalParams + - Added Interface DppResourceGuardProxyUnlockDeleteOptionalParams + - Added Interface FetchSecondaryRPsRequestParameters + - Added Interface IdentityDetails + - Added Interface ResourceGuardOperationDetail + - Added Interface ResourceGuardProxyBase + - Added Interface ResourceGuardProxyBaseResource + - Added Interface ResourceGuardProxyBaseResourceList + - Added Interface SecondaryRPsFetchNextOptionalParams + - Added Interface SecondaryRPsFetchOptionalParams + - Added Interface UnlockDeleteRequest + - Added Interface UnlockDeleteResponse + - Added Interface UserAssignedIdentityDetails + - Added Interface ValidateCrossRegionRestoreRequestObject + - Added Type Alias BackupInstancesExtensionRoutingListNextResponse + - Added Type Alias BackupInstancesExtensionRoutingListResponse + - Added Type Alias BackupInstancesTriggerCrossRegionRestoreResponse + - Added Type Alias BackupInstancesValidateCrossRegionRestoreResponse + - Added Type Alias CrossRegionRestoreJobGetResponse + - Added Type Alias CrossRegionRestoreJobsListNextResponse + - Added Type Alias CrossRegionRestoreJobsListResponse + - Added Type Alias CrossRegionRestoreState + - Added Type Alias DppResourceGuardProxyCreateOrUpdateResponse + - Added Type Alias DppResourceGuardProxyGetResponse + - Added Type Alias DppResourceGuardProxyListNextResponse + - Added Type Alias DppResourceGuardProxyListResponse + - Added Type Alias DppResourceGuardProxyUnlockDeleteResponse + - Added Type Alias SecondaryRPsFetchNextResponse + - Added Type Alias SecondaryRPsFetchResponse + - Added Type Alias SecureScoreLevel + - Interface AzureBackupRestoreRequest has a new optional parameter identityDetails + - Interface BackupInstance has a new optional parameter identityDetails + - Interface BackupVault has a new optional parameter secureScore + - Interface DppIdentityDetails has a new optional parameter userAssignedIdentities + - Interface FeatureSettings has a new optional parameter crossRegionRestoreSettings + - Added Enum KnownCrossRegionRestoreState + - Added Enum KnownSecureScoreLevel + + ## 1.0.0 (2023-03-08) The package of @azure/arm-dataprotection is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart). diff --git a/sdk/dataprotection/arm-dataprotection/README.md b/sdk/dataprotection/arm-dataprotection/README.md index b96d59c2cadd..b8dfaf89280d 100644 --- a/sdk/dataprotection/arm-dataprotection/README.md +++ b/sdk/dataprotection/arm-dataprotection/README.md @@ -6,7 +6,7 @@ Open API 2.0 Specs for Azure Data Protection service [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/dataprotection/arm-dataprotection) | [Package (NPM)](https://www.npmjs.com/package/@azure/arm-dataprotection) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-dataprotection) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-dataprotection?view=azure-node-preview) | [Samples](https://github.com/Azure-Samples/azure-samples-js-management) ## Getting started diff --git a/sdk/dataprotection/arm-dataprotection/_meta.json b/sdk/dataprotection/arm-dataprotection/_meta.json index 9b18dddf8453..7df5a55d8db4 100644 --- a/sdk/dataprotection/arm-dataprotection/_meta.json +++ b/sdk/dataprotection/arm-dataprotection/_meta.json @@ -1,8 +1,8 @@ { - "commit": "d66735f5dc80731ee5c7a31399c2a46f8743153a", - "readme": "specification\\dataprotection\\resource-manager\\readme.md", - "autorest_command": "autorest --version=3.9.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\dataprotection\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.9 --generate-sample=true", + "commit": "724d25ed1b226d8f85f13e43a2e457d8e32f2daa", + "readme": "specification/dataprotection/resource-manager/readme.md", + "autorest_command": "autorest --version=3.9.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/dataprotection/resource-manager/readme.md --use=@autorest/typescript@6.0.0-rc.10", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.6.2", - "use": "@autorest/typescript@6.0.0-rc.9" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.0", + "use": "@autorest/typescript@6.0.0-rc.10" } \ No newline at end of file diff --git a/sdk/dataprotection/arm-dataprotection/package.json b/sdk/dataprotection/arm-dataprotection/package.json index fc4827f8636a..e644ac7b9a5a 100644 --- a/sdk/dataprotection/arm-dataprotection/package.json +++ b/sdk/dataprotection/arm-dataprotection/package.json @@ -3,7 +3,7 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for DataProtectionClient.", - "version": "1.0.1", + "version": "1.1.0-beta.1", "engines": { "node": ">=14.0.0" }, @@ -36,7 +36,7 @@ "mkdirp": "^2.1.2", "rollup": "^2.66.1", "rollup-plugin-sourcemaps": "^0.6.3", - "typescript": "~5.0.0", + "typescript": "~4.8.0", "uglify-js": "^3.4.9", "rimraf": "^3.0.0", "dotenv": "^16.0.0", @@ -111,13 +111,5 @@ ] }, "autoPublish": true, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/dataprotection/arm-dataprotection", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-dataprotection?view=azure-node-preview" - } -} + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/dataprotection/arm-dataprotection" +} \ No newline at end of file diff --git a/sdk/dataprotection/arm-dataprotection/review/arm-dataprotection.api.md b/sdk/dataprotection/arm-dataprotection/review/arm-dataprotection.api.md index 93252002517f..e4123073a78a 100644 --- a/sdk/dataprotection/arm-dataprotection/review/arm-dataprotection.api.md +++ b/sdk/dataprotection/arm-dataprotection/review/arm-dataprotection.api.md @@ -197,6 +197,7 @@ export interface AzureBackupRehydrationRequest { // @public export interface AzureBackupRestoreRequest { + identityDetails?: IdentityDetails; objectType: "AzureBackupRecoveryPointBasedRestoreRequest" | "AzureBackupRestoreWithRehydrationRequest" | "AzureBackupRecoveryTimeBasedRestoreRequest"; restoreTargetInfo: RestoreTargetInfoBaseUnion; sourceDataStoreType: SourceDataStoreType; @@ -265,6 +266,7 @@ export interface BackupInstance { dataSourceInfo: Datasource; dataSourceSetInfo?: DatasourceSet; friendlyName?: string; + identityDetails?: IdentityDetails; // (undocumented) objectType: string; policyInfo: PolicyInfo; @@ -302,10 +304,18 @@ export interface BackupInstances { beginSuspendBackupsAndWait(resourceGroupName: string, vaultName: string, backupInstanceName: string, options?: BackupInstancesSuspendBackupsOptionalParams): Promise; beginSyncBackupInstance(resourceGroupName: string, vaultName: string, backupInstanceName: string, parameters: SyncBackupInstanceRequest, options?: BackupInstancesSyncBackupInstanceOptionalParams): Promise, void>>; beginSyncBackupInstanceAndWait(resourceGroupName: string, vaultName: string, backupInstanceName: string, parameters: SyncBackupInstanceRequest, options?: BackupInstancesSyncBackupInstanceOptionalParams): Promise; + // (undocumented) + beginTriggerCrossRegionRestore(resourceGroupName: string, location: string, parameters: CrossRegionRestoreRequestObject, options?: BackupInstancesTriggerCrossRegionRestoreOptionalParams): Promise, BackupInstancesTriggerCrossRegionRestoreResponse>>; + // (undocumented) + beginTriggerCrossRegionRestoreAndWait(resourceGroupName: string, location: string, parameters: CrossRegionRestoreRequestObject, options?: BackupInstancesTriggerCrossRegionRestoreOptionalParams): Promise; beginTriggerRehydrate(resourceGroupName: string, vaultName: string, backupInstanceName: string, parameters: AzureBackupRehydrationRequest, options?: BackupInstancesTriggerRehydrateOptionalParams): Promise, BackupInstancesTriggerRehydrateResponse>>; beginTriggerRehydrateAndWait(resourceGroupName: string, vaultName: string, backupInstanceName: string, parameters: AzureBackupRehydrationRequest, options?: BackupInstancesTriggerRehydrateOptionalParams): Promise; beginTriggerRestore(resourceGroupName: string, vaultName: string, backupInstanceName: string, parameters: AzureBackupRestoreRequestUnion, options?: BackupInstancesTriggerRestoreOptionalParams): Promise, BackupInstancesTriggerRestoreResponse>>; beginTriggerRestoreAndWait(resourceGroupName: string, vaultName: string, backupInstanceName: string, parameters: AzureBackupRestoreRequestUnion, options?: BackupInstancesTriggerRestoreOptionalParams): Promise; + // (undocumented) + beginValidateCrossRegionRestore(resourceGroupName: string, location: string, parameters: ValidateCrossRegionRestoreRequestObject, options?: BackupInstancesValidateCrossRegionRestoreOptionalParams): Promise, BackupInstancesValidateCrossRegionRestoreResponse>>; + // (undocumented) + beginValidateCrossRegionRestoreAndWait(resourceGroupName: string, location: string, parameters: ValidateCrossRegionRestoreRequestObject, options?: BackupInstancesValidateCrossRegionRestoreOptionalParams): Promise; beginValidateForBackup(resourceGroupName: string, vaultName: string, parameters: ValidateForBackupRequest, options?: BackupInstancesValidateForBackupOptionalParams): Promise, BackupInstancesValidateForBackupResponse>>; beginValidateForBackupAndWait(resourceGroupName: string, vaultName: string, parameters: ValidateForBackupRequest, options?: BackupInstancesValidateForBackupOptionalParams): Promise; beginValidateForRestore(resourceGroupName: string, vaultName: string, backupInstanceName: string, parameters: ValidateRestoreRequestObject, options?: BackupInstancesValidateForRestoreOptionalParams): Promise, BackupInstancesValidateForRestoreResponse>>; @@ -359,6 +369,25 @@ export interface BackupInstancesDeleteOptionalParams extends coreClient.Operatio updateIntervalInMs?: number; } +// @public +export interface BackupInstancesExtensionRouting { + list(resourceId: string, options?: BackupInstancesExtensionRoutingListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface BackupInstancesExtensionRoutingListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type BackupInstancesExtensionRoutingListNextResponse = BackupInstanceResourceList; + +// @public +export interface BackupInstancesExtensionRoutingListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type BackupInstancesExtensionRoutingListResponse = BackupInstanceResourceList; + // @public export interface BackupInstancesGetBackupInstanceOperationResultOptionalParams extends coreClient.OperationOptions { } @@ -452,6 +481,22 @@ export interface BackupInstancesSyncBackupInstanceOptionalParams extends coreCli updateIntervalInMs?: number; } +// @public +export interface BackupInstancesTriggerCrossRegionRestoreHeaders { + azureAsyncOperation?: string; + location?: string; + retryAfter?: number; +} + +// @public +export interface BackupInstancesTriggerCrossRegionRestoreOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type BackupInstancesTriggerCrossRegionRestoreResponse = OperationJobExtendedInfo; + // @public export interface BackupInstancesTriggerRehydrateHeaders { azureAsyncOperation?: string; @@ -484,6 +529,22 @@ export interface BackupInstancesTriggerRestoreOptionalParams extends coreClient. // @public export type BackupInstancesTriggerRestoreResponse = OperationJobExtendedInfo; +// @public +export interface BackupInstancesValidateCrossRegionRestoreHeaders { + azureAsyncOperation?: string; + location?: string; + retryAfter?: number; +} + +// @public +export interface BackupInstancesValidateCrossRegionRestoreOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type BackupInstancesValidateCrossRegionRestoreResponse = OperationJobExtendedInfo; + // @public export interface BackupInstancesValidateForBackupHeaders { azureAsyncOperation?: string; @@ -584,6 +645,7 @@ export interface BackupVault { readonly provisioningState?: ProvisioningState; readonly resourceMoveDetails?: ResourceMoveDetails; readonly resourceMoveState?: ResourceMoveState; + readonly secureScore?: SecureScoreLevel; securitySettings?: SecuritySettings; storageSettings: StorageSetting[]; } @@ -807,6 +869,79 @@ export type CopyOptionUnion = CopyOption | CopyOnExpiryOption | CustomCopyOption // @public export type CreatedByType = string; +// @public +export interface CrossRegionRestoreDetails { + // (undocumented) + sourceBackupInstanceId: string; + // (undocumented) + sourceRegion: string; +} + +// @public +export interface CrossRegionRestoreJob { + // (undocumented) + get(resourceGroupName: string, location: string, parameters: CrossRegionRestoreJobRequest, options?: CrossRegionRestoreJobGetOptionalParams): Promise; +} + +// @public +export interface CrossRegionRestoreJobGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CrossRegionRestoreJobGetResponse = AzureBackupJobResource; + +// @public (undocumented) +export interface CrossRegionRestoreJobRequest { + // (undocumented) + jobId: string; + // (undocumented) + sourceBackupVaultId: string; + // (undocumented) + sourceRegion: string; +} + +// @public +export interface CrossRegionRestoreJobs { + // (undocumented) + list(resourceGroupName: string, location: string, parameters: CrossRegionRestoreJobsRequest, options?: CrossRegionRestoreJobsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface CrossRegionRestoreJobsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CrossRegionRestoreJobsListNextResponse = AzureBackupJobResourceList; + +// @public +export interface CrossRegionRestoreJobsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CrossRegionRestoreJobsListResponse = AzureBackupJobResourceList; + +// @public (undocumented) +export interface CrossRegionRestoreJobsRequest { + // (undocumented) + sourceBackupVaultId: string; + // (undocumented) + sourceRegion: string; +} + +// @public +export interface CrossRegionRestoreRequestObject { + crossRegionRestoreDetails: CrossRegionRestoreDetails; + restoreRequestObject: AzureBackupRestoreRequestUnion; +} + +// @public (undocumented) +export interface CrossRegionRestoreSettings { + state?: CrossRegionRestoreState; +} + +// @public +export type CrossRegionRestoreState = string; + // @public export interface CrossSubscriptionRestoreSettings { state?: CrossSubscriptionRestoreState; @@ -846,18 +981,26 @@ export class DataProtectionClient extends coreClient.ServiceClient { // (undocumented) backupInstances: BackupInstances; // (undocumented) + backupInstancesExtensionRouting: BackupInstancesExtensionRouting; + // (undocumented) backupPolicies: BackupPolicies; // (undocumented) backupVaultOperationResults: BackupVaultOperationResults; // (undocumented) backupVaults: BackupVaults; // (undocumented) + crossRegionRestoreJob: CrossRegionRestoreJob; + // (undocumented) + crossRegionRestoreJobs: CrossRegionRestoreJobs; + // (undocumented) dataProtection: DataProtection; // (undocumented) dataProtectionOperations: DataProtectionOperations; // (undocumented) deletedBackupInstances: DeletedBackupInstances; // (undocumented) + dppResourceGuardProxy: DppResourceGuardProxy; + // (undocumented) exportJobs: ExportJobs; // (undocumented) exportJobsOperationResult: ExportJobsOperationResult; @@ -878,6 +1021,8 @@ export class DataProtectionClient extends coreClient.ServiceClient { // (undocumented) restorableTimeRanges: RestorableTimeRanges; // (undocumented) + secondaryRPs: SecondaryRPs; + // (undocumented) subscriptionId: string; } @@ -1056,6 +1201,9 @@ export interface DppIdentityDetails { readonly principalId?: string; readonly tenantId?: string; type?: string; + userAssignedIdentities?: { + [propertyName: string]: UserAssignedIdentityDetails; + }; } // @public (undocumented) @@ -1077,6 +1225,54 @@ export interface DppResource { readonly type?: string; } +// @public +export interface DppResourceGuardProxy { + createOrUpdate(resourceGroupName: string, vaultName: string, resourceGuardProxyName: string, parameters: ResourceGuardProxyBaseResource, options?: DppResourceGuardProxyCreateOrUpdateOptionalParams): Promise; + delete(resourceGroupName: string, vaultName: string, resourceGuardProxyName: string, options?: DppResourceGuardProxyDeleteOptionalParams): Promise; + get(resourceGroupName: string, vaultName: string, resourceGuardProxyName: string, options?: DppResourceGuardProxyGetOptionalParams): Promise; + list(resourceGroupName: string, vaultName: string, options?: DppResourceGuardProxyListOptionalParams): PagedAsyncIterableIterator; + unlockDelete(resourceGroupName: string, vaultName: string, resourceGuardProxyName: string, parameters: UnlockDeleteRequest, options?: DppResourceGuardProxyUnlockDeleteOptionalParams): Promise; +} + +// @public +export interface DppResourceGuardProxyCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DppResourceGuardProxyCreateOrUpdateResponse = ResourceGuardProxyBaseResource; + +// @public +export interface DppResourceGuardProxyDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface DppResourceGuardProxyGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DppResourceGuardProxyGetResponse = ResourceGuardProxyBaseResource; + +// @public +export interface DppResourceGuardProxyListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DppResourceGuardProxyListNextResponse = ResourceGuardProxyBaseResourceList; + +// @public +export interface DppResourceGuardProxyListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DppResourceGuardProxyListResponse = ResourceGuardProxyBaseResourceList; + +// @public +export interface DppResourceGuardProxyUnlockDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DppResourceGuardProxyUnlockDeleteResponse = UnlockDeleteResponse; + // @public export interface DppResourceList { nextLink?: string; @@ -1173,6 +1369,8 @@ export type ExportJobsTriggerResponse = ExportJobsTriggerHeaders; // @public export interface FeatureSettings { + // (undocumented) + crossRegionRestoreSettings?: CrossRegionRestoreSettings; crossSubscriptionRestoreSettings?: CrossSubscriptionRestoreSettings; } @@ -1212,9 +1410,21 @@ export interface FeatureValidationResponseBase { // @public (undocumented) export type FeatureValidationResponseBaseUnion = FeatureValidationResponseBase | FeatureValidationResponse; +// @public +export interface FetchSecondaryRPsRequestParameters { + sourceBackupInstanceId?: string; + sourceRegion?: string; +} + // @public export function getContinuationToken(page: unknown): string | undefined; +// @public (undocumented) +export interface IdentityDetails { + userAssignedIdentityArmUrl?: string; + useSystemAssignedIdentity?: boolean; +} + // @public export interface ImmediateCopyOption extends CopyOption { objectType: "ImmediateCopyOption"; @@ -1336,6 +1546,12 @@ export enum KnownCreatedByType { User = "User" } +// @public +export enum KnownCrossRegionRestoreState { + Disabled = "Disabled", + Enabled = "Enabled" +} + // @public export enum KnownCrossSubscriptionRestoreState { Disabled = "Disabled", @@ -1492,6 +1708,15 @@ export enum KnownSecretStoreType { Invalid = "Invalid" } +// @public +export enum KnownSecureScoreLevel { + Adequate = "Adequate", + Maximum = "Maximum", + Minimum = "Minimum", + None = "None", + NotSupported = "NotSupported" +} + // @public export enum KnownSoftDeleteState { AlwaysOn = "AlwaysOn", @@ -1828,6 +2053,36 @@ export interface ResourceGuardOperation { readonly vaultCriticalOperation?: string; } +// @public +export interface ResourceGuardOperationDetail { + // (undocumented) + defaultResourceRequest?: string; + // (undocumented) + vaultCriticalOperation?: string; +} + +// @public +export interface ResourceGuardProxyBase { + // (undocumented) + description?: string; + // (undocumented) + lastUpdatedTime?: string; + // (undocumented) + resourceGuardOperationDetails?: ResourceGuardOperationDetail[]; + // (undocumented) + resourceGuardResourceId?: string; +} + +// @public +export interface ResourceGuardProxyBaseResource extends DppResource { + properties?: ResourceGuardProxyBase; +} + +// @public +export interface ResourceGuardProxyBaseResourceList extends DppResourceList { + value?: ResourceGuardProxyBaseResource[]; +} + // @public (undocumented) export interface ResourceGuardResource extends DppBaseTrackedResource { properties?: ResourceGuard; @@ -2135,6 +2390,27 @@ export interface ScheduleBasedTriggerContext extends TriggerContext { taggingCriteria: TaggingCriteria[]; } +// @public +export interface SecondaryRPs { + listFetch(resourceGroupName: string, location: string, parameters: FetchSecondaryRPsRequestParameters, options?: SecondaryRPsFetchOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface SecondaryRPsFetchNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SecondaryRPsFetchNextResponse = AzureBackupRecoveryPointResourceList; + +// @public +export interface SecondaryRPsFetchOptionalParams extends coreClient.OperationOptions { + filter?: string; + skipToken?: string; +} + +// @public +export type SecondaryRPsFetchResponse = AzureBackupRecoveryPointResourceList; + // @public export interface SecretStoreBasedAuthCredentials extends AuthCredentials { objectType: "SecretStoreBasedAuthCredentials"; @@ -2151,6 +2427,9 @@ export interface SecretStoreResource { // @public export type SecretStoreType = string; +// @public +export type SecureScoreLevel = string; + // @public export interface SecuritySettings { immutabilitySettings?: ImmutabilitySettings; @@ -2252,6 +2531,25 @@ export interface TriggerContext { // @public (undocumented) export type TriggerContextUnion = TriggerContext | AdhocBasedTriggerContext | ScheduleBasedTriggerContext; +// @public +export interface UnlockDeleteRequest { + // (undocumented) + resourceGuardOperationRequests?: string[]; + // (undocumented) + resourceToBeDeleted?: string; +} + +// @public +export interface UnlockDeleteResponse { + unlockDeleteExpiryTime?: string; +} + +// @public +export interface UserAssignedIdentityDetails { + readonly clientId?: string; + readonly principalId?: string; +} + // @public export interface UserFacingError { code?: string; @@ -2268,6 +2566,12 @@ export interface UserFacingError { target?: string; } +// @public +export interface ValidateCrossRegionRestoreRequestObject { + crossRegionRestoreDetails: CrossRegionRestoreDetails; + restoreRequestObject: AzureBackupRestoreRequestUnion; +} + // @public export interface ValidateForBackupRequest { backupInstance: BackupInstance; diff --git a/sdk/dataprotection/arm-dataprotection/src/dataProtectionClient.ts b/sdk/dataprotection/arm-dataprotection/src/dataProtectionClient.ts index 4dc3aa569e81..2c81ca83cfc7 100644 --- a/sdk/dataprotection/arm-dataprotection/src/dataProtectionClient.ts +++ b/sdk/dataprotection/arm-dataprotection/src/dataProtectionClient.ts @@ -26,12 +26,17 @@ import { BackupPoliciesImpl, BackupInstancesImpl, RecoveryPointsImpl, + SecondaryRPsImpl, + CrossRegionRestoreJobImpl, + CrossRegionRestoreJobsImpl, + BackupInstancesExtensionRoutingImpl, JobsImpl, RestorableTimeRangesImpl, ExportJobsImpl, ExportJobsOperationResultImpl, DeletedBackupInstancesImpl, - ResourceGuardsImpl + ResourceGuardsImpl, + DppResourceGuardProxyImpl } from "./operations"; import { BackupVaults, @@ -45,12 +50,17 @@ import { BackupPolicies, BackupInstances, RecoveryPoints, + SecondaryRPs, + CrossRegionRestoreJob, + CrossRegionRestoreJobs, + BackupInstancesExtensionRouting, Jobs, RestorableTimeRanges, ExportJobs, ExportJobsOperationResult, DeletedBackupInstances, - ResourceGuards + ResourceGuards, + DppResourceGuardProxy } from "./operationsInterfaces"; import { DataProtectionClientOptionalParams } from "./models"; @@ -86,7 +96,7 @@ export class DataProtectionClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-dataprotection/1.0.1`; + const packageDetails = `azsdk-js-arm-dataprotection/1.1.0-beta.1`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -139,7 +149,7 @@ export class DataProtectionClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2023-01-01"; + this.apiVersion = options.apiVersion || "2023-04-01-preview"; this.backupVaults = new BackupVaultsImpl(this); this.operationResult = new OperationResultImpl(this); this.operationStatus = new OperationStatusImpl(this); @@ -157,12 +167,19 @@ export class DataProtectionClient extends coreClient.ServiceClient { this.backupPolicies = new BackupPoliciesImpl(this); this.backupInstances = new BackupInstancesImpl(this); this.recoveryPoints = new RecoveryPointsImpl(this); + this.secondaryRPs = new SecondaryRPsImpl(this); + this.crossRegionRestoreJob = new CrossRegionRestoreJobImpl(this); + this.crossRegionRestoreJobs = new CrossRegionRestoreJobsImpl(this); + this.backupInstancesExtensionRouting = new BackupInstancesExtensionRoutingImpl( + this + ); this.jobs = new JobsImpl(this); this.restorableTimeRanges = new RestorableTimeRangesImpl(this); this.exportJobs = new ExportJobsImpl(this); this.exportJobsOperationResult = new ExportJobsOperationResultImpl(this); this.deletedBackupInstances = new DeletedBackupInstancesImpl(this); this.resourceGuards = new ResourceGuardsImpl(this); + this.dppResourceGuardProxy = new DppResourceGuardProxyImpl(this); this.addCustomApiVersionPolicy(options.apiVersion); } @@ -205,10 +222,15 @@ export class DataProtectionClient extends coreClient.ServiceClient { backupPolicies: BackupPolicies; backupInstances: BackupInstances; recoveryPoints: RecoveryPoints; + secondaryRPs: SecondaryRPs; + crossRegionRestoreJob: CrossRegionRestoreJob; + crossRegionRestoreJobs: CrossRegionRestoreJobs; + backupInstancesExtensionRouting: BackupInstancesExtensionRouting; jobs: Jobs; restorableTimeRanges: RestorableTimeRanges; exportJobs: ExportJobs; exportJobsOperationResult: ExportJobsOperationResult; deletedBackupInstances: DeletedBackupInstances; resourceGuards: ResourceGuards; + dppResourceGuardProxy: DppResourceGuardProxy; } diff --git a/sdk/dataprotection/arm-dataprotection/src/models/index.ts b/sdk/dataprotection/arm-dataprotection/src/models/index.ts index f0f70dbf0b7e..6ecfa14ce8f0 100644 --- a/sdk/dataprotection/arm-dataprotection/src/models/index.ts +++ b/sdk/dataprotection/arm-dataprotection/src/models/index.ts @@ -97,6 +97,11 @@ export interface BackupVault { readonly isVaultProtectedByResourceGuard?: boolean; /** Feature Settings */ featureSettings?: FeatureSettings; + /** + * Secure Score of Backup Vault + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly secureScore?: SecureScoreLevel; } /** Monitoring Settings */ @@ -158,6 +163,7 @@ export interface StorageSetting { export interface FeatureSettings { /** CrossSubscriptionRestore Settings */ crossSubscriptionRestoreSettings?: CrossSubscriptionRestoreSettings; + crossRegionRestoreSettings?: CrossRegionRestoreSettings; } /** CrossSubscriptionRestore Settings */ @@ -166,6 +172,11 @@ export interface CrossSubscriptionRestoreSettings { state?: CrossSubscriptionRestoreState; } +export interface CrossRegionRestoreSettings { + /** CrossRegionRestore state */ + state?: CrossRegionRestoreState; +} + /** Identity details */ export interface DppIdentityDetails { /** @@ -178,8 +189,26 @@ export interface DppIdentityDetails { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly tenantId?: string; - /** The identityType which can be either SystemAssigned or None */ + /** The identityType which can be either SystemAssigned, UserAssigned, 'SystemAssigned,UserAssigned' or None */ type?: string; + /** Gets or sets the user assigned identities. */ + userAssignedIdentities?: { + [propertyName: string]: UserAssignedIdentityDetails; + }; +} + +/** User Assigned Identity Details */ +export interface UserAssignedIdentityDetails { + /** + * The Client Id of the User Assigned Managed Identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly clientId?: string; + /** + * The Object Id of the User Assigned Managed Identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly principalId?: string; } export interface DppBaseTrackedResource { @@ -480,6 +509,11 @@ export interface BackupInstance { datasourceAuthCredentials?: AuthCredentialsUnion; /** Specifies the type of validation. In case of DeepValidation, all validations from /validateForBackup API will run again. */ validationType?: ValidationType; + /** + * Contains information of the Identity Details for the BI. + * If it is null, default will be considered as System Assigned. + */ + identityDetails?: IdentityDetails; objectType: string; } @@ -597,6 +631,13 @@ export interface AuthCredentials { objectType: "SecretStoreBasedAuthCredentials"; } +export interface IdentityDetails { + /** Specifies if the BI is protected by System Identity. */ + useSystemAssignedIdentity?: boolean; + /** ARM URL for User Assigned Identity. */ + userAssignedIdentityArmUrl?: string; +} + export interface DppProxyResource { /** * Proxy Resource Id represents the complete path to the resource. @@ -652,14 +693,24 @@ export interface AzureBackupRecoveryPoint { objectType: "AzureBackupDiscreteRecoveryPoint"; } -/** Azure Backup Rehydrate Request */ -export interface AzureBackupRehydrationRequest { - /** Id of the recovery point to be recovered */ - recoveryPointId: string; - /** Priority to be used for rehydration. Values High or Standard */ - rehydrationPriority?: RehydrationPriority; - /** Retention duration in ISO 8601 format i.e P10D . */ - rehydrationRetentionDuration: string; +/** + * Information about BI whose secondary RecoveryPoints are requested + * Source region and + * BI ARM path + */ +export interface FetchSecondaryRPsRequestParameters { + /** Source region in which BackupInstance is located */ + sourceRegion?: string; + /** ARM Path of BackupInstance */ + sourceBackupInstanceId?: string; +} + +/** Cross Region Restore Request Object */ +export interface CrossRegionRestoreRequestObject { + /** Gets or sets the restore request object. */ + restoreRequestObject: AzureBackupRestoreRequestUnion; + /** Cross region restore details. */ + crossRegionRestoreDetails: CrossRegionRestoreDetails; } /** Azure backup restore request */ @@ -675,6 +726,11 @@ export interface AzureBackupRestoreRequest { sourceDataStoreType: SourceDataStoreType; /** Fully qualified Azure Resource Manager ID of the datasource which is being recovered. */ sourceResourceId?: string; + /** + * Contains information of the Identity Details for the BI. + * If it is null, default will be considered as System Assigned. + */ + identityDetails?: IdentityDetails; } /** Base class common to RestoreTargetInfo and RestoreFilesTargetInfo */ @@ -690,16 +746,24 @@ export interface RestoreTargetInfoBase { restoreLocation?: string; } -/** Sync BackupInstance Request */ -export interface SyncBackupInstanceRequest { - /** Field indicating sync type e.g. to sync only in case of failure or in all cases */ - syncType?: SyncType; +/** Cross Region Restore details */ +export interface CrossRegionRestoreDetails { + sourceRegion: string; + sourceBackupInstanceId: string; } -/** Validate restore request object */ -export interface ValidateRestoreRequestObject { +/** Cross Region Restore Request Object */ +export interface ValidateCrossRegionRestoreRequestObject { /** Gets or sets the restore request object. */ restoreRequestObject: AzureBackupRestoreRequestUnion; + /** Cross region restore details. */ + crossRegionRestoreDetails: CrossRegionRestoreDetails; +} + +export interface CrossRegionRestoreJobRequest { + sourceRegion: string; + sourceBackupVaultId: string; + jobId: string; } /** AzureBackup Job Class */ @@ -845,6 +909,33 @@ export interface JobSubTask { taskStatus: string; } +export interface CrossRegionRestoreJobsRequest { + sourceRegion: string; + sourceBackupVaultId: string; +} + +/** Azure Backup Rehydrate Request */ +export interface AzureBackupRehydrationRequest { + /** Id of the recovery point to be recovered */ + recoveryPointId: string; + /** Priority to be used for rehydration. Values High or Standard */ + rehydrationPriority?: RehydrationPriority; + /** Retention duration in ISO 8601 format i.e P10D . */ + rehydrationRetentionDuration: string; +} + +/** Sync BackupInstance Request */ +export interface SyncBackupInstanceRequest { + /** Field indicating sync type e.g. to sync only in case of failure or in all cases */ + syncType?: SyncType; +} + +/** Validate restore request object */ +export interface ValidateRestoreRequestObject { + /** Gets or sets the restore request object. */ + restoreRequestObject: AzureBackupRestoreRequestUnion; +} + /** List Restore Ranges Request */ export interface AzureBackupFindRestorableTimeRangesRequest { /** Gets or sets the type of the source data store. */ @@ -995,6 +1086,32 @@ export interface DppBaseResource { readonly type?: string; } +/** ResourceGuardProxyBase object, used in ResourceGuardProxyBaseResource */ +export interface ResourceGuardProxyBase { + resourceGuardResourceId?: string; + resourceGuardOperationDetails?: ResourceGuardOperationDetail[]; + lastUpdatedTime?: string; + description?: string; +} + +/** VaultCritical Operation protected by a resource guard */ +export interface ResourceGuardOperationDetail { + vaultCriticalOperation?: string; + defaultResourceRequest?: string; +} + +/** Request body of unlock delete API. */ +export interface UnlockDeleteRequest { + resourceGuardOperationRequests?: string[]; + resourceToBeDeleted?: string; +} + +/** Response of Unlock Delete API. */ +export interface UnlockDeleteResponse { + /** This is the time when unlock delete privileges will get expired. */ + unlockDeleteExpiryTime?: string; +} + /** Delete Option */ export interface DeleteOption { /** Polymorphic discriminator, which specifies the different types this object can be */ @@ -1244,6 +1361,12 @@ export interface DeletedBackupInstanceResourceList extends DppResourceList { value?: DeletedBackupInstanceResource[]; } +/** List of ResourceGuardProxyBase resources */ +export interface ResourceGuardProxyBaseResourceList extends DppResourceList { + /** List of resources. */ + value?: ResourceGuardProxyBaseResource[]; +} + /** Operation Job Extended Info */ export interface OperationJobExtendedInfo extends OperationExtendedInfo { /** Polymorphic discriminator, which specifies the different types this object can be */ @@ -1312,6 +1435,12 @@ export interface DeletedBackupInstanceResource extends DppResource { properties?: DeletedBackupInstance; } +/** ResourceGuardProxyBaseResource object, used for response and request bodies for ResourceGuardProxy APIs */ +export interface ResourceGuardProxyBaseResource extends DppResource { + /** ResourceGuardProxyBaseResource properties */ + properties?: ResourceGuardProxyBase; +} + /** Deleted Backup Instance */ export interface DeletedBackupInstance extends BackupInstance { /** @@ -1694,6 +1823,26 @@ export interface BackupInstancesValidateForBackupHeaders { retryAfter?: number; } +/** Defines headers for BackupInstances_triggerCrossRegionRestore operation. */ +export interface BackupInstancesTriggerCrossRegionRestoreHeaders { + /** The URL of the resource used to check the status of the asynchronous operation. */ + location?: string; + /** The URL of the resource used to check the status of the asynchronous operation. */ + azureAsyncOperation?: string; + /** Suggested delay to check the status of the asynchronous operation. The value is an integer that represents the seconds. */ + retryAfter?: number; +} + +/** Defines headers for BackupInstances_validateCrossRegionRestore operation. */ +export interface BackupInstancesValidateCrossRegionRestoreHeaders { + /** The URL of the resource used to check the status of the asynchronous operation. */ + location?: string; + /** The URL of the resource used to check the status of the asynchronous operation. */ + azureAsyncOperation?: string; + /** Suggested delay to check the status of the asynchronous operation. The value is an integer that represents the seconds. */ + retryAfter?: number; +} + /** Defines headers for BackupInstances_triggerRehydrate operation. */ export interface BackupInstancesTriggerRehydrateHeaders { /** The URL of the resource used to check the status of the asynchronous operation. */ @@ -1974,6 +2123,51 @@ export enum KnownCrossSubscriptionRestoreState { */ export type CrossSubscriptionRestoreState = string; +/** Known values of {@link CrossRegionRestoreState} that the service accepts. */ +export enum KnownCrossRegionRestoreState { + /** Disabled */ + Disabled = "Disabled", + /** Enabled */ + Enabled = "Enabled" +} + +/** + * Defines values for CrossRegionRestoreState. \ + * {@link KnownCrossRegionRestoreState} can be used interchangeably with CrossRegionRestoreState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Disabled** \ + * **Enabled** + */ +export type CrossRegionRestoreState = string; + +/** Known values of {@link SecureScoreLevel} that the service accepts. */ +export enum KnownSecureScoreLevel { + /** None */ + None = "None", + /** Minimum */ + Minimum = "Minimum", + /** Adequate */ + Adequate = "Adequate", + /** Maximum */ + Maximum = "Maximum", + /** NotSupported */ + NotSupported = "NotSupported" +} + +/** + * Defines values for SecureScoreLevel. \ + * {@link KnownSecureScoreLevel} can be used interchangeably with SecureScoreLevel, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **Minimum** \ + * **Adequate** \ + * **Maximum** \ + * **NotSupported** + */ +export type SecureScoreLevel = string; + /** Known values of {@link CreatedByType} that the service accepts. */ export enum KnownCreatedByType { /** User */ @@ -2115,27 +2309,6 @@ export enum KnownValidationType { */ export type ValidationType = string; -/** Known values of {@link RehydrationPriority} that the service accepts. */ -export enum KnownRehydrationPriority { - /** Invalid */ - Invalid = "Invalid", - /** High */ - High = "High", - /** Standard */ - Standard = "Standard" -} - -/** - * Defines values for RehydrationPriority. \ - * {@link KnownRehydrationPriority} can be used interchangeably with RehydrationPriority, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Invalid** \ - * **High** \ - * **Standard** - */ -export type RehydrationPriority = string; - /** Known values of {@link RecoveryOption} that the service accepts. */ export enum KnownRecoveryOption { /** FailIfExists */ @@ -2175,6 +2348,27 @@ export enum KnownSourceDataStoreType { */ export type SourceDataStoreType = string; +/** Known values of {@link RehydrationPriority} that the service accepts. */ +export enum KnownRehydrationPriority { + /** Invalid */ + Invalid = "Invalid", + /** High */ + High = "High", + /** Standard */ + Standard = "Standard" +} + +/** + * Defines values for RehydrationPriority. \ + * {@link KnownRehydrationPriority} can be used interchangeably with RehydrationPriority, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Invalid** \ + * **High** \ + * **Standard** + */ +export type RehydrationPriority = string; + /** Known values of {@link SyncType} that the service accepts. */ export enum KnownSyncType { /** Default */ @@ -2728,6 +2922,30 @@ export interface BackupInstancesGetBackupInstanceOperationResultOptionalParams /** Contains response data for the getBackupInstanceOperationResult operation. */ export type BackupInstancesGetBackupInstanceOperationResultResponse = BackupInstanceResource; +/** Optional parameters. */ +export interface BackupInstancesTriggerCrossRegionRestoreOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the triggerCrossRegionRestore operation. */ +export type BackupInstancesTriggerCrossRegionRestoreResponse = OperationJobExtendedInfo; + +/** Optional parameters. */ +export interface BackupInstancesValidateCrossRegionRestoreOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the validateCrossRegionRestore operation. */ +export type BackupInstancesValidateCrossRegionRestoreResponse = OperationJobExtendedInfo; + /** Optional parameters. */ export interface BackupInstancesTriggerRehydrateOptionalParams extends coreClient.OperationOptions { @@ -2842,6 +3060,60 @@ export interface RecoveryPointsListNextOptionalParams /** Contains response data for the listNext operation. */ export type RecoveryPointsListNextResponse = AzureBackupRecoveryPointResourceList; +/** Optional parameters. */ +export interface SecondaryRPsFetchOptionalParams + extends coreClient.OperationOptions { + /** OData filter options. */ + filter?: string; + /** skipToken Filter. */ + skipToken?: string; +} + +/** Contains response data for the fetch operation. */ +export type SecondaryRPsFetchResponse = AzureBackupRecoveryPointResourceList; + +/** Optional parameters. */ +export interface SecondaryRPsFetchNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the fetchNext operation. */ +export type SecondaryRPsFetchNextResponse = AzureBackupRecoveryPointResourceList; + +/** Optional parameters. */ +export interface CrossRegionRestoreJobGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type CrossRegionRestoreJobGetResponse = AzureBackupJobResource; + +/** Optional parameters. */ +export interface CrossRegionRestoreJobsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type CrossRegionRestoreJobsListResponse = AzureBackupJobResourceList; + +/** Optional parameters. */ +export interface CrossRegionRestoreJobsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type CrossRegionRestoreJobsListNextResponse = AzureBackupJobResourceList; + +/** Optional parameters. */ +export interface BackupInstancesExtensionRoutingListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type BackupInstancesExtensionRoutingListResponse = BackupInstanceResourceList; + +/** Optional parameters. */ +export interface BackupInstancesExtensionRoutingListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type BackupInstancesExtensionRoutingListNextResponse = BackupInstanceResourceList; + /** Optional parameters. */ export interface JobsListOptionalParams extends coreClient.OperationOptions {} @@ -3096,6 +3368,45 @@ export interface ResourceGuardsGetUpdateProtectedItemRequestsObjectsNextOptional /** Contains response data for the getUpdateProtectedItemRequestsObjectsNext operation. */ export type ResourceGuardsGetUpdateProtectedItemRequestsObjectsNextResponse = DppBaseResourceList; +/** Optional parameters. */ +export interface DppResourceGuardProxyListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type DppResourceGuardProxyListResponse = ResourceGuardProxyBaseResourceList; + +/** Optional parameters. */ +export interface DppResourceGuardProxyGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type DppResourceGuardProxyGetResponse = ResourceGuardProxyBaseResource; + +/** Optional parameters. */ +export interface DppResourceGuardProxyCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createOrUpdate operation. */ +export type DppResourceGuardProxyCreateOrUpdateResponse = ResourceGuardProxyBaseResource; + +/** Optional parameters. */ +export interface DppResourceGuardProxyDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface DppResourceGuardProxyUnlockDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the unlockDelete operation. */ +export type DppResourceGuardProxyUnlockDeleteResponse = UnlockDeleteResponse; + +/** Optional parameters. */ +export interface DppResourceGuardProxyListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type DppResourceGuardProxyListNextResponse = ResourceGuardProxyBaseResourceList; + /** Optional parameters. */ export interface DataProtectionClientOptionalParams extends coreClient.ServiceClientOptions { diff --git a/sdk/dataprotection/arm-dataprotection/src/models/mappers.ts b/sdk/dataprotection/arm-dataprotection/src/models/mappers.ts index b19d89eb8215..5ae8e3c99c86 100644 --- a/sdk/dataprotection/arm-dataprotection/src/models/mappers.ts +++ b/sdk/dataprotection/arm-dataprotection/src/models/mappers.ts @@ -74,6 +74,13 @@ export const BackupVault: coreClient.CompositeMapper = { name: "Composite", className: "FeatureSettings" } + }, + secureScore: { + serializedName: "secureScore", + readOnly: true, + type: { + name: "String" + } } } } @@ -240,6 +247,13 @@ export const FeatureSettings: coreClient.CompositeMapper = { name: "Composite", className: "CrossSubscriptionRestoreSettings" } + }, + crossRegionRestoreSettings: { + serializedName: "crossRegionRestoreSettings", + type: { + name: "Composite", + className: "CrossRegionRestoreSettings" + } } } } @@ -260,6 +274,21 @@ export const CrossSubscriptionRestoreSettings: coreClient.CompositeMapper = { } }; +export const CrossRegionRestoreSettings: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CrossRegionRestoreSettings", + modelProperties: { + state: { + serializedName: "state", + type: { + name: "String" + } + } + } + } +}; + export const DppIdentityDetails: coreClient.CompositeMapper = { type: { name: "Composite", @@ -284,6 +313,41 @@ export const DppIdentityDetails: coreClient.CompositeMapper = { type: { name: "String" } + }, + userAssignedIdentities: { + serializedName: "userAssignedIdentities", + type: { + name: "Dictionary", + value: { + type: { + name: "Composite", + className: "UserAssignedIdentityDetails" + } + } + } + } + } + } +}; + +export const UserAssignedIdentityDetails: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "UserAssignedIdentityDetails", + modelProperties: { + clientId: { + serializedName: "clientId", + readOnly: true, + type: { + name: "String" + } + }, + principalId: { + serializedName: "principalId", + readOnly: true, + type: { + name: "String" + } } } } @@ -1033,6 +1097,13 @@ export const BackupInstance: coreClient.CompositeMapper = { name: "String" } }, + identityDetails: { + serializedName: "identityDetails", + type: { + name: "Composite", + className: "IdentityDetails" + } + }, objectType: { serializedName: "objectType", required: true, @@ -1408,6 +1479,27 @@ export const AuthCredentials: coreClient.CompositeMapper = { } }; +export const IdentityDetails: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "IdentityDetails", + modelProperties: { + useSystemAssignedIdentity: { + serializedName: "useSystemAssignedIdentity", + type: { + name: "Boolean" + } + }, + userAssignedIdentityArmUrl: { + serializedName: "userAssignedIdentityArmUrl", + type: { + name: "String" + } + } + } + } +}; + export const DppProxyResource: coreClient.CompositeMapper = { type: { name: "Composite", @@ -1543,29 +1635,44 @@ export const AzureBackupRecoveryPoint: coreClient.CompositeMapper = { } }; -export const AzureBackupRehydrationRequest: coreClient.CompositeMapper = { +export const FetchSecondaryRPsRequestParameters: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AzureBackupRehydrationRequest", + className: "FetchSecondaryRPsRequestParameters", modelProperties: { - recoveryPointId: { - serializedName: "recoveryPointId", - required: true, + sourceRegion: { + serializedName: "sourceRegion", type: { name: "String" } }, - rehydrationPriority: { - serializedName: "rehydrationPriority", + sourceBackupInstanceId: { + serializedName: "sourceBackupInstanceId", type: { name: "String" } + } + } + } +}; + +export const CrossRegionRestoreRequestObject: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CrossRegionRestoreRequestObject", + modelProperties: { + restoreRequestObject: { + serializedName: "restoreRequestObject", + type: { + name: "Composite", + className: "AzureBackupRestoreRequest" + } }, - rehydrationRetentionDuration: { - serializedName: "rehydrationRetentionDuration", - required: true, + crossRegionRestoreDetails: { + serializedName: "crossRegionRestoreDetails", type: { - name: "String" + name: "Composite", + className: "CrossRegionRestoreDetails" } } } @@ -1608,6 +1715,13 @@ export const AzureBackupRestoreRequest: coreClient.CompositeMapper = { type: { name: "String" } + }, + identityDetails: { + serializedName: "identityDetails", + type: { + name: "Composite", + className: "IdentityDetails" + } } } } @@ -1647,13 +1761,21 @@ export const RestoreTargetInfoBase: coreClient.CompositeMapper = { } }; -export const SyncBackupInstanceRequest: coreClient.CompositeMapper = { +export const CrossRegionRestoreDetails: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SyncBackupInstanceRequest", + className: "CrossRegionRestoreDetails", modelProperties: { - syncType: { - serializedName: "syncType", + sourceRegion: { + serializedName: "sourceRegion", + required: true, + type: { + name: "String" + } + }, + sourceBackupInstanceId: { + serializedName: "sourceBackupInstanceId", + required: true, type: { name: "String" } @@ -1662,10 +1784,10 @@ export const SyncBackupInstanceRequest: coreClient.CompositeMapper = { } }; -export const ValidateRestoreRequestObject: coreClient.CompositeMapper = { +export const ValidateCrossRegionRestoreRequestObject: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ValidateRestoreRequestObject", + className: "ValidateCrossRegionRestoreRequestObject", modelProperties: { restoreRequestObject: { serializedName: "restoreRequestObject", @@ -1673,6 +1795,43 @@ export const ValidateRestoreRequestObject: coreClient.CompositeMapper = { name: "Composite", className: "AzureBackupRestoreRequest" } + }, + crossRegionRestoreDetails: { + serializedName: "crossRegionRestoreDetails", + type: { + name: "Composite", + className: "CrossRegionRestoreDetails" + } + } + } + } +}; + +export const CrossRegionRestoreJobRequest: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CrossRegionRestoreJobRequest", + modelProperties: { + sourceRegion: { + serializedName: "sourceRegion", + required: true, + type: { + name: "String" + } + }, + sourceBackupVaultId: { + serializedName: "sourceBackupVaultId", + required: true, + type: { + name: "String" + } + }, + jobId: { + serializedName: "jobId", + required: true, + type: { + name: "String" + } } } } @@ -2032,6 +2191,89 @@ export const JobSubTask: coreClient.CompositeMapper = { } }; +export const CrossRegionRestoreJobsRequest: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CrossRegionRestoreJobsRequest", + modelProperties: { + sourceRegion: { + serializedName: "sourceRegion", + required: true, + type: { + name: "String" + } + }, + sourceBackupVaultId: { + serializedName: "sourceBackupVaultId", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const AzureBackupRehydrationRequest: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AzureBackupRehydrationRequest", + modelProperties: { + recoveryPointId: { + serializedName: "recoveryPointId", + required: true, + type: { + name: "String" + } + }, + rehydrationPriority: { + serializedName: "rehydrationPriority", + type: { + name: "String" + } + }, + rehydrationRetentionDuration: { + serializedName: "rehydrationRetentionDuration", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const SyncBackupInstanceRequest: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SyncBackupInstanceRequest", + modelProperties: { + syncType: { + serializedName: "syncType", + type: { + name: "String" + } + } + } + } +}; + +export const ValidateRestoreRequestObject: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ValidateRestoreRequestObject", + modelProperties: { + restoreRequestObject: { + serializedName: "restoreRequestObject", + type: { + name: "Composite", + className: "AzureBackupRestoreRequest" + } + } + } + } +}; + export const AzureBackupFindRestorableTimeRangesRequest: coreClient.CompositeMapper = { type: { name: "Composite", @@ -2355,6 +2597,107 @@ export const DppBaseResource: coreClient.CompositeMapper = { } }; +export const ResourceGuardProxyBase: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ResourceGuardProxyBase", + modelProperties: { + resourceGuardResourceId: { + serializedName: "resourceGuardResourceId", + type: { + name: "String" + } + }, + resourceGuardOperationDetails: { + serializedName: "resourceGuardOperationDetails", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ResourceGuardOperationDetail" + } + } + } + }, + lastUpdatedTime: { + serializedName: "lastUpdatedTime", + type: { + name: "String" + } + }, + description: { + serializedName: "description", + type: { + name: "String" + } + } + } + } +}; + +export const ResourceGuardOperationDetail: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ResourceGuardOperationDetail", + modelProperties: { + vaultCriticalOperation: { + serializedName: "vaultCriticalOperation", + type: { + name: "String" + } + }, + defaultResourceRequest: { + serializedName: "defaultResourceRequest", + type: { + name: "String" + } + } + } + } +}; + +export const UnlockDeleteRequest: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "UnlockDeleteRequest", + modelProperties: { + resourceGuardOperationRequests: { + serializedName: "resourceGuardOperationRequests", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + resourceToBeDeleted: { + serializedName: "resourceToBeDeleted", + type: { + name: "String" + } + } + } + } +}; + +export const UnlockDeleteResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "UnlockDeleteResponse", + modelProperties: { + unlockDeleteExpiryTime: { + serializedName: "unlockDeleteExpiryTime", + type: { + name: "String" + } + } + } + } +}; + export const DeleteOption: coreClient.CompositeMapper = { type: { name: "Composite", @@ -3165,6 +3508,28 @@ export const DeletedBackupInstanceResourceList: coreClient.CompositeMapper = { } }; +export const ResourceGuardProxyBaseResourceList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ResourceGuardProxyBaseResourceList", + modelProperties: { + ...DppResourceList.type.modelProperties, + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ResourceGuardProxyBaseResource" + } + } + } + } + } + } +}; + export const OperationJobExtendedInfo: coreClient.CompositeMapper = { serializedName: "OperationJobExtendedInfo", type: { @@ -3354,6 +3719,23 @@ export const DeletedBackupInstanceResource: coreClient.CompositeMapper = { } }; +export const ResourceGuardProxyBaseResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ResourceGuardProxyBaseResource", + modelProperties: { + ...DppResource.type.modelProperties, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "ResourceGuardProxyBase" + } + } + } + } +}; + export const DeletedBackupInstance: coreClient.CompositeMapper = { type: { name: "Composite", @@ -4495,6 +4877,60 @@ export const BackupInstancesValidateForBackupHeaders: coreClient.CompositeMapper } }; +export const BackupInstancesTriggerCrossRegionRestoreHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BackupInstancesTriggerCrossRegionRestoreHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + }, + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String" + } + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number" + } + } + } + } +}; + +export const BackupInstancesValidateCrossRegionRestoreHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BackupInstancesValidateCrossRegionRestoreHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + }, + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String" + } + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number" + } + } + } + } +}; + export const BackupInstancesTriggerRehydrateHeaders: coreClient.CompositeMapper = { type: { name: "Composite", diff --git a/sdk/dataprotection/arm-dataprotection/src/models/parameters.ts b/sdk/dataprotection/arm-dataprotection/src/models/parameters.ts index e08a54393cd8..3ef19628e7e6 100644 --- a/sdk/dataprotection/arm-dataprotection/src/models/parameters.ts +++ b/sdk/dataprotection/arm-dataprotection/src/models/parameters.ts @@ -20,13 +20,20 @@ import { BackupInstanceResource as BackupInstanceResourceMapper, TriggerBackupRequest as TriggerBackupRequestMapper, ValidateForBackupRequest as ValidateForBackupRequestMapper, + CrossRegionRestoreRequestObject as CrossRegionRestoreRequestObjectMapper, + ValidateCrossRegionRestoreRequestObject as ValidateCrossRegionRestoreRequestObjectMapper, AzureBackupRehydrationRequest as AzureBackupRehydrationRequestMapper, AzureBackupRestoreRequest as AzureBackupRestoreRequestMapper, SyncBackupInstanceRequest as SyncBackupInstanceRequestMapper, ValidateRestoreRequestObject as ValidateRestoreRequestObjectMapper, + FetchSecondaryRPsRequestParameters as FetchSecondaryRPsRequestParametersMapper, + CrossRegionRestoreJobRequest as CrossRegionRestoreJobRequestMapper, + CrossRegionRestoreJobsRequest as CrossRegionRestoreJobsRequestMapper, AzureBackupFindRestorableTimeRangesRequest as AzureBackupFindRestorableTimeRangesRequestMapper, ResourceGuardResource as ResourceGuardResourceMapper, - PatchResourceGuardInput as PatchResourceGuardInputMapper + PatchResourceGuardInput as PatchResourceGuardInputMapper, + ResourceGuardProxyBaseResource as ResourceGuardProxyBaseResourceMapper, + UnlockDeleteRequest as UnlockDeleteRequestMapper } from "../models/mappers"; export const accept: OperationParameter = { @@ -56,7 +63,7 @@ export const $host: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2023-01-01", + defaultValue: "2023-04-01-preview", isConstant: true, serializedName: "api-version", type: { @@ -212,20 +219,30 @@ export const parameters7: OperationParameter = { export const parameters8: OperationParameter = { parameterPath: "parameters", - mapper: AzureBackupRehydrationRequestMapper + mapper: CrossRegionRestoreRequestObjectMapper }; export const parameters9: OperationParameter = { parameterPath: "parameters", - mapper: AzureBackupRestoreRequestMapper + mapper: ValidateCrossRegionRestoreRequestObjectMapper }; export const parameters10: OperationParameter = { parameterPath: "parameters", - mapper: SyncBackupInstanceRequestMapper + mapper: AzureBackupRehydrationRequestMapper }; export const parameters11: OperationParameter = { + parameterPath: "parameters", + mapper: AzureBackupRestoreRequestMapper +}; + +export const parameters12: OperationParameter = { + parameterPath: "parameters", + mapper: SyncBackupInstanceRequestMapper +}; + +export const parameters13: OperationParameter = { parameterPath: "parameters", mapper: ValidateRestoreRequestObjectMapper }; @@ -261,6 +278,33 @@ export const recoveryPointId: OperationURLParameter = { } }; +export const parameters14: OperationParameter = { + parameterPath: "parameters", + mapper: FetchSecondaryRPsRequestParametersMapper +}; + +export const parameters15: OperationParameter = { + parameterPath: "parameters", + mapper: CrossRegionRestoreJobRequestMapper +}; + +export const parameters16: OperationParameter = { + parameterPath: "parameters", + mapper: CrossRegionRestoreJobsRequestMapper +}; + +export const resourceId: OperationURLParameter = { + parameterPath: "resourceId", + mapper: { + serializedName: "resourceId", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + export const jobId: OperationURLParameter = { parameterPath: "jobId", mapper: { @@ -272,12 +316,12 @@ export const jobId: OperationURLParameter = { } }; -export const parameters12: OperationParameter = { +export const parameters17: OperationParameter = { parameterPath: "parameters", mapper: AzureBackupFindRestorableTimeRangesRequestMapper }; -export const parameters13: OperationParameter = { +export const parameters18: OperationParameter = { parameterPath: "parameters", mapper: ResourceGuardResourceMapper }; @@ -293,7 +337,7 @@ export const resourceGuardsName: OperationURLParameter = { } }; -export const parameters14: OperationParameter = { +export const parameters19: OperationParameter = { parameterPath: "parameters", mapper: PatchResourceGuardInputMapper }; @@ -308,3 +352,27 @@ export const requestName: OperationURLParameter = { } } }; + +export const resourceGuardProxyName: OperationURLParameter = { + parameterPath: "resourceGuardProxyName", + mapper: { + constraints: { + Pattern: new RegExp("^[A-Za-z0-9]*$") + }, + serializedName: "resourceGuardProxyName", + required: true, + type: { + name: "String" + } + } +}; + +export const parameters20: OperationParameter = { + parameterPath: "parameters", + mapper: ResourceGuardProxyBaseResourceMapper +}; + +export const parameters21: OperationParameter = { + parameterPath: "parameters", + mapper: UnlockDeleteRequestMapper +}; diff --git a/sdk/dataprotection/arm-dataprotection/src/operations/backupInstances.ts b/sdk/dataprotection/arm-dataprotection/src/operations/backupInstances.ts index 7600004ee5bb..65d8b395bc80 100644 --- a/sdk/dataprotection/arm-dataprotection/src/operations/backupInstances.ts +++ b/sdk/dataprotection/arm-dataprotection/src/operations/backupInstances.ts @@ -37,6 +37,12 @@ import { BackupInstancesValidateForBackupResponse, BackupInstancesGetBackupInstanceOperationResultOptionalParams, BackupInstancesGetBackupInstanceOperationResultResponse, + CrossRegionRestoreRequestObject, + BackupInstancesTriggerCrossRegionRestoreOptionalParams, + BackupInstancesTriggerCrossRegionRestoreResponse, + ValidateCrossRegionRestoreRequestObject, + BackupInstancesValidateCrossRegionRestoreOptionalParams, + BackupInstancesValidateCrossRegionRestoreResponse, AzureBackupRehydrationRequest, BackupInstancesTriggerRehydrateOptionalParams, BackupInstancesTriggerRehydrateResponse, @@ -601,6 +607,194 @@ export class BackupInstancesImpl implements BackupInstances { ); } + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location + * @param parameters Request body for trigger CRR operation + * @param options The options parameters. + */ + async beginTriggerCrossRegionRestore( + resourceGroupName: string, + location: string, + parameters: CrossRegionRestoreRequestObject, + options?: BackupInstancesTriggerCrossRegionRestoreOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + BackupInstancesTriggerCrossRegionRestoreResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, location, parameters, options }, + spec: triggerCrossRegionRestoreOperationSpec + }); + const poller = await createHttpPoller< + BackupInstancesTriggerCrossRegionRestoreResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location + * @param parameters Request body for trigger CRR operation + * @param options The options parameters. + */ + async beginTriggerCrossRegionRestoreAndWait( + resourceGroupName: string, + location: string, + parameters: CrossRegionRestoreRequestObject, + options?: BackupInstancesTriggerCrossRegionRestoreOptionalParams + ): Promise { + const poller = await this.beginTriggerCrossRegionRestore( + resourceGroupName, + location, + parameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location + * @param parameters Request body for operation + * @param options The options parameters. + */ + async beginValidateCrossRegionRestore( + resourceGroupName: string, + location: string, + parameters: ValidateCrossRegionRestoreRequestObject, + options?: BackupInstancesValidateCrossRegionRestoreOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + BackupInstancesValidateCrossRegionRestoreResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, location, parameters, options }, + spec: validateCrossRegionRestoreOperationSpec + }); + const poller = await createHttpPoller< + BackupInstancesValidateCrossRegionRestoreResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location + * @param parameters Request body for operation + * @param options The options parameters. + */ + async beginValidateCrossRegionRestoreAndWait( + resourceGroupName: string, + location: string, + parameters: ValidateCrossRegionRestoreRequestObject, + options?: BackupInstancesValidateCrossRegionRestoreOptionalParams + ): Promise { + const poller = await this.beginValidateCrossRegionRestore( + resourceGroupName, + location, + parameters, + options + ); + return poller.pollUntilDone(); + } + /** * rehydrate recovery point for restore for a BackupInstance * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -1586,6 +1780,72 @@ const getBackupInstanceOperationResultOperationSpec: coreClient.OperationSpec = headerParameters: [Parameters.accept], serializer }; +const triggerCrossRegionRestoreOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/locations/{location}/crossRegionRestore", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.OperationJobExtendedInfo + }, + 201: { + bodyMapper: Mappers.OperationJobExtendedInfo + }, + 202: { + bodyMapper: Mappers.OperationJobExtendedInfo + }, + 204: { + bodyMapper: Mappers.OperationJobExtendedInfo + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.parameters8, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.location + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const validateCrossRegionRestoreOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/locations/{location}/validateCrossRegionRestore", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.OperationJobExtendedInfo + }, + 201: { + bodyMapper: Mappers.OperationJobExtendedInfo + }, + 202: { + bodyMapper: Mappers.OperationJobExtendedInfo + }, + 204: { + bodyMapper: Mappers.OperationJobExtendedInfo + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.parameters9, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.location + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; const triggerRehydrateOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/rehydrate", @@ -1607,7 +1867,7 @@ const triggerRehydrateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - requestBody: Parameters.parameters8, + requestBody: Parameters.parameters10, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, @@ -1641,7 +1901,7 @@ const triggerRestoreOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - requestBody: Parameters.parameters9, + requestBody: Parameters.parameters11, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, @@ -1763,7 +2023,7 @@ const syncBackupInstanceOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - requestBody: Parameters.parameters10, + requestBody: Parameters.parameters12, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, @@ -1797,7 +2057,7 @@ const validateForRestoreOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - requestBody: Parameters.parameters11, + requestBody: Parameters.parameters13, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, diff --git a/sdk/dataprotection/arm-dataprotection/src/operations/backupInstancesExtensionRouting.ts b/sdk/dataprotection/arm-dataprotection/src/operations/backupInstancesExtensionRouting.ts new file mode 100644 index 000000000000..9d356a75d410 --- /dev/null +++ b/sdk/dataprotection/arm-dataprotection/src/operations/backupInstancesExtensionRouting.ts @@ -0,0 +1,161 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { BackupInstancesExtensionRouting } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { DataProtectionClient } from "../dataProtectionClient"; +import { + BackupInstanceResource, + BackupInstancesExtensionRoutingListNextOptionalParams, + BackupInstancesExtensionRoutingListOptionalParams, + BackupInstancesExtensionRoutingListResponse, + BackupInstancesExtensionRoutingListNextResponse +} from "../models"; + +/// +/** Class containing BackupInstancesExtensionRouting operations. */ +export class BackupInstancesExtensionRoutingImpl + implements BackupInstancesExtensionRouting { + private readonly client: DataProtectionClient; + + /** + * Initialize a new instance of the class BackupInstancesExtensionRouting class. + * @param client Reference to the service client + */ + constructor(client: DataProtectionClient) { + this.client = client; + } + + /** + * Gets a list of backup instances associated with a tracked resource + * @param resourceId ARM path of the resource to be protected using Microsoft.DataProtection + * @param options The options parameters. + */ + public list( + resourceId: string, + options?: BackupInstancesExtensionRoutingListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(resourceId, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage(resourceId, options, settings); + } + }; + } + + private async *listPagingPage( + resourceId: string, + options?: BackupInstancesExtensionRoutingListOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: BackupInstancesExtensionRoutingListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceId, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext(resourceId, continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + resourceId: string, + options?: BackupInstancesExtensionRoutingListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(resourceId, options)) { + yield* page; + } + } + + /** + * Gets a list of backup instances associated with a tracked resource + * @param resourceId ARM path of the resource to be protected using Microsoft.DataProtection + * @param options The options parameters. + */ + private _list( + resourceId: string, + options?: BackupInstancesExtensionRoutingListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceId, options }, + listOperationSpec + ); + } + + /** + * ListNext + * @param resourceId ARM path of the resource to be protected using Microsoft.DataProtection + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceId: string, + nextLink: string, + options?: BackupInstancesExtensionRoutingListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceId, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/{resourceId}/providers/Microsoft.DataProtection/backupInstances", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BackupInstanceResourceList + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.resourceId], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BackupInstanceResourceList + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.resourceId], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/dataprotection/arm-dataprotection/src/operations/crossRegionRestoreJob.ts b/sdk/dataprotection/arm-dataprotection/src/operations/crossRegionRestoreJob.ts new file mode 100644 index 000000000000..5c30e55f1bbd --- /dev/null +++ b/sdk/dataprotection/arm-dataprotection/src/operations/crossRegionRestoreJob.ts @@ -0,0 +1,76 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { CrossRegionRestoreJob } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { DataProtectionClient } from "../dataProtectionClient"; +import { + CrossRegionRestoreJobRequest, + CrossRegionRestoreJobGetOptionalParams, + CrossRegionRestoreJobGetResponse +} from "../models"; + +/** Class containing CrossRegionRestoreJob operations. */ +export class CrossRegionRestoreJobImpl implements CrossRegionRestoreJob { + private readonly client: DataProtectionClient; + + /** + * Initialize a new instance of the class CrossRegionRestoreJob class. + * @param client Reference to the service client + */ + constructor(client: DataProtectionClient) { + this.client = client; + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location + * @param parameters Request body for operation + * @param options The options parameters. + */ + get( + resourceGroupName: string, + location: string, + parameters: CrossRegionRestoreJobRequest, + options?: CrossRegionRestoreJobGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, location, parameters, options }, + getOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/locations/{location}/fetchCrossRegionRestoreJob", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.AzureBackupJobResource + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.parameters15, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.location + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; diff --git a/sdk/dataprotection/arm-dataprotection/src/operations/crossRegionRestoreJobs.ts b/sdk/dataprotection/arm-dataprotection/src/operations/crossRegionRestoreJobs.ts new file mode 100644 index 000000000000..85f6c7fbf77a --- /dev/null +++ b/sdk/dataprotection/arm-dataprotection/src/operations/crossRegionRestoreJobs.ts @@ -0,0 +1,217 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { CrossRegionRestoreJobs } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { DataProtectionClient } from "../dataProtectionClient"; +import { + AzureBackupJobResource, + CrossRegionRestoreJobsRequest, + CrossRegionRestoreJobsListNextOptionalParams, + CrossRegionRestoreJobsListOptionalParams, + CrossRegionRestoreJobsListResponse, + CrossRegionRestoreJobsListNextResponse +} from "../models"; + +/// +/** Class containing CrossRegionRestoreJobs operations. */ +export class CrossRegionRestoreJobsImpl implements CrossRegionRestoreJobs { + private readonly client: DataProtectionClient; + + /** + * Initialize a new instance of the class CrossRegionRestoreJobs class. + * @param client Reference to the service client + */ + constructor(client: DataProtectionClient) { + this.client = client; + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location + * @param parameters Request body for operation + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + location: string, + parameters: CrossRegionRestoreJobsRequest, + options?: CrossRegionRestoreJobsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll( + resourceGroupName, + location, + parameters, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceGroupName, + location, + parameters, + options, + settings + ); + } + }; + } + + private async *listPagingPage( + resourceGroupName: string, + location: string, + parameters: CrossRegionRestoreJobsRequest, + options?: CrossRegionRestoreJobsListOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: CrossRegionRestoreJobsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list( + resourceGroupName, + location, + parameters, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + location, + parameters, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + resourceGroupName: string, + location: string, + parameters: CrossRegionRestoreJobsRequest, + options?: CrossRegionRestoreJobsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + location, + parameters, + options + )) { + yield* page; + } + } + + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location + * @param parameters Request body for operation + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + location: string, + parameters: CrossRegionRestoreJobsRequest, + options?: CrossRegionRestoreJobsListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, location, parameters, options }, + listOperationSpec + ); + } + + /** + * ListNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location + * @param parameters Request body for operation + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + location: string, + parameters: CrossRegionRestoreJobsRequest, + nextLink: string, + options?: CrossRegionRestoreJobsListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, location, parameters, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/locations/{location}/fetchCrossRegionRestoreJobs", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.AzureBackupJobResourceList + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.parameters16, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.location + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AzureBackupJobResourceList + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.location, + Parameters.nextLink + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; diff --git a/sdk/dataprotection/arm-dataprotection/src/operations/dppResourceGuardProxy.ts b/sdk/dataprotection/arm-dataprotection/src/operations/dppResourceGuardProxy.ts new file mode 100644 index 000000000000..598348800225 --- /dev/null +++ b/sdk/dataprotection/arm-dataprotection/src/operations/dppResourceGuardProxy.ts @@ -0,0 +1,390 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { DppResourceGuardProxy } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { DataProtectionClient } from "../dataProtectionClient"; +import { + ResourceGuardProxyBaseResource, + DppResourceGuardProxyListNextOptionalParams, + DppResourceGuardProxyListOptionalParams, + DppResourceGuardProxyListResponse, + DppResourceGuardProxyGetOptionalParams, + DppResourceGuardProxyGetResponse, + DppResourceGuardProxyCreateOrUpdateOptionalParams, + DppResourceGuardProxyCreateOrUpdateResponse, + DppResourceGuardProxyDeleteOptionalParams, + UnlockDeleteRequest, + DppResourceGuardProxyUnlockDeleteOptionalParams, + DppResourceGuardProxyUnlockDeleteResponse, + DppResourceGuardProxyListNextResponse +} from "../models"; + +/// +/** Class containing DppResourceGuardProxy operations. */ +export class DppResourceGuardProxyImpl implements DppResourceGuardProxy { + private readonly client: DataProtectionClient; + + /** + * Initialize a new instance of the class DppResourceGuardProxy class. + * @param client Reference to the service client + */ + constructor(client: DataProtectionClient) { + this.client = client; + } + + /** + * Returns the list of ResourceGuardProxies associated with the vault + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the backup vault. + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + vaultName: string, + options?: DppResourceGuardProxyListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(resourceGroupName, vaultName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceGroupName, + vaultName, + options, + settings + ); + } + }; + } + + private async *listPagingPage( + resourceGroupName: string, + vaultName: string, + options?: DppResourceGuardProxyListOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: DppResourceGuardProxyListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroupName, vaultName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + vaultName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + resourceGroupName: string, + vaultName: string, + options?: DppResourceGuardProxyListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + vaultName, + options + )) { + yield* page; + } + } + + /** + * Returns the list of ResourceGuardProxies associated with the vault + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the backup vault. + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + vaultName: string, + options?: DppResourceGuardProxyListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, vaultName, options }, + listOperationSpec + ); + } + + /** + * Returns the ResourceGuardProxy object associated with the vault, and that matches the name in the + * request + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the backup vault. + * @param resourceGuardProxyName name of the resource guard proxy + * @param options The options parameters. + */ + get( + resourceGroupName: string, + vaultName: string, + resourceGuardProxyName: string, + options?: DppResourceGuardProxyGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, vaultName, resourceGuardProxyName, options }, + getOperationSpec + ); + } + + /** + * Creates or Updates a ResourceGuardProxy + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the backup vault. + * @param resourceGuardProxyName name of the resource guard proxy + * @param parameters Request body for operation + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + vaultName: string, + resourceGuardProxyName: string, + parameters: ResourceGuardProxyBaseResource, + options?: DppResourceGuardProxyCreateOrUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + vaultName, + resourceGuardProxyName, + parameters, + options + }, + createOrUpdateOperationSpec + ); + } + + /** + * Deletes the ResourceGuardProxy + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the backup vault. + * @param resourceGuardProxyName name of the resource guard proxy + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + vaultName: string, + resourceGuardProxyName: string, + options?: DppResourceGuardProxyDeleteOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, vaultName, resourceGuardProxyName, options }, + deleteOperationSpec + ); + } + + /** + * UnlockDelete call for ResourceGuardProxy, executed before one can delete it + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the backup vault. + * @param resourceGuardProxyName name of the resource guard proxy + * @param parameters Request body for operation + * @param options The options parameters. + */ + unlockDelete( + resourceGroupName: string, + vaultName: string, + resourceGuardProxyName: string, + parameters: UnlockDeleteRequest, + options?: DppResourceGuardProxyUnlockDeleteOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + vaultName, + resourceGuardProxyName, + parameters, + options + }, + unlockDeleteOperationSpec + ); + } + + /** + * ListNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the backup vault. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + vaultName: string, + nextLink: string, + options?: DppResourceGuardProxyListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, vaultName, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupResourceGuardProxies", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ResourceGuardProxyBaseResourceList + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.vaultName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupResourceGuardProxies/{resourceGuardProxyName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ResourceGuardProxyBaseResource + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.vaultName, + Parameters.resourceGuardProxyName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupResourceGuardProxies/{resourceGuardProxyName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.ResourceGuardProxyBaseResource + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.parameters20, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.vaultName, + Parameters.resourceGuardProxyName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupResourceGuardProxies/{resourceGuardProxyName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.vaultName, + Parameters.resourceGuardProxyName + ], + headerParameters: [Parameters.accept], + serializer +}; +const unlockDeleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupResourceGuardProxies/{resourceGuardProxyName}/unlockDelete", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.UnlockDeleteResponse + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.parameters21, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.vaultName, + Parameters.resourceGuardProxyName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ResourceGuardProxyBaseResourceList + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.vaultName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/dataprotection/arm-dataprotection/src/operations/index.ts b/sdk/dataprotection/arm-dataprotection/src/operations/index.ts index 8f9497e552e9..1dc720416e8f 100644 --- a/sdk/dataprotection/arm-dataprotection/src/operations/index.ts +++ b/sdk/dataprotection/arm-dataprotection/src/operations/index.ts @@ -17,9 +17,14 @@ export * from "./dataProtectionOperations"; export * from "./backupPolicies"; export * from "./backupInstances"; export * from "./recoveryPoints"; +export * from "./secondaryRPs"; +export * from "./crossRegionRestoreJob"; +export * from "./crossRegionRestoreJobs"; +export * from "./backupInstancesExtensionRouting"; export * from "./jobs"; export * from "./restorableTimeRanges"; export * from "./exportJobs"; export * from "./exportJobsOperationResult"; export * from "./deletedBackupInstances"; export * from "./resourceGuards"; +export * from "./dppResourceGuardProxy"; diff --git a/sdk/dataprotection/arm-dataprotection/src/operations/resourceGuards.ts b/sdk/dataprotection/arm-dataprotection/src/operations/resourceGuards.ts index 0080aa6f333e..b8c6ac5d5d3d 100644 --- a/sdk/dataprotection/arm-dataprotection/src/operations/resourceGuards.ts +++ b/sdk/dataprotection/arm-dataprotection/src/operations/resourceGuards.ts @@ -1278,7 +1278,7 @@ const putOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - requestBody: Parameters.parameters13, + requestBody: Parameters.parameters18, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, @@ -1345,7 +1345,7 @@ const patchOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - requestBody: Parameters.parameters14, + requestBody: Parameters.parameters19, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, diff --git a/sdk/dataprotection/arm-dataprotection/src/operations/restorableTimeRanges.ts b/sdk/dataprotection/arm-dataprotection/src/operations/restorableTimeRanges.ts index 7611400ddec5..60a5d0e0eba0 100644 --- a/sdk/dataprotection/arm-dataprotection/src/operations/restorableTimeRanges.ts +++ b/sdk/dataprotection/arm-dataprotection/src/operations/restorableTimeRanges.ts @@ -64,7 +64,7 @@ const findOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - requestBody: Parameters.parameters12, + requestBody: Parameters.parameters17, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, diff --git a/sdk/dataprotection/arm-dataprotection/src/operations/secondaryRPs.ts b/sdk/dataprotection/arm-dataprotection/src/operations/secondaryRPs.ts new file mode 100644 index 000000000000..8ef26ed24c37 --- /dev/null +++ b/sdk/dataprotection/arm-dataprotection/src/operations/secondaryRPs.ts @@ -0,0 +1,225 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { SecondaryRPs } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { DataProtectionClient } from "../dataProtectionClient"; +import { + AzureBackupRecoveryPointResource, + FetchSecondaryRPsRequestParameters, + SecondaryRPsFetchNextOptionalParams, + SecondaryRPsFetchOptionalParams, + SecondaryRPsFetchResponse, + SecondaryRPsFetchNextResponse +} from "../models"; + +/// +/** Class containing SecondaryRPs operations. */ +export class SecondaryRPsImpl implements SecondaryRPs { + private readonly client: DataProtectionClient; + + /** + * Initialize a new instance of the class SecondaryRPs class. + * @param client Reference to the service client + */ + constructor(client: DataProtectionClient) { + this.client = client; + } + + /** + * Returns a list of Secondary Recovery Points for a DataSource in a vault, that can be used for Cross + * Region Restore. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location + * @param parameters Request body for operation + * @param options The options parameters. + */ + public listFetch( + resourceGroupName: string, + location: string, + parameters: FetchSecondaryRPsRequestParameters, + options?: SecondaryRPsFetchOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.fetchPagingAll( + resourceGroupName, + location, + parameters, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.fetchPagingPage( + resourceGroupName, + location, + parameters, + options, + settings + ); + } + }; + } + + private async *fetchPagingPage( + resourceGroupName: string, + location: string, + parameters: FetchSecondaryRPsRequestParameters, + options?: SecondaryRPsFetchOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: SecondaryRPsFetchResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._fetch( + resourceGroupName, + location, + parameters, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._fetchNext( + resourceGroupName, + location, + parameters, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *fetchPagingAll( + resourceGroupName: string, + location: string, + parameters: FetchSecondaryRPsRequestParameters, + options?: SecondaryRPsFetchOptionalParams + ): AsyncIterableIterator { + for await (const page of this.fetchPagingPage( + resourceGroupName, + location, + parameters, + options + )) { + yield* page; + } + } + + /** + * Returns a list of Secondary Recovery Points for a DataSource in a vault, that can be used for Cross + * Region Restore. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location + * @param parameters Request body for operation + * @param options The options parameters. + */ + private _fetch( + resourceGroupName: string, + location: string, + parameters: FetchSecondaryRPsRequestParameters, + options?: SecondaryRPsFetchOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, location, parameters, options }, + fetchOperationSpec + ); + } + + /** + * FetchNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location + * @param parameters Request body for operation + * @param nextLink The nextLink from the previous successful call to the Fetch method. + * @param options The options parameters. + */ + private _fetchNext( + resourceGroupName: string, + location: string, + parameters: FetchSecondaryRPsRequestParameters, + nextLink: string, + options?: SecondaryRPsFetchNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, location, parameters, nextLink, options }, + fetchNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const fetchOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/locations/{location}/fetchSecondaryRecoveryPoints", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.AzureBackupRecoveryPointResourceList + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.parameters14, + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.skipToken + ], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.location + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const fetchNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AzureBackupRecoveryPointResourceList + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.location, + Parameters.nextLink + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; diff --git a/sdk/dataprotection/arm-dataprotection/src/operationsInterfaces/backupInstances.ts b/sdk/dataprotection/arm-dataprotection/src/operationsInterfaces/backupInstances.ts index 7f074eb60e10..f8df1ce4cd1e 100644 --- a/sdk/dataprotection/arm-dataprotection/src/operationsInterfaces/backupInstances.ts +++ b/sdk/dataprotection/arm-dataprotection/src/operationsInterfaces/backupInstances.ts @@ -24,6 +24,12 @@ import { BackupInstancesValidateForBackupResponse, BackupInstancesGetBackupInstanceOperationResultOptionalParams, BackupInstancesGetBackupInstanceOperationResultResponse, + CrossRegionRestoreRequestObject, + BackupInstancesTriggerCrossRegionRestoreOptionalParams, + BackupInstancesTriggerCrossRegionRestoreResponse, + ValidateCrossRegionRestoreRequestObject, + BackupInstancesValidateCrossRegionRestoreOptionalParams, + BackupInstancesValidateCrossRegionRestoreResponse, AzureBackupRehydrationRequest, BackupInstancesTriggerRehydrateOptionalParams, BackupInstancesTriggerRehydrateResponse, @@ -210,6 +216,64 @@ export interface BackupInstances { operationId: string, options?: BackupInstancesGetBackupInstanceOperationResultOptionalParams ): Promise; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location + * @param parameters Request body for trigger CRR operation + * @param options The options parameters. + */ + beginTriggerCrossRegionRestore( + resourceGroupName: string, + location: string, + parameters: CrossRegionRestoreRequestObject, + options?: BackupInstancesTriggerCrossRegionRestoreOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + BackupInstancesTriggerCrossRegionRestoreResponse + > + >; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location + * @param parameters Request body for trigger CRR operation + * @param options The options parameters. + */ + beginTriggerCrossRegionRestoreAndWait( + resourceGroupName: string, + location: string, + parameters: CrossRegionRestoreRequestObject, + options?: BackupInstancesTriggerCrossRegionRestoreOptionalParams + ): Promise; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location + * @param parameters Request body for operation + * @param options The options parameters. + */ + beginValidateCrossRegionRestore( + resourceGroupName: string, + location: string, + parameters: ValidateCrossRegionRestoreRequestObject, + options?: BackupInstancesValidateCrossRegionRestoreOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + BackupInstancesValidateCrossRegionRestoreResponse + > + >; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location + * @param parameters Request body for operation + * @param options The options parameters. + */ + beginValidateCrossRegionRestoreAndWait( + resourceGroupName: string, + location: string, + parameters: ValidateCrossRegionRestoreRequestObject, + options?: BackupInstancesValidateCrossRegionRestoreOptionalParams + ): Promise; /** * rehydrate recovery point for restore for a BackupInstance * @param resourceGroupName The name of the resource group. The name is case insensitive. diff --git a/sdk/dataprotection/arm-dataprotection/src/operationsInterfaces/backupInstancesExtensionRouting.ts b/sdk/dataprotection/arm-dataprotection/src/operationsInterfaces/backupInstancesExtensionRouting.ts new file mode 100644 index 000000000000..f70b3d32f1fa --- /dev/null +++ b/sdk/dataprotection/arm-dataprotection/src/operationsInterfaces/backupInstancesExtensionRouting.ts @@ -0,0 +1,27 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + BackupInstanceResource, + BackupInstancesExtensionRoutingListOptionalParams +} from "../models"; + +/// +/** Interface representing a BackupInstancesExtensionRouting. */ +export interface BackupInstancesExtensionRouting { + /** + * Gets a list of backup instances associated with a tracked resource + * @param resourceId ARM path of the resource to be protected using Microsoft.DataProtection + * @param options The options parameters. + */ + list( + resourceId: string, + options?: BackupInstancesExtensionRoutingListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/dataprotection/arm-dataprotection/src/operationsInterfaces/crossRegionRestoreJob.ts b/sdk/dataprotection/arm-dataprotection/src/operationsInterfaces/crossRegionRestoreJob.ts new file mode 100644 index 000000000000..63b41de7ab47 --- /dev/null +++ b/sdk/dataprotection/arm-dataprotection/src/operationsInterfaces/crossRegionRestoreJob.ts @@ -0,0 +1,29 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + CrossRegionRestoreJobRequest, + CrossRegionRestoreJobGetOptionalParams, + CrossRegionRestoreJobGetResponse +} from "../models"; + +/** Interface representing a CrossRegionRestoreJob. */ +export interface CrossRegionRestoreJob { + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location + * @param parameters Request body for operation + * @param options The options parameters. + */ + get( + resourceGroupName: string, + location: string, + parameters: CrossRegionRestoreJobRequest, + options?: CrossRegionRestoreJobGetOptionalParams + ): Promise; +} diff --git a/sdk/dataprotection/arm-dataprotection/src/operationsInterfaces/crossRegionRestoreJobs.ts b/sdk/dataprotection/arm-dataprotection/src/operationsInterfaces/crossRegionRestoreJobs.ts new file mode 100644 index 000000000000..e77cfbe3c8df --- /dev/null +++ b/sdk/dataprotection/arm-dataprotection/src/operationsInterfaces/crossRegionRestoreJobs.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + AzureBackupJobResource, + CrossRegionRestoreJobsRequest, + CrossRegionRestoreJobsListOptionalParams +} from "../models"; + +/// +/** Interface representing a CrossRegionRestoreJobs. */ +export interface CrossRegionRestoreJobs { + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location + * @param parameters Request body for operation + * @param options The options parameters. + */ + list( + resourceGroupName: string, + location: string, + parameters: CrossRegionRestoreJobsRequest, + options?: CrossRegionRestoreJobsListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/dataprotection/arm-dataprotection/src/operationsInterfaces/dppResourceGuardProxy.ts b/sdk/dataprotection/arm-dataprotection/src/operationsInterfaces/dppResourceGuardProxy.ts new file mode 100644 index 000000000000..37f1c88f15ea --- /dev/null +++ b/sdk/dataprotection/arm-dataprotection/src/operationsInterfaces/dppResourceGuardProxy.ts @@ -0,0 +1,94 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + ResourceGuardProxyBaseResource, + DppResourceGuardProxyListOptionalParams, + DppResourceGuardProxyGetOptionalParams, + DppResourceGuardProxyGetResponse, + DppResourceGuardProxyCreateOrUpdateOptionalParams, + DppResourceGuardProxyCreateOrUpdateResponse, + DppResourceGuardProxyDeleteOptionalParams, + UnlockDeleteRequest, + DppResourceGuardProxyUnlockDeleteOptionalParams, + DppResourceGuardProxyUnlockDeleteResponse +} from "../models"; + +/// +/** Interface representing a DppResourceGuardProxy. */ +export interface DppResourceGuardProxy { + /** + * Returns the list of ResourceGuardProxies associated with the vault + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the backup vault. + * @param options The options parameters. + */ + list( + resourceGroupName: string, + vaultName: string, + options?: DppResourceGuardProxyListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Returns the ResourceGuardProxy object associated with the vault, and that matches the name in the + * request + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the backup vault. + * @param resourceGuardProxyName name of the resource guard proxy + * @param options The options parameters. + */ + get( + resourceGroupName: string, + vaultName: string, + resourceGuardProxyName: string, + options?: DppResourceGuardProxyGetOptionalParams + ): Promise; + /** + * Creates or Updates a ResourceGuardProxy + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the backup vault. + * @param resourceGuardProxyName name of the resource guard proxy + * @param parameters Request body for operation + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + vaultName: string, + resourceGuardProxyName: string, + parameters: ResourceGuardProxyBaseResource, + options?: DppResourceGuardProxyCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes the ResourceGuardProxy + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the backup vault. + * @param resourceGuardProxyName name of the resource guard proxy + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + vaultName: string, + resourceGuardProxyName: string, + options?: DppResourceGuardProxyDeleteOptionalParams + ): Promise; + /** + * UnlockDelete call for ResourceGuardProxy, executed before one can delete it + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the backup vault. + * @param resourceGuardProxyName name of the resource guard proxy + * @param parameters Request body for operation + * @param options The options parameters. + */ + unlockDelete( + resourceGroupName: string, + vaultName: string, + resourceGuardProxyName: string, + parameters: UnlockDeleteRequest, + options?: DppResourceGuardProxyUnlockDeleteOptionalParams + ): Promise; +} diff --git a/sdk/dataprotection/arm-dataprotection/src/operationsInterfaces/index.ts b/sdk/dataprotection/arm-dataprotection/src/operationsInterfaces/index.ts index 8f9497e552e9..1dc720416e8f 100644 --- a/sdk/dataprotection/arm-dataprotection/src/operationsInterfaces/index.ts +++ b/sdk/dataprotection/arm-dataprotection/src/operationsInterfaces/index.ts @@ -17,9 +17,14 @@ export * from "./dataProtectionOperations"; export * from "./backupPolicies"; export * from "./backupInstances"; export * from "./recoveryPoints"; +export * from "./secondaryRPs"; +export * from "./crossRegionRestoreJob"; +export * from "./crossRegionRestoreJobs"; +export * from "./backupInstancesExtensionRouting"; export * from "./jobs"; export * from "./restorableTimeRanges"; export * from "./exportJobs"; export * from "./exportJobsOperationResult"; export * from "./deletedBackupInstances"; export * from "./resourceGuards"; +export * from "./dppResourceGuardProxy"; diff --git a/sdk/dataprotection/arm-dataprotection/src/operationsInterfaces/secondaryRPs.ts b/sdk/dataprotection/arm-dataprotection/src/operationsInterfaces/secondaryRPs.ts new file mode 100644 index 000000000000..469a0a4d30d3 --- /dev/null +++ b/sdk/dataprotection/arm-dataprotection/src/operationsInterfaces/secondaryRPs.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + AzureBackupRecoveryPointResource, + FetchSecondaryRPsRequestParameters, + SecondaryRPsFetchOptionalParams +} from "../models"; + +/// +/** Interface representing a SecondaryRPs. */ +export interface SecondaryRPs { + /** + * Returns a list of Secondary Recovery Points for a DataSource in a vault, that can be used for Cross + * Region Restore. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location + * @param parameters Request body for operation + * @param options The options parameters. + */ + listFetch( + resourceGroupName: string, + location: string, + parameters: FetchSecondaryRPsRequestParameters, + options?: SecondaryRPsFetchOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/dataprotection/arm-dataprotection/test/sampleTest.ts b/sdk/dataprotection/arm-dataprotection/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /dev/null +++ b/sdk/dataprotection/arm-dataprotection/test/sampleTest.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + Recorder, + RecorderStartOptions, + env +} from "@azure-tools/test-recorder"; +import { assert } from "chai"; +import { Context } from "mocha"; + +const replaceableVariables: Record = { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function(this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/dataprotection/arm-dataprotection/tsconfig.json b/sdk/dataprotection/arm-dataprotection/tsconfig.json index 1f65f09046a1..3e6ae96443f3 100644 --- a/sdk/dataprotection/arm-dataprotection/tsconfig.json +++ b/sdk/dataprotection/arm-dataprotection/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-dataprotection": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"