From 2e23bd3d6ffb662bc7e96d47fcf8f88a43199453 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 5 Jan 2022 06:04:15 +0000 Subject: [PATCH] CodeGen from PR 16870 in Azure/azure-rest-api-specs Track2 modify readme.go.md (#16870) --- common/config/rush/pnpm-lock.yaml | 131 +- rush.json | 5 + .../arm-azurearcdata/CHANGELOG.md | 5 + sdk/azurearcdata/arm-azurearcdata/LICENSE | 21 + sdk/azurearcdata/arm-azurearcdata/README.md | 98 ++ sdk/azurearcdata/arm-azurearcdata/_meta.json | 7 + .../arm-azurearcdata/api-extractor.json | 18 + .../arm-azurearcdata/package.json | 92 ++ .../review/arm-azurearcdata.api.md | 647 ++++++++++ .../arm-azurearcdata/rollup.config.js | 188 +++ .../src/azureArcDataManagementClient.ts | 91 ++ .../arm-azurearcdata/src/index.ts | 12 + .../arm-azurearcdata/src/lroImpl.ts | 34 + .../arm-azurearcdata/src/models/index.ts | 782 ++++++++++++ .../arm-azurearcdata/src/models/mappers.ts | 1088 +++++++++++++++++ .../arm-azurearcdata/src/models/parameters.ts | 166 +++ .../src/operations/dataControllers.ts | 605 +++++++++ .../arm-azurearcdata/src/operations/index.ts | 12 + .../src/operations/operations.ts | 137 +++ .../src/operations/sqlManagedInstances.ts | 597 +++++++++ .../src/operations/sqlServerInstances.ts | 592 +++++++++ .../operationsInterfaces/dataControllers.ts | 121 ++ .../src/operationsInterfaces/index.ts | 12 + .../src/operationsInterfaces/operations.ts | 22 + .../sqlManagedInstances.ts | 121 ++ .../sqlServerInstances.ts | 121 ++ .../arm-azurearcdata/test/sampleTest.ts | 48 + .../arm-azurearcdata/tsconfig.json | 19 + sdk/azurearcdata/ci.yml | 29 + 29 files changed, 5767 insertions(+), 54 deletions(-) create mode 100644 sdk/azurearcdata/arm-azurearcdata/CHANGELOG.md create mode 100644 sdk/azurearcdata/arm-azurearcdata/LICENSE create mode 100644 sdk/azurearcdata/arm-azurearcdata/README.md create mode 100644 sdk/azurearcdata/arm-azurearcdata/_meta.json create mode 100644 sdk/azurearcdata/arm-azurearcdata/api-extractor.json create mode 100644 sdk/azurearcdata/arm-azurearcdata/package.json create mode 100644 sdk/azurearcdata/arm-azurearcdata/review/arm-azurearcdata.api.md create mode 100644 sdk/azurearcdata/arm-azurearcdata/rollup.config.js create mode 100644 sdk/azurearcdata/arm-azurearcdata/src/azureArcDataManagementClient.ts create mode 100644 sdk/azurearcdata/arm-azurearcdata/src/index.ts create mode 100644 sdk/azurearcdata/arm-azurearcdata/src/lroImpl.ts create mode 100644 sdk/azurearcdata/arm-azurearcdata/src/models/index.ts create mode 100644 sdk/azurearcdata/arm-azurearcdata/src/models/mappers.ts create mode 100644 sdk/azurearcdata/arm-azurearcdata/src/models/parameters.ts create mode 100644 sdk/azurearcdata/arm-azurearcdata/src/operations/dataControllers.ts create mode 100644 sdk/azurearcdata/arm-azurearcdata/src/operations/index.ts create mode 100644 sdk/azurearcdata/arm-azurearcdata/src/operations/operations.ts create mode 100644 sdk/azurearcdata/arm-azurearcdata/src/operations/sqlManagedInstances.ts create mode 100644 sdk/azurearcdata/arm-azurearcdata/src/operations/sqlServerInstances.ts create mode 100644 sdk/azurearcdata/arm-azurearcdata/src/operationsInterfaces/dataControllers.ts create mode 100644 sdk/azurearcdata/arm-azurearcdata/src/operationsInterfaces/index.ts create mode 100644 sdk/azurearcdata/arm-azurearcdata/src/operationsInterfaces/operations.ts create mode 100644 sdk/azurearcdata/arm-azurearcdata/src/operationsInterfaces/sqlManagedInstances.ts create mode 100644 sdk/azurearcdata/arm-azurearcdata/src/operationsInterfaces/sqlServerInstances.ts create mode 100644 sdk/azurearcdata/arm-azurearcdata/test/sampleTest.ts create mode 100644 sdk/azurearcdata/arm-azurearcdata/tsconfig.json create mode 100644 sdk/azurearcdata/ci.yml diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 694e81b4a476..5e64bd61a333 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -16,6 +16,7 @@ specifiers: '@rush-temp/arm-appservice': file:./projects/arm-appservice.tgz '@rush-temp/arm-attestation': file:./projects/arm-attestation.tgz '@rush-temp/arm-authorization': file:./projects/arm-authorization.tgz + '@rush-temp/arm-azurearcdata': file:./projects/arm-azurearcdata.tgz '@rush-temp/arm-azurestack': file:./projects/arm-azurestack.tgz '@rush-temp/arm-batch': file:./projects/arm-batch.tgz '@rush-temp/arm-billing': file:./projects/arm-billing.tgz @@ -197,6 +198,7 @@ dependencies: '@rush-temp/arm-appservice': file:projects/arm-appservice.tgz '@rush-temp/arm-attestation': file:projects/arm-attestation.tgz '@rush-temp/arm-authorization': file:projects/arm-authorization.tgz + '@rush-temp/arm-azurearcdata': file:projects/arm-azurearcdata.tgz '@rush-temp/arm-azurestack': file:projects/arm-azurestack.tgz '@rush-temp/arm-batch': file:projects/arm-batch.tgz '@rush-temp/arm-billing': file:projects/arm-billing.tgz @@ -6977,7 +6979,7 @@ packages: hasBin: true dev: false - /ts-node/10.4.0_276ff2ad8f60608417677a4691c0f835: + /ts-node/10.4.0_28670484a221c7e896c5d6b821a5cbb7: resolution: {integrity: sha512-g0FlPvvCXSIO1JDF6S232P5jPYqBkRL9qly81ZgAOSU7rwI0stphCgd2kLiCrU9DjQCrJMWEqcNSjQL02s6d8A==} hasBin: true peerDependencies: @@ -7003,11 +7005,11 @@ packages: create-require: 1.1.1 diff: 4.0.2 make-error: 1.3.6 - typescript: 4.2.4 + typescript: 4.4.4 yn: 3.1.1 dev: false - /ts-node/10.4.0_54d7f9b57c83a5c5120be11b085b9de6: + /ts-node/10.4.0_f9f9f28f986ed7ad377c75abc9f416f4: resolution: {integrity: sha512-g0FlPvvCXSIO1JDF6S232P5jPYqBkRL9qly81ZgAOSU7rwI0stphCgd2kLiCrU9DjQCrJMWEqcNSjQL02s6d8A==} hasBin: true peerDependencies: @@ -7033,7 +7035,7 @@ packages: create-require: 1.1.1 diff: 4.0.2 make-error: 1.3.6 - typescript: 4.4.4 + typescript: 4.2.4 yn: 3.1.1 dev: false @@ -7629,7 +7631,7 @@ packages: prettier: 2.5.1 rimraf: 3.0.2 rollup: 1.32.1 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 transitivePeerDependencies: @@ -7857,7 +7859,7 @@ packages: rollup: 1.32.1 sinon: 9.2.4 source-map-support: 0.5.21 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 transitivePeerDependencies: @@ -7908,7 +7910,7 @@ packages: rollup: 1.32.1 sinon: 9.2.4 source-map-support: 0.5.21 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 transitivePeerDependencies: @@ -7965,7 +7967,7 @@ packages: rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 rollup-plugin-terser: 5.3.1_rollup@1.32.1 sinon: 9.2.4 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uglify-js: 3.14.5 @@ -8122,6 +8124,27 @@ packages: uglify-js: 3.14.5 dev: false + file:projects/arm-azurearcdata.tgz: + resolution: {integrity: sha512-iRyJRdqcw3K0QAbck8OGmMZmU4KltDgYXWzRG6k93US7fcOXYr094XsXzBMcgZdVr8v1cUXTbHe3lKxPSsCFpg==, tarball: file:projects/arm-azurearcdata.tgz} + name: '@rush-temp/arm-azurearcdata' + version: 0.0.0 + dependencies: + '@microsoft/api-extractor': 7.19.2 + '@rollup/plugin-commonjs': 11.0.2_rollup@1.32.1 + '@rollup/plugin-json': 4.1.0_rollup@1.32.1 + '@rollup/plugin-multi-entry': 3.0.1_rollup@1.32.1 + '@rollup/plugin-node-resolve': 8.4.0_rollup@1.32.1 + cross-env: 7.0.3 + mkdirp: 1.0.4 + mocha: 7.2.0 + rimraf: 3.0.2 + rollup: 1.32.1 + rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 + tslib: 2.3.1 + typescript: 4.2.4 + uglify-js: 3.14.5 + dev: false + file:projects/arm-azurestack.tgz: resolution: {integrity: sha512-nx1zmEvcREyoaIZ/93bbMgWvGE7yOL/imhdnkRkyHyHm3ek5MjE8jW4PeY3WwhVx9ZvHqYmnQqk53QgYbhlFjw==, tarball: file:projects/arm-azurestack.tgz} name: '@rush-temp/arm-azurestack' @@ -9487,7 +9510,7 @@ packages: rollup: 1.32.1 safe-buffer: 5.2.1 source-map-support: 0.5.21 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 util: 0.12.4 @@ -9982,7 +10005,7 @@ packages: dev: false file:projects/core-amqp.tgz: - resolution: {integrity: sha512-jmyXvDp5FyZIlqp1zATESQp6qO2NqjKSfY5o9ojPsKN/g9WJ45RL4jfy+cD5u8C2t9jSDTsCoL+jbiLptpkDLA==, tarball: file:projects/core-amqp.tgz} + resolution: {integrity: sha512-nAZlMW/WFVSloK1iVzoSJNx9CHjvMl4/kJrnq1s5Okn96/AQX19SYkqfdvmew1Oy3bxfDC2g3n3e1CFLrlSyEg==, tarball: file:projects/core-amqp.tgz} name: '@rush-temp/core-amqp' version: 0.0.0 dependencies: @@ -10025,7 +10048,7 @@ packages: rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 rollup-plugin-terser: 5.3.1_rollup@1.32.1 sinon: 9.2.4 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 url: 0.11.0 @@ -10111,7 +10134,7 @@ packages: rimraf: 3.0.2 rollup: 1.32.1 sinon: 9.2.4 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 util: 0.12.4 @@ -10342,7 +10365,7 @@ packages: shx: 0.3.3 sinon: 9.2.4 tough-cookie: 4.0.0 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 tunnel: 0.0.6 typescript: 4.2.4 @@ -10390,7 +10413,7 @@ packages: prettier: 2.5.1 rimraf: 3.0.2 rollup: 1.32.1 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uglify-js: 3.14.5 @@ -10657,7 +10680,7 @@ packages: sinon: 9.2.4 snap-shot-it: 7.9.6 source-map-support: 0.5.21 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 universal-user-agent: 6.0.0 @@ -10714,7 +10737,7 @@ packages: rollup-plugin-terser: 5.3.1_rollup@1.32.1 rollup-plugin-visualizer: 4.2.2_rollup@1.32.1 sinon: 9.2.4 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 util: 0.12.4 @@ -10760,7 +10783,7 @@ packages: rollup: 1.32.1 rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 rollup-plugin-visualizer: 4.2.2_rollup@1.32.1 - ts-node: 10.4.0_54d7f9b57c83a5c5120be11b085b9de6 + ts-node: 10.4.0_28670484a221c7e896c5d6b821a5cbb7 tslib: 2.3.1 typescript: 4.4.4 yaml: 1.10.2 @@ -10917,7 +10940,7 @@ packages: rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 rollup-plugin-terser: 5.3.1_rollup@1.32.1 sinon: 9.2.4 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uuid: 8.3.2 @@ -10979,7 +11002,7 @@ packages: rollup-plugin-visualizer: 4.2.2_rollup@1.32.1 sinon: 9.2.4 source-map-support: 0.5.21 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uuid: 8.3.2 @@ -11034,7 +11057,7 @@ packages: prettier: 2.5.1 rimraf: 3.0.2 rollup: 1.32.1 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 util: 0.12.4 @@ -11087,7 +11110,7 @@ packages: prettier: 2.5.1 rimraf: 3.0.2 rollup: 1.32.1 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 util: 0.12.4 @@ -11289,7 +11312,7 @@ packages: rollup-plugin-terser: 5.3.1_rollup@1.32.1 rollup-plugin-visualizer: 4.2.2_rollup@1.32.1 sinon: 9.2.4 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 util: 0.12.4 @@ -11553,7 +11576,7 @@ packages: rimraf: 3.0.2 rollup: 1.32.1 sinon: 9.2.4 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 transitivePeerDependencies: @@ -11702,7 +11725,7 @@ packages: rimraf: 3.0.2 rollup: 1.32.1 sinon: 9.2.4 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 transitivePeerDependencies: @@ -11774,7 +11797,7 @@ packages: eslint: 7.32.0 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 transitivePeerDependencies: @@ -11794,7 +11817,7 @@ packages: eslint: 7.32.0 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 transitivePeerDependencies: @@ -11814,7 +11837,7 @@ packages: eslint: 7.32.0 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 transitivePeerDependencies: @@ -11834,7 +11857,7 @@ packages: eslint: 7.32.0 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uuid: 8.3.2 @@ -11873,7 +11896,7 @@ packages: eslint: 7.32.0 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 transitivePeerDependencies: @@ -11894,7 +11917,7 @@ packages: eslint: 7.32.0 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uuid: 8.3.2 @@ -11917,7 +11940,7 @@ packages: moment: 2.29.1 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uuid: 8.3.2 @@ -11937,7 +11960,7 @@ packages: eslint: 7.32.0 prettier: 1.19.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 transitivePeerDependencies: @@ -11957,7 +11980,7 @@ packages: eslint: 7.32.0 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 transitivePeerDependencies: @@ -11978,7 +12001,7 @@ packages: eslint: 7.32.0 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uuid: 8.3.2 @@ -12000,7 +12023,7 @@ packages: eslint: 7.32.0 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uuid: 8.3.2 @@ -12021,7 +12044,7 @@ packages: eslint: 7.32.0 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uuid: 8.3.2 @@ -12041,7 +12064,7 @@ packages: eslint: 7.32.0 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 transitivePeerDependencies: @@ -12060,7 +12083,7 @@ packages: eslint: 7.32.0 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 transitivePeerDependencies: @@ -12081,7 +12104,7 @@ packages: eslint: 7.32.0 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uuid: 8.3.2 @@ -12104,7 +12127,7 @@ packages: node-fetch: 2.6.6 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uuid: 8.3.2 @@ -12125,7 +12148,7 @@ packages: eslint: 7.32.0 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uuid: 8.3.2 @@ -12146,7 +12169,7 @@ packages: eslint: 7.32.0 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uuid: 8.3.2 @@ -12167,7 +12190,7 @@ packages: eslint: 7.32.0 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uuid: 8.3.2 @@ -12539,7 +12562,7 @@ packages: rimraf: 3.0.2 rollup: 1.32.1 sinon: 9.2.4 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 util: 0.12.4 @@ -12608,7 +12631,7 @@ packages: rimraf: 3.0.2 rollup: 1.32.1 sinon: 9.2.4 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 ws: 8.3.0 @@ -12671,7 +12694,7 @@ packages: rollup-plugin-visualizer: 4.2.2_rollup@1.32.1 sinon: 9.2.4 source-map-support: 0.5.21 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 util: 0.12.4 @@ -12734,7 +12757,7 @@ packages: rollup-plugin-terser: 5.3.1_rollup@1.32.1 rollup-plugin-visualizer: 4.2.2_rollup@1.32.1 source-map-support: 0.5.21 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 util: 0.12.4 @@ -12797,7 +12820,7 @@ packages: rollup-plugin-terser: 5.3.1_rollup@1.32.1 rollup-plugin-visualizer: 4.2.2_rollup@1.32.1 source-map-support: 0.5.21 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 util: 0.12.4 @@ -12858,7 +12881,7 @@ packages: rollup-plugin-terser: 5.3.1_rollup@1.32.1 rollup-plugin-visualizer: 4.2.2_rollup@1.32.1 source-map-support: 0.5.21 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 util: 0.12.4 @@ -12916,7 +12939,7 @@ packages: rollup-plugin-terser: 5.3.1_rollup@1.32.1 rollup-plugin-visualizer: 4.2.2_rollup@1.32.1 source-map-support: 0.5.21 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 util: 0.12.4 @@ -12976,7 +12999,7 @@ packages: rollup-plugin-terser: 5.3.1_rollup@1.32.1 rollup-plugin-visualizer: 4.2.2_rollup@1.32.1 source-map-support: 0.5.21 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 util: 0.12.4 @@ -13028,7 +13051,7 @@ packages: rollup: 1.32.1 sinon: 9.2.4 source-map-support: 0.5.21 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uglify-js: 3.14.5 @@ -13082,7 +13105,7 @@ packages: rollup: 1.32.1 sinon: 9.2.4 source-map-support: 0.5.21 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uglify-js: 3.14.5 @@ -13135,7 +13158,7 @@ packages: rollup: 1.32.1 sinon: 9.2.4 source-map-support: 0.5.21 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uglify-js: 3.14.5 diff --git a/rush.json b/rush.json index 66a9aa13703f..e9ee84b0143e 100644 --- a/rush.json +++ b/rush.json @@ -1215,6 +1215,11 @@ "packageName": "@azure/arm-containerinstance", "projectFolder": "sdk/containerinstance/arm-containerinstance", "versionPolicyName": "management" + }, + { + "packageName": "@azure/arm-azurearcdata", + "projectFolder": "sdk/azurearcdata/arm-azurearcdata", + "versionPolicyName": "management" } ] } \ No newline at end of file diff --git a/sdk/azurearcdata/arm-azurearcdata/CHANGELOG.md b/sdk/azurearcdata/arm-azurearcdata/CHANGELOG.md new file mode 100644 index 000000000000..9e40ddd60900 --- /dev/null +++ b/sdk/azurearcdata/arm-azurearcdata/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0 (2022-01-05) + +The package of @azure/arm-azurearcdata 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/azurearcdata/arm-azurearcdata/LICENSE b/sdk/azurearcdata/arm-azurearcdata/LICENSE new file mode 100644 index 000000000000..5d1d36e0af80 --- /dev/null +++ b/sdk/azurearcdata/arm-azurearcdata/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2022 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/sdk/azurearcdata/arm-azurearcdata/README.md b/sdk/azurearcdata/arm-azurearcdata/README.md new file mode 100644 index 000000000000..40eeb0f73d11 --- /dev/null +++ b/sdk/azurearcdata/arm-azurearcdata/README.md @@ -0,0 +1,98 @@ +# AzureArcDataManagement client library for JavaScript + +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for AzureArcDataManagement client. + +The AzureArcData management API provides a RESTful set of web APIs to manage Azure Data Services on Azure Arc Resources. + +[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/azurearcdata/arm-azurearcdata) | +[Package (NPM)](https://www.npmjs.com/package/@azure/arm-azurearcdata) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-azurearcdata) | +[Samples](https://github.com/Azure-Samples/azure-samples-js-management) + +## Getting started + +### Currently supported environments + +- [LTS versions of Node.js](https://nodejs.org/about/releases/) +- Latest versions of Safari, Chrome, Edge and Firefox. + +### Prerequisites + +- An [Azure subscription][azure_sub]. + +### Install the `@azure/arm-azurearcdata` package + +Install the AzureArcDataManagement client library for JavaScript with `npm`: + +```bash +npm install @azure/arm-azurearcdata +``` + +### Create and authenticate a `AzureArcDataManagementClient` + +To create a client object to access the AzureArcDataManagement API, you will need the `endpoint` of your AzureArcDataManagement resource and a `credential`. The AzureArcDataManagement client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your AzureArcDataManagement resource in the [Azure Portal][azure_portal]. + +You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). + +To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package: + +```bash +npm install @azure/identity +``` + +You will also need to **register a new AAD application and grant access to AzureArcDataManagement** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). +Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`. + +For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). + +```javascript +const { AzureArcDataManagementClient } = require("@azure/arm-azurearcdata"); +const { DefaultAzureCredential } = require("@azure/identity"); +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new AzureArcDataManagementClient(new DefaultAzureCredential(), subscriptionId); +``` + + +### JavaScript Bundle +To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). + +## Key concepts + +### AzureArcDataManagementClient + +`AzureArcDataManagementClient` is the primary interface for developers using the AzureArcDataManagement client library. Explore the methods on this client object to understand the different features of the AzureArcDataManagement service that you can access. + +## Troubleshooting + +### Logging + +Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: + +```javascript +const { setLogLevel } = require("@azure/logger"); +setLogLevel("info"); +``` + +For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger). + +## Next steps + +Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. + +## Contributing + +If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code. + +## Related projects + +- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fazurearcdata%2Farm-azurearcdata%2FREADME.png) + +[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_sub]: https://azure.microsoft.com/free/ +[azure_sub]: https://azure.microsoft.com/free/ +[azure_portal]: https://portal.azure.com +[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity +[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential diff --git a/sdk/azurearcdata/arm-azurearcdata/_meta.json b/sdk/azurearcdata/arm-azurearcdata/_meta.json new file mode 100644 index 000000000000..7d9d6dfb9154 --- /dev/null +++ b/sdk/azurearcdata/arm-azurearcdata/_meta.json @@ -0,0 +1,7 @@ +{ + "commit": "754938e4cb9416358b02dcc11f444adf14b3b7b6", + "readme": "specification/azurearcdata/resource-manager/readme.md", + "autorest_command": "autorest --version=3.1.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/azurearcdata/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20211130.1", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "use": "@autorest/typescript@6.0.0-alpha.16.20211130.1" +} \ No newline at end of file diff --git a/sdk/azurearcdata/arm-azurearcdata/api-extractor.json b/sdk/azurearcdata/arm-azurearcdata/api-extractor.json new file mode 100644 index 000000000000..d51b5ad36893 --- /dev/null +++ b/sdk/azurearcdata/arm-azurearcdata/api-extractor.json @@ -0,0 +1,18 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + "mainEntryPointFilePath": "./dist-esm/src/index.d.ts", + "docModel": { "enabled": true }, + "apiReport": { "enabled": true, "reportFolder": "./review" }, + "dtsRollup": { + "enabled": true, + "untrimmedFilePath": "", + "publicTrimmedFilePath": "./types/arm-azurearcdata.d.ts" + }, + "messages": { + "tsdocMessageReporting": { "default": { "logLevel": "none" } }, + "extractorMessageReporting": { + "ae-missing-release-tag": { "logLevel": "none" }, + "ae-unresolved-link": { "logLevel": "none" } + } + } +} diff --git a/sdk/azurearcdata/arm-azurearcdata/package.json b/sdk/azurearcdata/arm-azurearcdata/package.json new file mode 100644 index 000000000000..2df43713ac36 --- /dev/null +++ b/sdk/azurearcdata/arm-azurearcdata/package.json @@ -0,0 +1,92 @@ +{ + "name": "@azure/arm-azurearcdata", + "sdk-type": "mgmt", + "author": "Microsoft Corporation", + "description": "A generated SDK for AzureArcDataManagementClient.", + "version": "1.0.0", + "engines": { "node": ">=12.0.0" }, + "dependencies": { + "@azure/core-lro": "^2.2.0", + "@azure/abort-controller": "^1.0.0", + "@azure/core-paging": "^1.2.0", + "@azure/core-client": "^1.0.0", + "@azure/core-auth": "^1.3.0", + "@azure/core-rest-pipeline": "^1.1.0", + "tslib": "^2.2.0" + }, + "keywords": ["node", "azure", "typescript", "browser", "isomorphic"], + "license": "MIT", + "main": "./dist/index.js", + "module": "./dist-esm/src/index.js", + "types": "./types/arm-azurearcdata.d.ts", + "devDependencies": { + "@microsoft/api-extractor": "^7.18.11", + "@rollup/plugin-commonjs": "11.0.2", + "@rollup/plugin-json": "^4.0.0", + "@rollup/plugin-multi-entry": "^3.0.0", + "@rollup/plugin-node-resolve": "^8.0.0", + "mkdirp": "^1.0.4", + "rollup": "^1.16.3", + "rollup-plugin-sourcemaps": "^0.4.2", + "typescript": "~4.2.0", + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0", + "@azure/identity": "^2.0.1", + "@azure-tools/test-recorder": "^1.0.0", + "mocha": "^7.1.1", + "cross-env": "^7.0.2" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/azurearcdata/arm-azurearcdata", + "repository": { + "type": "git", + "url": "https://github.com/Azure/azure-sdk-for-js.git" + }, + "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, + "files": [ + "dist/**/*.js", + "dist/**/*.js.map", + "dist/**/*.d.ts", + "dist/**/*.d.ts.map", + "dist-esm/**/*.js", + "dist-esm/**/*.js.map", + "dist-esm/**/*.d.ts", + "dist-esm/**/*.d.ts.map", + "src/**/*.ts", + "README.md", + "LICENSE", + "rollup.config.js", + "tsconfig.json", + "review/*", + "CHANGELOG.md", + "types/*" + ], + "scripts": { + "build": "npm run clean && tsc && rollup -c 2>&1 && npm run minify && mkdirp ./review && npm run extract-api", + "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", + "prepack": "npm run build", + "pack": "npm pack 2>&1", + "extract-api": "api-extractor run --local", + "lint": "echo skipped", + "audit": "echo skipped", + "clean": "rimraf dist dist-browser dist-esm test-dist temp types *.tgz *.log", + "build:node": "echo skipped", + "build:browser": "echo skipped", + "build:test": "echo skipped", + "build:samples": "echo skipped.", + "check-format": "echo skipped", + "execute:samples": "echo skipped", + "format": "echo skipped", + "test": "npm run integration-test", + "test:node": "echo skipped", + "test:browser": "echo skipped", + "unit-test": "npm run unit-test:node && npm run unit-test:browser", + "unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node", + "unit-test:browser": "echo skipped", + "integration-test": "npm run integration-test:node && npm run integration-test:browser", + "integration-test:node": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts --reporter ../../../common/tools/mocha-multi-reporter.js", + "integration-test:browser": "echo skipped", + "docs": "echo skipped" + }, + "sideEffects": false, + "autoPublish": true +} diff --git a/sdk/azurearcdata/arm-azurearcdata/review/arm-azurearcdata.api.md b/sdk/azurearcdata/arm-azurearcdata/review/arm-azurearcdata.api.md new file mode 100644 index 000000000000..426f91a3d323 --- /dev/null +++ b/sdk/azurearcdata/arm-azurearcdata/review/arm-azurearcdata.api.md @@ -0,0 +1,647 @@ +## API Report File for "@azure/arm-azurearcdata" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import * as coreAuth from '@azure/core-auth'; +import * as coreClient from '@azure/core-client'; +import { PagedAsyncIterableIterator } from '@azure/core-paging'; +import { PollerLike } from '@azure/core-lro'; +import { PollOperationState } from '@azure/core-lro'; + +// @public +export type ArcSqlManagedInstanceLicenseType = "BasePrice" | "LicenseIncluded"; + +// @public +export type ArcSqlServerLicenseType = string; + +// @public (undocumented) +export class AzureArcDataManagementClient extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: AzureArcDataManagementClientOptionalParams); + // (undocumented) + apiVersion: string; + // (undocumented) + dataControllers: DataControllers; + // (undocumented) + operations: Operations; + // (undocumented) + sqlManagedInstances: SqlManagedInstances; + // (undocumented) + sqlServerInstances: SqlServerInstances; + // (undocumented) + subscriptionId: string; +} + +// @public +export interface AzureArcDataManagementClientOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + apiVersion?: string; + endpoint?: string; +} + +// @public +export interface BasicLoginInformation { + password?: string; + username?: string; +} + +// @public +export type ConnectionStatus = string; + +// @public +export type CreatedByType = string; + +// @public +export interface DataControllerProperties { + basicLoginInformation?: BasicLoginInformation; + clusterId?: string; + extensionId?: string; + infrastructure?: Infrastructure; + k8SRaw?: Record; + lastUploadedDate?: Date; + logAnalyticsWorkspaceConfig?: LogAnalyticsWorkspaceConfig; + logsDashboardCredential?: BasicLoginInformation; + metricsDashboardCredential?: BasicLoginInformation; + onPremiseProperty?: OnPremiseProperty; + readonly provisioningState?: string; + uploadServicePrincipal?: UploadServicePrincipal; + uploadWatermark?: UploadWatermark; +} + +// @public +export type DataControllerResource = TrackedResource & { + extendedLocation?: ExtendedLocation; + properties: DataControllerProperties; +}; + +// @public +export interface DataControllers { + beginDeleteDataController(resourceGroupName: string, dataControllerName: string, options?: DataControllersDeleteDataControllerOptionalParams): Promise, void>>; + beginDeleteDataControllerAndWait(resourceGroupName: string, dataControllerName: string, options?: DataControllersDeleteDataControllerOptionalParams): Promise; + beginPutDataController(resourceGroupName: string, dataControllerName: string, dataControllerResource: DataControllerResource, options?: DataControllersPutDataControllerOptionalParams): Promise, DataControllersPutDataControllerResponse>>; + beginPutDataControllerAndWait(resourceGroupName: string, dataControllerName: string, dataControllerResource: DataControllerResource, options?: DataControllersPutDataControllerOptionalParams): Promise; + getDataController(resourceGroupName: string, dataControllerName: string, options?: DataControllersGetDataControllerOptionalParams): Promise; + listInGroup(resourceGroupName: string, options?: DataControllersListInGroupOptionalParams): PagedAsyncIterableIterator; + listInSubscription(options?: DataControllersListInSubscriptionOptionalParams): PagedAsyncIterableIterator; + patchDataController(resourceGroupName: string, dataControllerName: string, dataControllerResource: DataControllerUpdate, options?: DataControllersPatchDataControllerOptionalParams): Promise; +} + +// @public +export interface DataControllersDeleteDataControllerOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface DataControllersGetDataControllerOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DataControllersGetDataControllerResponse = DataControllerResource; + +// @public +export interface DataControllersListInGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DataControllersListInGroupNextResponse = PageOfDataControllerResource; + +// @public +export interface DataControllersListInGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DataControllersListInGroupResponse = PageOfDataControllerResource; + +// @public +export interface DataControllersListInSubscriptionNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DataControllersListInSubscriptionNextResponse = PageOfDataControllerResource; + +// @public +export interface DataControllersListInSubscriptionOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DataControllersListInSubscriptionResponse = PageOfDataControllerResource; + +// @public +export interface DataControllersPatchDataControllerOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DataControllersPatchDataControllerResponse = DataControllerResource; + +// @public +export interface DataControllersPutDataControllerOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type DataControllersPutDataControllerResponse = DataControllerResource; + +// @public +export interface DataControllerUpdate { + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export type DefenderStatus = string; + +// @public +export type EditionType = string; + +// @public +export interface ErrorResponse { + error?: ErrorResponseBody; +} + +// @public +export interface ErrorResponseBody { + code?: string; + details?: ErrorResponseBody[]; + message?: string; + target?: string; +} + +// @public +export interface ExtendedLocation { + name?: string; + type?: ExtendedLocationTypes; +} + +// @public +export type ExtendedLocationTypes = string; + +// @public +export type Infrastructure = "azure" | "gcp" | "aws" | "alibaba" | "onpremises" | "other"; + +// @public +export interface K8SResourceRequirements { + [property: string]: any; + limits?: { + [propertyName: string]: string; + }; + requests?: { + [propertyName: string]: string; + }; +} + +// @public +export interface K8SScheduling { + [property: string]: any; + default?: K8SSchedulingOptions; +} + +// @public +export interface K8SSchedulingOptions { + [property: string]: any; + resources?: K8SResourceRequirements; +} + +// @public +export enum KnownArcSqlServerLicenseType { + // (undocumented) + Free = "Free", + // (undocumented) + Hadr = "HADR", + // (undocumented) + Paid = "Paid", + // (undocumented) + Undefined = "Undefined" +} + +// @public +export enum KnownConnectionStatus { + // (undocumented) + Connected = "Connected", + // (undocumented) + Disconnected = "Disconnected", + // (undocumented) + Unknown = "Unknown" +} + +// @public +export enum KnownCreatedByType { + // (undocumented) + Application = "Application", + // (undocumented) + Key = "Key", + // (undocumented) + ManagedIdentity = "ManagedIdentity", + // (undocumented) + User = "User" +} + +// @public +export enum KnownDefenderStatus { + // (undocumented) + Protected = "Protected", + // (undocumented) + Unknown = "Unknown", + // (undocumented) + Unprotected = "Unprotected" +} + +// @public +export enum KnownEditionType { + // (undocumented) + Developer = "Developer", + // (undocumented) + Enterprise = "Enterprise", + // (undocumented) + Evaluation = "Evaluation", + // (undocumented) + Express = "Express", + // (undocumented) + Standard = "Standard", + // (undocumented) + Web = "Web" +} + +// @public +export enum KnownExtendedLocationTypes { + // (undocumented) + CustomLocation = "CustomLocation" +} + +// @public +export enum KnownOperationOrigin { + // (undocumented) + System = "system", + // (undocumented) + User = "user" +} + +// @public +export enum KnownSqlVersion { + // (undocumented) + SQLServer2016 = "SQL Server 2016", + // (undocumented) + SQLServer2017 = "SQL Server 2017", + // (undocumented) + SQLServer2019 = "SQL Server 2019" +} + +// @public +export interface LogAnalyticsWorkspaceConfig { + primaryKey?: string; + workspaceId?: string; +} + +// @public +export interface OnPremiseProperty { + id: string; + publicSigningKey: string; + signingCertificateThumbprint?: string; +} + +// @public +export interface Operation { + display: OperationDisplay; + isDataAction: boolean; + name: string; + readonly origin?: OperationOrigin; + readonly properties?: { + [propertyName: string]: Record; + }; +} + +// @public +export interface OperationDisplay { + description: string; + operation: string; + provider: string; + resource: string; +} + +// @public +export interface OperationListResult { + readonly nextLink?: string; + readonly value?: Operation[]; +} + +// @public +export type OperationOrigin = string; + +// @public +export interface Operations { + list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface OperationsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListNextResponse = OperationListResult; + +// @public +export interface OperationsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListResponse = OperationListResult; + +// @public (undocumented) +export interface PageOfDataControllerResource { + nextLink?: string; + // (undocumented) + value?: DataControllerResource[]; +} + +// @public +export interface Resource { + readonly id?: string; + readonly name?: string; + readonly systemData?: SystemData; + readonly type?: string; +} + +// @public +export type SqlManagedInstance = TrackedResource & { + properties: SqlManagedInstanceProperties; + extendedLocation?: ExtendedLocation; + sku?: SqlManagedInstanceSku; +}; + +// @public +export interface SqlManagedInstanceK8SRaw { + [property: string]: any; + spec?: SqlManagedInstanceK8SSpec; +} + +// @public +export interface SqlManagedInstanceK8SSpec { + [property: string]: any; + replicas?: number; + scheduling?: K8SScheduling; +} + +// @public +export interface SqlManagedInstanceListResult { + readonly nextLink?: string; + readonly value?: SqlManagedInstance[]; +} + +// @public +export interface SqlManagedInstanceProperties { + admin?: string; + basicLoginInformation?: BasicLoginInformation; + clusterId?: string; + dataControllerId?: string; + endTime?: string; + extensionId?: string; + k8SRaw?: SqlManagedInstanceK8SRaw; + lastUploadedDate?: Date; + licenseType?: ArcSqlManagedInstanceLicenseType; + readonly provisioningState?: string; + startTime?: string; +} + +// @public +export interface SqlManagedInstances { + beginCreate(resourceGroupName: string, sqlManagedInstanceName: string, sqlManagedInstance: SqlManagedInstance, options?: SqlManagedInstancesCreateOptionalParams): Promise, SqlManagedInstancesCreateResponse>>; + beginCreateAndWait(resourceGroupName: string, sqlManagedInstanceName: string, sqlManagedInstance: SqlManagedInstance, options?: SqlManagedInstancesCreateOptionalParams): Promise; + beginDelete(resourceGroupName: string, sqlManagedInstanceName: string, options?: SqlManagedInstancesDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, sqlManagedInstanceName: string, options?: SqlManagedInstancesDeleteOptionalParams): Promise; + get(resourceGroupName: string, sqlManagedInstanceName: string, options?: SqlManagedInstancesGetOptionalParams): Promise; + list(options?: SqlManagedInstancesListOptionalParams): PagedAsyncIterableIterator; + listByResourceGroup(resourceGroupName: string, options?: SqlManagedInstancesListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + update(resourceGroupName: string, sqlManagedInstanceName: string, parameters: SqlManagedInstanceUpdate, options?: SqlManagedInstancesUpdateOptionalParams): Promise; +} + +// @public +export interface SqlManagedInstancesCreateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type SqlManagedInstancesCreateResponse = SqlManagedInstance; + +// @public +export interface SqlManagedInstancesDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface SqlManagedInstancesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SqlManagedInstancesGetResponse = SqlManagedInstance; + +// @public +export interface SqlManagedInstanceSku { + // (undocumented) + capacity?: number; + dev?: boolean; + // (undocumented) + family?: string; + name: "vCore"; + size?: string; + tier?: SqlManagedInstanceSkuTier; +} + +// @public +export type SqlManagedInstanceSkuTier = "GeneralPurpose" | "BusinessCritical"; + +// @public +export interface SqlManagedInstancesListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SqlManagedInstancesListByResourceGroupNextResponse = SqlManagedInstanceListResult; + +// @public +export interface SqlManagedInstancesListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SqlManagedInstancesListByResourceGroupResponse = SqlManagedInstanceListResult; + +// @public +export interface SqlManagedInstancesListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SqlManagedInstancesListNextResponse = SqlManagedInstanceListResult; + +// @public +export interface SqlManagedInstancesListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SqlManagedInstancesListResponse = SqlManagedInstanceListResult; + +// @public +export interface SqlManagedInstancesUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SqlManagedInstancesUpdateResponse = SqlManagedInstance; + +// @public +export interface SqlManagedInstanceUpdate { + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export type SqlServerInstance = TrackedResource & { + properties?: SqlServerInstanceProperties; +}; + +// @public +export interface SqlServerInstanceListResult { + readonly nextLink?: string; + readonly value?: SqlServerInstance[]; +} + +// @public +export interface SqlServerInstanceProperties { + azureDefenderStatus?: DefenderStatus; + azureDefenderStatusLastUpdated?: Date; + collation?: string; + containerResourceId: string; + readonly createTime?: string; + currentVersion?: string; + edition?: EditionType; + instanceName?: string; + licenseType?: ArcSqlServerLicenseType; + patchLevel?: string; + productId?: string; + readonly provisioningState?: string; + status: ConnectionStatus; + tcpDynamicPorts?: string; + tcpStaticPorts?: string; + vCore?: string; + version?: SqlVersion; +} + +// @public +export interface SqlServerInstances { + beginCreate(resourceGroupName: string, sqlServerInstanceName: string, sqlServerInstance: SqlServerInstance, options?: SqlServerInstancesCreateOptionalParams): Promise, SqlServerInstancesCreateResponse>>; + beginCreateAndWait(resourceGroupName: string, sqlServerInstanceName: string, sqlServerInstance: SqlServerInstance, options?: SqlServerInstancesCreateOptionalParams): Promise; + beginDelete(resourceGroupName: string, sqlServerInstanceName: string, options?: SqlServerInstancesDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, sqlServerInstanceName: string, options?: SqlServerInstancesDeleteOptionalParams): Promise; + get(resourceGroupName: string, sqlServerInstanceName: string, options?: SqlServerInstancesGetOptionalParams): Promise; + list(options?: SqlServerInstancesListOptionalParams): PagedAsyncIterableIterator; + listByResourceGroup(resourceGroupName: string, options?: SqlServerInstancesListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + update(resourceGroupName: string, sqlServerInstanceName: string, parameters: SqlServerInstanceUpdate, options?: SqlServerInstancesUpdateOptionalParams): Promise; +} + +// @public +export interface SqlServerInstancesCreateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type SqlServerInstancesCreateResponse = SqlServerInstance; + +// @public +export interface SqlServerInstancesDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface SqlServerInstancesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SqlServerInstancesGetResponse = SqlServerInstance; + +// @public +export interface SqlServerInstancesListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SqlServerInstancesListByResourceGroupNextResponse = SqlServerInstanceListResult; + +// @public +export interface SqlServerInstancesListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SqlServerInstancesListByResourceGroupResponse = SqlServerInstanceListResult; + +// @public +export interface SqlServerInstancesListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SqlServerInstancesListNextResponse = SqlServerInstanceListResult; + +// @public +export interface SqlServerInstancesListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SqlServerInstancesListResponse = SqlServerInstanceListResult; + +// @public +export interface SqlServerInstancesUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SqlServerInstancesUpdateResponse = SqlServerInstance; + +// @public +export interface SqlServerInstanceUpdate { + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export type SqlVersion = string; + +// @public +export interface SystemData { + createdAt?: Date; + createdBy?: string; + createdByType?: CreatedByType; + lastModifiedAt?: Date; + lastModifiedBy?: string; + lastModifiedByType?: CreatedByType; +} + +// @public +export type TrackedResource = Resource & { + tags?: { + [propertyName: string]: string; + }; + location: string; +}; + +// @public +export interface UploadServicePrincipal { + authority?: string; + clientId?: string; + clientSecret?: string; + tenantId?: string; +} + +// @public +export interface UploadWatermark { + logs?: Date; + metrics?: Date; + usages?: Date; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/azurearcdata/arm-azurearcdata/rollup.config.js b/sdk/azurearcdata/arm-azurearcdata/rollup.config.js new file mode 100644 index 000000000000..9be1955eb7f1 --- /dev/null +++ b/sdk/azurearcdata/arm-azurearcdata/rollup.config.js @@ -0,0 +1,188 @@ +/* + * 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 nodeResolve from "@rollup/plugin-node-resolve"; +import cjs from "@rollup/plugin-commonjs"; +import sourcemaps from "rollup-plugin-sourcemaps"; +import multiEntry from "@rollup/plugin-multi-entry"; +import json from "@rollup/plugin-json"; + +import nodeBuiltins from "builtin-modules"; + +/** + * Gets the proper configuration needed for rollup's commonJS plugin for @opentelemetry/api. + * + * NOTE: this manual configuration is only needed because OpenTelemetry uses an + * __exportStar downleveled helper function to declare its exports which confuses + * rollup's automatic discovery mechanism. + * + * @returns an object reference that can be `...`'d into your cjs() configuration. + */ +export function openTelemetryCommonJs() { + const namedExports = {}; + + for (const key of [ + "@opentelemetry/api", + "@azure/core-tracing/node_modules/@opentelemetry/api" + ]) { + namedExports[key] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "SpanStatusCode", + "getSpanContext", + "setSpanContext" + ]; + } + + const releasedOpenTelemetryVersions = ["0.10.2", "1.0.0-rc.0"]; + + for (const version of releasedOpenTelemetryVersions) { + namedExports[ + // working around a limitation in the rollup common.js plugin - it's not able to resolve these modules so the named exports listed above will not get applied. We have to drill down to the actual path. + `../../../common/temp/node_modules/.pnpm/@opentelemetry/api@${version}/node_modules/@opentelemetry/api/build/src/index.js` + ] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "StatusCode", + "CanonicalCode", + "getSpanContext", + "setSpanContext" + ]; + } + + return namedExports; +} + +// #region Warning Handler + +/** + * A function that can determine whether a rollupwarning should be ignored. If + * the function returns `true`, then the warning will not be displayed. + */ + +function ignoreNiseSinonEvalWarnings(warning) { + return ( + warning.code === "EVAL" && + warning.id && + (warning.id.includes("node_modules/nise") || + warning.id.includes("node_modules/sinon")) === true + ); +} + +function ignoreChaiCircularDependencyWarnings(warning) { + return ( + warning.code === "CIRCULAR_DEPENDENCY" && + warning.importer && warning.importer.includes("node_modules/chai") === true + ); +} + +const warningInhibitors = [ + ignoreChaiCircularDependencyWarnings, + ignoreNiseSinonEvalWarnings +]; + +/** + * Construct a warning handler for the shared rollup configuration + * that ignores certain warnings that are not relevant to testing. + */ +function makeOnWarnForTesting() { + return (warning, warn) => { + // If every inhibitor returns false (i.e. no inhibitors), then show the warning + if (warningInhibitors.every((inhib) => !inhib(warning))) { + warn(warning); + } + }; +} + +// #endregion + +function makeBrowserTestConfig() { + const config = { + input: { + include: ["dist-esm/test/**/*.spec.js"], + exclude: ["dist-esm/test/**/node/**"] + }, + output: { + file: `dist-test/index.browser.js`, + format: "umd", + sourcemap: true + }, + preserveSymlinks: false, + plugins: [ + multiEntry({ exports: false }), + nodeResolve({ + mainFields: ["module", "browser"] + }), + cjs({ + namedExports: { + // Chai's strange internal architecture makes it impossible to statically + // analyze its exports. + chai: [ + "version", + "use", + "util", + "config", + "expect", + "should", + "assert" + ], + ...openTelemetryCommonJs() + } + }), + json(), + sourcemaps() + //viz({ filename: "dist-test/browser-stats.html", sourcemap: true }) + ], + onwarn: makeOnWarnForTesting(), + // Disable tree-shaking of test code. In rollup-plugin-node-resolve@5.0.0, + // rollup started respecting the "sideEffects" field in package.json. Since + // our package.json sets "sideEffects=false", this also applies to test + // code, which causes all tests to be removed by tree-shaking. + treeshake: false + }; + + return config; +} + +const defaultConfigurationOptions = { + disableBrowserBundle: false +}; + +export function makeConfig(pkg, options) { + options = { + ...defaultConfigurationOptions, + ...(options || {}) + }; + + const baseConfig = { + // Use the package's module field if it has one + input: pkg["module"] || "dist-esm/src/index.js", + external: [ + ...nodeBuiltins, + ...Object.keys(pkg.dependencies), + ...Object.keys(pkg.devDependencies) + ], + output: { file: "dist/index.js", format: "cjs", sourcemap: true }, + preserveSymlinks: false, + plugins: [sourcemaps(), nodeResolve(), cjs()] + }; + + const config = [baseConfig]; + + if (!options.disableBrowserBundle) { + config.push(makeBrowserTestConfig()); + } + + return config; +} + +export default makeConfig(require("./package.json")); diff --git a/sdk/azurearcdata/arm-azurearcdata/src/azureArcDataManagementClient.ts b/sdk/azurearcdata/arm-azurearcdata/src/azureArcDataManagementClient.ts new file mode 100644 index 000000000000..2b7fb04b6a17 --- /dev/null +++ b/sdk/azurearcdata/arm-azurearcdata/src/azureArcDataManagementClient.ts @@ -0,0 +1,91 @@ +/* + * 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 * as coreClient from "@azure/core-client"; +import * as coreAuth from "@azure/core-auth"; +import { + OperationsImpl, + SqlManagedInstancesImpl, + SqlServerInstancesImpl, + DataControllersImpl +} from "./operations"; +import { + Operations, + SqlManagedInstances, + SqlServerInstances, + DataControllers +} from "./operationsInterfaces"; +import { AzureArcDataManagementClientOptionalParams } from "./models"; + +export class AzureArcDataManagementClient extends coreClient.ServiceClient { + $host: string; + apiVersion: string; + subscriptionId: string; + + /** + * Initializes a new instance of the AzureArcDataManagementClient class. + * @param credentials Subscription credentials which uniquely identify client subscription. + * @param subscriptionId The ID of the Azure subscription + * @param options The parameter options + */ + constructor( + credentials: coreAuth.TokenCredential, + subscriptionId: string, + options?: AzureArcDataManagementClientOptionalParams + ) { + if (credentials === undefined) { + throw new Error("'credentials' cannot be null"); + } + if (subscriptionId === undefined) { + throw new Error("'subscriptionId' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: AzureArcDataManagementClientOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; + + const packageDetails = `azsdk-js-arm-azurearcdata/1.0.0`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + if (!options.credentialScopes) { + options.credentialScopes = ["https://management.azure.com/.default"]; + } + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "https://management.azure.com" + }; + super(optionsWithDefaults); + // Parameter assignments + this.subscriptionId = subscriptionId; + + // Assigning values to Constant parameters + this.$host = options.$host || "https://management.azure.com"; + this.apiVersion = options.apiVersion || "2021-11-01"; + this.operations = new OperationsImpl(this); + this.sqlManagedInstances = new SqlManagedInstancesImpl(this); + this.sqlServerInstances = new SqlServerInstancesImpl(this); + this.dataControllers = new DataControllersImpl(this); + } + + operations: Operations; + sqlManagedInstances: SqlManagedInstances; + sqlServerInstances: SqlServerInstances; + dataControllers: DataControllers; +} diff --git a/sdk/azurearcdata/arm-azurearcdata/src/index.ts b/sdk/azurearcdata/arm-azurearcdata/src/index.ts new file mode 100644 index 000000000000..c18adc5c41af --- /dev/null +++ b/sdk/azurearcdata/arm-azurearcdata/src/index.ts @@ -0,0 +1,12 @@ +/* + * 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. + */ + +/// +export * from "./models"; +export { AzureArcDataManagementClient } from "./azureArcDataManagementClient"; +export * from "./operationsInterfaces"; diff --git a/sdk/azurearcdata/arm-azurearcdata/src/lroImpl.ts b/sdk/azurearcdata/arm-azurearcdata/src/lroImpl.ts new file mode 100644 index 000000000000..518d5f053b4e --- /dev/null +++ b/sdk/azurearcdata/arm-azurearcdata/src/lroImpl.ts @@ -0,0 +1,34 @@ +/* + * 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 { LongRunningOperation, LroResponse } from "@azure/core-lro"; + +export class LroImpl implements LongRunningOperation { + constructor( + private sendOperationFn: (args: any, spec: any) => Promise>, + private args: Record, + private spec: { + readonly requestBody?: unknown; + readonly path?: string; + readonly httpMethod: string; + } & Record, + public requestPath: string = spec.path!, + public requestMethod: string = spec.httpMethod + ) {} + public async sendInitialRequest(): Promise> { + return this.sendOperationFn(this.args, this.spec); + } + public async sendPollRequest(path: string): Promise> { + const { requestBody, ...restSpec } = this.spec; + return this.sendOperationFn(this.args, { + ...restSpec, + path, + httpMethod: "GET" + }); + } +} diff --git a/sdk/azurearcdata/arm-azurearcdata/src/models/index.ts b/sdk/azurearcdata/arm-azurearcdata/src/models/index.ts new file mode 100644 index 000000000000..ec6eadd25798 --- /dev/null +++ b/sdk/azurearcdata/arm-azurearcdata/src/models/index.ts @@ -0,0 +1,782 @@ +/* + * 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 * as coreClient from "@azure/core-client"; + +/** Result of the request to list Azure Data Services on Azure Arc operations. */ +export interface OperationListResult { + /** + * Array of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: Operation[]; + /** + * Link to retrieve next page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Azure Data Services on Azure Arc operation definition. */ +export interface Operation { + /** The name of the operation being performed on this particular object. */ + name: string; + /** The localized display information for this particular operation / action. */ + display: OperationDisplay; + /** + * The intended executor of the operation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly origin?: OperationOrigin; + /** Indicates whether the operation is a data action */ + isDataAction: boolean; + /** + * Additional descriptions for the operation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly properties?: { [propertyName: string]: Record }; +} + +/** Display metadata associated with the operation. */ +export interface OperationDisplay { + /** The localized friendly form of the resource provider name. */ + provider: string; + /** The localized friendly form of the resource type related to this action/operation. */ + resource: string; + /** The localized friendly name for the operation. */ + operation: string; + /** The localized friendly description for the operation. */ + description: string; +} + +/** An error response from the Azure Data on Azure Arc service. */ +export interface ErrorResponse { + /** null */ + error?: ErrorResponseBody; +} + +/** An error response from the Batch service. */ +export interface ErrorResponseBody { + /** An identifier for the error. Codes are invariant and are intended to be consumed programmatically. */ + code?: string; + /** A message describing the error, intended to be suitable for display in a user interface. */ + message?: string; + /** The target of the particular error. For example, the name of the property in error. */ + target?: string; + /** A list of additional details about the error. */ + details?: ErrorResponseBody[]; +} + +/** A list of SqlManagedInstance. */ +export interface SqlManagedInstanceListResult { + /** + * Array of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: SqlManagedInstance[]; + /** + * Link to retrieve next page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Properties of sqlManagedInstance. */ +export interface SqlManagedInstanceProperties { + /** null */ + dataControllerId?: string; + /** The instance admin user */ + admin?: string; + /** The instance start time */ + startTime?: string; + /** The instance end time */ + endTime?: string; + /** The raw kubernetes information */ + k8SRaw?: SqlManagedInstanceK8SRaw; + /** Username and password for basic authentication. */ + basicLoginInformation?: BasicLoginInformation; + /** Last uploaded date from Kubernetes cluster. Defaults to current date time */ + lastUploadedDate?: Date; + /** NOTE: This property will not be serialized. It can only be populated by the server. */ + readonly provisioningState?: string; + /** The license type to apply for this managed instance. */ + licenseType?: ArcSqlManagedInstanceLicenseType; + /** If a CustomLocation is provided, this contains the ARM id of the connected cluster the custom location belongs to. */ + clusterId?: string; + /** If a CustomLocation is provided, this contains the ARM id of the extension the custom location belongs to. */ + extensionId?: string; +} + +/** The raw kubernetes information. */ +export interface SqlManagedInstanceK8SRaw { + /** Describes unknown properties. The value of an unknown property can be of "any" type. */ + [property: string]: any; + /** The kubernetes spec information. */ + spec?: SqlManagedInstanceK8SSpec; +} + +/** The kubernetes spec information. */ +export interface SqlManagedInstanceK8SSpec { + /** Describes unknown properties. The value of an unknown property can be of "any" type. */ + [property: string]: any; + /** The kubernetes scheduling information. */ + scheduling?: K8SScheduling; + /** This option specifies the number of SQL Managed Instance replicas that will be deployed in your Kubernetes cluster for high availability purposes. If sku.tier is BusinessCritical, allowed values are '2' or '3' with default of '3'. If sku.tier is GeneralPurpose, replicas must be '1'. */ + replicas?: number; +} + +/** The kubernetes scheduling information. */ +export interface K8SScheduling { + /** Describes unknown properties. The value of an unknown property can be of "any" type. */ + [property: string]: any; + /** The kubernetes scheduling options. It describes restrictions used to help Kubernetes select appropriate nodes to host the database service */ + default?: K8SSchedulingOptions; +} + +/** The kubernetes scheduling options. It describes restrictions used to help Kubernetes select appropriate nodes to host the database service */ +export interface K8SSchedulingOptions { + /** Describes unknown properties. The value of an unknown property can be of "any" type. */ + [property: string]: any; + /** The kubernetes resource limits and requests used to restrict or reserve resource usage. */ + resources?: K8SResourceRequirements; +} + +/** The kubernetes resource limits and requests used to restrict or reserve resource usage. */ +export interface K8SResourceRequirements { + /** Describes unknown properties. The value of an unknown property can be of "any" type. */ + [property: string]: any; + /** Requests for a kubernetes resource type (e.g 'cpu', 'memory'). The 'cpu' request must be less than or equal to 'cpu' limit. Default 'cpu' is 2, minimum is 1. Default 'memory' is '4Gi', minimum is '2Gi. If sku.tier is GeneralPurpose, maximum 'cpu' is 24 and maximum 'memory' is '128Gi'. */ + requests?: { [propertyName: string]: string }; + /** Limits for a kubernetes resource type (e.g 'cpu', 'memory'). The 'cpu' request must be less than or equal to 'cpu' limit. Default 'cpu' is 2, minimum is 1. Default 'memory' is '4Gi', minimum is '2Gi. If sku.tier is GeneralPurpose, maximum 'cpu' is 24 and maximum 'memory' is '128Gi'. */ + limits?: { [propertyName: string]: string }; +} + +/** Username and password for basic login authentication. */ +export interface BasicLoginInformation { + /** Login username. */ + username?: string; + /** Login password. */ + password?: string; +} + +/** The complex type of the extended location. */ +export interface ExtendedLocation { + /** The name of the extended location. */ + name?: string; + /** The type of the extended location. */ + type?: ExtendedLocationTypes; +} + +/** The resource model definition representing SKU for Azure Managed Instance - Azure Arc */ +export interface SqlManagedInstanceSku { + /** The name of the SKU. */ + name: "vCore"; + /** The pricing tier for the instance. */ + tier?: SqlManagedInstanceSkuTier; + /** Whether dev/test is enabled. When the dev field is set to true, the resource is used for dev/test purpose. */ + dev?: boolean; + /** The SKU size. When the name field is the combination of tier and some other value, this would be the standalone code. */ + size?: string; + family?: string; + capacity?: number; +} + +/** Common fields that are returned in the response for all Azure Resource Manager resources */ +export interface Resource { + /** + * Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * The name of the resource + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; +} + +/** Metadata pertaining to creation and last modification of the resource. */ +export interface SystemData { + /** The identity that created the resource. */ + createdBy?: string; + /** The type of identity that created the resource. */ + createdByType?: CreatedByType; + /** The timestamp of resource creation (UTC). */ + createdAt?: Date; + /** The identity that last modified the resource. */ + lastModifiedBy?: string; + /** The type of identity that last modified the resource. */ + lastModifiedByType?: CreatedByType; + /** The timestamp of resource last modification (UTC) */ + lastModifiedAt?: Date; +} + +/** An update to a SQL Managed Instance. */ +export interface SqlManagedInstanceUpdate { + /** Resource tags. */ + tags?: { [propertyName: string]: string }; +} + +/** A list of SqlServerInstance. */ +export interface SqlServerInstanceListResult { + /** + * Array of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: SqlServerInstance[]; + /** + * Link to retrieve next page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Properties of SqlServerInstance. */ +export interface SqlServerInstanceProperties { + /** SQL Server version. */ + version?: SqlVersion; + /** SQL Server edition. */ + edition?: EditionType; + /** ARM Resource id of the container resource (Azure Arc for Servers). */ + containerResourceId: string; + /** + * The time when the resource was created. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly createTime?: string; + /** The number of logical processors used by the SQL Server instance. */ + vCore?: string; + /** The cloud connectivity status. */ + status: ConnectionStatus; + /** SQL Server update level. */ + patchLevel?: string; + /** SQL Server collation. */ + collation?: string; + /** SQL Server current version. */ + currentVersion?: string; + /** SQL Server instance name. */ + instanceName?: string; + /** Dynamic TCP ports used by SQL Server. */ + tcpDynamicPorts?: string; + /** Static TCP ports used by SQL Server. */ + tcpStaticPorts?: string; + /** SQL Server product ID. */ + productId?: string; + /** SQL Server license type. */ + licenseType?: ArcSqlServerLicenseType; + /** Timestamp of last Azure Defender status update. */ + azureDefenderStatusLastUpdated?: Date; + /** Status of Azure Defender. */ + azureDefenderStatus?: DefenderStatus; + /** NOTE: This property will not be serialized. It can only be populated by the server. */ + readonly provisioningState?: string; +} + +/** An update to a SQL Server Instance. */ +export interface SqlServerInstanceUpdate { + /** Resource tags. */ + tags?: { [propertyName: string]: string }; +} + +export interface PageOfDataControllerResource { + value?: DataControllerResource[]; + /** Link to retrieve next page of results. */ + nextLink?: string; +} + +/** The data controller properties. */ +export interface DataControllerProperties { + /** The infrastructure the data controller is running on. */ + infrastructure?: Infrastructure; + /** Properties from the Kubernetes data controller */ + onPremiseProperty?: OnPremiseProperty; + /** The raw kubernetes information */ + k8SRaw?: Record; + /** Properties on upload watermark. Mostly timestamp for each upload data type */ + uploadWatermark?: UploadWatermark; + /** Last uploaded date from Kubernetes cluster. Defaults to current date time */ + lastUploadedDate?: Date; + /** Deprecated. Azure Arc Data Services data controller no longer expose any endpoint. All traffic are exposed through Kubernetes native API. */ + basicLoginInformation?: BasicLoginInformation; + /** Login credential for metrics dashboard on the Kubernetes cluster. */ + metricsDashboardCredential?: BasicLoginInformation; + /** Login credential for logs dashboard on the Kubernetes cluster. */ + logsDashboardCredential?: BasicLoginInformation; + /** Log analytics workspace id and primary key */ + logAnalyticsWorkspaceConfig?: LogAnalyticsWorkspaceConfig; + /** Deprecated. Service principal is deprecated in favor of Arc Kubernetes service extension managed identity. */ + uploadServicePrincipal?: UploadServicePrincipal; + /** NOTE: This property will not be serialized. It can only be populated by the server. */ + readonly provisioningState?: string; + /** If a CustomLocation is provided, this contains the ARM id of the connected cluster the custom location belongs to. */ + clusterId?: string; + /** If a CustomLocation is provided, this contains the ARM id of the extension the custom location belongs to. */ + extensionId?: string; +} + +/** Properties from the Kubernetes data controller */ +export interface OnPremiseProperty { + /** A globally unique ID identifying the associated Kubernetes cluster */ + id: string; + /** Certificate that contains the Kubernetes cluster public key used to verify signing */ + publicSigningKey: string; + /** Unique thumbprint returned to customer to verify the certificate being uploaded */ + signingCertificateThumbprint?: string; +} + +/** Properties on upload watermark. Mostly timestamp for each upload data type */ +export interface UploadWatermark { + /** Last uploaded date for metrics from kubernetes cluster. Defaults to current date time */ + metrics?: Date; + /** Last uploaded date for logs from kubernetes cluster. Defaults to current date time */ + logs?: Date; + /** Last uploaded date for usages from kubernetes cluster. Defaults to current date time */ + usages?: Date; +} + +/** Log analytics workspace id and primary key */ +export interface LogAnalyticsWorkspaceConfig { + /** Azure Log Analytics workspace ID */ + workspaceId?: string; + /** Primary key of the workspace */ + primaryKey?: string; +} + +/** Service principal for uploading billing, metrics and logs. */ +export interface UploadServicePrincipal { + /** Client ID of the service principal for uploading data. */ + clientId?: string; + /** Tenant ID of the service principal. */ + tenantId?: string; + /** Authority for the service principal. Example: https://login.microsoftonline.com/ */ + authority?: string; + /** Secret of the service principal */ + clientSecret?: string; +} + +/** Used for updating a data controller resource. */ +export interface DataControllerUpdate { + /** Resource tags */ + tags?: { [propertyName: string]: string }; +} + +/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ +export type TrackedResource = Resource & { + /** Resource tags. */ + tags?: { [propertyName: string]: string }; + /** The geo-location where the resource lives */ + location: string; +}; + +/** A SqlManagedInstance. */ +export type SqlManagedInstance = TrackedResource & { + /** null */ + properties: SqlManagedInstanceProperties; + /** The extendedLocation of the resource. */ + extendedLocation?: ExtendedLocation; + /** Resource sku. */ + sku?: SqlManagedInstanceSku; +}; + +/** A SqlServerInstance. */ +export type SqlServerInstance = TrackedResource & { + /** null */ + properties?: SqlServerInstanceProperties; +}; + +/** Data controller resource */ +export type DataControllerResource = TrackedResource & { + /** The extendedLocation of the resource. */ + extendedLocation?: ExtendedLocation; + /** The data controller's properties */ + properties: DataControllerProperties; +}; + +/** Known values of {@link OperationOrigin} that the service accepts. */ +export enum KnownOperationOrigin { + User = "user", + System = "system" +} + +/** + * Defines values for OperationOrigin. \ + * {@link KnownOperationOrigin} can be used interchangeably with OperationOrigin, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **user** \ + * **system** + */ +export type OperationOrigin = string; + +/** Known values of {@link ExtendedLocationTypes} that the service accepts. */ +export enum KnownExtendedLocationTypes { + CustomLocation = "CustomLocation" +} + +/** + * Defines values for ExtendedLocationTypes. \ + * {@link KnownExtendedLocationTypes} can be used interchangeably with ExtendedLocationTypes, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **CustomLocation** + */ +export type ExtendedLocationTypes = string; + +/** Known values of {@link CreatedByType} that the service accepts. */ +export enum KnownCreatedByType { + User = "User", + Application = "Application", + ManagedIdentity = "ManagedIdentity", + Key = "Key" +} + +/** + * Defines values for CreatedByType. \ + * {@link KnownCreatedByType} can be used interchangeably with CreatedByType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **User** \ + * **Application** \ + * **ManagedIdentity** \ + * **Key** + */ +export type CreatedByType = string; + +/** Known values of {@link SqlVersion} that the service accepts. */ +export enum KnownSqlVersion { + SQLServer2019 = "SQL Server 2019", + SQLServer2017 = "SQL Server 2017", + SQLServer2016 = "SQL Server 2016" +} + +/** + * Defines values for SqlVersion. \ + * {@link KnownSqlVersion} can be used interchangeably with SqlVersion, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **SQL Server 2019** \ + * **SQL Server 2017** \ + * **SQL Server 2016** + */ +export type SqlVersion = string; + +/** Known values of {@link EditionType} that the service accepts. */ +export enum KnownEditionType { + Evaluation = "Evaluation", + Enterprise = "Enterprise", + Standard = "Standard", + Web = "Web", + Developer = "Developer", + Express = "Express" +} + +/** + * Defines values for EditionType. \ + * {@link KnownEditionType} can be used interchangeably with EditionType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Evaluation** \ + * **Enterprise** \ + * **Standard** \ + * **Web** \ + * **Developer** \ + * **Express** + */ +export type EditionType = string; + +/** Known values of {@link ConnectionStatus} that the service accepts. */ +export enum KnownConnectionStatus { + Connected = "Connected", + Disconnected = "Disconnected", + Unknown = "Unknown" +} + +/** + * Defines values for ConnectionStatus. \ + * {@link KnownConnectionStatus} can be used interchangeably with ConnectionStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Connected** \ + * **Disconnected** \ + * **Unknown** + */ +export type ConnectionStatus = string; + +/** Known values of {@link ArcSqlServerLicenseType} that the service accepts. */ +export enum KnownArcSqlServerLicenseType { + Paid = "Paid", + Free = "Free", + Hadr = "HADR", + Undefined = "Undefined" +} + +/** + * Defines values for ArcSqlServerLicenseType. \ + * {@link KnownArcSqlServerLicenseType} can be used interchangeably with ArcSqlServerLicenseType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Paid** \ + * **Free** \ + * **HADR** \ + * **Undefined** + */ +export type ArcSqlServerLicenseType = string; + +/** Known values of {@link DefenderStatus} that the service accepts. */ +export enum KnownDefenderStatus { + Protected = "Protected", + Unprotected = "Unprotected", + Unknown = "Unknown" +} + +/** + * Defines values for DefenderStatus. \ + * {@link KnownDefenderStatus} can be used interchangeably with DefenderStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Protected** \ + * **Unprotected** \ + * **Unknown** + */ +export type DefenderStatus = string; +/** Defines values for ArcSqlManagedInstanceLicenseType. */ +export type ArcSqlManagedInstanceLicenseType = "BasePrice" | "LicenseIncluded"; +/** Defines values for SqlManagedInstanceSkuTier. */ +export type SqlManagedInstanceSkuTier = "GeneralPurpose" | "BusinessCritical"; +/** Defines values for Infrastructure. */ +export type Infrastructure = + | "azure" + | "gcp" + | "aws" + | "alibaba" + | "onpremises" + | "other"; + +/** Optional parameters. */ +export interface OperationsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type OperationsListResponse = OperationListResult; + +/** Optional parameters. */ +export interface OperationsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type OperationsListNextResponse = OperationListResult; + +/** Optional parameters. */ +export interface SqlManagedInstancesListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type SqlManagedInstancesListResponse = SqlManagedInstanceListResult; + +/** Optional parameters. */ +export interface SqlManagedInstancesListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type SqlManagedInstancesListByResourceGroupResponse = SqlManagedInstanceListResult; + +/** Optional parameters. */ +export interface SqlManagedInstancesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type SqlManagedInstancesGetResponse = SqlManagedInstance; + +/** Optional parameters. */ +export interface SqlManagedInstancesCreateOptionalParams + 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 create operation. */ +export type SqlManagedInstancesCreateResponse = SqlManagedInstance; + +/** Optional parameters. */ +export interface SqlManagedInstancesDeleteOptionalParams + 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; +} + +/** Optional parameters. */ +export interface SqlManagedInstancesUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the update operation. */ +export type SqlManagedInstancesUpdateResponse = SqlManagedInstance; + +/** Optional parameters. */ +export interface SqlManagedInstancesListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type SqlManagedInstancesListNextResponse = SqlManagedInstanceListResult; + +/** Optional parameters. */ +export interface SqlManagedInstancesListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type SqlManagedInstancesListByResourceGroupNextResponse = SqlManagedInstanceListResult; + +/** Optional parameters. */ +export interface SqlServerInstancesListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type SqlServerInstancesListResponse = SqlServerInstanceListResult; + +/** Optional parameters. */ +export interface SqlServerInstancesListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type SqlServerInstancesListByResourceGroupResponse = SqlServerInstanceListResult; + +/** Optional parameters. */ +export interface SqlServerInstancesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type SqlServerInstancesGetResponse = SqlServerInstance; + +/** Optional parameters. */ +export interface SqlServerInstancesCreateOptionalParams + 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 create operation. */ +export type SqlServerInstancesCreateResponse = SqlServerInstance; + +/** Optional parameters. */ +export interface SqlServerInstancesDeleteOptionalParams + 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; +} + +/** Optional parameters. */ +export interface SqlServerInstancesUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the update operation. */ +export type SqlServerInstancesUpdateResponse = SqlServerInstance; + +/** Optional parameters. */ +export interface SqlServerInstancesListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type SqlServerInstancesListNextResponse = SqlServerInstanceListResult; + +/** Optional parameters. */ +export interface SqlServerInstancesListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type SqlServerInstancesListByResourceGroupNextResponse = SqlServerInstanceListResult; + +/** Optional parameters. */ +export interface DataControllersListInSubscriptionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listInSubscription operation. */ +export type DataControllersListInSubscriptionResponse = PageOfDataControllerResource; + +/** Optional parameters. */ +export interface DataControllersListInGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listInGroup operation. */ +export type DataControllersListInGroupResponse = PageOfDataControllerResource; + +/** Optional parameters. */ +export interface DataControllersPutDataControllerOptionalParams + 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 putDataController operation. */ +export type DataControllersPutDataControllerResponse = DataControllerResource; + +/** Optional parameters. */ +export interface DataControllersDeleteDataControllerOptionalParams + 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; +} + +/** Optional parameters. */ +export interface DataControllersGetDataControllerOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getDataController operation. */ +export type DataControllersGetDataControllerResponse = DataControllerResource; + +/** Optional parameters. */ +export interface DataControllersPatchDataControllerOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the patchDataController operation. */ +export type DataControllersPatchDataControllerResponse = DataControllerResource; + +/** Optional parameters. */ +export interface DataControllersListInSubscriptionNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listInSubscriptionNext operation. */ +export type DataControllersListInSubscriptionNextResponse = PageOfDataControllerResource; + +/** Optional parameters. */ +export interface DataControllersListInGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listInGroupNext operation. */ +export type DataControllersListInGroupNextResponse = PageOfDataControllerResource; + +/** Optional parameters. */ +export interface AzureArcDataManagementClientOptionalParams + extends coreClient.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Api Version */ + apiVersion?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/azurearcdata/arm-azurearcdata/src/models/mappers.ts b/sdk/azurearcdata/arm-azurearcdata/src/models/mappers.ts new file mode 100644 index 000000000000..7b930048786a --- /dev/null +++ b/sdk/azurearcdata/arm-azurearcdata/src/models/mappers.ts @@ -0,0 +1,1088 @@ +/* + * 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 * as coreClient from "@azure/core-client"; + +export const OperationListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const Operation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Operation", + modelProperties: { + name: { + serializedName: "name", + required: true, + type: { + name: "String" + } + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplay" + } + }, + origin: { + serializedName: "origin", + readOnly: true, + type: { + name: "String" + } + }, + isDataAction: { + serializedName: "isDataAction", + required: true, + type: { + name: "Boolean" + } + }, + properties: { + serializedName: "properties", + readOnly: true, + type: { + name: "Dictionary", + value: { + type: { name: "Dictionary", value: { type: { name: "any" } } } + } + } + } + } + } +}; + +export const OperationDisplay: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationDisplay", + modelProperties: { + provider: { + serializedName: "provider", + required: true, + type: { + name: "String" + } + }, + resource: { + serializedName: "resource", + required: true, + type: { + name: "String" + } + }, + operation: { + serializedName: "operation", + required: true, + type: { + name: "String" + } + }, + description: { + serializedName: "description", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const ErrorResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorResponse", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorResponseBody" + } + } + } + } +}; + +export const ErrorResponseBody: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorResponseBody", + modelProperties: { + code: { + serializedName: "code", + type: { + name: "String" + } + }, + message: { + serializedName: "message", + type: { + name: "String" + } + }, + target: { + serializedName: "target", + type: { + name: "String" + } + }, + details: { + serializedName: "details", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorResponseBody" + } + } + } + } + } + } +}; + +export const SqlManagedInstanceListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SqlManagedInstanceListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SqlManagedInstance" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const SqlManagedInstanceProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SqlManagedInstanceProperties", + modelProperties: { + dataControllerId: { + serializedName: "dataControllerId", + type: { + name: "String" + } + }, + admin: { + serializedName: "admin", + type: { + name: "String" + } + }, + startTime: { + serializedName: "startTime", + type: { + name: "String" + } + }, + endTime: { + serializedName: "endTime", + type: { + name: "String" + } + }, + k8SRaw: { + serializedName: "k8sRaw", + type: { + name: "Composite", + className: "SqlManagedInstanceK8SRaw" + } + }, + basicLoginInformation: { + serializedName: "basicLoginInformation", + type: { + name: "Composite", + className: "BasicLoginInformation" + } + }, + lastUploadedDate: { + serializedName: "lastUploadedDate", + type: { + name: "DateTime" + } + }, + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + licenseType: { + defaultValue: "BasePrice", + serializedName: "licenseType", + type: { + name: "Enum", + allowedValues: ["BasePrice", "LicenseIncluded"] + } + }, + clusterId: { + serializedName: "clusterId", + type: { + name: "String" + } + }, + extensionId: { + serializedName: "extensionId", + type: { + name: "String" + } + } + } + } +}; + +export const SqlManagedInstanceK8SRaw: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SqlManagedInstanceK8SRaw", + additionalProperties: { type: { name: "Object" } }, + modelProperties: { + spec: { + serializedName: "spec", + type: { + name: "Composite", + className: "SqlManagedInstanceK8SSpec" + } + } + } + } +}; + +export const SqlManagedInstanceK8SSpec: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SqlManagedInstanceK8SSpec", + additionalProperties: { type: { name: "Object" } }, + modelProperties: { + scheduling: { + serializedName: "scheduling", + type: { + name: "Composite", + className: "K8SScheduling" + } + }, + replicas: { + serializedName: "replicas", + type: { + name: "Number" + } + } + } + } +}; + +export const K8SScheduling: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "K8SScheduling", + additionalProperties: { type: { name: "Object" } }, + modelProperties: { + default: { + serializedName: "default", + type: { + name: "Composite", + className: "K8SSchedulingOptions" + } + } + } + } +}; + +export const K8SSchedulingOptions: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "K8SSchedulingOptions", + additionalProperties: { type: { name: "Object" } }, + modelProperties: { + resources: { + serializedName: "resources", + type: { + name: "Composite", + className: "K8SResourceRequirements" + } + } + } + } +}; + +export const K8SResourceRequirements: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "K8SResourceRequirements", + additionalProperties: { type: { name: "Object" } }, + modelProperties: { + requests: { + serializedName: "requests", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + limits: { + serializedName: "limits", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + } + } + } +}; + +export const BasicLoginInformation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BasicLoginInformation", + modelProperties: { + username: { + serializedName: "username", + type: { + name: "String" + } + }, + password: { + serializedName: "password", + type: { + name: "String" + } + } + } + } +}; + +export const ExtendedLocation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ExtendedLocation", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + type: { + serializedName: "type", + type: { + name: "String" + } + } + } + } +}; + +export const SqlManagedInstanceSku: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SqlManagedInstanceSku", + modelProperties: { + name: { + defaultValue: "vCore", + isConstant: true, + serializedName: "name", + type: { + name: "String" + } + }, + tier: { + defaultValue: "GeneralPurpose", + serializedName: "tier", + type: { + name: "Enum", + allowedValues: ["GeneralPurpose", "BusinessCritical"] + } + }, + dev: { + defaultValue: true, + serializedName: "dev", + type: { + name: "Boolean" + } + }, + size: { + serializedName: "size", + type: { + name: "String" + } + }, + family: { + serializedName: "family", + type: { + name: "String" + } + }, + capacity: { + serializedName: "capacity", + type: { + name: "Number" + } + } + } + } +}; + +export const Resource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Resource", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + } + } + } +}; + +export const SystemData: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SystemData", + modelProperties: { + createdBy: { + serializedName: "createdBy", + type: { + name: "String" + } + }, + createdByType: { + serializedName: "createdByType", + type: { + name: "String" + } + }, + createdAt: { + serializedName: "createdAt", + type: { + name: "DateTime" + } + }, + lastModifiedBy: { + serializedName: "lastModifiedBy", + type: { + name: "String" + } + }, + lastModifiedByType: { + serializedName: "lastModifiedByType", + type: { + name: "String" + } + }, + lastModifiedAt: { + serializedName: "lastModifiedAt", + type: { + name: "DateTime" + } + } + } + } +}; + +export const SqlManagedInstanceUpdate: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SqlManagedInstanceUpdate", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + } + } + } +}; + +export const SqlServerInstanceListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SqlServerInstanceListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SqlServerInstance" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const SqlServerInstanceProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SqlServerInstanceProperties", + modelProperties: { + version: { + serializedName: "version", + type: { + name: "String" + } + }, + edition: { + serializedName: "edition", + type: { + name: "String" + } + }, + containerResourceId: { + serializedName: "containerResourceId", + required: true, + type: { + name: "String" + } + }, + createTime: { + serializedName: "createTime", + readOnly: true, + type: { + name: "String" + } + }, + vCore: { + serializedName: "vCore", + type: { + name: "String" + } + }, + status: { + serializedName: "status", + required: true, + type: { + name: "String" + } + }, + patchLevel: { + serializedName: "patchLevel", + type: { + name: "String" + } + }, + collation: { + serializedName: "collation", + type: { + name: "String" + } + }, + currentVersion: { + serializedName: "currentVersion", + type: { + name: "String" + } + }, + instanceName: { + serializedName: "instanceName", + type: { + name: "String" + } + }, + tcpDynamicPorts: { + serializedName: "tcpDynamicPorts", + type: { + name: "String" + } + }, + tcpStaticPorts: { + serializedName: "tcpStaticPorts", + type: { + name: "String" + } + }, + productId: { + serializedName: "productId", + type: { + name: "String" + } + }, + licenseType: { + serializedName: "licenseType", + type: { + name: "String" + } + }, + azureDefenderStatusLastUpdated: { + serializedName: "azureDefenderStatusLastUpdated", + type: { + name: "DateTime" + } + }, + azureDefenderStatus: { + serializedName: "azureDefenderStatus", + type: { + name: "String" + } + }, + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const SqlServerInstanceUpdate: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SqlServerInstanceUpdate", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + } + } + } +}; + +export const PageOfDataControllerResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PageOfDataControllerResource", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DataControllerResource" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const DataControllerProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DataControllerProperties", + modelProperties: { + infrastructure: { + defaultValue: "other", + serializedName: "infrastructure", + type: { + name: "Enum", + allowedValues: [ + "azure", + "gcp", + "aws", + "alibaba", + "onpremises", + "other" + ] + } + }, + onPremiseProperty: { + serializedName: "onPremiseProperty", + type: { + name: "Composite", + className: "OnPremiseProperty" + } + }, + k8SRaw: { + serializedName: "k8sRaw", + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } + }, + uploadWatermark: { + serializedName: "uploadWatermark", + type: { + name: "Composite", + className: "UploadWatermark" + } + }, + lastUploadedDate: { + serializedName: "lastUploadedDate", + type: { + name: "DateTime" + } + }, + basicLoginInformation: { + serializedName: "basicLoginInformation", + type: { + name: "Composite", + className: "BasicLoginInformation" + } + }, + metricsDashboardCredential: { + serializedName: "metricsDashboardCredential", + type: { + name: "Composite", + className: "BasicLoginInformation" + } + }, + logsDashboardCredential: { + serializedName: "logsDashboardCredential", + type: { + name: "Composite", + className: "BasicLoginInformation" + } + }, + logAnalyticsWorkspaceConfig: { + serializedName: "logAnalyticsWorkspaceConfig", + type: { + name: "Composite", + className: "LogAnalyticsWorkspaceConfig" + } + }, + uploadServicePrincipal: { + serializedName: "uploadServicePrincipal", + type: { + name: "Composite", + className: "UploadServicePrincipal" + } + }, + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + clusterId: { + serializedName: "clusterId", + type: { + name: "String" + } + }, + extensionId: { + serializedName: "extensionId", + type: { + name: "String" + } + } + } + } +}; + +export const OnPremiseProperty: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OnPremiseProperty", + modelProperties: { + id: { + serializedName: "id", + required: true, + type: { + name: "Uuid" + } + }, + publicSigningKey: { + serializedName: "publicSigningKey", + required: true, + type: { + name: "String" + } + }, + signingCertificateThumbprint: { + serializedName: "signingCertificateThumbprint", + type: { + name: "String" + } + } + } + } +}; + +export const UploadWatermark: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "UploadWatermark", + modelProperties: { + metrics: { + serializedName: "metrics", + type: { + name: "DateTime" + } + }, + logs: { + serializedName: "logs", + type: { + name: "DateTime" + } + }, + usages: { + serializedName: "usages", + type: { + name: "DateTime" + } + } + } + } +}; + +export const LogAnalyticsWorkspaceConfig: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LogAnalyticsWorkspaceConfig", + modelProperties: { + workspaceId: { + serializedName: "workspaceId", + type: { + name: "Uuid" + } + }, + primaryKey: { + serializedName: "primaryKey", + type: { + name: "String" + } + } + } + } +}; + +export const UploadServicePrincipal: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "UploadServicePrincipal", + modelProperties: { + clientId: { + serializedName: "clientId", + type: { + name: "Uuid" + } + }, + tenantId: { + serializedName: "tenantId", + type: { + name: "Uuid" + } + }, + authority: { + serializedName: "authority", + type: { + name: "String" + } + }, + clientSecret: { + serializedName: "clientSecret", + type: { + name: "String" + } + } + } + } +}; + +export const DataControllerUpdate: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DataControllerUpdate", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + } + } + } +}; + +export const TrackedResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TrackedResource", + modelProperties: { + ...Resource.type.modelProperties, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + location: { + serializedName: "location", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const SqlManagedInstance: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SqlManagedInstance", + modelProperties: { + ...TrackedResource.type.modelProperties, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "SqlManagedInstanceProperties" + } + }, + extendedLocation: { + serializedName: "extendedLocation", + type: { + name: "Composite", + className: "ExtendedLocation" + } + }, + sku: { + serializedName: "sku", + type: { + name: "Composite", + className: "SqlManagedInstanceSku" + } + } + } + } +}; + +export const SqlServerInstance: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SqlServerInstance", + modelProperties: { + ...TrackedResource.type.modelProperties, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "SqlServerInstanceProperties" + } + } + } + } +}; + +export const DataControllerResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DataControllerResource", + modelProperties: { + ...TrackedResource.type.modelProperties, + extendedLocation: { + serializedName: "extendedLocation", + type: { + name: "Composite", + className: "ExtendedLocation" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "DataControllerProperties" + } + } + } + } +}; diff --git a/sdk/azurearcdata/arm-azurearcdata/src/models/parameters.ts b/sdk/azurearcdata/arm-azurearcdata/src/models/parameters.ts new file mode 100644 index 000000000000..966424a337d9 --- /dev/null +++ b/sdk/azurearcdata/arm-azurearcdata/src/models/parameters.ts @@ -0,0 +1,166 @@ +/* + * 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 { + OperationParameter, + OperationURLParameter, + OperationQueryParameter +} from "@azure/core-client"; +import { + SqlManagedInstance as SqlManagedInstanceMapper, + SqlManagedInstanceUpdate as SqlManagedInstanceUpdateMapper, + SqlServerInstance as SqlServerInstanceMapper, + SqlServerInstanceUpdate as SqlServerInstanceUpdateMapper, + DataControllerResource as DataControllerResourceMapper, + DataControllerUpdate as DataControllerUpdateMapper +} from "../models/mappers"; + +export const accept: OperationParameter = { + parameterPath: "accept", + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Accept", + type: { + name: "String" + } + } +}; + +export const $host: OperationURLParameter = { + parameterPath: "$host", + mapper: { + serializedName: "$host", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const apiVersion: OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + defaultValue: "2021-11-01", + isConstant: true, + serializedName: "api-version", + type: { + name: "String" + } + } +}; + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", + mapper: { + serializedName: "nextLink", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + serializedName: "subscriptionId", + required: true, + type: { + name: "String" + } + } +}; + +export const resourceGroupName: OperationURLParameter = { + parameterPath: "resourceGroupName", + mapper: { + serializedName: "resourceGroupName", + required: true, + type: { + name: "String" + } + } +}; + +export const sqlManagedInstanceName: OperationURLParameter = { + parameterPath: "sqlManagedInstanceName", + mapper: { + serializedName: "sqlManagedInstanceName", + required: true, + type: { + name: "String" + } + } +}; + +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", + type: { + name: "String" + } + } +}; + +export const sqlManagedInstance: OperationParameter = { + parameterPath: "sqlManagedInstance", + mapper: SqlManagedInstanceMapper +}; + +export const parameters: OperationParameter = { + parameterPath: "parameters", + mapper: SqlManagedInstanceUpdateMapper +}; + +export const sqlServerInstanceName: OperationURLParameter = { + parameterPath: "sqlServerInstanceName", + mapper: { + serializedName: "sqlServerInstanceName", + required: true, + type: { + name: "String" + } + } +}; + +export const sqlServerInstance: OperationParameter = { + parameterPath: "sqlServerInstance", + mapper: SqlServerInstanceMapper +}; + +export const parameters1: OperationParameter = { + parameterPath: "parameters", + mapper: SqlServerInstanceUpdateMapper +}; + +export const dataControllerResource: OperationParameter = { + parameterPath: "dataControllerResource", + mapper: DataControllerResourceMapper +}; + +export const dataControllerName: OperationURLParameter = { + parameterPath: "dataControllerName", + mapper: { + serializedName: "dataControllerName", + required: true, + type: { + name: "String" + } + } +}; + +export const dataControllerResource1: OperationParameter = { + parameterPath: "dataControllerResource", + mapper: DataControllerUpdateMapper +}; diff --git a/sdk/azurearcdata/arm-azurearcdata/src/operations/dataControllers.ts b/sdk/azurearcdata/arm-azurearcdata/src/operations/dataControllers.ts new file mode 100644 index 000000000000..b12977c94b7e --- /dev/null +++ b/sdk/azurearcdata/arm-azurearcdata/src/operations/dataControllers.ts @@ -0,0 +1,605 @@ +/* + * 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 { DataControllers } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AzureArcDataManagementClient } from "../azureArcDataManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + DataControllerResource, + DataControllersListInSubscriptionNextOptionalParams, + DataControllersListInSubscriptionOptionalParams, + DataControllersListInGroupNextOptionalParams, + DataControllersListInGroupOptionalParams, + DataControllersListInSubscriptionResponse, + DataControllersListInGroupResponse, + DataControllersPutDataControllerOptionalParams, + DataControllersPutDataControllerResponse, + DataControllersDeleteDataControllerOptionalParams, + DataControllersGetDataControllerOptionalParams, + DataControllersGetDataControllerResponse, + DataControllerUpdate, + DataControllersPatchDataControllerOptionalParams, + DataControllersPatchDataControllerResponse, + DataControllersListInSubscriptionNextResponse, + DataControllersListInGroupNextResponse +} from "../models"; + +/// +/** Class containing DataControllers operations. */ +export class DataControllersImpl implements DataControllers { + private readonly client: AzureArcDataManagementClient; + + /** + * Initialize a new instance of the class DataControllers class. + * @param client Reference to the service client + */ + constructor(client: AzureArcDataManagementClient) { + this.client = client; + } + + /** + * List dataController resources in the subscription + * @param options The options parameters. + */ + public listInSubscription( + options?: DataControllersListInSubscriptionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listInSubscriptionPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listInSubscriptionPagingPage(options); + } + }; + } + + private async *listInSubscriptionPagingPage( + options?: DataControllersListInSubscriptionOptionalParams + ): AsyncIterableIterator { + let result = await this._listInSubscription(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listInSubscriptionNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listInSubscriptionPagingAll( + options?: DataControllersListInSubscriptionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listInSubscriptionPagingPage(options)) { + yield* page; + } + } + + /** + * List dataController resources in the resource group + * @param resourceGroupName The name of the Azure resource group + * @param options The options parameters. + */ + public listInGroup( + resourceGroupName: string, + options?: DataControllersListInGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listInGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listInGroupPagingPage(resourceGroupName, options); + } + }; + } + + private async *listInGroupPagingPage( + resourceGroupName: string, + options?: DataControllersListInGroupOptionalParams + ): AsyncIterableIterator { + let result = await this._listInGroup(resourceGroupName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listInGroupNext( + resourceGroupName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listInGroupPagingAll( + resourceGroupName: string, + options?: DataControllersListInGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listInGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + + /** + * List dataController resources in the subscription + * @param options The options parameters. + */ + private _listInSubscription( + options?: DataControllersListInSubscriptionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + listInSubscriptionOperationSpec + ); + } + + /** + * List dataController resources in the resource group + * @param resourceGroupName The name of the Azure resource group + * @param options The options parameters. + */ + private _listInGroup( + resourceGroupName: string, + options?: DataControllersListInGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listInGroupOperationSpec + ); + } + + /** + * Creates or replaces a dataController resource + * @param resourceGroupName The name of the Azure resource group + * @param dataControllerName + * @param dataControllerResource desc + * @param options The options parameters. + */ + async beginPutDataController( + resourceGroupName: string, + dataControllerName: string, + dataControllerResource: DataControllerResource, + options?: DataControllersPutDataControllerOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DataControllersPutDataControllerResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = 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 = new LroImpl( + sendOperation, + { + resourceGroupName, + dataControllerName, + dataControllerResource, + options + }, + putDataControllerOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + } + + /** + * Creates or replaces a dataController resource + * @param resourceGroupName The name of the Azure resource group + * @param dataControllerName + * @param dataControllerResource desc + * @param options The options parameters. + */ + async beginPutDataControllerAndWait( + resourceGroupName: string, + dataControllerName: string, + dataControllerResource: DataControllerResource, + options?: DataControllersPutDataControllerOptionalParams + ): Promise { + const poller = await this.beginPutDataController( + resourceGroupName, + dataControllerName, + dataControllerResource, + options + ); + return poller.pollUntilDone(); + } + + /** + * Deletes a dataController resource + * @param resourceGroupName The name of the Azure resource group + * @param dataControllerName + * @param options The options parameters. + */ + async beginDeleteDataController( + resourceGroupName: string, + dataControllerName: string, + options?: DataControllersDeleteDataControllerOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = 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 = new LroImpl( + sendOperation, + { resourceGroupName, dataControllerName, options }, + deleteDataControllerOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + + /** + * Deletes a dataController resource + * @param resourceGroupName The name of the Azure resource group + * @param dataControllerName + * @param options The options parameters. + */ + async beginDeleteDataControllerAndWait( + resourceGroupName: string, + dataControllerName: string, + options?: DataControllersDeleteDataControllerOptionalParams + ): Promise { + const poller = await this.beginDeleteDataController( + resourceGroupName, + dataControllerName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Retrieves a dataController resource + * @param resourceGroupName The name of the Azure resource group + * @param dataControllerName + * @param options The options parameters. + */ + getDataController( + resourceGroupName: string, + dataControllerName: string, + options?: DataControllersGetDataControllerOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, dataControllerName, options }, + getDataControllerOperationSpec + ); + } + + /** + * Updates a dataController resource + * @param resourceGroupName The name of the Azure resource group + * @param dataControllerName + * @param dataControllerResource The update data controller resource + * @param options The options parameters. + */ + patchDataController( + resourceGroupName: string, + dataControllerName: string, + dataControllerResource: DataControllerUpdate, + options?: DataControllersPatchDataControllerOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + dataControllerName, + dataControllerResource, + options + }, + patchDataControllerOperationSpec + ); + } + + /** + * ListInSubscriptionNext + * @param nextLink The nextLink from the previous successful call to the ListInSubscription method. + * @param options The options parameters. + */ + private _listInSubscriptionNext( + nextLink: string, + options?: DataControllersListInSubscriptionNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listInSubscriptionNextOperationSpec + ); + } + + /** + * ListInGroupNext + * @param resourceGroupName The name of the Azure resource group + * @param nextLink The nextLink from the previous successful call to the ListInGroup method. + * @param options The options parameters. + */ + private _listInGroupNext( + resourceGroupName: string, + nextLink: string, + options?: DataControllersListInGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listInGroupNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listInSubscriptionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.AzureArcData/dataControllers", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PageOfDataControllerResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listInGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/dataControllers", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PageOfDataControllerResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const putDataControllerOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/dataControllers/{dataControllerName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.DataControllerResource + }, + 201: { + bodyMapper: Mappers.DataControllerResource + }, + 202: { + bodyMapper: Mappers.DataControllerResource + }, + 204: { + bodyMapper: Mappers.DataControllerResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.dataControllerResource, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.dataControllerName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteDataControllerOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/dataControllers/{dataControllerName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.dataControllerName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getDataControllerOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/dataControllers/{dataControllerName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DataControllerResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.dataControllerName + ], + headerParameters: [Parameters.accept], + serializer +}; +const patchDataControllerOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/dataControllers/{dataControllerName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.DataControllerResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.dataControllerResource1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.dataControllerName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listInSubscriptionNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PageOfDataControllerResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listInGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PageOfDataControllerResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/azurearcdata/arm-azurearcdata/src/operations/index.ts b/sdk/azurearcdata/arm-azurearcdata/src/operations/index.ts new file mode 100644 index 000000000000..171083ef6132 --- /dev/null +++ b/sdk/azurearcdata/arm-azurearcdata/src/operations/index.ts @@ -0,0 +1,12 @@ +/* + * 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. + */ + +export * from "./operations"; +export * from "./sqlManagedInstances"; +export * from "./sqlServerInstances"; +export * from "./dataControllers"; diff --git a/sdk/azurearcdata/arm-azurearcdata/src/operations/operations.ts b/sdk/azurearcdata/arm-azurearcdata/src/operations/operations.ts new file mode 100644 index 000000000000..6a51c9252104 --- /dev/null +++ b/sdk/azurearcdata/arm-azurearcdata/src/operations/operations.ts @@ -0,0 +1,137 @@ +/* + * 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 { Operations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AzureArcDataManagementClient } from "../azureArcDataManagementClient"; +import { + Operation, + OperationsListNextOptionalParams, + OperationsListOptionalParams, + OperationsListResponse, + OperationsListNextResponse +} from "../models"; + +/// +/** Class containing Operations operations. */ +export class OperationsImpl implements Operations { + private readonly client: AzureArcDataManagementClient; + + /** + * Initialize a new instance of the class Operations class. + * @param client Reference to the service client + */ + constructor(client: AzureArcDataManagementClient) { + this.client = client; + } + + /** + * Lists all of the available Azure Data Services on Azure Arc API operations. + * @param options The options parameters. + */ + public list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: OperationsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + options?: OperationsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + + /** + * Lists all of the available Azure Data Services on Azure Arc API operations. + * @param options The options parameters. + */ + private _list( + options?: OperationsListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + nextLink: string, + options?: OperationsListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.AzureArcData/operations", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.OperationListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.OperationListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.nextLink], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/azurearcdata/arm-azurearcdata/src/operations/sqlManagedInstances.ts b/sdk/azurearcdata/arm-azurearcdata/src/operations/sqlManagedInstances.ts new file mode 100644 index 000000000000..ade4d8d51c4e --- /dev/null +++ b/sdk/azurearcdata/arm-azurearcdata/src/operations/sqlManagedInstances.ts @@ -0,0 +1,597 @@ +/* + * 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 { SqlManagedInstances } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AzureArcDataManagementClient } from "../azureArcDataManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + SqlManagedInstance, + SqlManagedInstancesListNextOptionalParams, + SqlManagedInstancesListOptionalParams, + SqlManagedInstancesListByResourceGroupNextOptionalParams, + SqlManagedInstancesListByResourceGroupOptionalParams, + SqlManagedInstancesListResponse, + SqlManagedInstancesListByResourceGroupResponse, + SqlManagedInstancesGetOptionalParams, + SqlManagedInstancesGetResponse, + SqlManagedInstancesCreateOptionalParams, + SqlManagedInstancesCreateResponse, + SqlManagedInstancesDeleteOptionalParams, + SqlManagedInstanceUpdate, + SqlManagedInstancesUpdateOptionalParams, + SqlManagedInstancesUpdateResponse, + SqlManagedInstancesListNextResponse, + SqlManagedInstancesListByResourceGroupNextResponse +} from "../models"; + +/// +/** Class containing SqlManagedInstances operations. */ +export class SqlManagedInstancesImpl implements SqlManagedInstances { + private readonly client: AzureArcDataManagementClient; + + /** + * Initialize a new instance of the class SqlManagedInstances class. + * @param client Reference to the service client + */ + constructor(client: AzureArcDataManagementClient) { + this.client = client; + } + + /** + * List sqlManagedInstance resources in the subscription + * @param options The options parameters. + */ + public list( + options?: SqlManagedInstancesListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: SqlManagedInstancesListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + options?: SqlManagedInstancesListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + + /** + * Gets all sqlManagedInstances in a resource group. + * @param resourceGroupName The name of the Azure resource group + * @param options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: SqlManagedInstancesListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByResourceGroupPagingPage(resourceGroupName, options); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: SqlManagedInstancesListByResourceGroupOptionalParams + ): AsyncIterableIterator { + let result = await this._listByResourceGroup(resourceGroupName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: SqlManagedInstancesListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + + /** + * List sqlManagedInstance resources in the subscription + * @param options The options parameters. + */ + private _list( + options?: SqlManagedInstancesListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + + /** + * Gets all sqlManagedInstances in a resource group. + * @param resourceGroupName The name of the Azure resource group + * @param options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: SqlManagedInstancesListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + + /** + * Retrieves a SQL Managed Instance resource + * @param resourceGroupName The name of the Azure resource group + * @param sqlManagedInstanceName Name of SQL Managed Instance + * @param options The options parameters. + */ + get( + resourceGroupName: string, + sqlManagedInstanceName: string, + options?: SqlManagedInstancesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, sqlManagedInstanceName, options }, + getOperationSpec + ); + } + + /** + * Creates or replaces a SQL Managed Instance resource + * @param resourceGroupName The name of the Azure resource group + * @param sqlManagedInstanceName The name of SQL Managed Instances + * @param sqlManagedInstance The SQL Managed Instance to be created or updated. + * @param options The options parameters. + */ + async beginCreate( + resourceGroupName: string, + sqlManagedInstanceName: string, + sqlManagedInstance: SqlManagedInstance, + options?: SqlManagedInstancesCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + SqlManagedInstancesCreateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = 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 = new LroImpl( + sendOperation, + { + resourceGroupName, + sqlManagedInstanceName, + sqlManagedInstance, + options + }, + createOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + } + + /** + * Creates or replaces a SQL Managed Instance resource + * @param resourceGroupName The name of the Azure resource group + * @param sqlManagedInstanceName The name of SQL Managed Instances + * @param sqlManagedInstance The SQL Managed Instance to be created or updated. + * @param options The options parameters. + */ + async beginCreateAndWait( + resourceGroupName: string, + sqlManagedInstanceName: string, + sqlManagedInstance: SqlManagedInstance, + options?: SqlManagedInstancesCreateOptionalParams + ): Promise { + const poller = await this.beginCreate( + resourceGroupName, + sqlManagedInstanceName, + sqlManagedInstance, + options + ); + return poller.pollUntilDone(); + } + + /** + * Deletes a SQL Managed Instance resource + * @param resourceGroupName The name of the Azure resource group + * @param sqlManagedInstanceName The name of Sql Managed Instances + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + sqlManagedInstanceName: string, + options?: SqlManagedInstancesDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = 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 = new LroImpl( + sendOperation, + { resourceGroupName, sqlManagedInstanceName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + + /** + * Deletes a SQL Managed Instance resource + * @param resourceGroupName The name of the Azure resource group + * @param sqlManagedInstanceName The name of Sql Managed Instances + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + sqlManagedInstanceName: string, + options?: SqlManagedInstancesDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + sqlManagedInstanceName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Updates a SQL Managed Instance resource + * @param resourceGroupName The name of the Azure resource group + * @param sqlManagedInstanceName Name of sqlManagedInstance + * @param parameters The SQL Managed Instance. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + sqlManagedInstanceName: string, + parameters: SqlManagedInstanceUpdate, + options?: SqlManagedInstancesUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, sqlManagedInstanceName, parameters, options }, + updateOperationSpec + ); + } + + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + nextLink: string, + options?: SqlManagedInstancesListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listNextOperationSpec + ); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName The name of the Azure resource group + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. + */ + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: SqlManagedInstancesListByResourceGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.AzureArcData/sqlManagedInstances", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.SqlManagedInstanceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlManagedInstances", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.SqlManagedInstanceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlManagedInstances/{sqlManagedInstanceName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.SqlManagedInstance + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.sqlManagedInstanceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlManagedInstances/{sqlManagedInstanceName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.SqlManagedInstance + }, + 201: { + bodyMapper: Mappers.SqlManagedInstance + }, + 202: { + bodyMapper: Mappers.SqlManagedInstance + }, + 204: { + bodyMapper: Mappers.SqlManagedInstance + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.sqlManagedInstance, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.sqlManagedInstanceName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlManagedInstances/{sqlManagedInstanceName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.sqlManagedInstanceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlManagedInstances/{sqlManagedInstanceName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.SqlManagedInstance + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.parameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.sqlManagedInstanceName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.SqlManagedInstanceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.SqlManagedInstanceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/azurearcdata/arm-azurearcdata/src/operations/sqlServerInstances.ts b/sdk/azurearcdata/arm-azurearcdata/src/operations/sqlServerInstances.ts new file mode 100644 index 000000000000..747d6e5c7898 --- /dev/null +++ b/sdk/azurearcdata/arm-azurearcdata/src/operations/sqlServerInstances.ts @@ -0,0 +1,592 @@ +/* + * 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 { SqlServerInstances } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AzureArcDataManagementClient } from "../azureArcDataManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + SqlServerInstance, + SqlServerInstancesListNextOptionalParams, + SqlServerInstancesListOptionalParams, + SqlServerInstancesListByResourceGroupNextOptionalParams, + SqlServerInstancesListByResourceGroupOptionalParams, + SqlServerInstancesListResponse, + SqlServerInstancesListByResourceGroupResponse, + SqlServerInstancesGetOptionalParams, + SqlServerInstancesGetResponse, + SqlServerInstancesCreateOptionalParams, + SqlServerInstancesCreateResponse, + SqlServerInstancesDeleteOptionalParams, + SqlServerInstanceUpdate, + SqlServerInstancesUpdateOptionalParams, + SqlServerInstancesUpdateResponse, + SqlServerInstancesListNextResponse, + SqlServerInstancesListByResourceGroupNextResponse +} from "../models"; + +/// +/** Class containing SqlServerInstances operations. */ +export class SqlServerInstancesImpl implements SqlServerInstances { + private readonly client: AzureArcDataManagementClient; + + /** + * Initialize a new instance of the class SqlServerInstances class. + * @param client Reference to the service client + */ + constructor(client: AzureArcDataManagementClient) { + this.client = client; + } + + /** + * List sqlServerInstance resources in the subscription + * @param options The options parameters. + */ + public list( + options?: SqlServerInstancesListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: SqlServerInstancesListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + options?: SqlServerInstancesListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + + /** + * Gets all sqlServerInstances in a resource group. + * @param resourceGroupName The name of the Azure resource group + * @param options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: SqlServerInstancesListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByResourceGroupPagingPage(resourceGroupName, options); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: SqlServerInstancesListByResourceGroupOptionalParams + ): AsyncIterableIterator { + let result = await this._listByResourceGroup(resourceGroupName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: SqlServerInstancesListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + + /** + * List sqlServerInstance resources in the subscription + * @param options The options parameters. + */ + private _list( + options?: SqlServerInstancesListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + + /** + * Gets all sqlServerInstances in a resource group. + * @param resourceGroupName The name of the Azure resource group + * @param options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: SqlServerInstancesListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + + /** + * Retrieves a SQL Server Instance resource + * @param resourceGroupName The name of the Azure resource group + * @param sqlServerInstanceName Name of SQL Server Instance + * @param options The options parameters. + */ + get( + resourceGroupName: string, + sqlServerInstanceName: string, + options?: SqlServerInstancesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, sqlServerInstanceName, options }, + getOperationSpec + ); + } + + /** + * Creates or replaces a SQL Server Instance resource + * @param resourceGroupName The name of the Azure resource group + * @param sqlServerInstanceName The name of SQL Server Instance + * @param sqlServerInstance The SQL Server Instance to be created or updated. + * @param options The options parameters. + */ + async beginCreate( + resourceGroupName: string, + sqlServerInstanceName: string, + sqlServerInstance: SqlServerInstance, + options?: SqlServerInstancesCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + SqlServerInstancesCreateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = 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 = new LroImpl( + sendOperation, + { resourceGroupName, sqlServerInstanceName, sqlServerInstance, options }, + createOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + } + + /** + * Creates or replaces a SQL Server Instance resource + * @param resourceGroupName The name of the Azure resource group + * @param sqlServerInstanceName The name of SQL Server Instance + * @param sqlServerInstance The SQL Server Instance to be created or updated. + * @param options The options parameters. + */ + async beginCreateAndWait( + resourceGroupName: string, + sqlServerInstanceName: string, + sqlServerInstance: SqlServerInstance, + options?: SqlServerInstancesCreateOptionalParams + ): Promise { + const poller = await this.beginCreate( + resourceGroupName, + sqlServerInstanceName, + sqlServerInstance, + options + ); + return poller.pollUntilDone(); + } + + /** + * Deletes a SQL Server Instance resource + * @param resourceGroupName The name of the Azure resource group + * @param sqlServerInstanceName The name of SQL Server Instance + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + sqlServerInstanceName: string, + options?: SqlServerInstancesDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = 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 = new LroImpl( + sendOperation, + { resourceGroupName, sqlServerInstanceName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + + /** + * Deletes a SQL Server Instance resource + * @param resourceGroupName The name of the Azure resource group + * @param sqlServerInstanceName The name of SQL Server Instance + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + sqlServerInstanceName: string, + options?: SqlServerInstancesDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + sqlServerInstanceName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Updates a SQL Server Instance resource + * @param resourceGroupName The name of the Azure resource group + * @param sqlServerInstanceName Name of sqlServerInstance + * @param parameters The SQL Server Instance. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + sqlServerInstanceName: string, + parameters: SqlServerInstanceUpdate, + options?: SqlServerInstancesUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, sqlServerInstanceName, parameters, options }, + updateOperationSpec + ); + } + + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + nextLink: string, + options?: SqlServerInstancesListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listNextOperationSpec + ); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName The name of the Azure resource group + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. + */ + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: SqlServerInstancesListByResourceGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.AzureArcData/sqlServerInstances", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.SqlServerInstanceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.SqlServerInstanceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances/{sqlServerInstanceName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.SqlServerInstance + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.sqlServerInstanceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances/{sqlServerInstanceName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.SqlServerInstance + }, + 201: { + bodyMapper: Mappers.SqlServerInstance + }, + 202: { + bodyMapper: Mappers.SqlServerInstance + }, + 204: { + bodyMapper: Mappers.SqlServerInstance + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.sqlServerInstance, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.sqlServerInstanceName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances/{sqlServerInstanceName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.sqlServerInstanceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances/{sqlServerInstanceName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.SqlServerInstance + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.parameters1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.sqlServerInstanceName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.SqlServerInstanceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.SqlServerInstanceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/azurearcdata/arm-azurearcdata/src/operationsInterfaces/dataControllers.ts b/sdk/azurearcdata/arm-azurearcdata/src/operationsInterfaces/dataControllers.ts new file mode 100644 index 000000000000..5e280ac9feca --- /dev/null +++ b/sdk/azurearcdata/arm-azurearcdata/src/operationsInterfaces/dataControllers.ts @@ -0,0 +1,121 @@ +/* + * 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 { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + DataControllerResource, + DataControllersListInSubscriptionOptionalParams, + DataControllersListInGroupOptionalParams, + DataControllersPutDataControllerOptionalParams, + DataControllersPutDataControllerResponse, + DataControllersDeleteDataControllerOptionalParams, + DataControllersGetDataControllerOptionalParams, + DataControllersGetDataControllerResponse, + DataControllerUpdate, + DataControllersPatchDataControllerOptionalParams, + DataControllersPatchDataControllerResponse +} from "../models"; + +/// +/** Interface representing a DataControllers. */ +export interface DataControllers { + /** + * List dataController resources in the subscription + * @param options The options parameters. + */ + listInSubscription( + options?: DataControllersListInSubscriptionOptionalParams + ): PagedAsyncIterableIterator; + /** + * List dataController resources in the resource group + * @param resourceGroupName The name of the Azure resource group + * @param options The options parameters. + */ + listInGroup( + resourceGroupName: string, + options?: DataControllersListInGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Creates or replaces a dataController resource + * @param resourceGroupName The name of the Azure resource group + * @param dataControllerName + * @param dataControllerResource desc + * @param options The options parameters. + */ + beginPutDataController( + resourceGroupName: string, + dataControllerName: string, + dataControllerResource: DataControllerResource, + options?: DataControllersPutDataControllerOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DataControllersPutDataControllerResponse + > + >; + /** + * Creates or replaces a dataController resource + * @param resourceGroupName The name of the Azure resource group + * @param dataControllerName + * @param dataControllerResource desc + * @param options The options parameters. + */ + beginPutDataControllerAndWait( + resourceGroupName: string, + dataControllerName: string, + dataControllerResource: DataControllerResource, + options?: DataControllersPutDataControllerOptionalParams + ): Promise; + /** + * Deletes a dataController resource + * @param resourceGroupName The name of the Azure resource group + * @param dataControllerName + * @param options The options parameters. + */ + beginDeleteDataController( + resourceGroupName: string, + dataControllerName: string, + options?: DataControllersDeleteDataControllerOptionalParams + ): Promise, void>>; + /** + * Deletes a dataController resource + * @param resourceGroupName The name of the Azure resource group + * @param dataControllerName + * @param options The options parameters. + */ + beginDeleteDataControllerAndWait( + resourceGroupName: string, + dataControllerName: string, + options?: DataControllersDeleteDataControllerOptionalParams + ): Promise; + /** + * Retrieves a dataController resource + * @param resourceGroupName The name of the Azure resource group + * @param dataControllerName + * @param options The options parameters. + */ + getDataController( + resourceGroupName: string, + dataControllerName: string, + options?: DataControllersGetDataControllerOptionalParams + ): Promise; + /** + * Updates a dataController resource + * @param resourceGroupName The name of the Azure resource group + * @param dataControllerName + * @param dataControllerResource The update data controller resource + * @param options The options parameters. + */ + patchDataController( + resourceGroupName: string, + dataControllerName: string, + dataControllerResource: DataControllerUpdate, + options?: DataControllersPatchDataControllerOptionalParams + ): Promise; +} diff --git a/sdk/azurearcdata/arm-azurearcdata/src/operationsInterfaces/index.ts b/sdk/azurearcdata/arm-azurearcdata/src/operationsInterfaces/index.ts new file mode 100644 index 000000000000..171083ef6132 --- /dev/null +++ b/sdk/azurearcdata/arm-azurearcdata/src/operationsInterfaces/index.ts @@ -0,0 +1,12 @@ +/* + * 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. + */ + +export * from "./operations"; +export * from "./sqlManagedInstances"; +export * from "./sqlServerInstances"; +export * from "./dataControllers"; diff --git a/sdk/azurearcdata/arm-azurearcdata/src/operationsInterfaces/operations.ts b/sdk/azurearcdata/arm-azurearcdata/src/operationsInterfaces/operations.ts new file mode 100644 index 000000000000..d96d1ced0389 --- /dev/null +++ b/sdk/azurearcdata/arm-azurearcdata/src/operationsInterfaces/operations.ts @@ -0,0 +1,22 @@ +/* + * 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 { Operation, OperationsListOptionalParams } from "../models"; + +/// +/** Interface representing a Operations. */ +export interface Operations { + /** + * Lists all of the available Azure Data Services on Azure Arc API operations. + * @param options The options parameters. + */ + list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/azurearcdata/arm-azurearcdata/src/operationsInterfaces/sqlManagedInstances.ts b/sdk/azurearcdata/arm-azurearcdata/src/operationsInterfaces/sqlManagedInstances.ts new file mode 100644 index 000000000000..714429b7a5ee --- /dev/null +++ b/sdk/azurearcdata/arm-azurearcdata/src/operationsInterfaces/sqlManagedInstances.ts @@ -0,0 +1,121 @@ +/* + * 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 { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + SqlManagedInstance, + SqlManagedInstancesListOptionalParams, + SqlManagedInstancesListByResourceGroupOptionalParams, + SqlManagedInstancesGetOptionalParams, + SqlManagedInstancesGetResponse, + SqlManagedInstancesCreateOptionalParams, + SqlManagedInstancesCreateResponse, + SqlManagedInstancesDeleteOptionalParams, + SqlManagedInstanceUpdate, + SqlManagedInstancesUpdateOptionalParams, + SqlManagedInstancesUpdateResponse +} from "../models"; + +/// +/** Interface representing a SqlManagedInstances. */ +export interface SqlManagedInstances { + /** + * List sqlManagedInstance resources in the subscription + * @param options The options parameters. + */ + list( + options?: SqlManagedInstancesListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets all sqlManagedInstances in a resource group. + * @param resourceGroupName The name of the Azure resource group + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: SqlManagedInstancesListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Retrieves a SQL Managed Instance resource + * @param resourceGroupName The name of the Azure resource group + * @param sqlManagedInstanceName Name of SQL Managed Instance + * @param options The options parameters. + */ + get( + resourceGroupName: string, + sqlManagedInstanceName: string, + options?: SqlManagedInstancesGetOptionalParams + ): Promise; + /** + * Creates or replaces a SQL Managed Instance resource + * @param resourceGroupName The name of the Azure resource group + * @param sqlManagedInstanceName The name of SQL Managed Instances + * @param sqlManagedInstance The SQL Managed Instance to be created or updated. + * @param options The options parameters. + */ + beginCreate( + resourceGroupName: string, + sqlManagedInstanceName: string, + sqlManagedInstance: SqlManagedInstance, + options?: SqlManagedInstancesCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + SqlManagedInstancesCreateResponse + > + >; + /** + * Creates or replaces a SQL Managed Instance resource + * @param resourceGroupName The name of the Azure resource group + * @param sqlManagedInstanceName The name of SQL Managed Instances + * @param sqlManagedInstance The SQL Managed Instance to be created or updated. + * @param options The options parameters. + */ + beginCreateAndWait( + resourceGroupName: string, + sqlManagedInstanceName: string, + sqlManagedInstance: SqlManagedInstance, + options?: SqlManagedInstancesCreateOptionalParams + ): Promise; + /** + * Deletes a SQL Managed Instance resource + * @param resourceGroupName The name of the Azure resource group + * @param sqlManagedInstanceName The name of Sql Managed Instances + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + sqlManagedInstanceName: string, + options?: SqlManagedInstancesDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes a SQL Managed Instance resource + * @param resourceGroupName The name of the Azure resource group + * @param sqlManagedInstanceName The name of Sql Managed Instances + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + sqlManagedInstanceName: string, + options?: SqlManagedInstancesDeleteOptionalParams + ): Promise; + /** + * Updates a SQL Managed Instance resource + * @param resourceGroupName The name of the Azure resource group + * @param sqlManagedInstanceName Name of sqlManagedInstance + * @param parameters The SQL Managed Instance. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + sqlManagedInstanceName: string, + parameters: SqlManagedInstanceUpdate, + options?: SqlManagedInstancesUpdateOptionalParams + ): Promise; +} diff --git a/sdk/azurearcdata/arm-azurearcdata/src/operationsInterfaces/sqlServerInstances.ts b/sdk/azurearcdata/arm-azurearcdata/src/operationsInterfaces/sqlServerInstances.ts new file mode 100644 index 000000000000..6cf67a4a423c --- /dev/null +++ b/sdk/azurearcdata/arm-azurearcdata/src/operationsInterfaces/sqlServerInstances.ts @@ -0,0 +1,121 @@ +/* + * 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 { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + SqlServerInstance, + SqlServerInstancesListOptionalParams, + SqlServerInstancesListByResourceGroupOptionalParams, + SqlServerInstancesGetOptionalParams, + SqlServerInstancesGetResponse, + SqlServerInstancesCreateOptionalParams, + SqlServerInstancesCreateResponse, + SqlServerInstancesDeleteOptionalParams, + SqlServerInstanceUpdate, + SqlServerInstancesUpdateOptionalParams, + SqlServerInstancesUpdateResponse +} from "../models"; + +/// +/** Interface representing a SqlServerInstances. */ +export interface SqlServerInstances { + /** + * List sqlServerInstance resources in the subscription + * @param options The options parameters. + */ + list( + options?: SqlServerInstancesListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets all sqlServerInstances in a resource group. + * @param resourceGroupName The name of the Azure resource group + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: SqlServerInstancesListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Retrieves a SQL Server Instance resource + * @param resourceGroupName The name of the Azure resource group + * @param sqlServerInstanceName Name of SQL Server Instance + * @param options The options parameters. + */ + get( + resourceGroupName: string, + sqlServerInstanceName: string, + options?: SqlServerInstancesGetOptionalParams + ): Promise; + /** + * Creates or replaces a SQL Server Instance resource + * @param resourceGroupName The name of the Azure resource group + * @param sqlServerInstanceName The name of SQL Server Instance + * @param sqlServerInstance The SQL Server Instance to be created or updated. + * @param options The options parameters. + */ + beginCreate( + resourceGroupName: string, + sqlServerInstanceName: string, + sqlServerInstance: SqlServerInstance, + options?: SqlServerInstancesCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + SqlServerInstancesCreateResponse + > + >; + /** + * Creates or replaces a SQL Server Instance resource + * @param resourceGroupName The name of the Azure resource group + * @param sqlServerInstanceName The name of SQL Server Instance + * @param sqlServerInstance The SQL Server Instance to be created or updated. + * @param options The options parameters. + */ + beginCreateAndWait( + resourceGroupName: string, + sqlServerInstanceName: string, + sqlServerInstance: SqlServerInstance, + options?: SqlServerInstancesCreateOptionalParams + ): Promise; + /** + * Deletes a SQL Server Instance resource + * @param resourceGroupName The name of the Azure resource group + * @param sqlServerInstanceName The name of SQL Server Instance + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + sqlServerInstanceName: string, + options?: SqlServerInstancesDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes a SQL Server Instance resource + * @param resourceGroupName The name of the Azure resource group + * @param sqlServerInstanceName The name of SQL Server Instance + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + sqlServerInstanceName: string, + options?: SqlServerInstancesDeleteOptionalParams + ): Promise; + /** + * Updates a SQL Server Instance resource + * @param resourceGroupName The name of the Azure resource group + * @param sqlServerInstanceName Name of sqlServerInstance + * @param parameters The SQL Server Instance. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + sqlServerInstanceName: string, + parameters: SqlServerInstanceUpdate, + options?: SqlServerInstancesUpdateOptionalParams + ): Promise; +} diff --git a/sdk/azurearcdata/arm-azurearcdata/test/sampleTest.ts b/sdk/azurearcdata/arm-azurearcdata/test/sampleTest.ts new file mode 100644 index 000000000000..7ed89b043e1b --- /dev/null +++ b/sdk/azurearcdata/arm-azurearcdata/test/sampleTest.ts @@ -0,0 +1,48 @@ +/* + * 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 { + env, + record, + RecorderEnvironmentSetup, + Recorder +} from "@azure-tools/test-recorder"; +import * as assert from "assert"; + +const recorderEnvSetup: RecorderEnvironmentSetup = { + replaceableVariables: { + 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" + }, + customizationsOnRecordings: [ + (recording: any): any => + recording.replace( + /"access_token":"[^"]*"/g, + `"access_token":"access_token"` + ) + ], + queryParametersToSkip: [] +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function() { + recorder = record(this, recorderEnvSetup); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/azurearcdata/arm-azurearcdata/tsconfig.json b/sdk/azurearcdata/arm-azurearcdata/tsconfig.json new file mode 100644 index 000000000000..6e3251194117 --- /dev/null +++ b/sdk/azurearcdata/arm-azurearcdata/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "es6", + "moduleResolution": "node", + "strict": true, + "target": "es6", + "sourceMap": true, + "declarationMap": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "lib": ["es6", "dom"], + "declaration": true, + "outDir": "./dist-esm", + "importHelpers": true + }, + "include": ["./src/**/*.ts", "./test/**/*.ts"], + "exclude": ["node_modules"] +} diff --git a/sdk/azurearcdata/ci.yml b/sdk/azurearcdata/ci.yml new file mode 100644 index 000000000000..061efe38a660 --- /dev/null +++ b/sdk/azurearcdata/ci.yml @@ -0,0 +1,29 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. +trigger: + branches: + include: + - main + - release/* + - hotfix/* + paths: + include: + - sdk/azurearcdata/ + +pr: + branches: + include: + - main + - release/* + - hotfix/* + paths: + include: + - sdk/azurearcdata/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: azurearcdata + Artifacts: + - name: azure-arm-azurearcdata + safeName: azurearmazurearcdata + \ No newline at end of file