From 5bec546d33cba5f88aadb879c283a45aef084369 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 5 Jan 2022 12:06:56 +0000 Subject: [PATCH] CodeGen from PR 16640 in Azure/azure-rest-api-specs Update the CSharp output directory. (#16640) --- common/config/rush/pnpm-lock.yaml | 131 +- rush.json | 5 + sdk/chaos/arm-chaos/CHANGELOG.md | 5 + sdk/chaos/arm-chaos/LICENSE | 21 + sdk/chaos/arm-chaos/README.md | 98 + sdk/chaos/arm-chaos/_meta.json | 7 + sdk/chaos/arm-chaos/api-extractor.json | 18 + sdk/chaos/arm-chaos/package.json | 92 + sdk/chaos/arm-chaos/review/arm-chaos.api.md | 689 +++++++ sdk/chaos/arm-chaos/rollup.config.js | 188 ++ .../arm-chaos/src/chaosManagementClient.ts | 99 + sdk/chaos/arm-chaos/src/index.ts | 12 + sdk/chaos/arm-chaos/src/lroImpl.ts | 34 + sdk/chaos/arm-chaos/src/models/index.ts | 1087 +++++++++++ sdk/chaos/arm-chaos/src/models/mappers.ts | 1598 +++++++++++++++++ sdk/chaos/arm-chaos/src/models/parameters.ts | 302 ++++ .../arm-chaos/src/operations/capabilities.ts | 435 +++++ .../src/operations/capabilityTypes.ts | 221 +++ .../arm-chaos/src/operations/experiments.ts | 1053 +++++++++++ sdk/chaos/arm-chaos/src/operations/index.ts | 14 + .../arm-chaos/src/operations/operations.ts | 137 ++ .../arm-chaos/src/operations/targetTypes.ts | 199 ++ sdk/chaos/arm-chaos/src/operations/targets.ts | 406 +++++ .../src/operationsInterfaces/capabilities.ts | 99 + .../operationsInterfaces/capabilityTypes.ts | 44 + .../src/operationsInterfaces/experiments.ts | 192 ++ .../src/operationsInterfaces/index.ts | 14 + .../src/operationsInterfaces/operations.ts | 22 + .../src/operationsInterfaces/targetTypes.ts | 40 + .../src/operationsInterfaces/targets.ts | 91 + sdk/chaos/arm-chaos/test/sampleTest.ts | 48 + sdk/chaos/arm-chaos/tsconfig.json | 19 + sdk/chaos/ci.yml | 29 + 33 files changed, 7395 insertions(+), 54 deletions(-) create mode 100644 sdk/chaos/arm-chaos/CHANGELOG.md create mode 100644 sdk/chaos/arm-chaos/LICENSE create mode 100644 sdk/chaos/arm-chaos/README.md create mode 100644 sdk/chaos/arm-chaos/_meta.json create mode 100644 sdk/chaos/arm-chaos/api-extractor.json create mode 100644 sdk/chaos/arm-chaos/package.json create mode 100644 sdk/chaos/arm-chaos/review/arm-chaos.api.md create mode 100644 sdk/chaos/arm-chaos/rollup.config.js create mode 100644 sdk/chaos/arm-chaos/src/chaosManagementClient.ts create mode 100644 sdk/chaos/arm-chaos/src/index.ts create mode 100644 sdk/chaos/arm-chaos/src/lroImpl.ts create mode 100644 sdk/chaos/arm-chaos/src/models/index.ts create mode 100644 sdk/chaos/arm-chaos/src/models/mappers.ts create mode 100644 sdk/chaos/arm-chaos/src/models/parameters.ts create mode 100644 sdk/chaos/arm-chaos/src/operations/capabilities.ts create mode 100644 sdk/chaos/arm-chaos/src/operations/capabilityTypes.ts create mode 100644 sdk/chaos/arm-chaos/src/operations/experiments.ts create mode 100644 sdk/chaos/arm-chaos/src/operations/index.ts create mode 100644 sdk/chaos/arm-chaos/src/operations/operations.ts create mode 100644 sdk/chaos/arm-chaos/src/operations/targetTypes.ts create mode 100644 sdk/chaos/arm-chaos/src/operations/targets.ts create mode 100644 sdk/chaos/arm-chaos/src/operationsInterfaces/capabilities.ts create mode 100644 sdk/chaos/arm-chaos/src/operationsInterfaces/capabilityTypes.ts create mode 100644 sdk/chaos/arm-chaos/src/operationsInterfaces/experiments.ts create mode 100644 sdk/chaos/arm-chaos/src/operationsInterfaces/index.ts create mode 100644 sdk/chaos/arm-chaos/src/operationsInterfaces/operations.ts create mode 100644 sdk/chaos/arm-chaos/src/operationsInterfaces/targetTypes.ts create mode 100644 sdk/chaos/arm-chaos/src/operationsInterfaces/targets.ts create mode 100644 sdk/chaos/arm-chaos/test/sampleTest.ts create mode 100644 sdk/chaos/arm-chaos/tsconfig.json create mode 100644 sdk/chaos/ci.yml diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 694e81b4a476..ee7488c65839 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -22,6 +22,7 @@ specifiers: '@rush-temp/arm-botservice': file:./projects/arm-botservice.tgz '@rush-temp/arm-cdn': file:./projects/arm-cdn.tgz '@rush-temp/arm-changeanalysis': file:./projects/arm-changeanalysis.tgz + '@rush-temp/arm-chaos': file:./projects/arm-chaos.tgz '@rush-temp/arm-cognitiveservices': file:./projects/arm-cognitiveservices.tgz '@rush-temp/arm-compute': file:./projects/arm-compute.tgz '@rush-temp/arm-consumption': file:./projects/arm-consumption.tgz @@ -203,6 +204,7 @@ dependencies: '@rush-temp/arm-botservice': file:projects/arm-botservice.tgz '@rush-temp/arm-cdn': file:projects/arm-cdn.tgz '@rush-temp/arm-changeanalysis': file:projects/arm-changeanalysis.tgz + '@rush-temp/arm-chaos': file:projects/arm-chaos.tgz '@rush-temp/arm-cognitiveservices': file:projects/arm-cognitiveservices.tgz '@rush-temp/arm-compute': file:projects/arm-compute.tgz '@rush-temp/arm-consumption': file:projects/arm-consumption.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 @@ -8248,6 +8250,27 @@ packages: uglify-js: 3.14.5 dev: false + file:projects/arm-chaos.tgz: + resolution: {integrity: sha512-Cct/RpLyDXCZHam3RED4VnJUPvmJeZP8UfzkUU5fzBTyewGxpSjtReZukx0xa1k7dDjvhp8NVQroedHCbsSGTw==, tarball: file:projects/arm-chaos.tgz} + name: '@rush-temp/arm-chaos' + 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-cognitiveservices.tgz: resolution: {integrity: sha512-nhXO2X6wsidbD/bRFm7geAnKOO7NFBrM7vNIOi5uSAzpGPhfWpqBwQBp4QvLeAtBXEnfjWJuRSvQwRa/9bzXWg==, tarball: file:projects/arm-cognitiveservices.tgz} name: '@rush-temp/arm-cognitiveservices' @@ -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..c918c6f893b6 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-chaos", + "projectFolder": "sdk/chaos/arm-chaos", + "versionPolicyName": "management" } ] } \ No newline at end of file diff --git a/sdk/chaos/arm-chaos/CHANGELOG.md b/sdk/chaos/arm-chaos/CHANGELOG.md new file mode 100644 index 000000000000..cd01984192c9 --- /dev/null +++ b/sdk/chaos/arm-chaos/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2022-01-05) + +The package of @azure/arm-chaos 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/chaos/arm-chaos/LICENSE b/sdk/chaos/arm-chaos/LICENSE new file mode 100644 index 000000000000..5d1d36e0af80 --- /dev/null +++ b/sdk/chaos/arm-chaos/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/chaos/arm-chaos/README.md b/sdk/chaos/arm-chaos/README.md new file mode 100644 index 000000000000..9fcf30beb57e --- /dev/null +++ b/sdk/chaos/arm-chaos/README.md @@ -0,0 +1,98 @@ +# Azure ChaosManagement client library for JavaScript + +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure ChaosManagement client. + +Chaos Management Client + +[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/chaos/arm-chaos) | +[Package (NPM)](https://www.npmjs.com/package/@azure/arm-chaos) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-chaos?view=azure-node-preview) | +[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-chaos` package + +Install the Azure ChaosManagement client library for JavaScript with `npm`: + +```bash +npm install @azure/arm-chaos +``` + +### Create and authenticate a `ChaosManagementClient` + +To create a client object to access the Azure ChaosManagement API, you will need the `endpoint` of your Azure ChaosManagement resource and a `credential`. The Azure ChaosManagement client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azure ChaosManagement 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 ChaosManagement** 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 { ChaosManagementClient } = require("@azure/arm-chaos"); +const { DefaultAzureCredential } = require("@azure/identity"); +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new ChaosManagementClient(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 + +### ChaosManagementClient + +`ChaosManagementClient` is the primary interface for developers using the Azure ChaosManagement client library. Explore the methods on this client object to understand the different features of the Azure ChaosManagement 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%2Fchaos%2Farm-chaos%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/chaos/arm-chaos/_meta.json b/sdk/chaos/arm-chaos/_meta.json new file mode 100644 index 000000000000..2b891e64d9f5 --- /dev/null +++ b/sdk/chaos/arm-chaos/_meta.json @@ -0,0 +1,7 @@ +{ + "commit": "c078a73d6a9afe6df19b5945f8784359a3c21c74", + "readme": "specification/chaos/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/chaos/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/chaos/arm-chaos/api-extractor.json b/sdk/chaos/arm-chaos/api-extractor.json new file mode 100644 index 000000000000..16000296f87c --- /dev/null +++ b/sdk/chaos/arm-chaos/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-chaos.d.ts" + }, + "messages": { + "tsdocMessageReporting": { "default": { "logLevel": "none" } }, + "extractorMessageReporting": { + "ae-missing-release-tag": { "logLevel": "none" }, + "ae-unresolved-link": { "logLevel": "none" } + } + } +} diff --git a/sdk/chaos/arm-chaos/package.json b/sdk/chaos/arm-chaos/package.json new file mode 100644 index 000000000000..990262c92643 --- /dev/null +++ b/sdk/chaos/arm-chaos/package.json @@ -0,0 +1,92 @@ +{ + "name": "@azure/arm-chaos", + "sdk-type": "mgmt", + "author": "Microsoft Corporation", + "description": "A generated SDK for ChaosManagementClient.", + "version": "1.0.0-beta.1", + "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-chaos.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/chaos/arm-chaos", + "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/chaos/arm-chaos/review/arm-chaos.api.md b/sdk/chaos/arm-chaos/review/arm-chaos.api.md new file mode 100644 index 000000000000..7a8dfeda7a6d --- /dev/null +++ b/sdk/chaos/arm-chaos/review/arm-chaos.api.md @@ -0,0 +1,689 @@ +## API Report File for "@azure/arm-chaos" + +> 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 Action { + name: string; + type: "delay" | "discrete" | "continuous"; +} + +// @public +export interface ActionStatus { + readonly id?: string; + readonly name?: string; + readonly status?: string; + readonly targets?: ExperimentExecutionActionTargetDetailsProperties[]; +} + +// @public +export type ActionType = string; + +// @public (undocumented) +export type ActionUnion = Action | DelayAction | DiscreteAction | ContinuousAction; + +// @public +export interface Branch { + actions: ActionUnion[]; + name: string; +} + +// @public +export interface BranchStatus { + readonly actions?: ActionStatus[]; + readonly id?: string; + readonly name?: string; + readonly status?: string; +} + +// @public +export interface Capabilities { + createOrUpdate(resourceGroupName: string, parentProviderNamespace: string, parentResourceType: string, parentResourceName: string, targetName: string, capabilityName: string, capability: Capability, options?: CapabilitiesCreateOrUpdateOptionalParams): Promise; + delete(resourceGroupName: string, parentProviderNamespace: string, parentResourceType: string, parentResourceName: string, targetName: string, capabilityName: string, options?: CapabilitiesDeleteOptionalParams): Promise; + get(resourceGroupName: string, parentProviderNamespace: string, parentResourceType: string, parentResourceName: string, targetName: string, capabilityName: string, options?: CapabilitiesGetOptionalParams): Promise; + list(resourceGroupName: string, parentProviderNamespace: string, parentResourceType: string, parentResourceName: string, targetName: string, options?: CapabilitiesListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface CapabilitiesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CapabilitiesCreateOrUpdateResponse = Capability; + +// @public +export interface CapabilitiesDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface CapabilitiesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CapabilitiesGetResponse = Capability; + +// @public +export interface CapabilitiesListNextOptionalParams extends coreClient.OperationOptions { + continuationToken?: string; +} + +// @public +export type CapabilitiesListNextResponse = CapabilityListResult; + +// @public +export interface CapabilitiesListOptionalParams extends coreClient.OperationOptions { + continuationToken?: string; +} + +// @public +export type CapabilitiesListResponse = CapabilityListResult; + +// @public +export type Capability = Resource & { + readonly systemData?: SystemData; + readonly publisher?: string; + readonly targetType?: string; + readonly description?: string; + readonly parametersSchema?: string; + readonly urn?: string; +}; + +// @public +export interface CapabilityListResult { + readonly nextLink?: string; + readonly value?: Capability[]; +} + +// @public +export type CapabilityType = Resource & { + readonly systemData?: SystemData; + location?: string; + readonly publisher?: string; + readonly targetType?: string; + readonly displayName?: string; + readonly description?: string; + readonly parametersSchema?: string; + readonly urn?: string; +}; + +// @public +export interface CapabilityTypeListResult { + readonly nextLink?: string; + readonly value?: CapabilityType[]; +} + +// @public +export interface CapabilityTypes { + get(locationName: string, targetTypeName: string, capabilityTypeName: string, options?: CapabilityTypesGetOptionalParams): Promise; + list(locationName: string, targetTypeName: string, options?: CapabilityTypesListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface CapabilityTypesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CapabilityTypesGetResponse = CapabilityType; + +// @public +export interface CapabilityTypesListNextOptionalParams extends coreClient.OperationOptions { + continuationToken?: string; +} + +// @public +export type CapabilityTypesListNextResponse = CapabilityTypeListResult; + +// @public +export interface CapabilityTypesListOptionalParams extends coreClient.OperationOptions { + continuationToken?: string; +} + +// @public +export type CapabilityTypesListResponse = CapabilityTypeListResult; + +// @public (undocumented) +export class ChaosManagementClient extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: ChaosManagementClientOptionalParams); + // (undocumented) + apiVersion: string; + // (undocumented) + capabilities: Capabilities; + // (undocumented) + capabilityTypes: CapabilityTypes; + // (undocumented) + experiments: Experiments; + // (undocumented) + operations: Operations; + // (undocumented) + subscriptionId: string; + // (undocumented) + targets: Targets; + // (undocumented) + targetTypes: TargetTypes; +} + +// @public +export interface ChaosManagementClientOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + apiVersion?: string; + endpoint?: string; +} + +// @public +export type ContinuousAction = Action & { + type: "continuous"; + duration: string; + parameters: KeyValuePair[]; + selectorId: string; +}; + +// @public +export type CreatedByType = string; + +// @public +export type DelayAction = Action & { + type: "delay"; + duration: string; +}; + +// @public +export type DiscreteAction = Action & { + type: "discrete"; + parameters: KeyValuePair[]; + selectorId: string; +}; + +// @public +export interface ErrorAdditionalInfo { + readonly info?: Record; + readonly type?: string; +} + +// @public +export interface ErrorDetail { + readonly additionalInfo?: ErrorAdditionalInfo[]; + readonly code?: string; + readonly details?: ErrorDetail[]; + readonly message?: string; + readonly target?: string; +} + +// @public +export interface ErrorResponse { + error?: ErrorDetail; +} + +// @public +export type Experiment = TrackedResource & { + readonly systemData?: SystemData; + identity?: ResourceIdentity; + steps: Step[]; + selectors: Selector[]; + startOnCreation?: boolean; +}; + +// @public +export interface ExperimentCancelOperationResult { + readonly name?: string; + readonly statusUrl?: string; +} + +// @public +export interface ExperimentExecutionActionTargetDetailsError { + readonly code?: string; + readonly message?: string; +} + +// @public +export interface ExperimentExecutionActionTargetDetailsProperties { + readonly completedDateUtc?: Date; + readonly error?: ExperimentExecutionActionTargetDetailsError; + readonly failedDateUtc?: Date; + readonly status?: string; + readonly target?: string; +} + +// @public +export interface ExperimentExecutionDetails { + readonly createdDateUtc?: Date; + readonly experimentId?: string; + readonly failureReason?: string; + readonly id?: string; + readonly lastActionDateUtc?: Date; + readonly name?: string; + readonly runInformation?: ExperimentExecutionDetailsPropertiesRunInformation; + readonly startDateUtc?: Date; + readonly status?: string; + readonly stopDateUtc?: Date; + readonly type?: string; +} + +// @public +export interface ExperimentExecutionDetailsListResult { + readonly nextLink?: string; + readonly value?: ExperimentExecutionDetails[]; +} + +// @public +export interface ExperimentExecutionDetailsPropertiesRunInformation { + readonly steps?: StepStatus[]; +} + +// @public +export interface ExperimentListResult { + readonly nextLink?: string; + readonly value?: Experiment[]; +} + +// @public +export interface Experiments { + beginCancel(resourceGroupName: string, experimentName: string, options?: ExperimentsCancelOptionalParams): Promise, ExperimentsCancelResponse>>; + beginCancelAndWait(resourceGroupName: string, experimentName: string, options?: ExperimentsCancelOptionalParams): Promise; + beginCreateOrUpdate(resourceGroupName: string, experimentName: string, experiment: Experiment, options?: ExperimentsCreateOrUpdateOptionalParams): Promise, ExperimentsCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, experimentName: string, experiment: Experiment, options?: ExperimentsCreateOrUpdateOptionalParams): Promise; + delete(resourceGroupName: string, experimentName: string, options?: ExperimentsDeleteOptionalParams): Promise; + get(resourceGroupName: string, experimentName: string, options?: ExperimentsGetOptionalParams): Promise; + getExecutionDetails(resourceGroupName: string, experimentName: string, executionDetailsId: string, options?: ExperimentsGetExecutionDetailsOptionalParams): Promise; + getStatus(resourceGroupName: string, experimentName: string, statusId: string, options?: ExperimentsGetStatusOptionalParams): Promise; + list(resourceGroupName: string, options?: ExperimentsListOptionalParams): PagedAsyncIterableIterator; + listAll(options?: ExperimentsListAllOptionalParams): PagedAsyncIterableIterator; + listAllStatuses(resourceGroupName: string, experimentName: string, options?: ExperimentsListAllStatusesOptionalParams): PagedAsyncIterableIterator; + listExecutionDetails(resourceGroupName: string, experimentName: string, options?: ExperimentsListExecutionDetailsOptionalParams): PagedAsyncIterableIterator; + start(resourceGroupName: string, experimentName: string, options?: ExperimentsStartOptionalParams): Promise; +} + +// @public +export interface ExperimentsCancelOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ExperimentsCancelResponse = ExperimentCancelOperationResult; + +// @public +export interface ExperimentsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ExperimentsCreateOrUpdateResponse = Experiment; + +// @public +export interface ExperimentsDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface ExperimentsGetExecutionDetailsOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ExperimentsGetExecutionDetailsResponse = ExperimentExecutionDetails; + +// @public +export interface ExperimentsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ExperimentsGetResponse = Experiment; + +// @public +export interface ExperimentsGetStatusOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ExperimentsGetStatusResponse = ExperimentStatus; + +// @public +export interface ExperimentsListAllNextOptionalParams extends coreClient.OperationOptions { + continuationToken?: string; + running?: boolean; +} + +// @public +export type ExperimentsListAllNextResponse = ExperimentListResult; + +// @public +export interface ExperimentsListAllOptionalParams extends coreClient.OperationOptions { + continuationToken?: string; + running?: boolean; +} + +// @public +export type ExperimentsListAllResponse = ExperimentListResult; + +// @public +export interface ExperimentsListAllStatusesNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ExperimentsListAllStatusesNextResponse = ExperimentStatusListResult; + +// @public +export interface ExperimentsListAllStatusesOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ExperimentsListAllStatusesResponse = ExperimentStatusListResult; + +// @public +export interface ExperimentsListExecutionDetailsNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ExperimentsListExecutionDetailsNextResponse = ExperimentExecutionDetailsListResult; + +// @public +export interface ExperimentsListExecutionDetailsOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ExperimentsListExecutionDetailsResponse = ExperimentExecutionDetailsListResult; + +// @public +export interface ExperimentsListNextOptionalParams extends coreClient.OperationOptions { + continuationToken?: string; + running?: boolean; +} + +// @public +export type ExperimentsListNextResponse = ExperimentListResult; + +// @public +export interface ExperimentsListOptionalParams extends coreClient.OperationOptions { + continuationToken?: string; + running?: boolean; +} + +// @public +export type ExperimentsListResponse = ExperimentListResult; + +// @public +export interface ExperimentsStartOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ExperimentsStartResponse = ExperimentStartOperationResult; + +// @public +export interface ExperimentStartOperationResult { + readonly name?: string; + readonly statusUrl?: string; +} + +// @public +export interface ExperimentStatus { + readonly createdDateUtc?: Date; + readonly endDateUtc?: Date; + readonly id?: string; + readonly name?: string; + readonly status?: string; + readonly type?: string; +} + +// @public +export interface ExperimentStatusListResult { + readonly nextLink?: string; + readonly value?: ExperimentStatus[]; +} + +// @public +export interface KeyValuePair { + key: string; + value: string; +} + +// @public +export enum KnownActionType { + // (undocumented) + Internal = "Internal" +} + +// @public +export enum KnownCreatedByType { + // (undocumented) + Application = "Application", + // (undocumented) + Key = "Key", + // (undocumented) + ManagedIdentity = "ManagedIdentity", + // (undocumented) + User = "User" +} + +// @public +export enum KnownOrigin { + // (undocumented) + System = "system", + // (undocumented) + User = "user", + // (undocumented) + UserSystem = "user,system" +} + +// @public +export interface Operation { + readonly actionType?: ActionType; + display?: OperationDisplay; + readonly isDataAction?: boolean; + readonly name?: string; + readonly origin?: Origin; +} + +// @public +export interface OperationDisplay { + readonly description?: string; + readonly operation?: string; + readonly provider?: string; + readonly resource?: string; +} + +// @public +export interface OperationListResult { + readonly nextLink?: string; + readonly value?: Operation[]; +} + +// @public +export interface Operations { + listAll(options?: OperationsListAllOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface OperationsListAllNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListAllNextResponse = OperationListResult; + +// @public +export interface OperationsListAllOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListAllResponse = OperationListResult; + +// @public +export type Origin = string; + +// @public +export interface Resource { + readonly id?: string; + readonly name?: string; + readonly type?: string; +} + +// @public +export interface ResourceIdentity { + readonly principalId?: string; + readonly tenantId?: string; + type: ResourceIdentityType; +} + +// @public +export type ResourceIdentityType = "None" | "SystemAssigned"; + +// @public +export interface Selector { + id: string; + targets: TargetReference[]; + type: SelectorType; +} + +// @public +export type SelectorType = "Percent" | "Random" | "Tag" | "List"; + +// @public +export interface Step { + branches: Branch[]; + name: string; +} + +// @public +export interface StepStatus { + readonly branches?: BranchStatus[]; + readonly id?: string; + readonly name?: string; + readonly status?: string; +} + +// @public +export interface SystemData { + createdAt?: Date; + createdBy?: string; + createdByType?: CreatedByType; + lastModifiedAt?: Date; + lastModifiedBy?: string; + lastModifiedByType?: CreatedByType; +} + +// @public +export type Target = Resource & { + readonly systemData?: SystemData; + location?: string; + properties: { + [propertyName: string]: Record; + }; +}; + +// @public +export interface TargetListResult { + readonly nextLink?: string; + readonly value?: Target[]; +} + +// @public +export interface TargetReference { + id: string; + type: "ChaosTarget"; +} + +// @public +export interface Targets { + createOrUpdate(resourceGroupName: string, parentProviderNamespace: string, parentResourceType: string, parentResourceName: string, targetName: string, target: Target, options?: TargetsCreateOrUpdateOptionalParams): Promise; + delete(resourceGroupName: string, parentProviderNamespace: string, parentResourceType: string, parentResourceName: string, targetName: string, options?: TargetsDeleteOptionalParams): Promise; + get(resourceGroupName: string, parentProviderNamespace: string, parentResourceType: string, parentResourceName: string, targetName: string, options?: TargetsGetOptionalParams): Promise; + list(resourceGroupName: string, parentProviderNamespace: string, parentResourceType: string, parentResourceName: string, options?: TargetsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface TargetsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TargetsCreateOrUpdateResponse = Target; + +// @public +export interface TargetsDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface TargetsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TargetsGetResponse = Target; + +// @public +export interface TargetsListNextOptionalParams extends coreClient.OperationOptions { + continuationToken?: string; +} + +// @public +export type TargetsListNextResponse = TargetListResult; + +// @public +export interface TargetsListOptionalParams extends coreClient.OperationOptions { + continuationToken?: string; +} + +// @public +export type TargetsListResponse = TargetListResult; + +// @public +export type TargetType = Resource & { + readonly systemData?: SystemData; + location?: string; + readonly displayName?: string; + readonly description?: string; + readonly propertiesSchema?: string; + readonly resourceTypes?: string[]; +}; + +// @public +export interface TargetTypeListResult { + readonly nextLink?: string; + readonly value?: TargetType[]; +} + +// @public +export interface TargetTypes { + get(locationName: string, targetTypeName: string, options?: TargetTypesGetOptionalParams): Promise; + list(locationName: string, options?: TargetTypesListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface TargetTypesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TargetTypesGetResponse = TargetType; + +// @public +export interface TargetTypesListNextOptionalParams extends coreClient.OperationOptions { + continuationToken?: string; +} + +// @public +export type TargetTypesListNextResponse = TargetTypeListResult; + +// @public +export interface TargetTypesListOptionalParams extends coreClient.OperationOptions { + continuationToken?: string; +} + +// @public +export type TargetTypesListResponse = TargetTypeListResult; + +// @public +export type TrackedResource = Resource & { + tags?: { + [propertyName: string]: string; + }; + location: string; +}; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/chaos/arm-chaos/rollup.config.js b/sdk/chaos/arm-chaos/rollup.config.js new file mode 100644 index 000000000000..9be1955eb7f1 --- /dev/null +++ b/sdk/chaos/arm-chaos/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/chaos/arm-chaos/src/chaosManagementClient.ts b/sdk/chaos/arm-chaos/src/chaosManagementClient.ts new file mode 100644 index 000000000000..f9713864fe0b --- /dev/null +++ b/sdk/chaos/arm-chaos/src/chaosManagementClient.ts @@ -0,0 +1,99 @@ +/* + * 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 { + CapabilitiesImpl, + ExperimentsImpl, + OperationsImpl, + TargetsImpl, + TargetTypesImpl, + CapabilityTypesImpl +} from "./operations"; +import { + Capabilities, + Experiments, + Operations, + Targets, + TargetTypes, + CapabilityTypes +} from "./operationsInterfaces"; +import { ChaosManagementClientOptionalParams } from "./models"; + +export class ChaosManagementClient extends coreClient.ServiceClient { + $host: string; + apiVersion: string; + subscriptionId: string; + + /** + * Initializes a new instance of the ChaosManagementClient class. + * @param credentials Subscription credentials which uniquely identify client subscription. + * @param subscriptionId GUID that represents an Azure subscription ID. + * @param options The parameter options + */ + constructor( + credentials: coreAuth.TokenCredential, + subscriptionId: string, + options?: ChaosManagementClientOptionalParams + ) { + 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: ChaosManagementClientOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; + + const packageDetails = `azsdk-js-arm-chaos/1.0.0-beta.1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + if (!options.credentialScopes) { + options.credentialScopes = ["https://management.azure.com/.default"]; + } + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "https://management.azure.com" + }; + super(optionsWithDefaults); + // Parameter assignments + this.subscriptionId = subscriptionId; + + // Assigning values to Constant parameters + this.$host = options.$host || "https://management.azure.com"; + this.apiVersion = options.apiVersion || "2021-09-15-preview"; + this.capabilities = new CapabilitiesImpl(this); + this.experiments = new ExperimentsImpl(this); + this.operations = new OperationsImpl(this); + this.targets = new TargetsImpl(this); + this.targetTypes = new TargetTypesImpl(this); + this.capabilityTypes = new CapabilityTypesImpl(this); + } + + capabilities: Capabilities; + experiments: Experiments; + operations: Operations; + targets: Targets; + targetTypes: TargetTypes; + capabilityTypes: CapabilityTypes; +} diff --git a/sdk/chaos/arm-chaos/src/index.ts b/sdk/chaos/arm-chaos/src/index.ts new file mode 100644 index 000000000000..3b5eeb0f9d3f --- /dev/null +++ b/sdk/chaos/arm-chaos/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 { ChaosManagementClient } from "./chaosManagementClient"; +export * from "./operationsInterfaces"; diff --git a/sdk/chaos/arm-chaos/src/lroImpl.ts b/sdk/chaos/arm-chaos/src/lroImpl.ts new file mode 100644 index 000000000000..518d5f053b4e --- /dev/null +++ b/sdk/chaos/arm-chaos/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/chaos/arm-chaos/src/models/index.ts b/sdk/chaos/arm-chaos/src/models/index.ts new file mode 100644 index 000000000000..efb9b7dcc63e --- /dev/null +++ b/sdk/chaos/arm-chaos/src/models/index.ts @@ -0,0 +1,1087 @@ +/* + * 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 type ActionUnion = + | Action + | DelayAction + | DiscreteAction + | ContinuousAction; + +/** Model that represents a list of Capability resources and a link for pagination. */ +export interface CapabilityListResult { + /** + * List of Capability resources. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: Capability[]; + /** + * URL to retrieve the next page of Capability resources. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** 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; +} + +/** Common fields that are returned in the response for all Azure Resource Manager resources */ +export interface Resource { + /** + * Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * The name of the resource + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; +} + +/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */ +export interface ErrorResponse { + /** The error object. */ + error?: ErrorDetail; +} + +/** The error detail. */ +export interface ErrorDetail { + /** + * The error code. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly code?: string; + /** + * The error message. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly message?: string; + /** + * The error target. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly target?: string; + /** + * The error details. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly details?: ErrorDetail[]; + /** + * The error additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly additionalInfo?: ErrorAdditionalInfo[]; +} + +/** The resource management error additional info. */ +export interface ErrorAdditionalInfo { + /** + * The additional info type. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * The additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly info?: Record; +} + +/** Model that represents a list of Experiment resources and a link for pagination. */ +export interface ExperimentListResult { + /** + * List of Experiment resources. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: Experiment[]; + /** + * URL to retrieve the next page of Experiment resources. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** The managed identity of a resource. */ +export interface ResourceIdentity { + /** String of the resource identity type. */ + type: ResourceIdentityType; + /** + * GUID that represents the principal ID of this resource identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly principalId?: string; + /** + * GUID that represents the tenant ID of this resource identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly tenantId?: string; +} + +/** Model that represents a step in the Experiment resource. */ +export interface Step { + /** String of the step name. */ + name: string; + /** List of branches. */ + branches: Branch[]; +} + +/** Model that represents a branch in the step. */ +export interface Branch { + /** String of the branch name. */ + name: string; + /** List of actions. */ + actions: ActionUnion[]; +} + +/** Model that represents the base action model. */ +export interface Action { + /** Polymorphic discriminator, which specifies the different types this object can be */ + type: "delay" | "discrete" | "continuous"; + /** String that represents a Capability URN. */ + name: string; +} + +/** Model that represents a selector in the Experiment resource. */ +export interface Selector { + /** Enum of the selector type. */ + type: SelectorType; + /** String of the selector ID. */ + id: string; + /** List of Target references. */ + targets: TargetReference[]; +} + +/** Model that represents a reference to a Target in the selector. */ +export interface TargetReference { + /** Enum of the Target reference type. */ + type: "ChaosTarget"; + /** String of the resource ID of a Target resource. */ + id: string; +} + +/** Model that represents the result of a cancel Experiment operation. */ +export interface ExperimentCancelOperationResult { + /** + * String of the Experiment name. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * URL to retrieve the Experiment status. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly statusUrl?: string; +} + +/** Model that represents the result of a start Experiment operation. */ +export interface ExperimentStartOperationResult { + /** + * String of the Experiment name. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * URL to retrieve the Experiment status. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly statusUrl?: string; +} + +/** Model that represents a list of Experiment statuses and a link for pagination. */ +export interface ExperimentStatusListResult { + /** + * List of Experiment statuses. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: ExperimentStatus[]; + /** + * URL to retrieve the next page of Experiment statuses. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Model that represents the status of a Experiment. */ +export interface ExperimentStatus { + /** + * String of the resource type. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * String of the fully qualified resource ID. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * String of the resource name. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * String that represents the status of a Experiment. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly status?: string; + /** + * String that represents the created date time of a Experiment. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly createdDateUtc?: Date; + /** + * String that represents the end date time of a Experiment. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly endDateUtc?: Date; +} + +/** Model that represents a list of Experiment execution details and a link for pagination. */ +export interface ExperimentExecutionDetailsListResult { + /** + * List of Experiment execution details. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: ExperimentExecutionDetails[]; + /** + * URL to retrieve the next page of Experiment execution details. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Model that represents the execution details of a Experiment. */ +export interface ExperimentExecutionDetails { + /** + * String of the resource type. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * String of the fully qualified resource ID. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * String of the resource name. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * The id of the experiment. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly experimentId?: string; + /** + * The value of the status of the experiment execution. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly status?: string; + /** + * The reason why the execution failed. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly failureReason?: string; + /** + * String that represents the created date time. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly createdDateUtc?: Date; + /** + * String that represents the last action date time. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly lastActionDateUtc?: Date; + /** + * String that represents the start date time. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly startDateUtc?: Date; + /** + * String that represents the stop date time. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly stopDateUtc?: Date; + /** + * The information of the experiment run. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly runInformation?: ExperimentExecutionDetailsPropertiesRunInformation; +} + +/** The information of the experiment run. */ +export interface ExperimentExecutionDetailsPropertiesRunInformation { + /** + * The steps of the experiment run. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly steps?: StepStatus[]; +} + +/** Model that represents the a list of branches and branch statuses. */ +export interface StepStatus { + /** + * The name of the step. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * The id of the step. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * The value of the status of the step. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly status?: string; + /** + * The array of branches. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly branches?: BranchStatus[]; +} + +/** Model that represents the a list of actions and action statuses. */ +export interface BranchStatus { + /** + * The name of the branch status. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * The id of the branch status. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * The status of the branch. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly status?: string; + /** + * The array of actions. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly actions?: ActionStatus[]; +} + +/** Model that represents the an action and its status. */ +export interface ActionStatus { + /** + * The name of the action status. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * The id of the action status. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * The status of the action. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly status?: string; + /** + * The array of targets. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly targets?: ExperimentExecutionActionTargetDetailsProperties[]; +} + +/** Model that represents the Experiment action target details properties model. */ +export interface ExperimentExecutionActionTargetDetailsProperties { + /** + * The status of the execution. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly status?: string; + /** + * The target for the action. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly target?: string; + /** + * String that represents the failed date time. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly failedDateUtc?: Date; + /** + * String that represents the completed date time. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly completedDateUtc?: Date; + /** + * The error of the action. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly error?: ExperimentExecutionActionTargetDetailsError; +} + +/** Model that represents the Experiment action target details error model. */ +export interface ExperimentExecutionActionTargetDetailsError { + /** + * The error code. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly code?: string; + /** + * The error message + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly message?: string; +} + +/** A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. */ +export interface OperationListResult { + /** + * List of operations supported by the resource provider + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: Operation[]; + /** + * URL to get the next set of operation list results (if there are any). + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Details of a REST API operation, returned from the Resource Provider Operations API */ +export interface Operation { + /** + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane operations. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly isDataAction?: boolean; + /** Localized display information for this particular operation. */ + display?: OperationDisplay; + /** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly origin?: Origin; + /** + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly actionType?: ActionType; +} + +/** Localized display information for this particular operation. */ +export interface OperationDisplay { + /** + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provider?: string; + /** + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resource?: string; + /** + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly operation?: string; + /** + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly description?: string; +} + +/** Model that represents a list of Target resources and a link for pagination. */ +export interface TargetListResult { + /** + * List of Target resources. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: Target[]; + /** + * URL to retrieve the next page of Target resources. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Model that represents a list of Target Type resources and a link for pagination. */ +export interface TargetTypeListResult { + /** + * List of Target Type resources. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: TargetType[]; + /** + * URL to retrieve the next page of Target Type resources. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Model that represents a list of Capability Type resources and a link for pagination. */ +export interface CapabilityTypeListResult { + /** + * List of Capability Type resources. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: CapabilityType[]; + /** + * URL to retrieve the next page of Capability Type resources. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** A map to describe the settings of an action. */ +export interface KeyValuePair { + /** The name of the setting for the action. */ + key: string; + /** The value of the setting for the action. */ + value: string; +} + +/** Model that represents a Capability resource. */ +export type Capability = Resource & { + /** + * The standard system metadata of a resource type. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** + * String of the Publisher that this Capability extends. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly publisher?: string; + /** + * String of the Target Type that this Capability extends. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly targetType?: string; + /** + * Localized string of the description. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly description?: string; + /** + * URL to retrieve JSON schema of the Capability parameters. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly parametersSchema?: string; + /** + * String of the URN for this Capability Type. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly urn?: string; +}; + +/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ +export type TrackedResource = Resource & { + /** Resource tags. */ + tags?: { [propertyName: string]: string }; + /** The geo-location where the resource lives */ + location: string; +}; + +/** Model that represents a Target resource. */ +export type Target = Resource & { + /** + * The system metadata of the target resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** Location of the target resource. */ + location?: string; + /** The properties of the target resource. */ + properties: { [propertyName: string]: Record }; +}; + +/** Model that represents a Target Type resource. */ +export type TargetType = Resource & { + /** + * The system metadata properties of the target type resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** Location of the Target Type resource. */ + location?: string; + /** + * Localized string of the display name. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly displayName?: string; + /** + * Localized string of the description. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly description?: string; + /** + * URL to retrieve JSON schema of the Target Type properties. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly propertiesSchema?: string; + /** + * List of resource types this Target Type can extend. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resourceTypes?: string[]; +}; + +/** Model that represents a Capability Type resource. */ +export type CapabilityType = Resource & { + /** + * The system metadata properties of the capability type resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** Location of the Capability Type resource. */ + location?: string; + /** + * String of the Publisher that this Capability Type extends. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly publisher?: string; + /** + * String of the Target Type that this Capability Type extends. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly targetType?: string; + /** + * Localized string of the display name. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly displayName?: string; + /** + * Localized string of the description. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly description?: string; + /** + * URL to retrieve JSON schema of the Capability Type parameters. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly parametersSchema?: string; + /** + * String of the URN for this Capability Type. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly urn?: string; +}; + +/** Model that represents a delay action. */ +export type DelayAction = Action & { + /** Polymorphic discriminator, which specifies the different types this object can be */ + type: "delay"; + /** ISO8601 formatted string that represents a duration. */ + duration: string; +}; + +/** Model that represents a discrete action. */ +export type DiscreteAction = Action & { + /** Polymorphic discriminator, which specifies the different types this object can be */ + type: "discrete"; + /** List of key value pairs. */ + parameters: KeyValuePair[]; + /** String that represents a selector. */ + selectorId: string; +}; + +/** Model that represents a continuous action. */ +export type ContinuousAction = Action & { + /** Polymorphic discriminator, which specifies the different types this object can be */ + type: "continuous"; + /** ISO8601 formatted string that represents a duration. */ + duration: string; + /** List of key value pairs. */ + parameters: KeyValuePair[]; + /** String that represents a selector. */ + selectorId: string; +}; + +/** Model that represents a Experiment resource. */ +export type Experiment = TrackedResource & { + /** + * The system metadata of the experiment resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** The identity of the experiment resource. */ + identity?: ResourceIdentity; + /** List of steps. */ + steps: Step[]; + /** List of selectors. */ + selectors: Selector[]; + /** A boolean value that indicates if experiment should be started on creation or not. */ + startOnCreation?: boolean; +}; + +/** 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 Origin} that the service accepts. */ +export enum KnownOrigin { + User = "user", + System = "system", + UserSystem = "user,system" +} + +/** + * Defines values for Origin. \ + * {@link KnownOrigin} can be used interchangeably with Origin, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **user** \ + * **system** \ + * **user,system** + */ +export type Origin = string; + +/** Known values of {@link ActionType} that the service accepts. */ +export enum KnownActionType { + Internal = "Internal" +} + +/** + * Defines values for ActionType. \ + * {@link KnownActionType} can be used interchangeably with ActionType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Internal** + */ +export type ActionType = string; +/** Defines values for ResourceIdentityType. */ +export type ResourceIdentityType = "None" | "SystemAssigned"; +/** Defines values for SelectorType. */ +export type SelectorType = "Percent" | "Random" | "Tag" | "List"; + +/** Optional parameters. */ +export interface CapabilitiesListOptionalParams + extends coreClient.OperationOptions { + /** String that sets the continuation token. */ + continuationToken?: string; +} + +/** Contains response data for the list operation. */ +export type CapabilitiesListResponse = CapabilityListResult; + +/** Optional parameters. */ +export interface CapabilitiesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type CapabilitiesGetResponse = Capability; + +/** Optional parameters. */ +export interface CapabilitiesDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface CapabilitiesCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createOrUpdate operation. */ +export type CapabilitiesCreateOrUpdateResponse = Capability; + +/** Optional parameters. */ +export interface CapabilitiesListNextOptionalParams + extends coreClient.OperationOptions { + /** String that sets the continuation token. */ + continuationToken?: string; +} + +/** Contains response data for the listNext operation. */ +export type CapabilitiesListNextResponse = CapabilityListResult; + +/** Optional parameters. */ +export interface ExperimentsListAllOptionalParams + extends coreClient.OperationOptions { + /** String that sets the continuation token. */ + continuationToken?: string; + /** Optional value that indicates whether to filter results based on if the Experiment is currently running. If null, then the results will not be filtered. */ + running?: boolean; +} + +/** Contains response data for the listAll operation. */ +export type ExperimentsListAllResponse = ExperimentListResult; + +/** Optional parameters. */ +export interface ExperimentsListOptionalParams + extends coreClient.OperationOptions { + /** String that sets the continuation token. */ + continuationToken?: string; + /** Optional value that indicates whether to filter results based on if the Experiment is currently running. If null, then the results will not be filtered. */ + running?: boolean; +} + +/** Contains response data for the list operation. */ +export type ExperimentsListResponse = ExperimentListResult; + +/** Optional parameters. */ +export interface ExperimentsDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface ExperimentsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type ExperimentsGetResponse = Experiment; + +/** Optional parameters. */ +export interface ExperimentsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createOrUpdate operation. */ +export type ExperimentsCreateOrUpdateResponse = Experiment; + +/** Optional parameters. */ +export interface ExperimentsCancelOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the cancel operation. */ +export type ExperimentsCancelResponse = ExperimentCancelOperationResult; + +/** Optional parameters. */ +export interface ExperimentsStartOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the start operation. */ +export type ExperimentsStartResponse = ExperimentStartOperationResult; + +/** Optional parameters. */ +export interface ExperimentsListAllStatusesOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listAllStatuses operation. */ +export type ExperimentsListAllStatusesResponse = ExperimentStatusListResult; + +/** Optional parameters. */ +export interface ExperimentsGetStatusOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getStatus operation. */ +export type ExperimentsGetStatusResponse = ExperimentStatus; + +/** Optional parameters. */ +export interface ExperimentsListExecutionDetailsOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listExecutionDetails operation. */ +export type ExperimentsListExecutionDetailsResponse = ExperimentExecutionDetailsListResult; + +/** Optional parameters. */ +export interface ExperimentsGetExecutionDetailsOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getExecutionDetails operation. */ +export type ExperimentsGetExecutionDetailsResponse = ExperimentExecutionDetails; + +/** Optional parameters. */ +export interface ExperimentsListAllNextOptionalParams + extends coreClient.OperationOptions { + /** String that sets the continuation token. */ + continuationToken?: string; + /** Optional value that indicates whether to filter results based on if the Experiment is currently running. If null, then the results will not be filtered. */ + running?: boolean; +} + +/** Contains response data for the listAllNext operation. */ +export type ExperimentsListAllNextResponse = ExperimentListResult; + +/** Optional parameters. */ +export interface ExperimentsListNextOptionalParams + extends coreClient.OperationOptions { + /** String that sets the continuation token. */ + continuationToken?: string; + /** Optional value that indicates whether to filter results based on if the Experiment is currently running. If null, then the results will not be filtered. */ + running?: boolean; +} + +/** Contains response data for the listNext operation. */ +export type ExperimentsListNextResponse = ExperimentListResult; + +/** Optional parameters. */ +export interface ExperimentsListAllStatusesNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listAllStatusesNext operation. */ +export type ExperimentsListAllStatusesNextResponse = ExperimentStatusListResult; + +/** Optional parameters. */ +export interface ExperimentsListExecutionDetailsNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listExecutionDetailsNext operation. */ +export type ExperimentsListExecutionDetailsNextResponse = ExperimentExecutionDetailsListResult; + +/** Optional parameters. */ +export interface OperationsListAllOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listAll operation. */ +export type OperationsListAllResponse = OperationListResult; + +/** Optional parameters. */ +export interface OperationsListAllNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listAllNext operation. */ +export type OperationsListAllNextResponse = OperationListResult; + +/** Optional parameters. */ +export interface TargetsListOptionalParams extends coreClient.OperationOptions { + /** String that sets the continuation token. */ + continuationToken?: string; +} + +/** Contains response data for the list operation. */ +export type TargetsListResponse = TargetListResult; + +/** Optional parameters. */ +export interface TargetsGetOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type TargetsGetResponse = Target; + +/** Optional parameters. */ +export interface TargetsDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface TargetsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createOrUpdate operation. */ +export type TargetsCreateOrUpdateResponse = Target; + +/** Optional parameters. */ +export interface TargetsListNextOptionalParams + extends coreClient.OperationOptions { + /** String that sets the continuation token. */ + continuationToken?: string; +} + +/** Contains response data for the listNext operation. */ +export type TargetsListNextResponse = TargetListResult; + +/** Optional parameters. */ +export interface TargetTypesListOptionalParams + extends coreClient.OperationOptions { + /** String that sets the continuation token. */ + continuationToken?: string; +} + +/** Contains response data for the list operation. */ +export type TargetTypesListResponse = TargetTypeListResult; + +/** Optional parameters. */ +export interface TargetTypesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type TargetTypesGetResponse = TargetType; + +/** Optional parameters. */ +export interface TargetTypesListNextOptionalParams + extends coreClient.OperationOptions { + /** String that sets the continuation token. */ + continuationToken?: string; +} + +/** Contains response data for the listNext operation. */ +export type TargetTypesListNextResponse = TargetTypeListResult; + +/** Optional parameters. */ +export interface CapabilityTypesListOptionalParams + extends coreClient.OperationOptions { + /** String that sets the continuation token. */ + continuationToken?: string; +} + +/** Contains response data for the list operation. */ +export type CapabilityTypesListResponse = CapabilityTypeListResult; + +/** Optional parameters. */ +export interface CapabilityTypesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type CapabilityTypesGetResponse = CapabilityType; + +/** Optional parameters. */ +export interface CapabilityTypesListNextOptionalParams + extends coreClient.OperationOptions { + /** String that sets the continuation token. */ + continuationToken?: string; +} + +/** Contains response data for the listNext operation. */ +export type CapabilityTypesListNextResponse = CapabilityTypeListResult; + +/** Optional parameters. */ +export interface ChaosManagementClientOptionalParams + extends coreClient.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Api Version */ + apiVersion?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/chaos/arm-chaos/src/models/mappers.ts b/sdk/chaos/arm-chaos/src/models/mappers.ts new file mode 100644 index 000000000000..f2b6b7612af6 --- /dev/null +++ b/sdk/chaos/arm-chaos/src/models/mappers.ts @@ -0,0 +1,1598 @@ +/* + * 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 CapabilityListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CapabilityListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Capability" + } + } + } + }, + nextLink: { + constraints: { + MaxLength: 2048 + }, + serializedName: "nextLink", + readOnly: true, + nullable: true, + 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 Resource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Resource", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ErrorResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorResponse", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorDetail" + } + } + } + } +}; + +export const ErrorDetail: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorDetail", + modelProperties: { + code: { + serializedName: "code", + readOnly: true, + type: { + name: "String" + } + }, + message: { + serializedName: "message", + readOnly: true, + type: { + name: "String" + } + }, + target: { + serializedName: "target", + readOnly: true, + type: { + name: "String" + } + }, + details: { + serializedName: "details", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorDetail" + } + } + } + }, + additionalInfo: { + serializedName: "additionalInfo", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorAdditionalInfo" + } + } + } + } + } + } +}; + +export const ErrorAdditionalInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorAdditionalInfo", + modelProperties: { + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + info: { + serializedName: "info", + readOnly: true, + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } + } + } + } +}; + +export const ExperimentListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ExperimentListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Experiment" + } + } + } + }, + nextLink: { + constraints: { + MaxLength: 2048 + }, + serializedName: "nextLink", + readOnly: true, + nullable: true, + type: { + name: "String" + } + } + } + } +}; + +export const ResourceIdentity: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ResourceIdentity", + modelProperties: { + type: { + serializedName: "type", + required: true, + type: { + name: "Enum", + allowedValues: ["None", "SystemAssigned"] + } + }, + principalId: { + constraints: { + Pattern: new RegExp( + "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" + ) + }, + serializedName: "principalId", + readOnly: true, + type: { + name: "String" + } + }, + tenantId: { + constraints: { + Pattern: new RegExp( + "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" + ) + }, + serializedName: "tenantId", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const Step: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Step", + modelProperties: { + name: { + constraints: { + MinLength: 1 + }, + serializedName: "name", + required: true, + type: { + name: "String" + } + }, + branches: { + constraints: { + MinItems: 1 + }, + serializedName: "branches", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Branch" + } + } + } + } + } + } +}; + +export const Branch: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Branch", + modelProperties: { + name: { + constraints: { + MinLength: 1 + }, + serializedName: "name", + required: true, + type: { + name: "String" + } + }, + actions: { + constraints: { + MinItems: 1 + }, + serializedName: "actions", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Action" + } + } + } + } + } + } +}; + +export const Action: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Action", + uberParent: "Action", + polymorphicDiscriminator: { + serializedName: "type", + clientName: "type" + }, + modelProperties: { + type: { + serializedName: "type", + required: true, + type: { + name: "String" + } + }, + name: { + constraints: { + MaxLength: 2048 + }, + serializedName: "name", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const Selector: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Selector", + modelProperties: { + type: { + serializedName: "type", + required: true, + type: { + name: "Enum", + allowedValues: ["Percent", "Random", "Tag", "List"] + } + }, + id: { + constraints: { + MinLength: 1 + }, + serializedName: "id", + required: true, + type: { + name: "String" + } + }, + targets: { + constraints: { + MinItems: 1 + }, + serializedName: "targets", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "TargetReference" + } + } + } + } + } + } +}; + +export const TargetReference: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TargetReference", + modelProperties: { + type: { + defaultValue: "ChaosTarget", + isConstant: true, + serializedName: "type", + type: { + name: "String" + } + }, + id: { + constraints: { + Pattern: new RegExp( + "^\\/[Ss][Uu][Bb][Ss][Cc][Rr][Ii][Pp][Tt][Ii][Oo][Nn][Ss]\\/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}\\/[Rr][Ee][Ss][Oo][Uu][Rr][Cc][Ee][Gg][Rr][Oo][Uu][Pp][Ss]\\/[a-zA-Z0-9_\\-\\.\\(\\)]*[a-zA-Z0-9_\\-\\(\\)]\\/[Pp][Rr][Oo][Vv][Ii][Dd][Ee][Rr][Ss]\\/[a-zA-Z0-9]+\\.[a-zA-Z0-9]+\\/[a-zA-Z0-9_\\-\\.]+\\/[a-zA-Z0-9_\\-\\.]+\\/[Pp][Rr][Oo][Vv][Ii][Dd][Ee][Rr][Ss]\\/[Mm][Ii][Cc][Rr][Oo][Ss][Oo][Ff][Tt]\\.[Cc][Hh][Aa][Oo][Ss]\\/[Tt][Aa][Rr][Gg][Ee][Tt][Ss]\\/[a-zA-Z0-9_\\-\\.]+$" + ) + }, + serializedName: "id", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const ExperimentCancelOperationResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ExperimentCancelOperationResult", + modelProperties: { + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + statusUrl: { + constraints: { + MaxLength: 2048 + }, + serializedName: "statusUrl", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ExperimentStartOperationResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ExperimentStartOperationResult", + modelProperties: { + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + statusUrl: { + constraints: { + MaxLength: 2048 + }, + serializedName: "statusUrl", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ExperimentStatusListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ExperimentStatusListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ExperimentStatus" + } + } + } + }, + nextLink: { + constraints: { + MaxLength: 2048 + }, + serializedName: "nextLink", + readOnly: true, + nullable: true, + type: { + name: "String" + } + } + } + } +}; + +export const ExperimentStatus: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ExperimentStatus", + modelProperties: { + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + status: { + serializedName: "properties.status", + readOnly: true, + type: { + name: "String" + } + }, + createdDateUtc: { + serializedName: "properties.createdDateUtc", + readOnly: true, + type: { + name: "DateTime" + } + }, + endDateUtc: { + serializedName: "properties.endDateUtc", + readOnly: true, + nullable: true, + type: { + name: "DateTime" + } + } + } + } +}; + +export const ExperimentExecutionDetailsListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ExperimentExecutionDetailsListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ExperimentExecutionDetails" + } + } + } + }, + nextLink: { + constraints: { + MaxLength: 2048 + }, + serializedName: "nextLink", + readOnly: true, + nullable: true, + type: { + name: "String" + } + } + } + } +}; + +export const ExperimentExecutionDetails: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ExperimentExecutionDetails", + modelProperties: { + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + experimentId: { + serializedName: "properties.experimentId", + readOnly: true, + type: { + name: "String" + } + }, + status: { + serializedName: "properties.status", + readOnly: true, + type: { + name: "String" + } + }, + failureReason: { + serializedName: "properties.failureReason", + readOnly: true, + type: { + name: "String" + } + }, + createdDateUtc: { + serializedName: "properties.createdDateUtc", + readOnly: true, + type: { + name: "DateTime" + } + }, + lastActionDateUtc: { + serializedName: "properties.lastActionDateUtc", + readOnly: true, + type: { + name: "DateTime" + } + }, + startDateUtc: { + serializedName: "properties.startDateUtc", + readOnly: true, + type: { + name: "DateTime" + } + }, + stopDateUtc: { + serializedName: "properties.stopDateUtc", + readOnly: true, + type: { + name: "DateTime" + } + }, + runInformation: { + serializedName: "properties.runInformation", + type: { + name: "Composite", + className: "ExperimentExecutionDetailsPropertiesRunInformation" + } + } + } + } +}; + +export const ExperimentExecutionDetailsPropertiesRunInformation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ExperimentExecutionDetailsPropertiesRunInformation", + modelProperties: { + steps: { + serializedName: "steps", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "StepStatus" + } + } + } + } + } + } +}; + +export const StepStatus: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "StepStatus", + modelProperties: { + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + status: { + serializedName: "status", + readOnly: true, + type: { + name: "String" + } + }, + branches: { + serializedName: "branches", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "BranchStatus" + } + } + } + } + } + } +}; + +export const BranchStatus: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BranchStatus", + modelProperties: { + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + status: { + serializedName: "status", + readOnly: true, + type: { + name: "String" + } + }, + actions: { + serializedName: "actions", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ActionStatus" + } + } + } + } + } + } +}; + +export const ActionStatus: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ActionStatus", + modelProperties: { + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + status: { + serializedName: "status", + readOnly: true, + type: { + name: "String" + } + }, + targets: { + serializedName: "targets", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ExperimentExecutionActionTargetDetailsProperties" + } + } + } + } + } + } +}; + +export const ExperimentExecutionActionTargetDetailsProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ExperimentExecutionActionTargetDetailsProperties", + modelProperties: { + status: { + serializedName: "status", + readOnly: true, + type: { + name: "String" + } + }, + target: { + serializedName: "target", + readOnly: true, + type: { + name: "String" + } + }, + failedDateUtc: { + serializedName: "failedDateUtc", + readOnly: true, + nullable: true, + type: { + name: "DateTime" + } + }, + completedDateUtc: { + serializedName: "completedDateUtc", + readOnly: true, + nullable: true, + type: { + name: "DateTime" + } + }, + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ExperimentExecutionActionTargetDetailsError" + } + } + } + } +}; + +export const ExperimentExecutionActionTargetDetailsError: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ExperimentExecutionActionTargetDetailsError", + modelProperties: { + code: { + serializedName: "code", + readOnly: true, + type: { + name: "String" + } + }, + message: { + serializedName: "message", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const OperationListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const Operation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Operation", + modelProperties: { + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + isDataAction: { + serializedName: "isDataAction", + readOnly: true, + type: { + name: "Boolean" + } + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplay" + } + }, + origin: { + serializedName: "origin", + readOnly: true, + type: { + name: "String" + } + }, + actionType: { + serializedName: "actionType", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const OperationDisplay: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationDisplay", + modelProperties: { + provider: { + serializedName: "provider", + readOnly: true, + type: { + name: "String" + } + }, + resource: { + serializedName: "resource", + readOnly: true, + type: { + name: "String" + } + }, + operation: { + serializedName: "operation", + readOnly: true, + type: { + name: "String" + } + }, + description: { + serializedName: "description", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const TargetListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TargetListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Target" + } + } + } + }, + nextLink: { + constraints: { + MaxLength: 2048 + }, + serializedName: "nextLink", + readOnly: true, + nullable: true, + type: { + name: "String" + } + } + } + } +}; + +export const TargetTypeListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TargetTypeListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "TargetType" + } + } + } + }, + nextLink: { + constraints: { + MaxLength: 2048 + }, + serializedName: "nextLink", + readOnly: true, + nullable: true, + type: { + name: "String" + } + } + } + } +}; + +export const CapabilityTypeListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CapabilityTypeListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "CapabilityType" + } + } + } + }, + nextLink: { + constraints: { + MaxLength: 2048 + }, + serializedName: "nextLink", + readOnly: true, + nullable: true, + type: { + name: "String" + } + } + } + } +}; + +export const KeyValuePair: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "KeyValuePair", + modelProperties: { + key: { + constraints: { + MinLength: 1 + }, + serializedName: "key", + required: true, + type: { + name: "String" + } + }, + value: { + constraints: { + MinLength: 1 + }, + serializedName: "value", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const Capability: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Capability", + modelProperties: { + ...Resource.type.modelProperties, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + publisher: { + serializedName: "properties.publisher", + readOnly: true, + type: { + name: "String" + } + }, + targetType: { + serializedName: "properties.targetType", + readOnly: true, + type: { + name: "String" + } + }, + description: { + serializedName: "properties.description", + readOnly: true, + type: { + name: "String" + } + }, + parametersSchema: { + constraints: { + MaxLength: 2048 + }, + serializedName: "properties.parametersSchema", + readOnly: true, + type: { + name: "String" + } + }, + urn: { + constraints: { + MaxLength: 2048 + }, + serializedName: "properties.urn", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const TrackedResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TrackedResource", + modelProperties: { + ...Resource.type.modelProperties, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + location: { + serializedName: "location", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const Target: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Target", + modelProperties: { + ...Resource.type.modelProperties, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + location: { + serializedName: "location", + type: { + name: "String" + } + }, + properties: { + serializedName: "properties", + required: true, + type: { + name: "Dictionary", + value: { + type: { name: "Dictionary", value: { type: { name: "any" } } } + } + } + } + } + } +}; + +export const TargetType: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TargetType", + modelProperties: { + ...Resource.type.modelProperties, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + location: { + serializedName: "location", + type: { + name: "String" + } + }, + displayName: { + serializedName: "properties.displayName", + readOnly: true, + type: { + name: "String" + } + }, + description: { + serializedName: "properties.description", + readOnly: true, + type: { + name: "String" + } + }, + propertiesSchema: { + constraints: { + MaxLength: 2048 + }, + serializedName: "properties.propertiesSchema", + readOnly: true, + type: { + name: "String" + } + }, + resourceTypes: { + serializedName: "properties.resourceTypes", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const CapabilityType: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CapabilityType", + modelProperties: { + ...Resource.type.modelProperties, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + location: { + serializedName: "location", + type: { + name: "String" + } + }, + publisher: { + serializedName: "properties.publisher", + readOnly: true, + type: { + name: "String" + } + }, + targetType: { + serializedName: "properties.targetType", + readOnly: true, + type: { + name: "String" + } + }, + displayName: { + serializedName: "properties.displayName", + readOnly: true, + type: { + name: "String" + } + }, + description: { + serializedName: "properties.description", + readOnly: true, + type: { + name: "String" + } + }, + parametersSchema: { + constraints: { + MaxLength: 2048 + }, + serializedName: "properties.parametersSchema", + readOnly: true, + type: { + name: "String" + } + }, + urn: { + constraints: { + MaxLength: 2048 + }, + serializedName: "properties.urn", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const DelayAction: coreClient.CompositeMapper = { + serializedName: "delay", + type: { + name: "Composite", + className: "DelayAction", + uberParent: "Action", + polymorphicDiscriminator: Action.type.polymorphicDiscriminator, + modelProperties: { + ...Action.type.modelProperties, + duration: { + constraints: { + Pattern: new RegExp( + "^P(\\d+Y)?(\\d+M)?(\\d+D)?(T(\\d+H)?(\\d+M)?(\\d+(\\.\\d+)?S)?)?$" + ) + }, + serializedName: "duration", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const DiscreteAction: coreClient.CompositeMapper = { + serializedName: "discrete", + type: { + name: "Composite", + className: "DiscreteAction", + uberParent: "Action", + polymorphicDiscriminator: Action.type.polymorphicDiscriminator, + modelProperties: { + ...Action.type.modelProperties, + parameters: { + serializedName: "parameters", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "KeyValuePair" + } + } + } + }, + selectorId: { + constraints: { + MinLength: 1 + }, + serializedName: "selectorId", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const ContinuousAction: coreClient.CompositeMapper = { + serializedName: "continuous", + type: { + name: "Composite", + className: "ContinuousAction", + uberParent: "Action", + polymorphicDiscriminator: Action.type.polymorphicDiscriminator, + modelProperties: { + ...Action.type.modelProperties, + duration: { + constraints: { + Pattern: new RegExp( + "^P(\\d+Y)?(\\d+M)?(\\d+D)?(T(\\d+H)?(\\d+M)?(\\d+(\\.\\d+)?S)?)?$" + ) + }, + serializedName: "duration", + required: true, + type: { + name: "String" + } + }, + parameters: { + serializedName: "parameters", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "KeyValuePair" + } + } + } + }, + selectorId: { + constraints: { + MinLength: 1 + }, + serializedName: "selectorId", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const Experiment: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Experiment", + modelProperties: { + ...TrackedResource.type.modelProperties, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "ResourceIdentity" + } + }, + steps: { + constraints: { + MinItems: 1 + }, + serializedName: "properties.steps", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Step" + } + } + } + }, + selectors: { + constraints: { + MinItems: 1 + }, + serializedName: "properties.selectors", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Selector" + } + } + } + }, + startOnCreation: { + serializedName: "properties.startOnCreation", + nullable: true, + type: { + name: "Boolean" + } + } + } + } +}; + +export let discriminators = { + Action: Action, + "Action.delay": DelayAction, + "Action.discrete": DiscreteAction, + "Action.continuous": ContinuousAction +}; diff --git a/sdk/chaos/arm-chaos/src/models/parameters.ts b/sdk/chaos/arm-chaos/src/models/parameters.ts new file mode 100644 index 000000000000..0ba7850d577b --- /dev/null +++ b/sdk/chaos/arm-chaos/src/models/parameters.ts @@ -0,0 +1,302 @@ +/* + * 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 { + Capability as CapabilityMapper, + Experiment as ExperimentMapper, + Target as TargetMapper +} from "../models/mappers"; + +export const accept: OperationParameter = { + parameterPath: "accept", + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Accept", + type: { + name: "String" + } + } +}; + +export const $host: OperationURLParameter = { + parameterPath: "$host", + mapper: { + serializedName: "$host", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const apiVersion: OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + defaultValue: "2021-09-15-preview", + isConstant: true, + serializedName: "api-version", + type: { + name: "String" + } + } +}; + +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + constraints: { + Pattern: new RegExp( + "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" + ) + }, + serializedName: "subscriptionId", + required: true, + type: { + name: "String" + } + } +}; + +export const resourceGroupName: OperationURLParameter = { + parameterPath: "resourceGroupName", + mapper: { + constraints: { + Pattern: new RegExp("^[a-zA-Z0-9_\\-\\.\\(\\)]*[a-zA-Z0-9_\\-\\(\\)]$") + }, + serializedName: "resourceGroupName", + required: true, + type: { + name: "String" + } + } +}; + +export const parentProviderNamespace: OperationURLParameter = { + parameterPath: "parentProviderNamespace", + mapper: { + constraints: { + Pattern: new RegExp("^[a-zA-Z0-9]+\\.[a-zA-Z0-9]+$") + }, + serializedName: "parentProviderNamespace", + required: true, + type: { + name: "String" + } + } +}; + +export const parentResourceType: OperationURLParameter = { + parameterPath: "parentResourceType", + mapper: { + constraints: { + Pattern: new RegExp("^[a-zA-Z0-9_\\-\\.]+$") + }, + serializedName: "parentResourceType", + required: true, + type: { + name: "String" + } + } +}; + +export const parentResourceName: OperationURLParameter = { + parameterPath: "parentResourceName", + mapper: { + constraints: { + Pattern: new RegExp("^[a-zA-Z0-9_\\-\\.]+$") + }, + serializedName: "parentResourceName", + required: true, + type: { + name: "String" + } + } +}; + +export const targetName: OperationURLParameter = { + parameterPath: "targetName", + mapper: { + constraints: { + Pattern: new RegExp("^[a-zA-Z0-9_\\-\\.]+$") + }, + serializedName: "targetName", + required: true, + type: { + name: "String" + } + } +}; + +export const continuationToken: OperationQueryParameter = { + parameterPath: ["options", "continuationToken"], + mapper: { + serializedName: "continuationToken", + type: { + name: "String" + } + } +}; + +export const capabilityName: OperationURLParameter = { + parameterPath: "capabilityName", + mapper: { + constraints: { + Pattern: new RegExp("^[a-zA-Z0-9\\-\\.]+-\\d\\.\\d$") + }, + serializedName: "capabilityName", + 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 capability: OperationParameter = { + parameterPath: "capability", + mapper: CapabilityMapper +}; + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", + mapper: { + serializedName: "nextLink", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const running: OperationQueryParameter = { + parameterPath: ["options", "running"], + mapper: { + serializedName: "running", + type: { + name: "Boolean" + } + } +}; + +export const experimentName: OperationURLParameter = { + parameterPath: "experimentName", + mapper: { + constraints: { + Pattern: new RegExp("^[a-zA-Z0-9_\\-\\.]+$"), + MinLength: 1 + }, + serializedName: "experimentName", + required: true, + type: { + name: "String" + } + } +}; + +export const experiment: OperationParameter = { + parameterPath: "experiment", + mapper: ExperimentMapper +}; + +export const statusId: OperationURLParameter = { + parameterPath: "statusId", + mapper: { + constraints: { + Pattern: new RegExp( + "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" + ) + }, + serializedName: "statusId", + required: true, + type: { + name: "String" + } + } +}; + +export const executionDetailsId: OperationURLParameter = { + parameterPath: "executionDetailsId", + mapper: { + constraints: { + Pattern: new RegExp( + "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" + ) + }, + serializedName: "executionDetailsId", + required: true, + type: { + name: "String" + } + } +}; + +export const target: OperationParameter = { + parameterPath: "target", + mapper: TargetMapper +}; + +export const locationName: OperationURLParameter = { + parameterPath: "locationName", + mapper: { + constraints: { + Pattern: new RegExp("^[a-zA-Z0-9_\\-\\.]+$") + }, + serializedName: "locationName", + required: true, + type: { + name: "String" + } + } +}; + +export const targetTypeName: OperationURLParameter = { + parameterPath: "targetTypeName", + mapper: { + constraints: { + Pattern: new RegExp("^[a-zA-Z0-9_\\-\\.]+$") + }, + serializedName: "targetTypeName", + required: true, + type: { + name: "String" + } + } +}; + +export const capabilityTypeName: OperationURLParameter = { + parameterPath: "capabilityTypeName", + mapper: { + constraints: { + Pattern: new RegExp("^[a-zA-Z0-9\\-\\.]+-\\d\\.\\d$") + }, + serializedName: "capabilityTypeName", + required: true, + type: { + name: "String" + } + } +}; diff --git a/sdk/chaos/arm-chaos/src/operations/capabilities.ts b/sdk/chaos/arm-chaos/src/operations/capabilities.ts new file mode 100644 index 000000000000..7a01ed4be9c2 --- /dev/null +++ b/sdk/chaos/arm-chaos/src/operations/capabilities.ts @@ -0,0 +1,435 @@ +/* + * 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 { Capabilities } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { ChaosManagementClient } from "../chaosManagementClient"; +import { + Capability, + CapabilitiesListNextOptionalParams, + CapabilitiesListOptionalParams, + CapabilitiesListResponse, + CapabilitiesGetOptionalParams, + CapabilitiesGetResponse, + CapabilitiesDeleteOptionalParams, + CapabilitiesCreateOrUpdateOptionalParams, + CapabilitiesCreateOrUpdateResponse, + CapabilitiesListNextResponse +} from "../models"; + +/// +/** Class containing Capabilities operations. */ +export class CapabilitiesImpl implements Capabilities { + private readonly client: ChaosManagementClient; + + /** + * Initialize a new instance of the class Capabilities class. + * @param client Reference to the service client + */ + constructor(client: ChaosManagementClient) { + this.client = client; + } + + /** + * Get a list of Capability resources that extend a Target resource.. + * @param resourceGroupName String that represents an Azure resource group. + * @param parentProviderNamespace String that represents a resource provider namespace. + * @param parentResourceType String that represents a resource type. + * @param parentResourceName String that represents a resource name. + * @param targetName String that represents a Target resource name. + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + parentProviderNamespace: string, + parentResourceType: string, + parentResourceName: string, + targetName: string, + options?: CapabilitiesListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll( + resourceGroupName, + parentProviderNamespace, + parentResourceType, + parentResourceName, + targetName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage( + resourceGroupName, + parentProviderNamespace, + parentResourceType, + parentResourceName, + targetName, + options + ); + } + }; + } + + private async *listPagingPage( + resourceGroupName: string, + parentProviderNamespace: string, + parentResourceType: string, + parentResourceName: string, + targetName: string, + options?: CapabilitiesListOptionalParams + ): AsyncIterableIterator { + let result = await this._list( + resourceGroupName, + parentProviderNamespace, + parentResourceType, + parentResourceName, + targetName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + parentProviderNamespace, + parentResourceType, + parentResourceName, + targetName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + resourceGroupName: string, + parentProviderNamespace: string, + parentResourceType: string, + parentResourceName: string, + targetName: string, + options?: CapabilitiesListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + parentProviderNamespace, + parentResourceType, + parentResourceName, + targetName, + options + )) { + yield* page; + } + } + + /** + * Get a list of Capability resources that extend a Target resource.. + * @param resourceGroupName String that represents an Azure resource group. + * @param parentProviderNamespace String that represents a resource provider namespace. + * @param parentResourceType String that represents a resource type. + * @param parentResourceName String that represents a resource name. + * @param targetName String that represents a Target resource name. + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + parentProviderNamespace: string, + parentResourceType: string, + parentResourceName: string, + targetName: string, + options?: CapabilitiesListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + parentProviderNamespace, + parentResourceType, + parentResourceName, + targetName, + options + }, + listOperationSpec + ); + } + + /** + * Get a Capability resource that extends a Target resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param parentProviderNamespace String that represents a resource provider namespace. + * @param parentResourceType String that represents a resource type. + * @param parentResourceName String that represents a resource name. + * @param targetName String that represents a Target resource name. + * @param capabilityName String that represents a Capability resource name. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + parentProviderNamespace: string, + parentResourceType: string, + parentResourceName: string, + targetName: string, + capabilityName: string, + options?: CapabilitiesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + parentProviderNamespace, + parentResourceType, + parentResourceName, + targetName, + capabilityName, + options + }, + getOperationSpec + ); + } + + /** + * Delete a Capability that extends a Target resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param parentProviderNamespace String that represents a resource provider namespace. + * @param parentResourceType String that represents a resource type. + * @param parentResourceName String that represents a resource name. + * @param targetName String that represents a Target resource name. + * @param capabilityName String that represents a Capability resource name. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + parentProviderNamespace: string, + parentResourceType: string, + parentResourceName: string, + targetName: string, + capabilityName: string, + options?: CapabilitiesDeleteOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + parentProviderNamespace, + parentResourceType, + parentResourceName, + targetName, + capabilityName, + options + }, + deleteOperationSpec + ); + } + + /** + * Create or update a Capability resource that extends a Target resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param parentProviderNamespace String that represents a resource provider namespace. + * @param parentResourceType String that represents a resource type. + * @param parentResourceName String that represents a resource name. + * @param targetName String that represents a Target resource name. + * @param capabilityName String that represents a Capability resource name. + * @param capability Capability resource to be created or updated. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + parentProviderNamespace: string, + parentResourceType: string, + parentResourceName: string, + targetName: string, + capabilityName: string, + capability: Capability, + options?: CapabilitiesCreateOrUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + parentProviderNamespace, + parentResourceType, + parentResourceName, + targetName, + capabilityName, + capability, + options + }, + createOrUpdateOperationSpec + ); + } + + /** + * ListNext + * @param resourceGroupName String that represents an Azure resource group. + * @param parentProviderNamespace String that represents a resource provider namespace. + * @param parentResourceType String that represents a resource type. + * @param parentResourceName String that represents a resource name. + * @param targetName String that represents a Target resource name. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + parentProviderNamespace: string, + parentResourceType: string, + parentResourceName: string, + targetName: string, + nextLink: string, + options?: CapabilitiesListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + parentProviderNamespace, + parentResourceType, + parentResourceName, + targetName, + nextLink, + options + }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{parentProviderNamespace}/{parentResourceType}/{parentResourceName}/providers/Microsoft.Chaos/targets/{targetName}/capabilities", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CapabilityListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion, Parameters.continuationToken], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.parentProviderNamespace, + Parameters.parentResourceType, + Parameters.parentResourceName, + Parameters.targetName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{parentProviderNamespace}/{parentResourceType}/{parentResourceName}/providers/Microsoft.Chaos/targets/{targetName}/capabilities/{capabilityName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Capability + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.parentProviderNamespace, + Parameters.parentResourceType, + Parameters.parentResourceName, + Parameters.targetName, + Parameters.capabilityName + ], + headerParameters: [Parameters.accept], + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{parentProviderNamespace}/{parentResourceType}/{parentResourceName}/providers/Microsoft.Chaos/targets/{targetName}/capabilities/{capabilityName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.parentProviderNamespace, + Parameters.parentResourceType, + Parameters.parentResourceName, + Parameters.targetName, + Parameters.capabilityName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{parentProviderNamespace}/{parentResourceType}/{parentResourceName}/providers/Microsoft.Chaos/targets/{targetName}/capabilities/{capabilityName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.Capability + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.capability, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.parentProviderNamespace, + Parameters.parentResourceType, + Parameters.parentResourceName, + Parameters.targetName, + Parameters.capabilityName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CapabilityListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion, Parameters.continuationToken], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.parentProviderNamespace, + Parameters.parentResourceType, + Parameters.parentResourceName, + Parameters.targetName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/chaos/arm-chaos/src/operations/capabilityTypes.ts b/sdk/chaos/arm-chaos/src/operations/capabilityTypes.ts new file mode 100644 index 000000000000..265f58041772 --- /dev/null +++ b/sdk/chaos/arm-chaos/src/operations/capabilityTypes.ts @@ -0,0 +1,221 @@ +/* + * 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 { CapabilityTypes } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { ChaosManagementClient } from "../chaosManagementClient"; +import { + CapabilityType, + CapabilityTypesListNextOptionalParams, + CapabilityTypesListOptionalParams, + CapabilityTypesListResponse, + CapabilityTypesGetOptionalParams, + CapabilityTypesGetResponse, + CapabilityTypesListNextResponse +} from "../models"; + +/// +/** Class containing CapabilityTypes operations. */ +export class CapabilityTypesImpl implements CapabilityTypes { + private readonly client: ChaosManagementClient; + + /** + * Initialize a new instance of the class CapabilityTypes class. + * @param client Reference to the service client + */ + constructor(client: ChaosManagementClient) { + this.client = client; + } + + /** + * Get a list of Capability Type resources for given Target Type and location. + * @param locationName String that represents a Location resource name. + * @param targetTypeName String that represents a Target Type resource name. + * @param options The options parameters. + */ + public list( + locationName: string, + targetTypeName: string, + options?: CapabilityTypesListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(locationName, targetTypeName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(locationName, targetTypeName, options); + } + }; + } + + private async *listPagingPage( + locationName: string, + targetTypeName: string, + options?: CapabilityTypesListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(locationName, targetTypeName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext( + locationName, + targetTypeName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + locationName: string, + targetTypeName: string, + options?: CapabilityTypesListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + locationName, + targetTypeName, + options + )) { + yield* page; + } + } + + /** + * Get a list of Capability Type resources for given Target Type and location. + * @param locationName String that represents a Location resource name. + * @param targetTypeName String that represents a Target Type resource name. + * @param options The options parameters. + */ + private _list( + locationName: string, + targetTypeName: string, + options?: CapabilityTypesListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { locationName, targetTypeName, options }, + listOperationSpec + ); + } + + /** + * Get a Capability Type resource for given Target Type and location. + * @param locationName String that represents a Location resource name. + * @param targetTypeName String that represents a Target Type resource name. + * @param capabilityTypeName String that represents a Capability Type resource name. + * @param options The options parameters. + */ + get( + locationName: string, + targetTypeName: string, + capabilityTypeName: string, + options?: CapabilityTypesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { locationName, targetTypeName, capabilityTypeName, options }, + getOperationSpec + ); + } + + /** + * ListNext + * @param locationName String that represents a Location resource name. + * @param targetTypeName String that represents a Target Type resource name. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + locationName: string, + targetTypeName: string, + nextLink: string, + options?: CapabilityTypesListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { locationName, targetTypeName, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{locationName}/targetTypes/{targetTypeName}/capabilityTypes", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CapabilityTypeListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion, Parameters.continuationToken], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.locationName, + Parameters.targetTypeName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{locationName}/targetTypes/{targetTypeName}/capabilityTypes/{capabilityTypeName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CapabilityType + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.locationName, + Parameters.targetTypeName, + Parameters.capabilityTypeName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CapabilityTypeListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion, Parameters.continuationToken], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink, + Parameters.locationName, + Parameters.targetTypeName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/chaos/arm-chaos/src/operations/experiments.ts b/sdk/chaos/arm-chaos/src/operations/experiments.ts new file mode 100644 index 000000000000..3e900402cfdc --- /dev/null +++ b/sdk/chaos/arm-chaos/src/operations/experiments.ts @@ -0,0 +1,1053 @@ +/* + * 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 { Experiments } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { ChaosManagementClient } from "../chaosManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + Experiment, + ExperimentsListAllNextOptionalParams, + ExperimentsListAllOptionalParams, + ExperimentsListNextOptionalParams, + ExperimentsListOptionalParams, + ExperimentStatus, + ExperimentsListAllStatusesNextOptionalParams, + ExperimentsListAllStatusesOptionalParams, + ExperimentExecutionDetails, + ExperimentsListExecutionDetailsNextOptionalParams, + ExperimentsListExecutionDetailsOptionalParams, + ExperimentsListAllResponse, + ExperimentsListResponse, + ExperimentsDeleteOptionalParams, + ExperimentsGetOptionalParams, + ExperimentsGetResponse, + ExperimentsCreateOrUpdateOptionalParams, + ExperimentsCreateOrUpdateResponse, + ExperimentsCancelOptionalParams, + ExperimentsCancelResponse, + ExperimentsStartOptionalParams, + ExperimentsStartResponse, + ExperimentsListAllStatusesResponse, + ExperimentsGetStatusOptionalParams, + ExperimentsGetStatusResponse, + ExperimentsListExecutionDetailsResponse, + ExperimentsGetExecutionDetailsOptionalParams, + ExperimentsGetExecutionDetailsResponse, + ExperimentsListAllNextResponse, + ExperimentsListNextResponse, + ExperimentsListAllStatusesNextResponse, + ExperimentsListExecutionDetailsNextResponse +} from "../models"; + +/// +/** Class containing Experiments operations. */ +export class ExperimentsImpl implements Experiments { + private readonly client: ChaosManagementClient; + + /** + * Initialize a new instance of the class Experiments class. + * @param client Reference to the service client + */ + constructor(client: ChaosManagementClient) { + this.client = client; + } + + /** + * Get a list of Experiment resources in a subscription. + * @param options The options parameters. + */ + public listAll( + options?: ExperimentsListAllOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listAllPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listAllPagingPage(options); + } + }; + } + + private async *listAllPagingPage( + options?: ExperimentsListAllOptionalParams + ): AsyncIterableIterator { + let result = await this._listAll(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listAllNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listAllPagingAll( + options?: ExperimentsListAllOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listAllPagingPage(options)) { + yield* page; + } + } + + /** + * Get a list of Experiment resources in a resource group. + * @param resourceGroupName String that represents an Azure resource group. + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + options?: ExperimentsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(resourceGroupName, options); + } + }; + } + + private async *listPagingPage( + resourceGroupName: string, + options?: ExperimentsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(resourceGroupName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + resourceGroupName: string, + options?: ExperimentsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(resourceGroupName, options)) { + yield* page; + } + } + + /** + * Get a list of statuses of a Experiment resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param experimentName String that represents a Experiment resource name. + * @param options The options parameters. + */ + public listAllStatuses( + resourceGroupName: string, + experimentName: string, + options?: ExperimentsListAllStatusesOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listAllStatusesPagingAll( + resourceGroupName, + experimentName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listAllStatusesPagingPage( + resourceGroupName, + experimentName, + options + ); + } + }; + } + + private async *listAllStatusesPagingPage( + resourceGroupName: string, + experimentName: string, + options?: ExperimentsListAllStatusesOptionalParams + ): AsyncIterableIterator { + let result = await this._listAllStatuses( + resourceGroupName, + experimentName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listAllStatusesNext( + resourceGroupName, + experimentName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listAllStatusesPagingAll( + resourceGroupName: string, + experimentName: string, + options?: ExperimentsListAllStatusesOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listAllStatusesPagingPage( + resourceGroupName, + experimentName, + options + )) { + yield* page; + } + } + + /** + * Get a list of execution details of a Experiment resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param experimentName String that represents a Experiment resource name. + * @param options The options parameters. + */ + public listExecutionDetails( + resourceGroupName: string, + experimentName: string, + options?: ExperimentsListExecutionDetailsOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listExecutionDetailsPagingAll( + resourceGroupName, + experimentName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listExecutionDetailsPagingPage( + resourceGroupName, + experimentName, + options + ); + } + }; + } + + private async *listExecutionDetailsPagingPage( + resourceGroupName: string, + experimentName: string, + options?: ExperimentsListExecutionDetailsOptionalParams + ): AsyncIterableIterator { + let result = await this._listExecutionDetails( + resourceGroupName, + experimentName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listExecutionDetailsNext( + resourceGroupName, + experimentName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listExecutionDetailsPagingAll( + resourceGroupName: string, + experimentName: string, + options?: ExperimentsListExecutionDetailsOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listExecutionDetailsPagingPage( + resourceGroupName, + experimentName, + options + )) { + yield* page; + } + } + + /** + * Get a list of Experiment resources in a subscription. + * @param options The options parameters. + */ + private _listAll( + options?: ExperimentsListAllOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listAllOperationSpec); + } + + /** + * Get a list of Experiment resources in a resource group. + * @param resourceGroupName String that represents an Azure resource group. + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + options?: ExperimentsListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listOperationSpec + ); + } + + /** + * Delete a Experiment resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param experimentName String that represents a Experiment resource name. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + experimentName: string, + options?: ExperimentsDeleteOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, experimentName, options }, + deleteOperationSpec + ); + } + + /** + * Get a Experiment resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param experimentName String that represents a Experiment resource name. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + experimentName: string, + options?: ExperimentsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, experimentName, options }, + getOperationSpec + ); + } + + /** + * Create or update a Experiment resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param experimentName String that represents a Experiment resource name. + * @param experiment Experiment resource to be created or updated. + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + experimentName: string, + experiment: Experiment, + options?: ExperimentsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ExperimentsCreateOrUpdateResponse + > + > { + 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, experimentName, experiment, options }, + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "original-uri" + }); + } + + /** + * Create or update a Experiment resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param experimentName String that represents a Experiment resource name. + * @param experiment Experiment resource to be created or updated. + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + experimentName: string, + experiment: Experiment, + options?: ExperimentsCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + experimentName, + experiment, + options + ); + return poller.pollUntilDone(); + } + + /** + * Cancel a running Experiment resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param experimentName String that represents a Experiment resource name. + * @param options The options parameters. + */ + async beginCancel( + resourceGroupName: string, + experimentName: string, + options?: ExperimentsCancelOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ExperimentsCancelResponse + > + > { + 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, experimentName, options }, + cancelOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "original-uri" + }); + } + + /** + * Cancel a running Experiment resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param experimentName String that represents a Experiment resource name. + * @param options The options parameters. + */ + async beginCancelAndWait( + resourceGroupName: string, + experimentName: string, + options?: ExperimentsCancelOptionalParams + ): Promise { + const poller = await this.beginCancel( + resourceGroupName, + experimentName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Start a Experiment resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param experimentName String that represents a Experiment resource name. + * @param options The options parameters. + */ + start( + resourceGroupName: string, + experimentName: string, + options?: ExperimentsStartOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, experimentName, options }, + startOperationSpec + ); + } + + /** + * Get a list of statuses of a Experiment resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param experimentName String that represents a Experiment resource name. + * @param options The options parameters. + */ + private _listAllStatuses( + resourceGroupName: string, + experimentName: string, + options?: ExperimentsListAllStatusesOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, experimentName, options }, + listAllStatusesOperationSpec + ); + } + + /** + * Get a status of a Experiment resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param experimentName String that represents a Experiment resource name. + * @param statusId GUID that represents a Experiment status. + * @param options The options parameters. + */ + getStatus( + resourceGroupName: string, + experimentName: string, + statusId: string, + options?: ExperimentsGetStatusOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, experimentName, statusId, options }, + getStatusOperationSpec + ); + } + + /** + * Get a list of execution details of a Experiment resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param experimentName String that represents a Experiment resource name. + * @param options The options parameters. + */ + private _listExecutionDetails( + resourceGroupName: string, + experimentName: string, + options?: ExperimentsListExecutionDetailsOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, experimentName, options }, + listExecutionDetailsOperationSpec + ); + } + + /** + * Get an execution detail of a Experiment resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param experimentName String that represents a Experiment resource name. + * @param executionDetailsId GUID that represents a Experiment execution detail. + * @param options The options parameters. + */ + getExecutionDetails( + resourceGroupName: string, + experimentName: string, + executionDetailsId: string, + options?: ExperimentsGetExecutionDetailsOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, experimentName, executionDetailsId, options }, + getExecutionDetailsOperationSpec + ); + } + + /** + * ListAllNext + * @param nextLink The nextLink from the previous successful call to the ListAll method. + * @param options The options parameters. + */ + private _listAllNext( + nextLink: string, + options?: ExperimentsListAllNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listAllNextOperationSpec + ); + } + + /** + * ListNext + * @param resourceGroupName String that represents an Azure resource group. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + nextLink: string, + options?: ExperimentsListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listNextOperationSpec + ); + } + + /** + * ListAllStatusesNext + * @param resourceGroupName String that represents an Azure resource group. + * @param experimentName String that represents a Experiment resource name. + * @param nextLink The nextLink from the previous successful call to the ListAllStatuses method. + * @param options The options parameters. + */ + private _listAllStatusesNext( + resourceGroupName: string, + experimentName: string, + nextLink: string, + options?: ExperimentsListAllStatusesNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, experimentName, nextLink, options }, + listAllStatusesNextOperationSpec + ); + } + + /** + * ListExecutionDetailsNext + * @param resourceGroupName String that represents an Azure resource group. + * @param experimentName String that represents a Experiment resource name. + * @param nextLink The nextLink from the previous successful call to the ListExecutionDetails method. + * @param options The options parameters. + */ + private _listExecutionDetailsNext( + resourceGroupName: string, + experimentName: string, + nextLink: string, + options?: ExperimentsListExecutionDetailsNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, experimentName, nextLink, options }, + listExecutionDetailsNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listAllOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Chaos/experiments", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ExperimentListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.continuationToken, + Parameters.running + ], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ExperimentListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.continuationToken, + Parameters.running + ], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.experimentName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Experiment + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.experimentName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.Experiment + }, + 201: { + bodyMapper: Mappers.Experiment + }, + 202: { + bodyMapper: Mappers.Experiment + }, + 204: { + bodyMapper: Mappers.Experiment + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.experiment, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.experimentName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const cancelOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}/cancel", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.ExperimentCancelOperationResult + }, + 201: { + bodyMapper: Mappers.ExperimentCancelOperationResult + }, + 202: { + bodyMapper: Mappers.ExperimentCancelOperationResult + }, + 204: { + bodyMapper: Mappers.ExperimentCancelOperationResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.experimentName + ], + headerParameters: [Parameters.accept], + serializer +}; +const startOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}/start", + httpMethod: "POST", + responses: { + 202: { + bodyMapper: Mappers.ExperimentStartOperationResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.experimentName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listAllStatusesOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}/statuses", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ExperimentStatusListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.experimentName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getStatusOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}/statuses/{statusId}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ExperimentStatus + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.experimentName, + Parameters.statusId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listExecutionDetailsOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}/executionDetails", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ExperimentExecutionDetailsListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.experimentName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getExecutionDetailsOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}/executionDetails/{executionDetailsId}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ExperimentExecutionDetails + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.experimentName, + Parameters.executionDetailsId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listAllNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ExperimentListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.continuationToken, + Parameters.running + ], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ExperimentListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.continuationToken, + Parameters.running + ], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; +const listAllStatusesNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ExperimentStatusListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.nextLink, + Parameters.experimentName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listExecutionDetailsNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ExperimentExecutionDetailsListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.nextLink, + Parameters.experimentName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/chaos/arm-chaos/src/operations/index.ts b/sdk/chaos/arm-chaos/src/operations/index.ts new file mode 100644 index 000000000000..540e90a46783 --- /dev/null +++ b/sdk/chaos/arm-chaos/src/operations/index.ts @@ -0,0 +1,14 @@ +/* + * 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 "./capabilities"; +export * from "./experiments"; +export * from "./operations"; +export * from "./targets"; +export * from "./targetTypes"; +export * from "./capabilityTypes"; diff --git a/sdk/chaos/arm-chaos/src/operations/operations.ts b/sdk/chaos/arm-chaos/src/operations/operations.ts new file mode 100644 index 000000000000..d7b3cde79040 --- /dev/null +++ b/sdk/chaos/arm-chaos/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 { ChaosManagementClient } from "../chaosManagementClient"; +import { + Operation, + OperationsListAllNextOptionalParams, + OperationsListAllOptionalParams, + OperationsListAllResponse, + OperationsListAllNextResponse +} from "../models"; + +/// +/** Class containing Operations operations. */ +export class OperationsImpl implements Operations { + private readonly client: ChaosManagementClient; + + /** + * Initialize a new instance of the class Operations class. + * @param client Reference to the service client + */ + constructor(client: ChaosManagementClient) { + this.client = client; + } + + /** + * Get a list all available Operations. + * @param options The options parameters. + */ + public listAll( + options?: OperationsListAllOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listAllPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listAllPagingPage(options); + } + }; + } + + private async *listAllPagingPage( + options?: OperationsListAllOptionalParams + ): AsyncIterableIterator { + let result = await this._listAll(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listAllNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listAllPagingAll( + options?: OperationsListAllOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listAllPagingPage(options)) { + yield* page; + } + } + + /** + * Get a list all available Operations. + * @param options The options parameters. + */ + private _listAll( + options?: OperationsListAllOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listAllOperationSpec); + } + + /** + * ListAllNext + * @param nextLink The nextLink from the previous successful call to the ListAll method. + * @param options The options parameters. + */ + private _listAllNext( + nextLink: string, + options?: OperationsListAllNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listAllNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listAllOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Chaos/operations", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.OperationListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], + serializer +}; +const listAllNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.OperationListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.nextLink], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/chaos/arm-chaos/src/operations/targetTypes.ts b/sdk/chaos/arm-chaos/src/operations/targetTypes.ts new file mode 100644 index 000000000000..1c7883c0266f --- /dev/null +++ b/sdk/chaos/arm-chaos/src/operations/targetTypes.ts @@ -0,0 +1,199 @@ +/* + * 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 { TargetTypes } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { ChaosManagementClient } from "../chaosManagementClient"; +import { + TargetType, + TargetTypesListNextOptionalParams, + TargetTypesListOptionalParams, + TargetTypesListResponse, + TargetTypesGetOptionalParams, + TargetTypesGetResponse, + TargetTypesListNextResponse +} from "../models"; + +/// +/** Class containing TargetTypes operations. */ +export class TargetTypesImpl implements TargetTypes { + private readonly client: ChaosManagementClient; + + /** + * Initialize a new instance of the class TargetTypes class. + * @param client Reference to the service client + */ + constructor(client: ChaosManagementClient) { + this.client = client; + } + + /** + * Get a list of Target Type resources for given location. + * @param locationName String that represents a Location resource name. + * @param options The options parameters. + */ + public list( + locationName: string, + options?: TargetTypesListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(locationName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(locationName, options); + } + }; + } + + private async *listPagingPage( + locationName: string, + options?: TargetTypesListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(locationName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(locationName, continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + locationName: string, + options?: TargetTypesListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(locationName, options)) { + yield* page; + } + } + + /** + * Get a list of Target Type resources for given location. + * @param locationName String that represents a Location resource name. + * @param options The options parameters. + */ + private _list( + locationName: string, + options?: TargetTypesListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { locationName, options }, + listOperationSpec + ); + } + + /** + * Get a Target Type resources for given location. + * @param locationName String that represents a Location resource name. + * @param targetTypeName String that represents a Target Type resource name. + * @param options The options parameters. + */ + get( + locationName: string, + targetTypeName: string, + options?: TargetTypesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { locationName, targetTypeName, options }, + getOperationSpec + ); + } + + /** + * ListNext + * @param locationName String that represents a Location resource name. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + locationName: string, + nextLink: string, + options?: TargetTypesListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { locationName, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{locationName}/targetTypes", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TargetTypeListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion, Parameters.continuationToken], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.locationName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{locationName}/targetTypes/{targetTypeName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TargetType + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.locationName, + Parameters.targetTypeName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TargetTypeListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion, Parameters.continuationToken], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink, + Parameters.locationName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/chaos/arm-chaos/src/operations/targets.ts b/sdk/chaos/arm-chaos/src/operations/targets.ts new file mode 100644 index 000000000000..b6c4dad4d2c3 --- /dev/null +++ b/sdk/chaos/arm-chaos/src/operations/targets.ts @@ -0,0 +1,406 @@ +/* + * 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 { Targets } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { ChaosManagementClient } from "../chaosManagementClient"; +import { + Target, + TargetsListNextOptionalParams, + TargetsListOptionalParams, + TargetsListResponse, + TargetsGetOptionalParams, + TargetsGetResponse, + TargetsDeleteOptionalParams, + TargetsCreateOrUpdateOptionalParams, + TargetsCreateOrUpdateResponse, + TargetsListNextResponse +} from "../models"; + +/// +/** Class containing Targets operations. */ +export class TargetsImpl implements Targets { + private readonly client: ChaosManagementClient; + + /** + * Initialize a new instance of the class Targets class. + * @param client Reference to the service client + */ + constructor(client: ChaosManagementClient) { + this.client = client; + } + + /** + * Get a list of Target resources that extend a tracked regional resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param parentProviderNamespace String that represents a resource provider namespace. + * @param parentResourceType String that represents a resource type. + * @param parentResourceName String that represents a resource name. + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + parentProviderNamespace: string, + parentResourceType: string, + parentResourceName: string, + options?: TargetsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll( + resourceGroupName, + parentProviderNamespace, + parentResourceType, + parentResourceName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage( + resourceGroupName, + parentProviderNamespace, + parentResourceType, + parentResourceName, + options + ); + } + }; + } + + private async *listPagingPage( + resourceGroupName: string, + parentProviderNamespace: string, + parentResourceType: string, + parentResourceName: string, + options?: TargetsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list( + resourceGroupName, + parentProviderNamespace, + parentResourceType, + parentResourceName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + parentProviderNamespace, + parentResourceType, + parentResourceName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + resourceGroupName: string, + parentProviderNamespace: string, + parentResourceType: string, + parentResourceName: string, + options?: TargetsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + parentProviderNamespace, + parentResourceType, + parentResourceName, + options + )) { + yield* page; + } + } + + /** + * Get a list of Target resources that extend a tracked regional resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param parentProviderNamespace String that represents a resource provider namespace. + * @param parentResourceType String that represents a resource type. + * @param parentResourceName String that represents a resource name. + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + parentProviderNamespace: string, + parentResourceType: string, + parentResourceName: string, + options?: TargetsListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + parentProviderNamespace, + parentResourceType, + parentResourceName, + options + }, + listOperationSpec + ); + } + + /** + * Get a Target resource that extends a tracked regional resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param parentProviderNamespace String that represents a resource provider namespace. + * @param parentResourceType String that represents a resource type. + * @param parentResourceName String that represents a resource name. + * @param targetName String that represents a Target resource name. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + parentProviderNamespace: string, + parentResourceType: string, + parentResourceName: string, + targetName: string, + options?: TargetsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + parentProviderNamespace, + parentResourceType, + parentResourceName, + targetName, + options + }, + getOperationSpec + ); + } + + /** + * Delete a Target resource that extends a tracked regional resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param parentProviderNamespace String that represents a resource provider namespace. + * @param parentResourceType String that represents a resource type. + * @param parentResourceName String that represents a resource name. + * @param targetName String that represents a Target resource name. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + parentProviderNamespace: string, + parentResourceType: string, + parentResourceName: string, + targetName: string, + options?: TargetsDeleteOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + parentProviderNamespace, + parentResourceType, + parentResourceName, + targetName, + options + }, + deleteOperationSpec + ); + } + + /** + * Create or update a Target resource that extends a tracked regional resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param parentProviderNamespace String that represents a resource provider namespace. + * @param parentResourceType String that represents a resource type. + * @param parentResourceName String that represents a resource name. + * @param targetName String that represents a Target resource name. + * @param target Target resource to be created or updated. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + parentProviderNamespace: string, + parentResourceType: string, + parentResourceName: string, + targetName: string, + target: Target, + options?: TargetsCreateOrUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + parentProviderNamespace, + parentResourceType, + parentResourceName, + targetName, + target, + options + }, + createOrUpdateOperationSpec + ); + } + + /** + * ListNext + * @param resourceGroupName String that represents an Azure resource group. + * @param parentProviderNamespace String that represents a resource provider namespace. + * @param parentResourceType String that represents a resource type. + * @param parentResourceName String that represents a resource name. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + parentProviderNamespace: string, + parentResourceType: string, + parentResourceName: string, + nextLink: string, + options?: TargetsListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + parentProviderNamespace, + parentResourceType, + parentResourceName, + nextLink, + options + }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{parentProviderNamespace}/{parentResourceType}/{parentResourceName}/providers/Microsoft.Chaos/targets", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TargetListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion, Parameters.continuationToken], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.parentProviderNamespace, + Parameters.parentResourceType, + Parameters.parentResourceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{parentProviderNamespace}/{parentResourceType}/{parentResourceName}/providers/Microsoft.Chaos/targets/{targetName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Target + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.parentProviderNamespace, + Parameters.parentResourceType, + Parameters.parentResourceName, + Parameters.targetName + ], + headerParameters: [Parameters.accept], + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{parentProviderNamespace}/{parentResourceType}/{parentResourceName}/providers/Microsoft.Chaos/targets/{targetName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.parentProviderNamespace, + Parameters.parentResourceType, + Parameters.parentResourceName, + Parameters.targetName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{parentProviderNamespace}/{parentResourceType}/{parentResourceName}/providers/Microsoft.Chaos/targets/{targetName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.Target + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.target, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.parentProviderNamespace, + Parameters.parentResourceType, + Parameters.parentResourceName, + Parameters.targetName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TargetListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion, Parameters.continuationToken], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.parentProviderNamespace, + Parameters.parentResourceType, + Parameters.parentResourceName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/chaos/arm-chaos/src/operationsInterfaces/capabilities.ts b/sdk/chaos/arm-chaos/src/operationsInterfaces/capabilities.ts new file mode 100644 index 000000000000..4baeaa650ad2 --- /dev/null +++ b/sdk/chaos/arm-chaos/src/operationsInterfaces/capabilities.ts @@ -0,0 +1,99 @@ +/* + * 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 { + Capability, + CapabilitiesListOptionalParams, + CapabilitiesGetOptionalParams, + CapabilitiesGetResponse, + CapabilitiesDeleteOptionalParams, + CapabilitiesCreateOrUpdateOptionalParams, + CapabilitiesCreateOrUpdateResponse +} from "../models"; + +/// +/** Interface representing a Capabilities. */ +export interface Capabilities { + /** + * Get a list of Capability resources that extend a Target resource.. + * @param resourceGroupName String that represents an Azure resource group. + * @param parentProviderNamespace String that represents a resource provider namespace. + * @param parentResourceType String that represents a resource type. + * @param parentResourceName String that represents a resource name. + * @param targetName String that represents a Target resource name. + * @param options The options parameters. + */ + list( + resourceGroupName: string, + parentProviderNamespace: string, + parentResourceType: string, + parentResourceName: string, + targetName: string, + options?: CapabilitiesListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get a Capability resource that extends a Target resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param parentProviderNamespace String that represents a resource provider namespace. + * @param parentResourceType String that represents a resource type. + * @param parentResourceName String that represents a resource name. + * @param targetName String that represents a Target resource name. + * @param capabilityName String that represents a Capability resource name. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + parentProviderNamespace: string, + parentResourceType: string, + parentResourceName: string, + targetName: string, + capabilityName: string, + options?: CapabilitiesGetOptionalParams + ): Promise; + /** + * Delete a Capability that extends a Target resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param parentProviderNamespace String that represents a resource provider namespace. + * @param parentResourceType String that represents a resource type. + * @param parentResourceName String that represents a resource name. + * @param targetName String that represents a Target resource name. + * @param capabilityName String that represents a Capability resource name. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + parentProviderNamespace: string, + parentResourceType: string, + parentResourceName: string, + targetName: string, + capabilityName: string, + options?: CapabilitiesDeleteOptionalParams + ): Promise; + /** + * Create or update a Capability resource that extends a Target resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param parentProviderNamespace String that represents a resource provider namespace. + * @param parentResourceType String that represents a resource type. + * @param parentResourceName String that represents a resource name. + * @param targetName String that represents a Target resource name. + * @param capabilityName String that represents a Capability resource name. + * @param capability Capability resource to be created or updated. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + parentProviderNamespace: string, + parentResourceType: string, + parentResourceName: string, + targetName: string, + capabilityName: string, + capability: Capability, + options?: CapabilitiesCreateOrUpdateOptionalParams + ): Promise; +} diff --git a/sdk/chaos/arm-chaos/src/operationsInterfaces/capabilityTypes.ts b/sdk/chaos/arm-chaos/src/operationsInterfaces/capabilityTypes.ts new file mode 100644 index 000000000000..84e2c648b666 --- /dev/null +++ b/sdk/chaos/arm-chaos/src/operationsInterfaces/capabilityTypes.ts @@ -0,0 +1,44 @@ +/* + * 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 { + CapabilityType, + CapabilityTypesListOptionalParams, + CapabilityTypesGetOptionalParams, + CapabilityTypesGetResponse +} from "../models"; + +/// +/** Interface representing a CapabilityTypes. */ +export interface CapabilityTypes { + /** + * Get a list of Capability Type resources for given Target Type and location. + * @param locationName String that represents a Location resource name. + * @param targetTypeName String that represents a Target Type resource name. + * @param options The options parameters. + */ + list( + locationName: string, + targetTypeName: string, + options?: CapabilityTypesListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get a Capability Type resource for given Target Type and location. + * @param locationName String that represents a Location resource name. + * @param targetTypeName String that represents a Target Type resource name. + * @param capabilityTypeName String that represents a Capability Type resource name. + * @param options The options parameters. + */ + get( + locationName: string, + targetTypeName: string, + capabilityTypeName: string, + options?: CapabilityTypesGetOptionalParams + ): Promise; +} diff --git a/sdk/chaos/arm-chaos/src/operationsInterfaces/experiments.ts b/sdk/chaos/arm-chaos/src/operationsInterfaces/experiments.ts new file mode 100644 index 000000000000..74d4ae5980bf --- /dev/null +++ b/sdk/chaos/arm-chaos/src/operationsInterfaces/experiments.ts @@ -0,0 +1,192 @@ +/* + * 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 { + Experiment, + ExperimentsListAllOptionalParams, + ExperimentsListOptionalParams, + ExperimentStatus, + ExperimentsListAllStatusesOptionalParams, + ExperimentExecutionDetails, + ExperimentsListExecutionDetailsOptionalParams, + ExperimentsDeleteOptionalParams, + ExperimentsGetOptionalParams, + ExperimentsGetResponse, + ExperimentsCreateOrUpdateOptionalParams, + ExperimentsCreateOrUpdateResponse, + ExperimentsCancelOptionalParams, + ExperimentsCancelResponse, + ExperimentsStartOptionalParams, + ExperimentsStartResponse, + ExperimentsGetStatusOptionalParams, + ExperimentsGetStatusResponse, + ExperimentsGetExecutionDetailsOptionalParams, + ExperimentsGetExecutionDetailsResponse +} from "../models"; + +/// +/** Interface representing a Experiments. */ +export interface Experiments { + /** + * Get a list of Experiment resources in a subscription. + * @param options The options parameters. + */ + listAll( + options?: ExperimentsListAllOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get a list of Experiment resources in a resource group. + * @param resourceGroupName String that represents an Azure resource group. + * @param options The options parameters. + */ + list( + resourceGroupName: string, + options?: ExperimentsListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get a list of statuses of a Experiment resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param experimentName String that represents a Experiment resource name. + * @param options The options parameters. + */ + listAllStatuses( + resourceGroupName: string, + experimentName: string, + options?: ExperimentsListAllStatusesOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get a list of execution details of a Experiment resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param experimentName String that represents a Experiment resource name. + * @param options The options parameters. + */ + listExecutionDetails( + resourceGroupName: string, + experimentName: string, + options?: ExperimentsListExecutionDetailsOptionalParams + ): PagedAsyncIterableIterator; + /** + * Delete a Experiment resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param experimentName String that represents a Experiment resource name. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + experimentName: string, + options?: ExperimentsDeleteOptionalParams + ): Promise; + /** + * Get a Experiment resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param experimentName String that represents a Experiment resource name. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + experimentName: string, + options?: ExperimentsGetOptionalParams + ): Promise; + /** + * Create or update a Experiment resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param experimentName String that represents a Experiment resource name. + * @param experiment Experiment resource to be created or updated. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + experimentName: string, + experiment: Experiment, + options?: ExperimentsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ExperimentsCreateOrUpdateResponse + > + >; + /** + * Create or update a Experiment resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param experimentName String that represents a Experiment resource name. + * @param experiment Experiment resource to be created or updated. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + experimentName: string, + experiment: Experiment, + options?: ExperimentsCreateOrUpdateOptionalParams + ): Promise; + /** + * Cancel a running Experiment resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param experimentName String that represents a Experiment resource name. + * @param options The options parameters. + */ + beginCancel( + resourceGroupName: string, + experimentName: string, + options?: ExperimentsCancelOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ExperimentsCancelResponse + > + >; + /** + * Cancel a running Experiment resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param experimentName String that represents a Experiment resource name. + * @param options The options parameters. + */ + beginCancelAndWait( + resourceGroupName: string, + experimentName: string, + options?: ExperimentsCancelOptionalParams + ): Promise; + /** + * Start a Experiment resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param experimentName String that represents a Experiment resource name. + * @param options The options parameters. + */ + start( + resourceGroupName: string, + experimentName: string, + options?: ExperimentsStartOptionalParams + ): Promise; + /** + * Get a status of a Experiment resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param experimentName String that represents a Experiment resource name. + * @param statusId GUID that represents a Experiment status. + * @param options The options parameters. + */ + getStatus( + resourceGroupName: string, + experimentName: string, + statusId: string, + options?: ExperimentsGetStatusOptionalParams + ): Promise; + /** + * Get an execution detail of a Experiment resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param experimentName String that represents a Experiment resource name. + * @param executionDetailsId GUID that represents a Experiment execution detail. + * @param options The options parameters. + */ + getExecutionDetails( + resourceGroupName: string, + experimentName: string, + executionDetailsId: string, + options?: ExperimentsGetExecutionDetailsOptionalParams + ): Promise; +} diff --git a/sdk/chaos/arm-chaos/src/operationsInterfaces/index.ts b/sdk/chaos/arm-chaos/src/operationsInterfaces/index.ts new file mode 100644 index 000000000000..540e90a46783 --- /dev/null +++ b/sdk/chaos/arm-chaos/src/operationsInterfaces/index.ts @@ -0,0 +1,14 @@ +/* + * 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 "./capabilities"; +export * from "./experiments"; +export * from "./operations"; +export * from "./targets"; +export * from "./targetTypes"; +export * from "./capabilityTypes"; diff --git a/sdk/chaos/arm-chaos/src/operationsInterfaces/operations.ts b/sdk/chaos/arm-chaos/src/operationsInterfaces/operations.ts new file mode 100644 index 000000000000..4c2347318693 --- /dev/null +++ b/sdk/chaos/arm-chaos/src/operationsInterfaces/operations.ts @@ -0,0 +1,22 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Operation, OperationsListAllOptionalParams } from "../models"; + +/// +/** Interface representing a Operations. */ +export interface Operations { + /** + * Get a list all available Operations. + * @param options The options parameters. + */ + listAll( + options?: OperationsListAllOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/chaos/arm-chaos/src/operationsInterfaces/targetTypes.ts b/sdk/chaos/arm-chaos/src/operationsInterfaces/targetTypes.ts new file mode 100644 index 000000000000..2d8010211214 --- /dev/null +++ b/sdk/chaos/arm-chaos/src/operationsInterfaces/targetTypes.ts @@ -0,0 +1,40 @@ +/* + * 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 { + TargetType, + TargetTypesListOptionalParams, + TargetTypesGetOptionalParams, + TargetTypesGetResponse +} from "../models"; + +/// +/** Interface representing a TargetTypes. */ +export interface TargetTypes { + /** + * Get a list of Target Type resources for given location. + * @param locationName String that represents a Location resource name. + * @param options The options parameters. + */ + list( + locationName: string, + options?: TargetTypesListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get a Target Type resources for given location. + * @param locationName String that represents a Location resource name. + * @param targetTypeName String that represents a Target Type resource name. + * @param options The options parameters. + */ + get( + locationName: string, + targetTypeName: string, + options?: TargetTypesGetOptionalParams + ): Promise; +} diff --git a/sdk/chaos/arm-chaos/src/operationsInterfaces/targets.ts b/sdk/chaos/arm-chaos/src/operationsInterfaces/targets.ts new file mode 100644 index 000000000000..c19d074e90d3 --- /dev/null +++ b/sdk/chaos/arm-chaos/src/operationsInterfaces/targets.ts @@ -0,0 +1,91 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + Target, + TargetsListOptionalParams, + TargetsGetOptionalParams, + TargetsGetResponse, + TargetsDeleteOptionalParams, + TargetsCreateOrUpdateOptionalParams, + TargetsCreateOrUpdateResponse +} from "../models"; + +/// +/** Interface representing a Targets. */ +export interface Targets { + /** + * Get a list of Target resources that extend a tracked regional resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param parentProviderNamespace String that represents a resource provider namespace. + * @param parentResourceType String that represents a resource type. + * @param parentResourceName String that represents a resource name. + * @param options The options parameters. + */ + list( + resourceGroupName: string, + parentProviderNamespace: string, + parentResourceType: string, + parentResourceName: string, + options?: TargetsListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get a Target resource that extends a tracked regional resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param parentProviderNamespace String that represents a resource provider namespace. + * @param parentResourceType String that represents a resource type. + * @param parentResourceName String that represents a resource name. + * @param targetName String that represents a Target resource name. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + parentProviderNamespace: string, + parentResourceType: string, + parentResourceName: string, + targetName: string, + options?: TargetsGetOptionalParams + ): Promise; + /** + * Delete a Target resource that extends a tracked regional resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param parentProviderNamespace String that represents a resource provider namespace. + * @param parentResourceType String that represents a resource type. + * @param parentResourceName String that represents a resource name. + * @param targetName String that represents a Target resource name. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + parentProviderNamespace: string, + parentResourceType: string, + parentResourceName: string, + targetName: string, + options?: TargetsDeleteOptionalParams + ): Promise; + /** + * Create or update a Target resource that extends a tracked regional resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param parentProviderNamespace String that represents a resource provider namespace. + * @param parentResourceType String that represents a resource type. + * @param parentResourceName String that represents a resource name. + * @param targetName String that represents a Target resource name. + * @param target Target resource to be created or updated. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + parentProviderNamespace: string, + parentResourceType: string, + parentResourceName: string, + targetName: string, + target: Target, + options?: TargetsCreateOrUpdateOptionalParams + ): Promise; +} diff --git a/sdk/chaos/arm-chaos/test/sampleTest.ts b/sdk/chaos/arm-chaos/test/sampleTest.ts new file mode 100644 index 000000000000..7ed89b043e1b --- /dev/null +++ b/sdk/chaos/arm-chaos/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/chaos/arm-chaos/tsconfig.json b/sdk/chaos/arm-chaos/tsconfig.json new file mode 100644 index 000000000000..6e3251194117 --- /dev/null +++ b/sdk/chaos/arm-chaos/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/chaos/ci.yml b/sdk/chaos/ci.yml new file mode 100644 index 000000000000..0d825c12fdf4 --- /dev/null +++ b/sdk/chaos/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/chaos/ + +pr: + branches: + include: + - main + - release/* + - hotfix/* + paths: + include: + - sdk/chaos/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: chaos + Artifacts: + - name: azure-arm-chaos + safeName: azurearmchaos + \ No newline at end of file