From fe2cef1f38eaec2cc720298e3bdcb093fd47cbe6 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 5 Jan 2022 10:51:59 +0000 Subject: [PATCH] CodeGen from PR 16902 in Azure/azure-rest-api-specs Track2 modify readme.go.md 4 (#16902) * Track2 modify readme.go.md 4 * devops --- common/config/rush/pnpm-lock.yaml | 131 ++- rush.json | 5 + sdk/elastic/arm-elastic/CHANGELOG.md | 5 + sdk/elastic/arm-elastic/LICENSE | 21 + sdk/elastic/arm-elastic/README.md | 98 ++ sdk/elastic/arm-elastic/_meta.json | 7 + sdk/elastic/arm-elastic/api-extractor.json | 18 + sdk/elastic/arm-elastic/package.json | 92 ++ .../arm-elastic/review/arm-elastic.api.md | 587 +++++++++++ sdk/elastic/arm-elastic/rollup.config.js | 188 ++++ sdk/elastic/arm-elastic/src/index.ts | 12 + sdk/elastic/arm-elastic/src/lroImpl.ts | 34 + .../arm-elastic/src/microsoftElastic.ts | 108 ++ sdk/elastic/arm-elastic/src/models/index.ts | 738 ++++++++++++++ sdk/elastic/arm-elastic/src/models/mappers.ts | 965 ++++++++++++++++++ .../arm-elastic/src/models/parameters.ts | 143 +++ .../src/operations/deploymentInfo.ts | 72 ++ .../arm-elastic/src/operations/index.ts | 16 + .../src/operations/monitoredResources.ts | 177 ++++ .../arm-elastic/src/operations/monitors.ts | 583 +++++++++++ .../arm-elastic/src/operations/operations.ts | 137 +++ .../arm-elastic/src/operations/tagRules.ts | 379 +++++++ .../src/operations/vMCollection.ts | 69 ++ .../arm-elastic/src/operations/vMHost.ts | 177 ++++ .../arm-elastic/src/operations/vMIngestion.ts | 72 ++ .../operationsInterfaces/deploymentInfo.ts | 27 + .../src/operationsInterfaces/index.ts | 16 + .../monitoredResources.ts | 29 + .../src/operationsInterfaces/monitors.ts | 114 +++ .../src/operationsInterfaces/operations.ts | 22 + .../src/operationsInterfaces/tagRules.ts | 87 ++ .../src/operationsInterfaces/vMCollection.ts | 24 + .../src/operationsInterfaces/vMHost.ts | 26 + .../src/operationsInterfaces/vMIngestion.ts | 27 + sdk/elastic/arm-elastic/test/sampleTest.ts | 48 + sdk/elastic/arm-elastic/tsconfig.json | 19 + sdk/elastic/ci.yml | 29 + 37 files changed, 5248 insertions(+), 54 deletions(-) create mode 100644 sdk/elastic/arm-elastic/CHANGELOG.md create mode 100644 sdk/elastic/arm-elastic/LICENSE create mode 100644 sdk/elastic/arm-elastic/README.md create mode 100644 sdk/elastic/arm-elastic/_meta.json create mode 100644 sdk/elastic/arm-elastic/api-extractor.json create mode 100644 sdk/elastic/arm-elastic/package.json create mode 100644 sdk/elastic/arm-elastic/review/arm-elastic.api.md create mode 100644 sdk/elastic/arm-elastic/rollup.config.js create mode 100644 sdk/elastic/arm-elastic/src/index.ts create mode 100644 sdk/elastic/arm-elastic/src/lroImpl.ts create mode 100644 sdk/elastic/arm-elastic/src/microsoftElastic.ts create mode 100644 sdk/elastic/arm-elastic/src/models/index.ts create mode 100644 sdk/elastic/arm-elastic/src/models/mappers.ts create mode 100644 sdk/elastic/arm-elastic/src/models/parameters.ts create mode 100644 sdk/elastic/arm-elastic/src/operations/deploymentInfo.ts create mode 100644 sdk/elastic/arm-elastic/src/operations/index.ts create mode 100644 sdk/elastic/arm-elastic/src/operations/monitoredResources.ts create mode 100644 sdk/elastic/arm-elastic/src/operations/monitors.ts create mode 100644 sdk/elastic/arm-elastic/src/operations/operations.ts create mode 100644 sdk/elastic/arm-elastic/src/operations/tagRules.ts create mode 100644 sdk/elastic/arm-elastic/src/operations/vMCollection.ts create mode 100644 sdk/elastic/arm-elastic/src/operations/vMHost.ts create mode 100644 sdk/elastic/arm-elastic/src/operations/vMIngestion.ts create mode 100644 sdk/elastic/arm-elastic/src/operationsInterfaces/deploymentInfo.ts create mode 100644 sdk/elastic/arm-elastic/src/operationsInterfaces/index.ts create mode 100644 sdk/elastic/arm-elastic/src/operationsInterfaces/monitoredResources.ts create mode 100644 sdk/elastic/arm-elastic/src/operationsInterfaces/monitors.ts create mode 100644 sdk/elastic/arm-elastic/src/operationsInterfaces/operations.ts create mode 100644 sdk/elastic/arm-elastic/src/operationsInterfaces/tagRules.ts create mode 100644 sdk/elastic/arm-elastic/src/operationsInterfaces/vMCollection.ts create mode 100644 sdk/elastic/arm-elastic/src/operationsInterfaces/vMHost.ts create mode 100644 sdk/elastic/arm-elastic/src/operationsInterfaces/vMIngestion.ts create mode 100644 sdk/elastic/arm-elastic/test/sampleTest.ts create mode 100644 sdk/elastic/arm-elastic/tsconfig.json create mode 100644 sdk/elastic/ci.yml diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 694e81b4a476..72c2c7a860a1 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -34,6 +34,7 @@ specifiers: '@rush-temp/arm-datalake-analytics': file:./projects/arm-datalake-analytics.tgz '@rush-temp/arm-desktopvirtualization': file:./projects/arm-desktopvirtualization.tgz '@rush-temp/arm-devtestlabs': file:./projects/arm-devtestlabs.tgz + '@rush-temp/arm-elastic': file:./projects/arm-elastic.tgz '@rush-temp/arm-eventgrid': file:./projects/arm-eventgrid.tgz '@rush-temp/arm-eventhub': file:./projects/arm-eventhub.tgz '@rush-temp/arm-extendedlocation': file:./projects/arm-extendedlocation.tgz @@ -215,6 +216,7 @@ dependencies: '@rush-temp/arm-datalake-analytics': file:projects/arm-datalake-analytics.tgz '@rush-temp/arm-desktopvirtualization': file:projects/arm-desktopvirtualization.tgz '@rush-temp/arm-devtestlabs': file:projects/arm-devtestlabs.tgz + '@rush-temp/arm-elastic': file:projects/arm-elastic.tgz '@rush-temp/arm-eventgrid': file:projects/arm-eventgrid.tgz '@rush-temp/arm-eventhub': file:projects/arm-eventhub.tgz '@rush-temp/arm-extendedlocation': file:projects/arm-extendedlocation.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 @@ -8500,6 +8502,27 @@ packages: uglify-js: 3.14.5 dev: false + file:projects/arm-elastic.tgz: + resolution: {integrity: sha512-C4AhPueLSSJAfD3uibmIzpcjqZr8+q/qZCU0kTKTxOqp34zYNr06vs1j0moDU6G4t1RI3BKirjvGVsYhTCMbAQ==, tarball: file:projects/arm-elastic.tgz} + name: '@rush-temp/arm-elastic' + 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-eventgrid.tgz: resolution: {integrity: sha512-26uyTQ6UX9N1i+BWqT3Ga154/45qazjGOcYOuleDzv7+gERljkMNe6dHkAbeLpwr8k/Tt9mdHY/1dLHrcRIa+w==, tarball: file:projects/arm-eventgrid.tgz} name: '@rush-temp/arm-eventgrid' @@ -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..96784a7fd59b 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-elastic", + "projectFolder": "sdk/elastic/arm-elastic", + "versionPolicyName": "management" } ] } \ No newline at end of file diff --git a/sdk/elastic/arm-elastic/CHANGELOG.md b/sdk/elastic/arm-elastic/CHANGELOG.md new file mode 100644 index 000000000000..816f56c8a63e --- /dev/null +++ b/sdk/elastic/arm-elastic/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0 (2022-01-05) + +The package of @azure/arm-elastic 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/elastic/arm-elastic/LICENSE b/sdk/elastic/arm-elastic/LICENSE new file mode 100644 index 000000000000..5d1d36e0af80 --- /dev/null +++ b/sdk/elastic/arm-elastic/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/elastic/arm-elastic/README.md b/sdk/elastic/arm-elastic/README.md new file mode 100644 index 000000000000..c62220fe2a2d --- /dev/null +++ b/sdk/elastic/arm-elastic/README.md @@ -0,0 +1,98 @@ +# Azure Service client library for JavaScript + +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure Service client. + + + +[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/elastic/arm-elastic) | +[Package (NPM)](https://www.npmjs.com/package/@azure/arm-elastic) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-elastic) | +[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-elastic` package + +Install the Azure Service client library for JavaScript with `npm`: + +```bash +npm install @azure/arm-elastic +``` + +### Create and authenticate a `MicrosoftElastic` + +To create a client object to access the Azure Service API, you will need the `endpoint` of your Azure Service resource and a `credential`. The Azure Service client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azure Service 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 Azure Service** 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 { MicrosoftElastic } = require("@azure/arm-elastic"); +const { DefaultAzureCredential } = require("@azure/identity"); +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new MicrosoftElastic(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 + +### MicrosoftElastic + +`MicrosoftElastic` is the primary interface for developers using the Azure Service client library. Explore the methods on this client object to understand the different features of the Azure Service 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%2Felastic%2Farm-elastic%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/elastic/arm-elastic/_meta.json b/sdk/elastic/arm-elastic/_meta.json new file mode 100644 index 000000000000..63dd3bf88866 --- /dev/null +++ b/sdk/elastic/arm-elastic/_meta.json @@ -0,0 +1,7 @@ +{ + "commit": "cea6492a1e41b3f3b4f8b4f69bdcc10431e79c0e", + "readme": "specification/elastic/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/elastic/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/elastic/arm-elastic/api-extractor.json b/sdk/elastic/arm-elastic/api-extractor.json new file mode 100644 index 000000000000..af8f8f36892d --- /dev/null +++ b/sdk/elastic/arm-elastic/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-elastic.d.ts" + }, + "messages": { + "tsdocMessageReporting": { "default": { "logLevel": "none" } }, + "extractorMessageReporting": { + "ae-missing-release-tag": { "logLevel": "none" }, + "ae-unresolved-link": { "logLevel": "none" } + } + } +} diff --git a/sdk/elastic/arm-elastic/package.json b/sdk/elastic/arm-elastic/package.json new file mode 100644 index 000000000000..c26269b8649b --- /dev/null +++ b/sdk/elastic/arm-elastic/package.json @@ -0,0 +1,92 @@ +{ + "name": "@azure/arm-elastic", + "sdk-type": "mgmt", + "author": "Microsoft Corporation", + "description": "A generated SDK for MicrosoftElastic.", + "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-elastic.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/elastic/arm-elastic", + "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/elastic/arm-elastic/review/arm-elastic.api.md b/sdk/elastic/arm-elastic/review/arm-elastic.api.md new file mode 100644 index 000000000000..704f48fc512d --- /dev/null +++ b/sdk/elastic/arm-elastic/review/arm-elastic.api.md @@ -0,0 +1,587 @@ +## API Report File for "@azure/arm-elastic" + +> 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 interface CompanyInfo { + business?: string; + country?: string; + domain?: string; + employeesNumber?: string; + state?: string; +} + +// @public +export type CreatedByType = string; + +// @public +export interface DeploymentInfo { + list(resourceGroupName: string, monitorName: string, options?: DeploymentInfoListOptionalParams): Promise; +} + +// @public +export interface DeploymentInfoListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DeploymentInfoListResponse = DeploymentInfoResponse; + +// @public +export interface DeploymentInfoResponse { + readonly diskCapacity?: string; + readonly memoryCapacity?: string; + readonly status?: ElasticDeploymentStatus; + readonly version?: string; +} + +// @public +export interface ElasticCloudDeployment { + readonly azureSubscriptionId?: string; + readonly deploymentId?: string; + readonly elasticsearchRegion?: string; + readonly elasticsearchServiceUrl?: string; + readonly kibanaServiceUrl?: string; + readonly kibanaSsoUrl?: string; + readonly name?: string; +} + +// @public +export interface ElasticCloudUser { + readonly elasticCloudSsoDefaultUrl?: string; + readonly emailAddress?: string; + readonly id?: string; +} + +// @public +export type ElasticDeploymentStatus = string; + +// @public +export interface ElasticMonitorResource { + readonly id?: string; + identity?: IdentityProperties; + location: string; + readonly name?: string; + properties?: MonitorProperties; + sku?: ResourceSku; + readonly systemData?: SystemData; + tags?: { + [propertyName: string]: string; + }; + readonly type?: string; +} + +// @public +export interface ElasticMonitorResourceListResponse { + nextLink?: string; + value?: ElasticMonitorResource[]; +} + +// @public +export interface ElasticMonitorResourceUpdateParameters { + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface ElasticProperties { + elasticCloudDeployment?: ElasticCloudDeployment; + elasticCloudUser?: ElasticCloudUser; +} + +// @public +export interface ErrorResponseBody { + code?: string; + details?: ErrorResponseBody[]; + message?: string; + target?: string; +} + +// @public +export interface FilteringTag { + action?: TagAction; + name?: string; + value?: string; +} + +// @public +export interface IdentityProperties { + readonly principalId?: string; + readonly tenantId?: string; + type?: ManagedIdentityTypes; +} + +// @public +export enum KnownCreatedByType { + // (undocumented) + Application = "Application", + // (undocumented) + Key = "Key", + // (undocumented) + ManagedIdentity = "ManagedIdentity", + // (undocumented) + User = "User" +} + +// @public +export enum KnownElasticDeploymentStatus { + // (undocumented) + Healthy = "Healthy", + // (undocumented) + Unhealthy = "Unhealthy" +} + +// @public +export enum KnownLiftrResourceCategories { + // (undocumented) + MonitorLogs = "MonitorLogs", + // (undocumented) + Unknown = "Unknown" +} + +// @public +export enum KnownManagedIdentityTypes { + // (undocumented) + SystemAssigned = "SystemAssigned" +} + +// @public +export enum KnownMonitoringStatus { + // (undocumented) + Disabled = "Disabled", + // (undocumented) + Enabled = "Enabled" +} + +// @public +export enum KnownOperationName { + // (undocumented) + Add = "Add", + // (undocumented) + Delete = "Delete" +} + +// @public +export enum KnownProvisioningState { + // (undocumented) + Accepted = "Accepted", + // (undocumented) + Canceled = "Canceled", + // (undocumented) + Creating = "Creating", + // (undocumented) + Deleted = "Deleted", + // (undocumented) + Deleting = "Deleting", + // (undocumented) + Failed = "Failed", + // (undocumented) + NotSpecified = "NotSpecified", + // (undocumented) + Succeeded = "Succeeded", + // (undocumented) + Updating = "Updating" +} + +// @public +export enum KnownSendingLogs { + // (undocumented) + False = "False", + // (undocumented) + True = "True" +} + +// @public +export enum KnownTagAction { + // (undocumented) + Exclude = "Exclude", + // (undocumented) + Include = "Include" +} + +// @public +export type LiftrResourceCategories = string; + +// @public +export interface LogRules { + filteringTags?: FilteringTag[]; + sendAadLogs?: boolean; + sendActivityLogs?: boolean; + sendSubscriptionLogs?: boolean; +} + +// @public +export type ManagedIdentityTypes = string; + +// @public (undocumented) +export class MicrosoftElastic extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: MicrosoftElasticOptionalParams); + // (undocumented) + apiVersion: string; + // (undocumented) + deploymentInfo: DeploymentInfo; + // (undocumented) + monitoredResources: MonitoredResources; + // (undocumented) + monitors: Monitors; + // (undocumented) + operations: Operations; + // (undocumented) + subscriptionId: string; + // (undocumented) + tagRules: TagRules; + // (undocumented) + vMCollection: VMCollection; + // (undocumented) + vMHost: VMHost; + // (undocumented) + vMIngestion: VMIngestion; +} + +// @public +export interface MicrosoftElasticOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + apiVersion?: string; + endpoint?: string; +} + +// @public +export interface MonitoredResource { + id?: string; + reasonForLogsStatus?: string; + sendingLogs?: SendingLogs; +} + +// @public +export interface MonitoredResourceListResponse { + nextLink?: string; + value?: MonitoredResource[]; +} + +// @public +export interface MonitoredResources { + list(resourceGroupName: string, monitorName: string, options?: MonitoredResourcesListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface MonitoredResourcesListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MonitoredResourcesListNextResponse = MonitoredResourceListResponse; + +// @public +export interface MonitoredResourcesListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MonitoredResourcesListResponse = MonitoredResourceListResponse; + +// @public +export type MonitoringStatus = string; + +// @public +export interface MonitoringTagRules { + readonly id?: string; + readonly name?: string; + properties?: MonitoringTagRulesProperties; + readonly systemData?: SystemData; + readonly type?: string; +} + +// @public +export interface MonitoringTagRulesListResponse { + nextLink?: string; + value?: MonitoringTagRules[]; +} + +// @public +export interface MonitoringTagRulesProperties { + logRules?: LogRules; + provisioningState?: ProvisioningState; +} + +// @public +export interface MonitorProperties { + elasticProperties?: ElasticProperties; + readonly liftrResourceCategory?: LiftrResourceCategories; + readonly liftrResourcePreference?: number; + monitoringStatus?: MonitoringStatus; + provisioningState?: ProvisioningState; + userInfo?: UserInfo; +} + +// @public +export interface Monitors { + beginCreate(resourceGroupName: string, monitorName: string, options?: MonitorsCreateOptionalParams): Promise, MonitorsCreateResponse>>; + beginCreateAndWait(resourceGroupName: string, monitorName: string, options?: MonitorsCreateOptionalParams): Promise; + beginDelete(resourceGroupName: string, monitorName: string, options?: MonitorsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, monitorName: string, options?: MonitorsDeleteOptionalParams): Promise; + get(resourceGroupName: string, monitorName: string, options?: MonitorsGetOptionalParams): Promise; + list(options?: MonitorsListOptionalParams): PagedAsyncIterableIterator; + listByResourceGroup(resourceGroupName: string, options?: MonitorsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + update(resourceGroupName: string, monitorName: string, options?: MonitorsUpdateOptionalParams): Promise; +} + +// @public +export interface MonitorsCreateOptionalParams extends coreClient.OperationOptions { + body?: ElasticMonitorResource; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type MonitorsCreateResponse = ElasticMonitorResource; + +// @public +export interface MonitorsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface MonitorsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MonitorsGetResponse = ElasticMonitorResource; + +// @public +export interface MonitorsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MonitorsListByResourceGroupNextResponse = ElasticMonitorResourceListResponse; + +// @public +export interface MonitorsListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MonitorsListByResourceGroupResponse = ElasticMonitorResourceListResponse; + +// @public +export interface MonitorsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MonitorsListNextResponse = ElasticMonitorResourceListResponse; + +// @public +export interface MonitorsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MonitorsListResponse = ElasticMonitorResourceListResponse; + +// @public +export interface MonitorsUpdateOptionalParams extends coreClient.OperationOptions { + body?: ElasticMonitorResourceUpdateParameters; +} + +// @public +export type MonitorsUpdateResponse = ElasticMonitorResource; + +// @public +export interface OperationDisplay { + description?: string; + operation?: string; + provider?: string; + resource?: string; +} + +// @public +export interface OperationListResult { + nextLink?: string; + value?: OperationResult[]; +} + +// @public +export type OperationName = string; + +// @public +export interface OperationResult { + display?: OperationDisplay; + isDataAction?: boolean; + name?: string; + origin?: 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 +export type ProvisioningState = string; + +// @public +export interface ResourceProviderDefaultErrorResponse { + readonly error?: ErrorResponseBody; +} + +// @public +export interface ResourceSku { + name: string; +} + +// @public +export type SendingLogs = string; + +// @public +export interface SystemData { + createdAt?: Date; + createdBy?: string; + createdByType?: CreatedByType; + lastModifiedAt?: Date; + lastModifiedBy?: string; + lastModifiedByType?: CreatedByType; +} + +// @public +export type TagAction = string; + +// @public +export interface TagRules { + beginDelete(resourceGroupName: string, monitorName: string, ruleSetName: string, options?: TagRulesDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, monitorName: string, ruleSetName: string, options?: TagRulesDeleteOptionalParams): Promise; + createOrUpdate(resourceGroupName: string, monitorName: string, ruleSetName: string, options?: TagRulesCreateOrUpdateOptionalParams): Promise; + get(resourceGroupName: string, monitorName: string, ruleSetName: string, options?: TagRulesGetOptionalParams): Promise; + list(resourceGroupName: string, monitorName: string, options?: TagRulesListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface TagRulesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + body?: MonitoringTagRules; +} + +// @public +export type TagRulesCreateOrUpdateResponse = MonitoringTagRules; + +// @public +export interface TagRulesDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface TagRulesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TagRulesGetResponse = MonitoringTagRules; + +// @public +export interface TagRulesListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TagRulesListNextResponse = MonitoringTagRulesListResponse; + +// @public +export interface TagRulesListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TagRulesListResponse = MonitoringTagRulesListResponse; + +// @public +export interface UserInfo { + companyInfo?: CompanyInfo; + companyName?: string; + emailAddress?: string; + firstName?: string; + lastName?: string; +} + +// @public +export interface VMCollection { + update(resourceGroupName: string, monitorName: string, options?: VMCollectionUpdateOptionalParams): Promise; +} + +// @public +export interface VMCollectionUpdate { + operationName?: OperationName; + vmResourceId?: string; +} + +// @public +export interface VMCollectionUpdateOptionalParams extends coreClient.OperationOptions { + body?: VMCollectionUpdate; +} + +// @public +export interface VMHost { + list(resourceGroupName: string, monitorName: string, options?: VMHostListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface VMHostListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VMHostListNextResponse = VMHostListResponse; + +// @public +export type VMHostListOperationResponse = VMHostListResponse; + +// @public +export interface VMHostListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface VMHostListResponse { + nextLink?: string; + value?: VMResources[]; +} + +// @public +export interface VMIngestion { + details(resourceGroupName: string, monitorName: string, options?: VMIngestionDetailsOptionalParams): Promise; +} + +// @public +export type VMIngestionDetailsOperationResponse = VMIngestionDetailsResponse; + +// @public +export interface VMIngestionDetailsOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface VMIngestionDetailsResponse { + cloudId?: string; + ingestionKey?: string; +} + +// @public +export interface VMResources { + vmResourceId?: string; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/elastic/arm-elastic/rollup.config.js b/sdk/elastic/arm-elastic/rollup.config.js new file mode 100644 index 000000000000..9be1955eb7f1 --- /dev/null +++ b/sdk/elastic/arm-elastic/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/elastic/arm-elastic/src/index.ts b/sdk/elastic/arm-elastic/src/index.ts new file mode 100644 index 000000000000..78d06887f9a2 --- /dev/null +++ b/sdk/elastic/arm-elastic/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 { MicrosoftElastic } from "./microsoftElastic"; +export * from "./operationsInterfaces"; diff --git a/sdk/elastic/arm-elastic/src/lroImpl.ts b/sdk/elastic/arm-elastic/src/lroImpl.ts new file mode 100644 index 000000000000..518d5f053b4e --- /dev/null +++ b/sdk/elastic/arm-elastic/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/elastic/arm-elastic/src/microsoftElastic.ts b/sdk/elastic/arm-elastic/src/microsoftElastic.ts new file mode 100644 index 000000000000..181a421a3766 --- /dev/null +++ b/sdk/elastic/arm-elastic/src/microsoftElastic.ts @@ -0,0 +1,108 @@ +/* + * 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, + MonitorsImpl, + MonitoredResourcesImpl, + DeploymentInfoImpl, + TagRulesImpl, + VMHostImpl, + VMIngestionImpl, + VMCollectionImpl +} from "./operations"; +import { + Operations, + Monitors, + MonitoredResources, + DeploymentInfo, + TagRules, + VMHost, + VMIngestion, + VMCollection +} from "./operationsInterfaces"; +import { MicrosoftElasticOptionalParams } from "./models"; + +export class MicrosoftElastic extends coreClient.ServiceClient { + $host: string; + apiVersion: string; + subscriptionId: string; + + /** + * Initializes a new instance of the MicrosoftElastic class. + * @param credentials Subscription credentials which uniquely identify client subscription. + * @param subscriptionId The Azure subscription ID. This is a GUID-formatted string (e.g. + * 00000000-0000-0000-0000-000000000000) + * @param options The parameter options + */ + constructor( + credentials: coreAuth.TokenCredential, + subscriptionId: string, + options?: MicrosoftElasticOptionalParams + ) { + 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: MicrosoftElasticOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; + + const packageDetails = `azsdk-js-arm-elastic/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 || "2020-07-01"; + this.operations = new OperationsImpl(this); + this.monitors = new MonitorsImpl(this); + this.monitoredResources = new MonitoredResourcesImpl(this); + this.deploymentInfo = new DeploymentInfoImpl(this); + this.tagRules = new TagRulesImpl(this); + this.vMHost = new VMHostImpl(this); + this.vMIngestion = new VMIngestionImpl(this); + this.vMCollection = new VMCollectionImpl(this); + } + + operations: Operations; + monitors: Monitors; + monitoredResources: MonitoredResources; + deploymentInfo: DeploymentInfo; + tagRules: TagRules; + vMHost: VMHost; + vMIngestion: VMIngestion; + vMCollection: VMCollection; +} diff --git a/sdk/elastic/arm-elastic/src/models/index.ts b/sdk/elastic/arm-elastic/src/models/index.ts new file mode 100644 index 000000000000..974ee71608ed --- /dev/null +++ b/sdk/elastic/arm-elastic/src/models/index.ts @@ -0,0 +1,738 @@ +/* + * 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 GET request to list the Microsoft.Elastic operations. */ +export interface OperationListResult { + /** List of operations supported by the Microsoft.Elastic provider. */ + value?: OperationResult[]; + /** URL to get the next set of operation list results if there are any. */ + nextLink?: string; +} + +/** A Microsoft.Elastic REST API operation. */ +export interface OperationResult { + /** Operation name, i.e., {provider}/{resource}/{operation}. */ + name?: string; + /** Indicates whether the operation is a data action */ + isDataAction?: boolean; + /** The object that represents the operation. */ + display?: OperationDisplay; + /** Origin of the operation */ + origin?: string; +} + +/** The object that represents the operation. */ +export interface OperationDisplay { + /** Service provider, i.e., Microsoft.Elastic. */ + provider?: string; + /** Type on which the operation is performed, e.g., 'monitors'. */ + resource?: string; + /** Operation type, e.g., read, write, delete, etc. */ + operation?: string; + /** Description of the operation, e.g., 'Write monitors'. */ + description?: string; +} + +/** RP default error response. */ +export interface ResourceProviderDefaultErrorResponse { + /** + * Response body of Error + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly error?: ErrorResponseBody; +} + +/** Error response body. */ +export interface ErrorResponseBody { + /** Error code. */ + code?: string; + /** Error message. */ + message?: string; + /** Error target. */ + target?: string; + /** Error details. */ + details?: ErrorResponseBody[]; +} + +/** Response of a list operation. */ +export interface ElasticMonitorResourceListResponse { + /** Results of a list operation. */ + value?: ElasticMonitorResource[]; + /** Link to the next set of results, if any. */ + nextLink?: string; +} + +/** Monitor resource. */ +export interface ElasticMonitorResource { + /** + * ARM id of the monitor resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * Name of the monitor resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * The type of the monitor resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** SKU of the monitor resource. */ + sku?: ResourceSku; + /** Properties of the monitor resource. */ + properties?: MonitorProperties; + /** Identity properties of the monitor resource. */ + identity?: IdentityProperties; + /** The tags of the monitor resource. */ + tags?: { [propertyName: string]: string }; + /** The location of the monitor resource */ + location: string; + /** + * The system metadata relating to this resource + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; +} + +/** Microsoft.Elastic SKU. */ +export interface ResourceSku { + /** Name of the SKU. */ + name: string; +} + +/** Properties specific to the monitor resource. */ +export interface MonitorProperties { + /** Provisioning state of the monitor resource. */ + provisioningState?: ProvisioningState; + /** Flag specifying if the resource monitoring is enabled or disabled. */ + monitoringStatus?: MonitoringStatus; + /** Elastic cloud properties. */ + elasticProperties?: ElasticProperties; + /** User information. */ + userInfo?: UserInfo; + /** NOTE: This property will not be serialized. It can only be populated by the server. */ + readonly liftrResourceCategory?: LiftrResourceCategories; + /** + * The priority of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly liftrResourcePreference?: number; +} + +/** Elastic Resource Properties. */ +export interface ElasticProperties { + /** Details of the user's elastic account. */ + elasticCloudUser?: ElasticCloudUser; + /** Details of the elastic cloud deployment. */ + elasticCloudDeployment?: ElasticCloudDeployment; +} + +/** Details of the user's elastic account. */ +export interface ElasticCloudUser { + /** + * Email of the Elastic User Account. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly emailAddress?: string; + /** + * User Id of the elastic account of the User. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * Elastic cloud default dashboard sso URL of the Elastic user account. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly elasticCloudSsoDefaultUrl?: string; +} + +/** Details of the user's elastic deployment associated with the monitor resource. */ +export interface ElasticCloudDeployment { + /** + * Elastic deployment name + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * Elastic deployment Id + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly deploymentId?: string; + /** + * Associated Azure subscription Id for the elastic deployment. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly azureSubscriptionId?: string; + /** + * Region where Deployment at Elastic side took place. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly elasticsearchRegion?: string; + /** + * Elasticsearch ingestion endpoint of the Elastic deployment. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly elasticsearchServiceUrl?: string; + /** + * Kibana endpoint of the Elastic deployment. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly kibanaServiceUrl?: string; + /** + * Kibana dashboard sso URL of the Elastic deployment. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly kibanaSsoUrl?: string; +} + +/** User Information to be passed to partners. */ +export interface UserInfo { + /** First name of the user */ + firstName?: string; + /** Last name of the user */ + lastName?: string; + /** Company name of the user */ + companyName?: string; + /** Email of the user used by Elastic for contacting them if needed */ + emailAddress?: string; + /** Company information of the user to be passed to partners. */ + companyInfo?: CompanyInfo; +} + +/** Company information of the user to be passed to partners. */ +export interface CompanyInfo { + /** Domain of the company */ + domain?: string; + /** Business of the company */ + business?: string; + /** Number of employees in the company */ + employeesNumber?: string; + /** State of the company location. */ + state?: string; + /** Country of the company location. */ + country?: string; +} + +/** Identity properties. */ +export interface IdentityProperties { + /** + * The identity ID. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly principalId?: string; + /** + * The tenant ID of resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly tenantId?: string; + /** Managed identity type. */ + type?: ManagedIdentityTypes; +} + +/** 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; +} + +/** Monitor resource update parameters. */ +export interface ElasticMonitorResourceUpdateParameters { + /** elastic monitor resource tags. */ + tags?: { [propertyName: string]: string }; +} + +/** Response of a list operation. */ +export interface MonitoredResourceListResponse { + /** Results of a list operation. */ + value?: MonitoredResource[]; + /** Link to the next set of results, if any. */ + nextLink?: string; +} + +/** The properties of a resource currently being monitored by the Elastic monitor resource. */ +export interface MonitoredResource { + /** The ARM id of the resource. */ + id?: string; + /** Flag indicating the status of the resource for sending logs operation to Elastic. */ + sendingLogs?: SendingLogs; + /** Reason for why the resource is sending logs (or why it is not sending). */ + reasonForLogsStatus?: string; +} + +/** The properties of deployment in Elastic cloud corresponding to the Elastic monitor resource. */ +export interface DeploymentInfoResponse { + /** + * The Elastic deployment status. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly status?: ElasticDeploymentStatus; + /** + * Version of the elasticsearch in Elastic cloud deployment. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly version?: string; + /** + * RAM capacity of the elasticsearch in Elastic cloud deployment. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly memoryCapacity?: string; + /** + * Disk capacity of the elasticsearch in Elastic cloud deployment. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly diskCapacity?: string; +} + +/** Response of a list operation. */ +export interface MonitoringTagRulesListResponse { + /** Results of a list operation. */ + value?: MonitoringTagRules[]; + /** Link to the next set of results, if any. */ + nextLink?: string; +} + +/** Capture logs and metrics of Azure resources based on ARM tags. */ +export interface MonitoringTagRules { + /** + * Name of the rule set. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * The id of the rule set. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * The type of the rule set. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** Properties of the monitoring tag rules. */ + properties?: MonitoringTagRulesProperties; + /** + * The system metadata relating to this resource + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; +} + +/** Definition of the properties for a TagRules resource. */ +export interface MonitoringTagRulesProperties { + /** Provisioning state of the monitoring tag rules. */ + provisioningState?: ProvisioningState; + /** Rules for sending logs. */ + logRules?: LogRules; +} + +/** Set of rules for sending logs for the Monitor resource. */ +export interface LogRules { + /** Flag specifying if AAD logs should be sent for the Monitor resource. */ + sendAadLogs?: boolean; + /** Flag specifying if subscription logs should be sent for the Monitor resource. */ + sendSubscriptionLogs?: boolean; + /** Flag specifying if activity logs from Azure resources should be sent for the Monitor resource. */ + sendActivityLogs?: boolean; + /** List of filtering tags to be used for capturing logs. This only takes effect if SendActivityLogs flag is enabled. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags. */ + filteringTags?: FilteringTag[]; +} + +/** The definition of a filtering tag. Filtering tags are used for capturing resources and include/exclude them from being monitored. */ +export interface FilteringTag { + /** The name (also known as the key) of the tag. */ + name?: string; + /** The value of the tag. */ + value?: string; + /** Valid actions for a filtering tag. */ + action?: TagAction; +} + +/** Response of a list operation. */ +export interface VMHostListResponse { + /** Results of a list operation. */ + value?: VMResources[]; + /** Link to the next Vm resource Id, if any. */ + nextLink?: string; +} + +/** The vm resource properties that is currently being monitored by the Elastic monitor resource. */ +export interface VMResources { + /** The ARM id of the VM resource. */ + vmResourceId?: string; +} + +/** The vm ingestion details to install an agent. */ +export interface VMIngestionDetailsResponse { + /** The cloudId of given Elastic monitor resource. */ + cloudId?: string; + /** Ingestion details to install agent on given VM. */ + ingestionKey?: string; +} + +/** Update VM resource collection. */ +export interface VMCollectionUpdate { + /** ARM id of the VM resource. */ + vmResourceId?: string; + /** Operation to be performed for given VM. */ + operationName?: OperationName; +} + +/** Known values of {@link ProvisioningState} that the service accepts. */ +export enum KnownProvisioningState { + Accepted = "Accepted", + Creating = "Creating", + Updating = "Updating", + Deleting = "Deleting", + Succeeded = "Succeeded", + Failed = "Failed", + Canceled = "Canceled", + Deleted = "Deleted", + NotSpecified = "NotSpecified" +} + +/** + * Defines values for ProvisioningState. \ + * {@link KnownProvisioningState} can be used interchangeably with ProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Accepted** \ + * **Creating** \ + * **Updating** \ + * **Deleting** \ + * **Succeeded** \ + * **Failed** \ + * **Canceled** \ + * **Deleted** \ + * **NotSpecified** + */ +export type ProvisioningState = string; + +/** Known values of {@link MonitoringStatus} that the service accepts. */ +export enum KnownMonitoringStatus { + Enabled = "Enabled", + Disabled = "Disabled" +} + +/** + * Defines values for MonitoringStatus. \ + * {@link KnownMonitoringStatus} can be used interchangeably with MonitoringStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Enabled** \ + * **Disabled** + */ +export type MonitoringStatus = string; + +/** Known values of {@link LiftrResourceCategories} that the service accepts. */ +export enum KnownLiftrResourceCategories { + Unknown = "Unknown", + MonitorLogs = "MonitorLogs" +} + +/** + * Defines values for LiftrResourceCategories. \ + * {@link KnownLiftrResourceCategories} can be used interchangeably with LiftrResourceCategories, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unknown** \ + * **MonitorLogs** + */ +export type LiftrResourceCategories = string; + +/** Known values of {@link ManagedIdentityTypes} that the service accepts. */ +export enum KnownManagedIdentityTypes { + SystemAssigned = "SystemAssigned" +} + +/** + * Defines values for ManagedIdentityTypes. \ + * {@link KnownManagedIdentityTypes} can be used interchangeably with ManagedIdentityTypes, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **SystemAssigned** + */ +export type ManagedIdentityTypes = 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 SendingLogs} that the service accepts. */ +export enum KnownSendingLogs { + True = "True", + False = "False" +} + +/** + * Defines values for SendingLogs. \ + * {@link KnownSendingLogs} can be used interchangeably with SendingLogs, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **True** \ + * **False** + */ +export type SendingLogs = string; + +/** Known values of {@link ElasticDeploymentStatus} that the service accepts. */ +export enum KnownElasticDeploymentStatus { + Healthy = "Healthy", + Unhealthy = "Unhealthy" +} + +/** + * Defines values for ElasticDeploymentStatus. \ + * {@link KnownElasticDeploymentStatus} can be used interchangeably with ElasticDeploymentStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Healthy** \ + * **Unhealthy** + */ +export type ElasticDeploymentStatus = string; + +/** Known values of {@link TagAction} that the service accepts. */ +export enum KnownTagAction { + Include = "Include", + Exclude = "Exclude" +} + +/** + * Defines values for TagAction. \ + * {@link KnownTagAction} can be used interchangeably with TagAction, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Include** \ + * **Exclude** + */ +export type TagAction = string; + +/** Known values of {@link OperationName} that the service accepts. */ +export enum KnownOperationName { + Add = "Add", + Delete = "Delete" +} + +/** + * Defines values for OperationName. \ + * {@link KnownOperationName} can be used interchangeably with OperationName, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Add** \ + * **Delete** + */ +export type OperationName = string; + +/** 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 MonitorsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type MonitorsListResponse = ElasticMonitorResourceListResponse; + +/** Optional parameters. */ +export interface MonitorsListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type MonitorsListByResourceGroupResponse = ElasticMonitorResourceListResponse; + +/** Optional parameters. */ +export interface MonitorsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type MonitorsGetResponse = ElasticMonitorResource; + +/** Optional parameters. */ +export interface MonitorsCreateOptionalParams + extends coreClient.OperationOptions { + /** Elastic monitor resource model */ + body?: ElasticMonitorResource; + /** 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 MonitorsCreateResponse = ElasticMonitorResource; + +/** Optional parameters. */ +export interface MonitorsUpdateOptionalParams + extends coreClient.OperationOptions { + /** Elastic resource model update parameters. */ + body?: ElasticMonitorResourceUpdateParameters; +} + +/** Contains response data for the update operation. */ +export type MonitorsUpdateResponse = ElasticMonitorResource; + +/** Optional parameters. */ +export interface MonitorsDeleteOptionalParams + 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 MonitorsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type MonitorsListNextResponse = ElasticMonitorResourceListResponse; + +/** Optional parameters. */ +export interface MonitorsListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type MonitorsListByResourceGroupNextResponse = ElasticMonitorResourceListResponse; + +/** Optional parameters. */ +export interface MonitoredResourcesListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type MonitoredResourcesListResponse = MonitoredResourceListResponse; + +/** Optional parameters. */ +export interface MonitoredResourcesListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type MonitoredResourcesListNextResponse = MonitoredResourceListResponse; + +/** Optional parameters. */ +export interface DeploymentInfoListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type DeploymentInfoListResponse = DeploymentInfoResponse; + +/** Optional parameters. */ +export interface TagRulesListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type TagRulesListResponse = MonitoringTagRulesListResponse; + +/** Optional parameters. */ +export interface TagRulesCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** request body of MonitoringTagRules */ + body?: MonitoringTagRules; +} + +/** Contains response data for the createOrUpdate operation. */ +export type TagRulesCreateOrUpdateResponse = MonitoringTagRules; + +/** Optional parameters. */ +export interface TagRulesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type TagRulesGetResponse = MonitoringTagRules; + +/** Optional parameters. */ +export interface TagRulesDeleteOptionalParams + 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 TagRulesListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type TagRulesListNextResponse = MonitoringTagRulesListResponse; + +/** Optional parameters. */ +export interface VMHostListOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type VMHostListOperationResponse = VMHostListResponse; + +/** Optional parameters. */ +export interface VMHostListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type VMHostListNextResponse = VMHostListResponse; + +/** Optional parameters. */ +export interface VMIngestionDetailsOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the details operation. */ +export type VMIngestionDetailsOperationResponse = VMIngestionDetailsResponse; + +/** Optional parameters. */ +export interface VMCollectionUpdateOptionalParams + extends coreClient.OperationOptions { + /** VM resource Id */ + body?: VMCollectionUpdate; +} + +/** Optional parameters. */ +export interface MicrosoftElasticOptionalParams + extends coreClient.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Api Version */ + apiVersion?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/elastic/arm-elastic/src/models/mappers.ts b/sdk/elastic/arm-elastic/src/models/mappers.ts new file mode 100644 index 000000000000..e0ff74a4952c --- /dev/null +++ b/sdk/elastic/arm-elastic/src/models/mappers.ts @@ -0,0 +1,965 @@ +/* + * 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", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "OperationResult" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const OperationResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationResult", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + isDataAction: { + serializedName: "isDataAction", + type: { + name: "Boolean" + } + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplay" + } + }, + origin: { + serializedName: "origin", + type: { + name: "String" + } + } + } + } +}; + +export const OperationDisplay: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationDisplay", + modelProperties: { + provider: { + serializedName: "provider", + type: { + name: "String" + } + }, + resource: { + serializedName: "resource", + type: { + name: "String" + } + }, + operation: { + serializedName: "operation", + type: { + name: "String" + } + }, + description: { + serializedName: "description", + type: { + name: "String" + } + } + } + } +}; + +export const ResourceProviderDefaultErrorResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ResourceProviderDefaultErrorResponse", + 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 ElasticMonitorResourceListResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ElasticMonitorResourceListResponse", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ElasticMonitorResource" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const ElasticMonitorResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ElasticMonitorResource", + 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" + } + }, + sku: { + serializedName: "sku", + type: { + name: "Composite", + className: "ResourceSku" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "MonitorProperties" + } + }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "IdentityProperties" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + location: { + serializedName: "location", + required: true, + type: { + name: "String" + } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + } + } + } +}; + +export const ResourceSku: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ResourceSku", + modelProperties: { + name: { + serializedName: "name", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const MonitorProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MonitorProperties", + modelProperties: { + provisioningState: { + serializedName: "provisioningState", + type: { + name: "String" + } + }, + monitoringStatus: { + serializedName: "monitoringStatus", + type: { + name: "String" + } + }, + elasticProperties: { + serializedName: "elasticProperties", + type: { + name: "Composite", + className: "ElasticProperties" + } + }, + userInfo: { + serializedName: "userInfo", + type: { + name: "Composite", + className: "UserInfo" + } + }, + liftrResourceCategory: { + serializedName: "liftrResourceCategory", + readOnly: true, + type: { + name: "String" + } + }, + liftrResourcePreference: { + serializedName: "liftrResourcePreference", + readOnly: true, + type: { + name: "Number" + } + } + } + } +}; + +export const ElasticProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ElasticProperties", + modelProperties: { + elasticCloudUser: { + serializedName: "elasticCloudUser", + type: { + name: "Composite", + className: "ElasticCloudUser" + } + }, + elasticCloudDeployment: { + serializedName: "elasticCloudDeployment", + type: { + name: "Composite", + className: "ElasticCloudDeployment" + } + } + } + } +}; + +export const ElasticCloudUser: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ElasticCloudUser", + modelProperties: { + emailAddress: { + serializedName: "emailAddress", + readOnly: true, + type: { + name: "String" + } + }, + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + elasticCloudSsoDefaultUrl: { + serializedName: "elasticCloudSsoDefaultUrl", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ElasticCloudDeployment: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ElasticCloudDeployment", + modelProperties: { + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + deploymentId: { + serializedName: "deploymentId", + readOnly: true, + type: { + name: "String" + } + }, + azureSubscriptionId: { + serializedName: "azureSubscriptionId", + readOnly: true, + type: { + name: "String" + } + }, + elasticsearchRegion: { + serializedName: "elasticsearchRegion", + readOnly: true, + type: { + name: "String" + } + }, + elasticsearchServiceUrl: { + serializedName: "elasticsearchServiceUrl", + readOnly: true, + type: { + name: "String" + } + }, + kibanaServiceUrl: { + serializedName: "kibanaServiceUrl", + readOnly: true, + type: { + name: "String" + } + }, + kibanaSsoUrl: { + serializedName: "kibanaSsoUrl", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const UserInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "UserInfo", + modelProperties: { + firstName: { + constraints: { + MaxLength: 50 + }, + serializedName: "firstName", + type: { + name: "String" + } + }, + lastName: { + constraints: { + MaxLength: 50 + }, + serializedName: "lastName", + type: { + name: "String" + } + }, + companyName: { + constraints: { + MaxLength: 50 + }, + serializedName: "companyName", + type: { + name: "String" + } + }, + emailAddress: { + constraints: { + Pattern: new RegExp( + '^([^<>()\\[\\]\\.,;:\\s@"]+(\\.[^<>()\\[\\]\\.,;:\\s@"]+)*)@(([a-zA-Z-_0-9]+\\.)+[a-zA-Z]{2,})$' + ) + }, + serializedName: "emailAddress", + type: { + name: "String" + } + }, + companyInfo: { + serializedName: "companyInfo", + type: { + name: "Composite", + className: "CompanyInfo" + } + } + } + } +}; + +export const CompanyInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CompanyInfo", + modelProperties: { + domain: { + constraints: { + MaxLength: 250 + }, + serializedName: "domain", + type: { + name: "String" + } + }, + business: { + constraints: { + MaxLength: 50 + }, + serializedName: "business", + type: { + name: "String" + } + }, + employeesNumber: { + constraints: { + MaxLength: 20 + }, + serializedName: "employeesNumber", + type: { + name: "String" + } + }, + state: { + constraints: { + MaxLength: 50 + }, + serializedName: "state", + type: { + name: "String" + } + }, + country: { + constraints: { + MaxLength: 50 + }, + serializedName: "country", + type: { + name: "String" + } + } + } + } +}; + +export const IdentityProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "IdentityProperties", + modelProperties: { + principalId: { + serializedName: "principalId", + readOnly: true, + type: { + name: "String" + } + }, + tenantId: { + serializedName: "tenantId", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + type: { + name: "String" + } + } + } + } +}; + +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 ElasticMonitorResourceUpdateParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ElasticMonitorResourceUpdateParameters", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + } + } + } +}; + +export const MonitoredResourceListResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MonitoredResourceListResponse", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MonitoredResource" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const MonitoredResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MonitoredResource", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String" + } + }, + sendingLogs: { + serializedName: "sendingLogs", + type: { + name: "String" + } + }, + reasonForLogsStatus: { + serializedName: "reasonForLogsStatus", + type: { + name: "String" + } + } + } + } +}; + +export const DeploymentInfoResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DeploymentInfoResponse", + modelProperties: { + status: { + serializedName: "status", + readOnly: true, + type: { + name: "String" + } + }, + version: { + serializedName: "version", + readOnly: true, + type: { + name: "String" + } + }, + memoryCapacity: { + serializedName: "memoryCapacity", + readOnly: true, + type: { + name: "String" + } + }, + diskCapacity: { + serializedName: "diskCapacity", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const MonitoringTagRulesListResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MonitoringTagRulesListResponse", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MonitoringTagRules" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const MonitoringTagRules: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MonitoringTagRules", + modelProperties: { + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "MonitoringTagRulesProperties" + } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + } + } + } +}; + +export const MonitoringTagRulesProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MonitoringTagRulesProperties", + modelProperties: { + provisioningState: { + serializedName: "provisioningState", + type: { + name: "String" + } + }, + logRules: { + serializedName: "logRules", + type: { + name: "Composite", + className: "LogRules" + } + } + } + } +}; + +export const LogRules: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LogRules", + modelProperties: { + sendAadLogs: { + serializedName: "sendAadLogs", + type: { + name: "Boolean" + } + }, + sendSubscriptionLogs: { + serializedName: "sendSubscriptionLogs", + type: { + name: "Boolean" + } + }, + sendActivityLogs: { + serializedName: "sendActivityLogs", + type: { + name: "Boolean" + } + }, + filteringTags: { + serializedName: "filteringTags", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "FilteringTag" + } + } + } + } + } + } +}; + +export const FilteringTag: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FilteringTag", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "String" + } + }, + action: { + serializedName: "action", + type: { + name: "String" + } + } + } + } +}; + +export const VMHostListResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VMHostListResponse", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "VMResources" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const VMResources: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VMResources", + modelProperties: { + vmResourceId: { + serializedName: "vmResourceId", + type: { + name: "String" + } + } + } + } +}; + +export const VMIngestionDetailsResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VMIngestionDetailsResponse", + modelProperties: { + cloudId: { + serializedName: "cloudId", + type: { + name: "String" + } + }, + ingestionKey: { + serializedName: "ingestionKey", + type: { + name: "String" + } + } + } + } +}; + +export const VMCollectionUpdate: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VMCollectionUpdate", + modelProperties: { + vmResourceId: { + serializedName: "vmResourceId", + type: { + name: "String" + } + }, + operationName: { + serializedName: "operationName", + type: { + name: "String" + } + } + } + } +}; diff --git a/sdk/elastic/arm-elastic/src/models/parameters.ts b/sdk/elastic/arm-elastic/src/models/parameters.ts new file mode 100644 index 000000000000..78ada243b3af --- /dev/null +++ b/sdk/elastic/arm-elastic/src/models/parameters.ts @@ -0,0 +1,143 @@ +/* + * 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 { + ElasticMonitorResource as ElasticMonitorResourceMapper, + ElasticMonitorResourceUpdateParameters as ElasticMonitorResourceUpdateParametersMapper, + MonitoringTagRules as MonitoringTagRulesMapper, + VMCollectionUpdate as VMCollectionUpdateMapper +} 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: "2020-07-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 monitorName: OperationURLParameter = { + parameterPath: "monitorName", + mapper: { + serializedName: "monitorName", + 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 body: OperationParameter = { + parameterPath: ["options", "body"], + mapper: ElasticMonitorResourceMapper +}; + +export const body1: OperationParameter = { + parameterPath: ["options", "body"], + mapper: ElasticMonitorResourceUpdateParametersMapper +}; + +export const body2: OperationParameter = { + parameterPath: ["options", "body"], + mapper: MonitoringTagRulesMapper +}; + +export const ruleSetName: OperationURLParameter = { + parameterPath: "ruleSetName", + mapper: { + serializedName: "ruleSetName", + required: true, + type: { + name: "String" + } + } +}; + +export const body3: OperationParameter = { + parameterPath: ["options", "body"], + mapper: VMCollectionUpdateMapper +}; diff --git a/sdk/elastic/arm-elastic/src/operations/deploymentInfo.ts b/sdk/elastic/arm-elastic/src/operations/deploymentInfo.ts new file mode 100644 index 000000000000..7f7afacce669 --- /dev/null +++ b/sdk/elastic/arm-elastic/src/operations/deploymentInfo.ts @@ -0,0 +1,72 @@ +/* + * 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 { DeploymentInfo } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { MicrosoftElastic } from "../microsoftElastic"; +import { + DeploymentInfoListOptionalParams, + DeploymentInfoListResponse +} from "../models"; + +/** Class containing DeploymentInfo operations. */ +export class DeploymentInfoImpl implements DeploymentInfo { + private readonly client: MicrosoftElastic; + + /** + * Initialize a new instance of the class DeploymentInfo class. + * @param client Reference to the service client + */ + constructor(client: MicrosoftElastic) { + this.client = client; + } + + /** + * Fetch information regarding Elastic cloud deployment corresponding to the Elastic monitor resource. + * @param resourceGroupName The name of the resource group to which the Elastic resource belongs. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + list( + resourceGroupName: string, + monitorName: string, + options?: DeploymentInfoListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, options }, + listOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}/listDeploymentInfo", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.DeploymentInfoResponse + }, + default: { + bodyMapper: Mappers.ResourceProviderDefaultErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/elastic/arm-elastic/src/operations/index.ts b/sdk/elastic/arm-elastic/src/operations/index.ts new file mode 100644 index 000000000000..836e7597ec47 --- /dev/null +++ b/sdk/elastic/arm-elastic/src/operations/index.ts @@ -0,0 +1,16 @@ +/* + * 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 "./monitors"; +export * from "./monitoredResources"; +export * from "./deploymentInfo"; +export * from "./tagRules"; +export * from "./vMHost"; +export * from "./vMIngestion"; +export * from "./vMCollection"; diff --git a/sdk/elastic/arm-elastic/src/operations/monitoredResources.ts b/sdk/elastic/arm-elastic/src/operations/monitoredResources.ts new file mode 100644 index 000000000000..bf285271671a --- /dev/null +++ b/sdk/elastic/arm-elastic/src/operations/monitoredResources.ts @@ -0,0 +1,177 @@ +/* + * 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 { MonitoredResources } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { MicrosoftElastic } from "../microsoftElastic"; +import { + MonitoredResource, + MonitoredResourcesListNextOptionalParams, + MonitoredResourcesListOptionalParams, + MonitoredResourcesListResponse, + MonitoredResourcesListNextResponse +} from "../models"; + +/// +/** Class containing MonitoredResources operations. */ +export class MonitoredResourcesImpl implements MonitoredResources { + private readonly client: MicrosoftElastic; + + /** + * Initialize a new instance of the class MonitoredResources class. + * @param client Reference to the service client + */ + constructor(client: MicrosoftElastic) { + this.client = client; + } + + /** + * List the resources currently being monitored by the Elastic monitor resource. + * @param resourceGroupName The name of the resource group to which the Elastic resource belongs. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + monitorName: string, + options?: MonitoredResourcesListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(resourceGroupName, monitorName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(resourceGroupName, monitorName, options); + } + }; + } + + private async *listPagingPage( + resourceGroupName: string, + monitorName: string, + options?: MonitoredResourcesListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(resourceGroupName, monitorName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + monitorName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + resourceGroupName: string, + monitorName: string, + options?: MonitoredResourcesListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + monitorName, + options + )) { + yield* page; + } + } + + /** + * List the resources currently being monitored by the Elastic monitor resource. + * @param resourceGroupName The name of the resource group to which the Elastic resource belongs. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + monitorName: string, + options?: MonitoredResourcesListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, options }, + listOperationSpec + ); + } + + /** + * ListNext + * @param resourceGroupName The name of the resource group to which the Elastic resource belongs. + * @param monitorName Monitor resource name + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + monitorName: string, + nextLink: string, + options?: MonitoredResourcesListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}/listMonitoredResources", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.MonitoredResourceListResponse + }, + default: { + bodyMapper: Mappers.ResourceProviderDefaultErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.MonitoredResourceListResponse + }, + default: { + bodyMapper: Mappers.ResourceProviderDefaultErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/elastic/arm-elastic/src/operations/monitors.ts b/sdk/elastic/arm-elastic/src/operations/monitors.ts new file mode 100644 index 000000000000..cccbfc1289fa --- /dev/null +++ b/sdk/elastic/arm-elastic/src/operations/monitors.ts @@ -0,0 +1,583 @@ +/* + * 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 { Monitors } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { MicrosoftElastic } from "../microsoftElastic"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + ElasticMonitorResource, + MonitorsListNextOptionalParams, + MonitorsListOptionalParams, + MonitorsListByResourceGroupNextOptionalParams, + MonitorsListByResourceGroupOptionalParams, + MonitorsListResponse, + MonitorsListByResourceGroupResponse, + MonitorsGetOptionalParams, + MonitorsGetResponse, + MonitorsCreateOptionalParams, + MonitorsCreateResponse, + MonitorsUpdateOptionalParams, + MonitorsUpdateResponse, + MonitorsDeleteOptionalParams, + MonitorsListNextResponse, + MonitorsListByResourceGroupNextResponse +} from "../models"; + +/// +/** Class containing Monitors operations. */ +export class MonitorsImpl implements Monitors { + private readonly client: MicrosoftElastic; + + /** + * Initialize a new instance of the class Monitors class. + * @param client Reference to the service client + */ + constructor(client: MicrosoftElastic) { + this.client = client; + } + + /** + * List all monitors under the specified subscription. + * @param options The options parameters. + */ + public list( + options?: MonitorsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: MonitorsListOptionalParams + ): 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?: MonitorsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + + /** + * List all monitors under the specified resource group. + * @param resourceGroupName The name of the resource group to which the Elastic resource belongs. + * @param options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: MonitorsListByResourceGroupOptionalParams + ): 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?: MonitorsListByResourceGroupOptionalParams + ): 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?: MonitorsListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + + /** + * List all monitors under the specified subscription. + * @param options The options parameters. + */ + private _list( + options?: MonitorsListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + + /** + * List all monitors under the specified resource group. + * @param resourceGroupName The name of the resource group to which the Elastic resource belongs. + * @param options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: MonitorsListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + + /** + * Get the properties of a specific monitor resource. + * @param resourceGroupName The name of the resource group to which the Elastic resource belongs. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + get( + resourceGroupName: string, + monitorName: string, + options?: MonitorsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, options }, + getOperationSpec + ); + } + + /** + * Create a monitor resource. + * @param resourceGroupName The name of the resource group to which the Elastic resource belongs. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + async beginCreate( + resourceGroupName: string, + monitorName: string, + options?: MonitorsCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + MonitorsCreateResponse + > + > { + 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, monitorName, options }, + createOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + } + + /** + * Create a monitor resource. + * @param resourceGroupName The name of the resource group to which the Elastic resource belongs. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + async beginCreateAndWait( + resourceGroupName: string, + monitorName: string, + options?: MonitorsCreateOptionalParams + ): Promise { + const poller = await this.beginCreate( + resourceGroupName, + monitorName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Update a monitor resource. + * @param resourceGroupName The name of the resource group to which the Elastic resource belongs. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + update( + resourceGroupName: string, + monitorName: string, + options?: MonitorsUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, options }, + updateOperationSpec + ); + } + + /** + * Delete a monitor resource. + * @param resourceGroupName The name of the resource group to which the Elastic resource belongs. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + monitorName: string, + options?: MonitorsDeleteOptionalParams + ): 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, monitorName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + + /** + * Delete a monitor resource. + * @param resourceGroupName The name of the resource group to which the Elastic resource belongs. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + monitorName: string, + options?: MonitorsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + monitorName, + options + ); + return poller.pollUntilDone(); + } + + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + nextLink: string, + options?: MonitorsListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listNextOperationSpec + ); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName The name of the resource group to which the Elastic resource belongs. + * @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?: MonitorsListByResourceGroupNextOptionalParams + ): 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.Elastic/monitors", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ElasticMonitorResourceListResponse + }, + default: { + bodyMapper: Mappers.ResourceProviderDefaultErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ElasticMonitorResourceListResponse + }, + default: { + bodyMapper: Mappers.ResourceProviderDefaultErrorResponse + } + }, + 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.Elastic/monitors/{monitorName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ElasticMonitorResource + }, + default: { + bodyMapper: Mappers.ResourceProviderDefaultErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.ElasticMonitorResource + }, + 201: { + bodyMapper: Mappers.ElasticMonitorResource + }, + 202: { + bodyMapper: Mappers.ElasticMonitorResource + }, + 204: { + bodyMapper: Mappers.ElasticMonitorResource + }, + default: { + bodyMapper: Mappers.ResourceProviderDefaultErrorResponse + } + }, + requestBody: Parameters.body, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.ElasticMonitorResource + }, + default: { + bodyMapper: Mappers.ResourceProviderDefaultErrorResponse + } + }, + requestBody: Parameters.body1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ResourceProviderDefaultErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ElasticMonitorResourceListResponse + }, + default: { + bodyMapper: Mappers.ResourceProviderDefaultErrorResponse + } + }, + 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.ElasticMonitorResourceListResponse + }, + default: { + bodyMapper: Mappers.ResourceProviderDefaultErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/elastic/arm-elastic/src/operations/operations.ts b/sdk/elastic/arm-elastic/src/operations/operations.ts new file mode 100644 index 000000000000..ebeee9635f54 --- /dev/null +++ b/sdk/elastic/arm-elastic/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 { MicrosoftElastic } from "../microsoftElastic"; +import { + OperationResult, + OperationsListNextOptionalParams, + OperationsListOptionalParams, + OperationsListResponse, + OperationsListNextResponse +} from "../models"; + +/// +/** Class containing Operations operations. */ +export class OperationsImpl implements Operations { + private readonly client: MicrosoftElastic; + + /** + * Initialize a new instance of the class Operations class. + * @param client Reference to the service client + */ + constructor(client: MicrosoftElastic) { + this.client = client; + } + + /** + * List all operations provided by Microsoft.Elastic. + * @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; + } + } + + /** + * List all operations provided by Microsoft.Elastic. + * @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.Elastic/operations", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.OperationListResult + }, + default: { + bodyMapper: Mappers.ResourceProviderDefaultErrorResponse + } + }, + 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.ResourceProviderDefaultErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.nextLink], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/elastic/arm-elastic/src/operations/tagRules.ts b/sdk/elastic/arm-elastic/src/operations/tagRules.ts new file mode 100644 index 000000000000..fb0657960b21 --- /dev/null +++ b/sdk/elastic/arm-elastic/src/operations/tagRules.ts @@ -0,0 +1,379 @@ +/* + * 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 { TagRules } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { MicrosoftElastic } from "../microsoftElastic"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + MonitoringTagRules, + TagRulesListNextOptionalParams, + TagRulesListOptionalParams, + TagRulesListResponse, + TagRulesCreateOrUpdateOptionalParams, + TagRulesCreateOrUpdateResponse, + TagRulesGetOptionalParams, + TagRulesGetResponse, + TagRulesDeleteOptionalParams, + TagRulesListNextResponse +} from "../models"; + +/// +/** Class containing TagRules operations. */ +export class TagRulesImpl implements TagRules { + private readonly client: MicrosoftElastic; + + /** + * Initialize a new instance of the class TagRules class. + * @param client Reference to the service client + */ + constructor(client: MicrosoftElastic) { + this.client = client; + } + + /** + * List the tag rules for a given monitor resource. + * @param resourceGroupName The name of the resource group to which the Elastic resource belongs. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + monitorName: string, + options?: TagRulesListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(resourceGroupName, monitorName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(resourceGroupName, monitorName, options); + } + }; + } + + private async *listPagingPage( + resourceGroupName: string, + monitorName: string, + options?: TagRulesListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(resourceGroupName, monitorName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + monitorName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + resourceGroupName: string, + monitorName: string, + options?: TagRulesListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + monitorName, + options + )) { + yield* page; + } + } + + /** + * List the tag rules for a given monitor resource. + * @param resourceGroupName The name of the resource group to which the Elastic resource belongs. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + monitorName: string, + options?: TagRulesListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, options }, + listOperationSpec + ); + } + + /** + * Create or update a tag rule set for a given monitor resource. + * @param resourceGroupName The name of the resource group to which the Elastic resource belongs. + * @param monitorName Monitor resource name + * @param ruleSetName Tag Rule Set resource name + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + monitorName: string, + ruleSetName: string, + options?: TagRulesCreateOrUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, ruleSetName, options }, + createOrUpdateOperationSpec + ); + } + + /** + * Get a tag rule set for a given monitor resource. + * @param resourceGroupName The name of the resource group to which the Elastic resource belongs. + * @param monitorName Monitor resource name + * @param ruleSetName Tag Rule Set resource name + * @param options The options parameters. + */ + get( + resourceGroupName: string, + monitorName: string, + ruleSetName: string, + options?: TagRulesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, ruleSetName, options }, + getOperationSpec + ); + } + + /** + * Delete a tag rule set for a given monitor resource. + * @param resourceGroupName The name of the resource group to which the Elastic resource belongs. + * @param monitorName Monitor resource name + * @param ruleSetName Tag Rule Set resource name + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + monitorName: string, + ruleSetName: string, + options?: TagRulesDeleteOptionalParams + ): 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, monitorName, ruleSetName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + + /** + * Delete a tag rule set for a given monitor resource. + * @param resourceGroupName The name of the resource group to which the Elastic resource belongs. + * @param monitorName Monitor resource name + * @param ruleSetName Tag Rule Set resource name + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + monitorName: string, + ruleSetName: string, + options?: TagRulesDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + monitorName, + ruleSetName, + options + ); + return poller.pollUntilDone(); + } + + /** + * ListNext + * @param resourceGroupName The name of the resource group to which the Elastic resource belongs. + * @param monitorName Monitor resource name + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + monitorName: string, + nextLink: string, + options?: TagRulesListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}/tagRules", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.MonitoringTagRulesListResponse + }, + default: { + bodyMapper: Mappers.ResourceProviderDefaultErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}/tagRules/{ruleSetName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.MonitoringTagRules + }, + default: { + bodyMapper: Mappers.ResourceProviderDefaultErrorResponse + } + }, + requestBody: Parameters.body2, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName, + Parameters.ruleSetName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}/tagRules/{ruleSetName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.MonitoringTagRules + }, + default: { + bodyMapper: Mappers.ResourceProviderDefaultErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName, + Parameters.ruleSetName + ], + headerParameters: [Parameters.accept], + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}/tagRules/{ruleSetName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ResourceProviderDefaultErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName, + Parameters.ruleSetName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.MonitoringTagRulesListResponse + }, + default: { + bodyMapper: Mappers.ResourceProviderDefaultErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/elastic/arm-elastic/src/operations/vMCollection.ts b/sdk/elastic/arm-elastic/src/operations/vMCollection.ts new file mode 100644 index 000000000000..3465719611e0 --- /dev/null +++ b/sdk/elastic/arm-elastic/src/operations/vMCollection.ts @@ -0,0 +1,69 @@ +/* + * 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 { VMCollection } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { MicrosoftElastic } from "../microsoftElastic"; +import { VMCollectionUpdateOptionalParams } from "../models"; + +/** Class containing VMCollection operations. */ +export class VMCollectionImpl implements VMCollection { + private readonly client: MicrosoftElastic; + + /** + * Initialize a new instance of the class VMCollection class. + * @param client Reference to the service client + */ + constructor(client: MicrosoftElastic) { + this.client = client; + } + + /** + * Update the vm details that will be monitored by the Elastic monitor resource. + * @param resourceGroupName The name of the resource group to which the Elastic resource belongs. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + update( + resourceGroupName: string, + monitorName: string, + options?: VMCollectionUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, options }, + updateOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}/vmCollectionUpdate", + httpMethod: "POST", + responses: { + 200: {}, + default: { + bodyMapper: Mappers.ResourceProviderDefaultErrorResponse + } + }, + requestBody: Parameters.body3, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; diff --git a/sdk/elastic/arm-elastic/src/operations/vMHost.ts b/sdk/elastic/arm-elastic/src/operations/vMHost.ts new file mode 100644 index 000000000000..fc9a8f85e0b8 --- /dev/null +++ b/sdk/elastic/arm-elastic/src/operations/vMHost.ts @@ -0,0 +1,177 @@ +/* + * 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 { VMHost } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { MicrosoftElastic } from "../microsoftElastic"; +import { + VMResources, + VMHostListNextOptionalParams, + VMHostListOptionalParams, + VMHostListOperationResponse, + VMHostListNextResponse +} from "../models"; + +/// +/** Class containing VMHost operations. */ +export class VMHostImpl implements VMHost { + private readonly client: MicrosoftElastic; + + /** + * Initialize a new instance of the class VMHost class. + * @param client Reference to the service client + */ + constructor(client: MicrosoftElastic) { + this.client = client; + } + + /** + * List the vm resources currently being monitored by the Elastic monitor resource. + * @param resourceGroupName The name of the resource group to which the Elastic resource belongs. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + monitorName: string, + options?: VMHostListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(resourceGroupName, monitorName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(resourceGroupName, monitorName, options); + } + }; + } + + private async *listPagingPage( + resourceGroupName: string, + monitorName: string, + options?: VMHostListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(resourceGroupName, monitorName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + monitorName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + resourceGroupName: string, + monitorName: string, + options?: VMHostListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + monitorName, + options + )) { + yield* page; + } + } + + /** + * List the vm resources currently being monitored by the Elastic monitor resource. + * @param resourceGroupName The name of the resource group to which the Elastic resource belongs. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + monitorName: string, + options?: VMHostListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, options }, + listOperationSpec + ); + } + + /** + * ListNext + * @param resourceGroupName The name of the resource group to which the Elastic resource belongs. + * @param monitorName Monitor resource name + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + monitorName: string, + nextLink: string, + options?: VMHostListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}/listVMHost", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.VMHostListResponse + }, + default: { + bodyMapper: Mappers.ResourceProviderDefaultErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VMHostListResponse + }, + default: { + bodyMapper: Mappers.ResourceProviderDefaultErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/elastic/arm-elastic/src/operations/vMIngestion.ts b/sdk/elastic/arm-elastic/src/operations/vMIngestion.ts new file mode 100644 index 000000000000..9f5cc474ca84 --- /dev/null +++ b/sdk/elastic/arm-elastic/src/operations/vMIngestion.ts @@ -0,0 +1,72 @@ +/* + * 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 { VMIngestion } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { MicrosoftElastic } from "../microsoftElastic"; +import { + VMIngestionDetailsOptionalParams, + VMIngestionDetailsOperationResponse +} from "../models"; + +/** Class containing VMIngestion operations. */ +export class VMIngestionImpl implements VMIngestion { + private readonly client: MicrosoftElastic; + + /** + * Initialize a new instance of the class VMIngestion class. + * @param client Reference to the service client + */ + constructor(client: MicrosoftElastic) { + this.client = client; + } + + /** + * List the vm ingestion details that will be monitored by the Elastic monitor resource. + * @param resourceGroupName The name of the resource group to which the Elastic resource belongs. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + details( + resourceGroupName: string, + monitorName: string, + options?: VMIngestionDetailsOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, options }, + detailsOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const detailsOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}/vmIngestionDetails", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.VMIngestionDetailsResponse + }, + default: { + bodyMapper: Mappers.ResourceProviderDefaultErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/elastic/arm-elastic/src/operationsInterfaces/deploymentInfo.ts b/sdk/elastic/arm-elastic/src/operationsInterfaces/deploymentInfo.ts new file mode 100644 index 000000000000..b2cef12d5f2a --- /dev/null +++ b/sdk/elastic/arm-elastic/src/operationsInterfaces/deploymentInfo.ts @@ -0,0 +1,27 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + DeploymentInfoListOptionalParams, + DeploymentInfoListResponse +} from "../models"; + +/** Interface representing a DeploymentInfo. */ +export interface DeploymentInfo { + /** + * Fetch information regarding Elastic cloud deployment corresponding to the Elastic monitor resource. + * @param resourceGroupName The name of the resource group to which the Elastic resource belongs. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + list( + resourceGroupName: string, + monitorName: string, + options?: DeploymentInfoListOptionalParams + ): Promise; +} diff --git a/sdk/elastic/arm-elastic/src/operationsInterfaces/index.ts b/sdk/elastic/arm-elastic/src/operationsInterfaces/index.ts new file mode 100644 index 000000000000..836e7597ec47 --- /dev/null +++ b/sdk/elastic/arm-elastic/src/operationsInterfaces/index.ts @@ -0,0 +1,16 @@ +/* + * 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 "./monitors"; +export * from "./monitoredResources"; +export * from "./deploymentInfo"; +export * from "./tagRules"; +export * from "./vMHost"; +export * from "./vMIngestion"; +export * from "./vMCollection"; diff --git a/sdk/elastic/arm-elastic/src/operationsInterfaces/monitoredResources.ts b/sdk/elastic/arm-elastic/src/operationsInterfaces/monitoredResources.ts new file mode 100644 index 000000000000..9eda85126836 --- /dev/null +++ b/sdk/elastic/arm-elastic/src/operationsInterfaces/monitoredResources.ts @@ -0,0 +1,29 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + MonitoredResource, + MonitoredResourcesListOptionalParams +} from "../models"; + +/// +/** Interface representing a MonitoredResources. */ +export interface MonitoredResources { + /** + * List the resources currently being monitored by the Elastic monitor resource. + * @param resourceGroupName The name of the resource group to which the Elastic resource belongs. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + list( + resourceGroupName: string, + monitorName: string, + options?: MonitoredResourcesListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/elastic/arm-elastic/src/operationsInterfaces/monitors.ts b/sdk/elastic/arm-elastic/src/operationsInterfaces/monitors.ts new file mode 100644 index 000000000000..2a202a969803 --- /dev/null +++ b/sdk/elastic/arm-elastic/src/operationsInterfaces/monitors.ts @@ -0,0 +1,114 @@ +/* + * 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 { + ElasticMonitorResource, + MonitorsListOptionalParams, + MonitorsListByResourceGroupOptionalParams, + MonitorsGetOptionalParams, + MonitorsGetResponse, + MonitorsCreateOptionalParams, + MonitorsCreateResponse, + MonitorsUpdateOptionalParams, + MonitorsUpdateResponse, + MonitorsDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a Monitors. */ +export interface Monitors { + /** + * List all monitors under the specified subscription. + * @param options The options parameters. + */ + list( + options?: MonitorsListOptionalParams + ): PagedAsyncIterableIterator; + /** + * List all monitors under the specified resource group. + * @param resourceGroupName The name of the resource group to which the Elastic resource belongs. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: MonitorsListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get the properties of a specific monitor resource. + * @param resourceGroupName The name of the resource group to which the Elastic resource belongs. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + get( + resourceGroupName: string, + monitorName: string, + options?: MonitorsGetOptionalParams + ): Promise; + /** + * Create a monitor resource. + * @param resourceGroupName The name of the resource group to which the Elastic resource belongs. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + beginCreate( + resourceGroupName: string, + monitorName: string, + options?: MonitorsCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + MonitorsCreateResponse + > + >; + /** + * Create a monitor resource. + * @param resourceGroupName The name of the resource group to which the Elastic resource belongs. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + beginCreateAndWait( + resourceGroupName: string, + monitorName: string, + options?: MonitorsCreateOptionalParams + ): Promise; + /** + * Update a monitor resource. + * @param resourceGroupName The name of the resource group to which the Elastic resource belongs. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + update( + resourceGroupName: string, + monitorName: string, + options?: MonitorsUpdateOptionalParams + ): Promise; + /** + * Delete a monitor resource. + * @param resourceGroupName The name of the resource group to which the Elastic resource belongs. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + monitorName: string, + options?: MonitorsDeleteOptionalParams + ): Promise, void>>; + /** + * Delete a monitor resource. + * @param resourceGroupName The name of the resource group to which the Elastic resource belongs. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + monitorName: string, + options?: MonitorsDeleteOptionalParams + ): Promise; +} diff --git a/sdk/elastic/arm-elastic/src/operationsInterfaces/operations.ts b/sdk/elastic/arm-elastic/src/operationsInterfaces/operations.ts new file mode 100644 index 000000000000..d265e58b1cc9 --- /dev/null +++ b/sdk/elastic/arm-elastic/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 { OperationResult, OperationsListOptionalParams } from "../models"; + +/// +/** Interface representing a Operations. */ +export interface Operations { + /** + * List all operations provided by Microsoft.Elastic. + * @param options The options parameters. + */ + list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/elastic/arm-elastic/src/operationsInterfaces/tagRules.ts b/sdk/elastic/arm-elastic/src/operationsInterfaces/tagRules.ts new file mode 100644 index 000000000000..943c9499dc33 --- /dev/null +++ b/sdk/elastic/arm-elastic/src/operationsInterfaces/tagRules.ts @@ -0,0 +1,87 @@ +/* + * 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 { + MonitoringTagRules, + TagRulesListOptionalParams, + TagRulesCreateOrUpdateOptionalParams, + TagRulesCreateOrUpdateResponse, + TagRulesGetOptionalParams, + TagRulesGetResponse, + TagRulesDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a TagRules. */ +export interface TagRules { + /** + * List the tag rules for a given monitor resource. + * @param resourceGroupName The name of the resource group to which the Elastic resource belongs. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + list( + resourceGroupName: string, + monitorName: string, + options?: TagRulesListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Create or update a tag rule set for a given monitor resource. + * @param resourceGroupName The name of the resource group to which the Elastic resource belongs. + * @param monitorName Monitor resource name + * @param ruleSetName Tag Rule Set resource name + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + monitorName: string, + ruleSetName: string, + options?: TagRulesCreateOrUpdateOptionalParams + ): Promise; + /** + * Get a tag rule set for a given monitor resource. + * @param resourceGroupName The name of the resource group to which the Elastic resource belongs. + * @param monitorName Monitor resource name + * @param ruleSetName Tag Rule Set resource name + * @param options The options parameters. + */ + get( + resourceGroupName: string, + monitorName: string, + ruleSetName: string, + options?: TagRulesGetOptionalParams + ): Promise; + /** + * Delete a tag rule set for a given monitor resource. + * @param resourceGroupName The name of the resource group to which the Elastic resource belongs. + * @param monitorName Monitor resource name + * @param ruleSetName Tag Rule Set resource name + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + monitorName: string, + ruleSetName: string, + options?: TagRulesDeleteOptionalParams + ): Promise, void>>; + /** + * Delete a tag rule set for a given monitor resource. + * @param resourceGroupName The name of the resource group to which the Elastic resource belongs. + * @param monitorName Monitor resource name + * @param ruleSetName Tag Rule Set resource name + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + monitorName: string, + ruleSetName: string, + options?: TagRulesDeleteOptionalParams + ): Promise; +} diff --git a/sdk/elastic/arm-elastic/src/operationsInterfaces/vMCollection.ts b/sdk/elastic/arm-elastic/src/operationsInterfaces/vMCollection.ts new file mode 100644 index 000000000000..65b121b32a6e --- /dev/null +++ b/sdk/elastic/arm-elastic/src/operationsInterfaces/vMCollection.ts @@ -0,0 +1,24 @@ +/* + * 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 { VMCollectionUpdateOptionalParams } from "../models"; + +/** Interface representing a VMCollection. */ +export interface VMCollection { + /** + * Update the vm details that will be monitored by the Elastic monitor resource. + * @param resourceGroupName The name of the resource group to which the Elastic resource belongs. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + update( + resourceGroupName: string, + monitorName: string, + options?: VMCollectionUpdateOptionalParams + ): Promise; +} diff --git a/sdk/elastic/arm-elastic/src/operationsInterfaces/vMHost.ts b/sdk/elastic/arm-elastic/src/operationsInterfaces/vMHost.ts new file mode 100644 index 000000000000..d64e5793945c --- /dev/null +++ b/sdk/elastic/arm-elastic/src/operationsInterfaces/vMHost.ts @@ -0,0 +1,26 @@ +/* + * 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 { VMResources, VMHostListOptionalParams } from "../models"; + +/// +/** Interface representing a VMHost. */ +export interface VMHost { + /** + * List the vm resources currently being monitored by the Elastic monitor resource. + * @param resourceGroupName The name of the resource group to which the Elastic resource belongs. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + list( + resourceGroupName: string, + monitorName: string, + options?: VMHostListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/elastic/arm-elastic/src/operationsInterfaces/vMIngestion.ts b/sdk/elastic/arm-elastic/src/operationsInterfaces/vMIngestion.ts new file mode 100644 index 000000000000..c751fe0770c9 --- /dev/null +++ b/sdk/elastic/arm-elastic/src/operationsInterfaces/vMIngestion.ts @@ -0,0 +1,27 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + VMIngestionDetailsOptionalParams, + VMIngestionDetailsOperationResponse +} from "../models"; + +/** Interface representing a VMIngestion. */ +export interface VMIngestion { + /** + * List the vm ingestion details that will be monitored by the Elastic monitor resource. + * @param resourceGroupName The name of the resource group to which the Elastic resource belongs. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + details( + resourceGroupName: string, + monitorName: string, + options?: VMIngestionDetailsOptionalParams + ): Promise; +} diff --git a/sdk/elastic/arm-elastic/test/sampleTest.ts b/sdk/elastic/arm-elastic/test/sampleTest.ts new file mode 100644 index 000000000000..7ed89b043e1b --- /dev/null +++ b/sdk/elastic/arm-elastic/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/elastic/arm-elastic/tsconfig.json b/sdk/elastic/arm-elastic/tsconfig.json new file mode 100644 index 000000000000..6e3251194117 --- /dev/null +++ b/sdk/elastic/arm-elastic/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/elastic/ci.yml b/sdk/elastic/ci.yml new file mode 100644 index 000000000000..a31be1b11321 --- /dev/null +++ b/sdk/elastic/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/elastic/ + +pr: + branches: + include: + - main + - release/* + - hotfix/* + paths: + include: + - sdk/elastic/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: elastic + Artifacts: + - name: azure-arm-elastic + safeName: azurearmelastic + \ No newline at end of file