From 180f19180783c4fbb14c9a33f77915f3fade2959 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 3 Feb 2022 17:21:02 +0000 Subject: [PATCH] CodeGen from PR 17652 in Azure/azure-rest-api-specs Merge fe6c781421bbac124f1057942f5774bf8f395d7f into 5582a35deb1bfa4aa22bac8f1d51b7934ead94ac --- common/config/rush/pnpm-lock.yaml | 95 +- rush.json | 7 +- sdk/logz/arm-logz/CHANGELOG.md | 5 + sdk/logz/arm-logz/LICENSE | 21 + sdk/logz/arm-logz/README.md | 98 ++ sdk/logz/arm-logz/_meta.json | 7 + sdk/logz/arm-logz/api-extractor.json | 31 + sdk/logz/arm-logz/package.json | 102 ++ sdk/logz/arm-logz/review/arm-logz.api.md | 859 ++++++++++++ sdk/logz/arm-logz/rollup.config.js | 188 +++ sdk/logz/arm-logz/src/index.ts | 12 + sdk/logz/arm-logz/src/lroImpl.ts | 34 + sdk/logz/arm-logz/src/microsoftLogz.ts | 103 ++ sdk/logz/arm-logz/src/models/index.ts | 1020 +++++++++++++++ sdk/logz/arm-logz/src/models/mappers.ts | 1155 +++++++++++++++++ sdk/logz/arm-logz/src/models/parameters.ts | 184 +++ sdk/logz/arm-logz/src/operations/index.ts | 15 + sdk/logz/arm-logz/src/operations/monitor.ts | 391 ++++++ sdk/logz/arm-logz/src/operations/monitors.ts | 904 +++++++++++++ .../arm-logz/src/operations/operations.ts | 137 ++ .../arm-logz/src/operations/singleSignOn.ts | 350 +++++ .../arm-logz/src/operations/subAccount.ts | 1070 +++++++++++++++ .../src/operations/subAccountTagRules.ts | 349 +++++ sdk/logz/arm-logz/src/operations/tagRules.ts | 313 +++++ .../src/operationsInterfaces/index.ts | 15 + .../src/operationsInterfaces/monitor.ts | 56 + .../src/operationsInterfaces/monitors.ts | 141 ++ .../src/operationsInterfaces/operations.ts | 22 + .../src/operationsInterfaces/singleSignOn.ts | 78 ++ .../src/operationsInterfaces/subAccount.ts | 182 +++ .../subAccountTagRules.ts | 82 ++ .../src/operationsInterfaces/tagRules.ts | 74 ++ sdk/logz/arm-logz/test/sampleTest.ts | 48 + sdk/logz/arm-logz/tsconfig.json | 27 + sdk/logz/ci.yml | 30 + 35 files changed, 8168 insertions(+), 37 deletions(-) create mode 100644 sdk/logz/arm-logz/CHANGELOG.md create mode 100644 sdk/logz/arm-logz/LICENSE create mode 100644 sdk/logz/arm-logz/README.md create mode 100644 sdk/logz/arm-logz/_meta.json create mode 100644 sdk/logz/arm-logz/api-extractor.json create mode 100644 sdk/logz/arm-logz/package.json create mode 100644 sdk/logz/arm-logz/review/arm-logz.api.md create mode 100644 sdk/logz/arm-logz/rollup.config.js create mode 100644 sdk/logz/arm-logz/src/index.ts create mode 100644 sdk/logz/arm-logz/src/lroImpl.ts create mode 100644 sdk/logz/arm-logz/src/microsoftLogz.ts create mode 100644 sdk/logz/arm-logz/src/models/index.ts create mode 100644 sdk/logz/arm-logz/src/models/mappers.ts create mode 100644 sdk/logz/arm-logz/src/models/parameters.ts create mode 100644 sdk/logz/arm-logz/src/operations/index.ts create mode 100644 sdk/logz/arm-logz/src/operations/monitor.ts create mode 100644 sdk/logz/arm-logz/src/operations/monitors.ts create mode 100644 sdk/logz/arm-logz/src/operations/operations.ts create mode 100644 sdk/logz/arm-logz/src/operations/singleSignOn.ts create mode 100644 sdk/logz/arm-logz/src/operations/subAccount.ts create mode 100644 sdk/logz/arm-logz/src/operations/subAccountTagRules.ts create mode 100644 sdk/logz/arm-logz/src/operations/tagRules.ts create mode 100644 sdk/logz/arm-logz/src/operationsInterfaces/index.ts create mode 100644 sdk/logz/arm-logz/src/operationsInterfaces/monitor.ts create mode 100644 sdk/logz/arm-logz/src/operationsInterfaces/monitors.ts create mode 100644 sdk/logz/arm-logz/src/operationsInterfaces/operations.ts create mode 100644 sdk/logz/arm-logz/src/operationsInterfaces/singleSignOn.ts create mode 100644 sdk/logz/arm-logz/src/operationsInterfaces/subAccount.ts create mode 100644 sdk/logz/arm-logz/src/operationsInterfaces/subAccountTagRules.ts create mode 100644 sdk/logz/arm-logz/src/operationsInterfaces/tagRules.ts create mode 100644 sdk/logz/arm-logz/test/sampleTest.ts create mode 100644 sdk/logz/arm-logz/tsconfig.json create mode 100644 sdk/logz/ci.yml diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 2166df15bb76..0f7d85b5f385 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -76,6 +76,7 @@ specifiers: '@rush-temp/arm-loadtestservice': file:./projects/arm-loadtestservice.tgz '@rush-temp/arm-locks': file:./projects/arm-locks.tgz '@rush-temp/arm-logic': file:./projects/arm-logic.tgz + '@rush-temp/arm-logz': file:./projects/arm-logz.tgz '@rush-temp/arm-machinelearningcompute': file:./projects/arm-machinelearningcompute.tgz '@rush-temp/arm-machinelearningexperimentation': file:./projects/arm-machinelearningexperimentation.tgz '@rush-temp/arm-machinelearningservices': file:./projects/arm-machinelearningservices.tgz @@ -331,6 +332,7 @@ dependencies: '@rush-temp/arm-loadtestservice': file:projects/arm-loadtestservice.tgz '@rush-temp/arm-locks': file:projects/arm-locks.tgz '@rush-temp/arm-logic': file:projects/arm-logic.tgz + '@rush-temp/arm-logz': file:projects/arm-logz.tgz '@rush-temp/arm-machinelearningcompute': file:projects/arm-machinelearningcompute.tgz '@rush-temp/arm-machinelearningexperimentation': file:projects/arm-machinelearningexperimentation.tgz '@rush-temp/arm-machinelearningservices': file:projects/arm-machinelearningservices.tgz @@ -2119,7 +2121,7 @@ packages: resolution: {integrity: sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==} dependencies: '@types/connect': 3.4.35 - '@types/node': 17.0.13 + '@types/node': 12.20.42 dev: false /@types/chai-as-promised/7.1.4: @@ -2145,14 +2147,14 @@ packages: /@types/concurrently/6.4.0: resolution: {integrity: sha512-CYU1eyFHsIa2IZIsb8gfUOdiewfnZcyM2Hg1Zaq95xnmB0Ix/bTRM8SttqZ2Cjy6JGPZLttHjZewVsDg1yvnJg==} dependencies: - '@types/node': 17.0.13 + '@types/node': 12.20.42 chalk: 4.1.2 dev: false /@types/connect/3.4.35: resolution: {integrity: sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==} dependencies: - '@types/node': 17.0.13 + '@types/node': 12.20.42 dev: false /@types/cookie/0.4.1: @@ -2187,7 +2189,7 @@ packages: /@types/express-serve-static-core/4.17.28: resolution: {integrity: sha512-P1BJAEAW3E2DJUlkgq4tOL3RyMunoWXqbSCygWo5ZIWTjUgN1YnaXWW4VWl/oc8vs/XoYibEGBKP0uZyF4AHig==} dependencies: - '@types/node': 17.0.13 + '@types/node': 12.20.42 '@types/qs': 6.9.7 '@types/range-parser': 1.2.4 dev: false @@ -2204,26 +2206,26 @@ packages: /@types/fs-extra/8.1.2: resolution: {integrity: sha512-SvSrYXfWSc7R4eqnOzbQF4TZmfpNSM9FrSWLU3EUnWBuyZqNBOrv1B1JA3byUDPUl9z4Ab3jeZG2eDdySlgNMg==} dependencies: - '@types/node': 17.0.13 + '@types/node': 12.20.42 dev: false /@types/fs-extra/9.0.13: resolution: {integrity: sha512-nEnwB++1u5lVDM2UI4c1+5R+FYaKfaAzS4OococimjVm3nQw3TuzH5UNsocrcTBbhnerblyHj4A49qXbIiZdpA==} dependencies: - '@types/node': 17.0.13 + '@types/node': 12.20.42 dev: false /@types/glob/7.2.0: resolution: {integrity: sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==} dependencies: '@types/minimatch': 3.0.5 - '@types/node': 17.0.13 + '@types/node': 12.20.42 dev: false /@types/is-buffer/2.0.0: resolution: {integrity: sha512-0f7N/e3BAz32qDYvgB4d2cqv1DqUwvGxHkXsrucICn8la1Vb6Yl6Eg8mPScGwUiqHJeE7diXlzaK+QMA9m4Gxw==} dependencies: - '@types/node': 17.0.13 + '@types/node': 12.20.42 dev: false /@types/json-schema/7.0.9: @@ -2237,13 +2239,13 @@ packages: /@types/jsonwebtoken/8.5.8: resolution: {integrity: sha512-zm6xBQpFDIDM6o9r6HSgDeIcLy82TKWctCXEPbJJcXb5AKmi5BNNdLXneixK4lplX3PqIVcwLBCGE/kAGnlD4A==} dependencies: - '@types/node': 17.0.13 + '@types/node': 12.20.42 dev: false /@types/jws/3.2.4: resolution: {integrity: sha512-aqtH4dPw1wUjFZaeMD1ak/pf8iXlu/odFe+trJrvw0g1sTh93i+SCykg0Ek8C6B7rVK3oBORbfZAsKO7P10etg==} dependencies: - '@types/node': 17.0.13 + '@types/node': 12.20.42 dev: false /@types/jwt-decode/2.2.1: @@ -2261,7 +2263,7 @@ packages: /@types/md5/2.3.1: resolution: {integrity: sha512-OK3oe+ALIoPSo262lnhAYwpqFNXbiwH2a+0+Z5YBnkQEwWD8fk5+PIeRhYA48PzvX9I4SGNpWy+9bLj8qz92RQ==} dependencies: - '@types/node': 17.0.13 + '@types/node': 12.20.42 dev: false /@types/mime/1.3.2: @@ -2287,13 +2289,13 @@ packages: /@types/mock-fs/4.13.1: resolution: {integrity: sha512-m6nFAJ3lBSnqbvDZioawRvpLXSaPyn52Srf7OfzjubYbYX8MTUdIgDxQl0wEapm4m/pNYSd9TXocpQ0TvZFlYA==} dependencies: - '@types/node': 17.0.13 + '@types/node': 12.20.42 dev: false /@types/mock-require/2.0.1: resolution: {integrity: sha512-O7U5DVGboY/Crueb5/huUCIRjKtRVRaLmRDbZJBlDQgJn966z3aiFDN+6AtYviu2ExwMkl34LjT/IiC0OPtKuQ==} dependencies: - '@types/node': 17.0.13 + '@types/node': 12.20.42 dev: false /@types/ms/0.7.31: @@ -2307,7 +2309,7 @@ packages: /@types/node-fetch/2.5.12: resolution: {integrity: sha512-MKgC4dlq4kKNa/mYrwpKfzQMB5X3ee5U6fSprkKpToBqBmX4nFZL9cW5jl6sWn+xpRJ7ypWh2yyqqr8UUCstSw==} dependencies: - '@types/node': 17.0.13 + '@types/node': 12.20.42 form-data: 3.0.1 dev: false @@ -2342,7 +2344,7 @@ packages: /@types/resolve/1.17.1: resolution: {integrity: sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==} dependencies: - '@types/node': 17.0.13 + '@types/node': 12.20.42 dev: false /@types/semaphore/1.1.1: @@ -2353,7 +2355,7 @@ packages: resolution: {integrity: sha512-nCkHGI4w7ZgAdNkrEu0bv+4xNV/XDqW+DydknebMOQwkpDGx8G+HTlj7R7ABI8i8nKxVw0wtKPi1D+lPOkh4YQ==} dependencies: '@types/mime': 1.3.2 - '@types/node': 17.0.13 + '@types/node': 12.20.42 dev: false /@types/sinon/10.0.8: @@ -2375,7 +2377,7 @@ packages: /@types/stoppable/1.1.1: resolution: {integrity: sha512-b8N+fCADRIYYrGZOcmOR8ZNBOqhktWTB/bMUl5LvGtT201QKJZOOH5UsFyI3qtteM6ZAJbJqZoBcLqqxKIwjhw==} dependencies: - '@types/node': 17.0.13 + '@types/node': 12.20.42 dev: false /@types/tough-cookie/4.0.1: @@ -2385,13 +2387,13 @@ packages: /@types/tunnel/0.0.1: resolution: {integrity: sha512-AOqu6bQu5MSWwYvehMXLukFHnupHrpZ8nvgae5Ggie9UwzDR1CCwoXgSSWNZJuyOlCdfdsWMA5F2LlmvyoTv8A==} dependencies: - '@types/node': 17.0.13 + '@types/node': 12.20.42 dev: false /@types/tunnel/0.0.3: resolution: {integrity: sha512-sOUTGn6h1SfQ+gbgqC364jLFBw2lnFqkgF3q0WovEHRLMrVD1sd5aufqi/aJObLekJO+Aq5z646U4Oxy6shXMA==} dependencies: - '@types/node': 17.0.13 + '@types/node': 12.20.42 dev: false /@types/underscore/1.11.4: @@ -2405,26 +2407,26 @@ packages: /@types/ws/7.4.7: resolution: {integrity: sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==} dependencies: - '@types/node': 17.0.13 + '@types/node': 12.20.42 dev: false /@types/ws/8.2.2: resolution: {integrity: sha512-NOn5eIcgWLOo6qW8AcuLZ7G8PycXu0xTxxkS6Q18VWFxgPUSOwV0pBj2a/4viNZVu25i7RIB7GttdkAIUUXOOg==} dependencies: - '@types/node': 17.0.13 + '@types/node': 12.20.42 dev: false /@types/xml2js/0.4.9: resolution: {integrity: sha512-CHiCKIihl1pychwR2RNX5mAYmJDACgFVCMT5OArMaO3erzwXVcBqPcusr+Vl8yeeXukxZqtF8mZioqX+mpjjdw==} dependencies: - '@types/node': 17.0.13 + '@types/node': 12.20.42 dev: false /@types/yauzl/2.9.2: resolution: {integrity: sha512-8uALY5LTvSuHgloDVUvWP3pIauILm+8/0pDMokuDYIoNsOkSwd5AiHBTSEJjKTDcZr5z8UpgOWZkxBF4iJftoA==} requiresBuild: true dependencies: - '@types/node': 17.0.13 + '@types/node': 12.20.42 dev: false optional: true @@ -3693,7 +3695,7 @@ packages: dependencies: '@types/cookie': 0.4.1 '@types/cors': 2.8.12 - '@types/node': 17.0.13 + '@types/node': 12.20.42 accepts: 1.3.7 base64id: 2.0.0 cookie: 0.4.1 @@ -8782,7 +8784,7 @@ packages: dev: false file:projects/ai-document-translator.tgz: - resolution: {integrity: sha512-UuJeVOwRAi2feGCvUkQqm2Ja6ezmDCMeqL2nUP8n3j/6U70oSbyE2k5Eqte3YwK6ApBbwFd3gQztashUpB3hIA==, tarball: file:projects/ai-document-translator.tgz} + resolution: {integrity: sha512-zozcQnuyn2AHp1noXpJiELpHf3M5jnmcfbwIPGe6noz7Hx88+wzVeV+mx4/07BEr+3499X5rTrMDD6crnevR3Q==, tarball: file:projects/ai-document-translator.tgz} name: '@rush-temp/ai-document-translator' version: 0.0.0 dependencies: @@ -8822,7 +8824,6 @@ packages: transitivePeerDependencies: - bufferutil - debug - - encoding - supports-color - utf-8-validate dev: false @@ -10707,6 +10708,31 @@ packages: - supports-color dev: false + file:projects/arm-logz.tgz: + resolution: {integrity: sha512-vTNt9MrVGUEcHG7kqNR34en9M99eu7l8RGZroqDcIcwcAWbsA19M5ueCPsTpazv1RbiY7LveKgLsiu0icB/DCQ==, tarball: file:projects/arm-logz.tgz} + name: '@rush-temp/arm-logz' + version: 0.0.0 + dependencies: + '@azure-tools/test-recorder': 1.0.2 + '@microsoft/api-extractor': 7.19.4 + '@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 + transitivePeerDependencies: + - encoding + - supports-color + dev: false + file:projects/arm-machinelearningcompute.tgz: resolution: {integrity: sha512-MASxoXTGPlsyS9vTB2LQkDGH9XAv1ex3a2A2GrU/T35OX6DXyLrnyZwLfxhdoGuNLoUN1AiZaMNzxusu3G9dqQ==, tarball: file:projects/arm-machinelearningcompute.tgz} name: '@rush-temp/arm-machinelearningcompute' @@ -13235,7 +13261,7 @@ packages: dev: false file:projects/core-client-1.tgz: - resolution: {integrity: sha512-VJDaBigC7m/RLkZKPK3expFqrcb6FrhVErkxSTck77oDo+P1S5ZOiZrP0Ma8cuias//+fwTjCGm48rsGSr8rbA==, tarball: file:projects/core-client-1.tgz} + resolution: {integrity: sha512-36Z3KNLPXfY5EZKDK1mY7EvHsv5/IbUHOhdqlHS2E+oz0Vle+EH9lp8d/QUozpaW/yq7IUdI3pKzgY9yhQ3phg==, tarball: file:projects/core-client-1.tgz} name: '@rush-temp/core-client-1' version: 0.0.0 dependencies: @@ -13363,7 +13389,7 @@ packages: dev: false file:projects/core-client.tgz: - resolution: {integrity: sha512-Xwvmnur0oqRGATJk6ScXN7bEK1gfgULs+OzrdIaiqCXTtB42NDDxNtOxDvN3RNbzP/9u8oV+XVdtaA2qzN8bRw==, tarball: file:projects/core-client.tgz} + resolution: {integrity: sha512-PtXu2tdeBOmMdUlWxsxh9SUxhJtzjYmhjy0BpwJFkGaLIqcriWwrRLJaXlNr6CMjB3v7cm5o3gV60MJDbzSyKA==, tarball: file:projects/core-client.tgz} name: '@rush-temp/core-client' version: 0.0.0 dependencies: @@ -14072,7 +14098,7 @@ packages: dev: false file:projects/event-hubs.tgz: - resolution: {integrity: sha512-ojLvhm10+tt8QAPXgfzzntZZgb/XxpPCtXvq9A1P9FiPRSjTKKukRezRUr8cQQMcznu/wN1HK2RBLNI3mDtBIw==, tarball: file:projects/event-hubs.tgz} + resolution: {integrity: sha512-pBrhEn6e2Di9awJaS8boEUBHwzLdLA6udItp6pqvGjjIl4LqQZSlYinDrlevKddv+aijwT0GXH1VcJJ8ANBxZQ==, tarball: file:projects/event-hubs.tgz} name: '@rush-temp/event-hubs' version: 0.0.0 dependencies: @@ -14519,7 +14545,7 @@ packages: dev: false file:projects/iot-modelsrepository.tgz: - resolution: {integrity: sha512-CkwX4EaeV2CNizJBlNXplmjoFNBTGSl9oComMh5pqwu9C+JQZeZXSgtxY7HLFm23z9GattcF92b7tAuTXwDxig==, tarball: file:projects/iot-modelsrepository.tgz} + resolution: {integrity: sha512-8vv01i7TIUzwOzsmvb9iY/zEq50GhIT3TAv/ZQhK1nrfqAghvFK7M4tChn+oErNgLkI8ltad4XV4MKG/jyZOmg==, tarball: file:projects/iot-modelsrepository.tgz} name: '@rush-temp/iot-modelsrepository' version: 0.0.0 dependencies: @@ -14571,7 +14597,6 @@ packages: - '@swc/wasm' - bufferutil - debug - - encoding - supports-color - utf-8-validate dev: false @@ -15395,7 +15420,7 @@ packages: dev: false file:projects/perf-search-documents.tgz: - resolution: {integrity: sha512-bWYNxuFrCq2vaETECiEOezIqefS87rjYMH1x78m9obtk1B2SHnjhPZafV29/nHiI3q+DL0jVlydcJSyI4e2USg==, tarball: file:projects/perf-search-documents.tgz} + resolution: {integrity: sha512-lm2jxNxZPi6K3EJMmT1OVMu8/+XCk7bapbkkAQ+HF0AJNYTBkgaZ9Yi1P9st98WlNjPixw7HstE8Hu5otIY+Yw==, tarball: file:projects/perf-search-documents.tgz} name: '@rush-temp/perf-search-documents' version: 0.0.0 dependencies: @@ -16421,7 +16446,7 @@ packages: dev: false file:projects/synapse-access-control.tgz: - resolution: {integrity: sha512-RrX0ZFtx73mCi07Igdjx6J17qXeIE53eedvytz+T/pqRImRv9wHdAtB0dt0HQMRhXZu8Yq0IvpCNRPoJVxWBfQ==, tarball: file:projects/synapse-access-control.tgz} + resolution: {integrity: sha512-r+K5go02ZzvB1eNv2HgJluelwAinqtfhWqRX4/yV5lfL7RMk3gizbot6n8Ne8aBVxiXRWPNRDKnEz9l8bTju7Q==, tarball: file:projects/synapse-access-control.tgz} name: '@rush-temp/synapse-access-control' version: 0.0.0 dependencies: @@ -16472,13 +16497,12 @@ packages: - '@swc/wasm' - bufferutil - debug - - encoding - supports-color - utf-8-validate dev: false file:projects/synapse-artifacts.tgz: - resolution: {integrity: sha512-YxJBI8or6XEUHmUQrCXKBqLbfjF+ThYrhJHRFlA9hynfKoGKuXmoIsOWGcScO9ZPT6B3UFqQgMZ6e485WyagLA==, tarball: file:projects/synapse-artifacts.tgz} + resolution: {integrity: sha512-KtQYlsVRkcz2GDW/LadS55O5Y1OZNEmKcrCsRF9MHT45Q4BkTat50HPy+xYWEHKa/v/UNeHVAiOuRMDPf252Nw==, tarball: file:projects/synapse-artifacts.tgz} name: '@rush-temp/synapse-artifacts' version: 0.0.0 dependencies: @@ -16526,7 +16550,6 @@ packages: - '@swc/wasm' - bufferutil - debug - - encoding - supports-color - utf-8-validate dev: false diff --git a/rush.json b/rush.json index bb1a03ea6c55..391b9e188fb7 100644 --- a/rush.json +++ b/rush.json @@ -1584,6 +1584,11 @@ "packageName": "@azure/arm-kusto", "projectFolder": "sdk/kusto/arm-kusto", "versionPolicyName": "management" + }, + { + "packageName": "@azure/arm-logz", + "projectFolder": "sdk/logz/arm-logz", + "versionPolicyName": "management" } ] -} +} \ No newline at end of file diff --git a/sdk/logz/arm-logz/CHANGELOG.md b/sdk/logz/arm-logz/CHANGELOG.md new file mode 100644 index 000000000000..a883902b6776 --- /dev/null +++ b/sdk/logz/arm-logz/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0 (2022-02-03) + +The package of @azure/arm-logz 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/logz/arm-logz/LICENSE b/sdk/logz/arm-logz/LICENSE new file mode 100644 index 000000000000..5d1d36e0af80 --- /dev/null +++ b/sdk/logz/arm-logz/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/logz/arm-logz/README.md b/sdk/logz/arm-logz/README.md new file mode 100644 index 000000000000..3a44d4079461 --- /dev/null +++ b/sdk/logz/arm-logz/README.md @@ -0,0 +1,98 @@ +# Azure Service client library for JavaScript + +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure Service client. + + + +[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/logz/arm-logz) | +[Package (NPM)](https://www.npmjs.com/package/@azure/arm-logz) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-logz) | +[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-logz` package + +Install the Azure Service client library for JavaScript with `npm`: + +```bash +npm install @azure/arm-logz +``` + +### Create and authenticate a `MicrosoftLogz` + +To create a client object to access the Azure Service API, you will need the `endpoint` of your Azure Service resource and a `credential`. The Azure Service client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azure Service resource in the [Azure Portal][azure_portal]. + +You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). + +To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package: + +```bash +npm install @azure/identity +``` + +You will also need to **register a new AAD application and grant access to Azure Service** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). +Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`. + +For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). + +```javascript +const { MicrosoftLogz } = require("@azure/arm-logz"); +const { DefaultAzureCredential } = require("@azure/identity"); +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new MicrosoftLogz(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 + +### MicrosoftLogz + +`MicrosoftLogz` is the primary interface for developers using the Azure Service client library. Explore the methods on this client object to understand the different features of the Azure Service service that you can access. + +## Troubleshooting + +### Logging + +Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: + +```javascript +const { setLogLevel } = require("@azure/logger"); +setLogLevel("info"); +``` + +For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger). + +## Next steps + +Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. + +## Contributing + +If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code. + +## Related projects + +- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Flogz%2Farm-logz%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/logz/arm-logz/_meta.json b/sdk/logz/arm-logz/_meta.json new file mode 100644 index 000000000000..f4b96f95f639 --- /dev/null +++ b/sdk/logz/arm-logz/_meta.json @@ -0,0 +1,7 @@ +{ + "commit": "3cfe6a443fab46ae08d6d5f91b85e5b63652cea4", + "readme": "specification/logz/resource-manager/readme.md", + "autorest_command": "autorest --version=3.7.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/logz/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20220105.1", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "use": "@autorest/typescript@6.0.0-alpha.16.20220105.1" +} \ No newline at end of file diff --git a/sdk/logz/arm-logz/api-extractor.json b/sdk/logz/arm-logz/api-extractor.json new file mode 100644 index 000000000000..458e2fb2acab --- /dev/null +++ b/sdk/logz/arm-logz/api-extractor.json @@ -0,0 +1,31 @@ +{ + "$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-logz.d.ts" + }, + "messages": { + "tsdocMessageReporting": { + "default": { + "logLevel": "none" + } + }, + "extractorMessageReporting": { + "ae-missing-release-tag": { + "logLevel": "none" + }, + "ae-unresolved-link": { + "logLevel": "none" + } + } + } +} \ No newline at end of file diff --git a/sdk/logz/arm-logz/package.json b/sdk/logz/arm-logz/package.json new file mode 100644 index 000000000000..cae4430246ec --- /dev/null +++ b/sdk/logz/arm-logz/package.json @@ -0,0 +1,102 @@ +{ + "name": "@azure/arm-logz", + "sdk-type": "mgmt", + "author": "Microsoft Corporation", + "description": "A generated SDK for MicrosoftLogz.", + "version": "1.0.0", + "engines": { + "node": ">=12.0.0" + }, + "dependencies": { + "@azure/core-lro": "^2.2.0", + "@azure/abort-controller": "^1.0.0", + "@azure/core-paging": "^1.2.0", + "@azure/core-client": "^1.0.0", + "@azure/core-auth": "^1.3.0", + "@azure/core-rest-pipeline": "^1.1.0", + "tslib": "^2.2.0" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "license": "MIT", + "main": "./dist/index.js", + "module": "./dist-esm/src/index.js", + "types": "./types/arm-logz.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/logz/arm-logz", + "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 +} \ No newline at end of file diff --git a/sdk/logz/arm-logz/review/arm-logz.api.md b/sdk/logz/arm-logz/review/arm-logz.api.md new file mode 100644 index 000000000000..fe7f73527c5b --- /dev/null +++ b/sdk/logz/arm-logz/review/arm-logz.api.md @@ -0,0 +1,859 @@ +## API Report File for "@azure/arm-logz" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import * as coreAuth from '@azure/core-auth'; +import * as coreClient from '@azure/core-client'; +import { PagedAsyncIterableIterator } from '@azure/core-paging'; +import { PollerLike } from '@azure/core-lro'; +import { PollOperationState } from '@azure/core-lro'; + +// @public +export type CreatedByType = 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 interface FilteringTag { + action?: TagAction; + name?: string; + value?: string; +} + +// @public (undocumented) +export interface IdentityProperties { + readonly principalId?: string; + readonly tenantId?: string; + // (undocumented) + type?: ManagedIdentityTypes; +} + +// @public +export enum KnownCreatedByType { + // (undocumented) + Application = "Application", + // (undocumented) + Key = "Key", + // (undocumented) + ManagedIdentity = "ManagedIdentity", + // (undocumented) + User = "User" +} + +// @public +export enum KnownLiftrResourceCategories { + // (undocumented) + MonitorLogs = "MonitorLogs", + // (undocumented) + Unknown = "Unknown" +} + +// @public +export enum KnownManagedIdentityTypes { + // (undocumented) + SystemAssigned = "SystemAssigned", + // (undocumented) + UserAssigned = "UserAssigned" +} + +// @public +export enum KnownMarketplaceSubscriptionStatus { + // (undocumented) + Active = "Active", + // (undocumented) + Suspended = "Suspended" +} + +// @public +export enum KnownMonitoringStatus { + // (undocumented) + Disabled = "Disabled", + // (undocumented) + Enabled = "Enabled" +} + +// @public +export enum KnownProvisioningState { + // (undocumented) + Accepted = "Accepted", + // (undocumented) + Canceled = "Canceled", + // (undocumented) + Creating = "Creating", + // (undocumented) + Deleted = "Deleted", + // (undocumented) + Deleting = "Deleting", + // (undocumented) + Failed = "Failed", + // (undocumented) + NotSpecified = "NotSpecified", + // (undocumented) + Succeeded = "Succeeded", + // (undocumented) + Updating = "Updating" +} + +// @public +export enum KnownSingleSignOnStates { + // (undocumented) + Disable = "Disable", + // (undocumented) + Enable = "Enable", + // (undocumented) + Existing = "Existing", + // (undocumented) + Initial = "Initial" +} + +// @public +export enum KnownTagAction { + // (undocumented) + Exclude = "Exclude", + // (undocumented) + Include = "Include" +} + +// @public +export enum KnownUserRole { + // (undocumented) + Admin = "Admin", + // (undocumented) + None = "None", + // (undocumented) + User = "User" +} + +// @public +export enum KnownVMHostUpdateStates { + // (undocumented) + Delete = "Delete", + // (undocumented) + Install = "Install" +} + +// @public +export type LiftrResourceCategories = string; + +// @public +export interface LogRules { + filteringTags?: FilteringTag[]; + sendAadLogs?: boolean; + sendActivityLogs?: boolean; + sendSubscriptionLogs?: boolean; +} + +// @public (undocumented) +export interface LogzMonitorResource { + readonly id?: string; + // (undocumented) + identity?: IdentityProperties; + // (undocumented) + location: string; + readonly name?: string; + properties?: MonitorProperties; + readonly systemData?: SystemData; + tags?: { + [propertyName: string]: string; + }; + readonly type?: string; +} + +// @public +export interface LogzMonitorResourceListResponse { + nextLink?: string; + value?: LogzMonitorResource[]; +} + +// @public +export interface LogzMonitorResourceUpdateParameters { + properties?: MonitorUpdateProperties; + tags?: { + [propertyName: string]: string; + }; +} + +// @public (undocumented) +export interface LogzOrganizationProperties { + companyName?: string; + enterpriseAppId?: string; + readonly id?: string; + singleSignOnUrl?: string; +} + +// @public (undocumented) +export interface LogzSingleSignOnProperties { + enterpriseAppId?: string; + readonly provisioningState?: ProvisioningState; + singleSignOnState?: SingleSignOnStates; + singleSignOnUrl?: string; +} + +// @public (undocumented) +export interface LogzSingleSignOnResource { + readonly id?: string; + readonly name?: string; + // (undocumented) + properties?: LogzSingleSignOnProperties; + readonly systemData?: SystemData; + readonly type?: string; +} + +// @public +export interface LogzSingleSignOnResourceListResponse { + nextLink?: string; + value?: LogzSingleSignOnResource[]; +} + +// @public +export type ManagedIdentityTypes = string; + +// @public +export type MarketplaceSubscriptionStatus = string; + +// @public (undocumented) +export class MicrosoftLogz extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: MicrosoftLogzOptionalParams); + // (undocumented) + apiVersion: string; + // (undocumented) + monitor: Monitor; + // (undocumented) + monitors: Monitors; + // (undocumented) + operations: Operations; + // (undocumented) + singleSignOn: SingleSignOn; + // (undocumented) + subAccount: SubAccount; + // (undocumented) + subAccountTagRules: SubAccountTagRules; + // (undocumented) + subscriptionId: string; + // (undocumented) + tagRules: TagRules; +} + +// @public +export interface MicrosoftLogzOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + apiVersion?: string; + endpoint?: string; +} + +// @public +export interface Monitor { + listVMHosts(resourceGroupName: string, monitorName: string, options?: MonitorListVMHostsOptionalParams): PagedAsyncIterableIterator; + listVmHostUpdate(resourceGroupName: string, monitorName: string, options?: MonitorListVmHostUpdateOptionalParams): PagedAsyncIterableIterator; + vMHostPayload(resourceGroupName: string, monitorName: string, options?: MonitorVMHostPayloadOptionalParams): Promise; +} + +// @public +export interface MonitoredResource { + id?: string; + reasonForLogsStatus?: string; + reasonForMetricsStatus?: string; + sendingLogs?: boolean; + sendingMetrics?: boolean; + readonly systemData?: SystemData; +} + +// @public +export interface MonitoredResourceListResponse { + nextLink?: string; + value?: MonitoredResource[]; +} + +// @public +export type MonitoringStatus = string; + +// @public +export interface MonitoringTagRules { + readonly id?: string; + readonly name?: string; + properties?: MonitoringTagRulesProperties; + readonly systemData?: SystemData; + readonly type?: string; +} + +// @public +export interface MonitoringTagRulesListResponse { + nextLink?: string; + value?: MonitoringTagRules[]; +} + +// @public +export interface MonitoringTagRulesProperties { + logRules?: LogRules; + readonly provisioningState?: ProvisioningState; + readonly systemData?: SystemData; +} + +// @public +export interface MonitorListVMHostsNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MonitorListVMHostsNextResponse = VMResourcesListResponse; + +// @public +export interface MonitorListVMHostsOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MonitorListVMHostsResponse = VMResourcesListResponse; + +// @public +export interface MonitorListVmHostUpdateNextOptionalParams extends coreClient.OperationOptions { + body?: VMHostUpdateRequest; +} + +// @public +export type MonitorListVmHostUpdateNextResponse = VMResourcesListResponse; + +// @public +export interface MonitorListVmHostUpdateOptionalParams extends coreClient.OperationOptions { + body?: VMHostUpdateRequest; +} + +// @public +export type MonitorListVmHostUpdateResponse = VMResourcesListResponse; + +// @public +export interface MonitorProperties { + readonly liftrResourceCategory?: LiftrResourceCategories; + readonly liftrResourcePreference?: number; + // (undocumented) + logzOrganizationProperties?: LogzOrganizationProperties; + marketplaceSubscriptionStatus?: MarketplaceSubscriptionStatus; + monitoringStatus?: MonitoringStatus; + // (undocumented) + planData?: PlanData; + readonly provisioningState?: ProvisioningState; + // (undocumented) + userInfo?: UserInfo; +} + +// @public +export interface Monitors { + beginCreate(resourceGroupName: string, monitorName: string, options?: MonitorsCreateOptionalParams): Promise, MonitorsCreateResponse>>; + beginCreateAndWait(resourceGroupName: string, monitorName: string, options?: MonitorsCreateOptionalParams): Promise; + beginDelete(resourceGroupName: string, monitorName: string, options?: MonitorsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, monitorName: string, options?: MonitorsDeleteOptionalParams): Promise; + get(resourceGroupName: string, monitorName: string, options?: MonitorsGetOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, options?: MonitorsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listBySubscription(options?: MonitorsListBySubscriptionOptionalParams): PagedAsyncIterableIterator; + listMonitoredResources(resourceGroupName: string, monitorName: string, options?: MonitorsListMonitoredResourcesOptionalParams): PagedAsyncIterableIterator; + listUserRoles(resourceGroupName: string, monitorName: string, options?: MonitorsListUserRolesOptionalParams): PagedAsyncIterableIterator; + update(resourceGroupName: string, monitorName: string, options?: MonitorsUpdateOptionalParams): Promise; +} + +// @public +export interface MonitorsCreateOptionalParams extends coreClient.OperationOptions { + // (undocumented) + body?: LogzMonitorResource; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type MonitorsCreateResponse = LogzMonitorResource; + +// @public +export interface MonitorsDeleteHeaders { + location?: string; +} + +// @public +export interface MonitorsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface MonitorsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MonitorsGetResponse = LogzMonitorResource; + +// @public +export interface MonitorsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MonitorsListByResourceGroupNextResponse = LogzMonitorResourceListResponse; + +// @public +export interface MonitorsListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MonitorsListByResourceGroupResponse = LogzMonitorResourceListResponse; + +// @public +export interface MonitorsListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MonitorsListBySubscriptionNextResponse = LogzMonitorResourceListResponse; + +// @public +export interface MonitorsListBySubscriptionOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MonitorsListBySubscriptionResponse = LogzMonitorResourceListResponse; + +// @public +export interface MonitorsListMonitoredResourcesNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MonitorsListMonitoredResourcesNextResponse = MonitoredResourceListResponse; + +// @public +export interface MonitorsListMonitoredResourcesOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MonitorsListMonitoredResourcesResponse = MonitoredResourceListResponse; + +// @public +export interface MonitorsListUserRolesNextOptionalParams extends coreClient.OperationOptions { + body?: UserRoleRequest; +} + +// @public +export type MonitorsListUserRolesNextResponse = UserRoleListResponse; + +// @public +export interface MonitorsListUserRolesOptionalParams extends coreClient.OperationOptions { + body?: UserRoleRequest; +} + +// @public +export type MonitorsListUserRolesResponse = UserRoleListResponse; + +// @public +export interface MonitorsUpdateOptionalParams extends coreClient.OperationOptions { + body?: LogzMonitorResourceUpdateParameters; +} + +// @public +export type MonitorsUpdateResponse = LogzMonitorResource; + +// @public +export interface MonitorUpdateProperties { + monitoringStatus?: MonitoringStatus; +} + +// @public +export interface MonitorVMHostPayloadOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MonitorVMHostPayloadResponse = VMExtensionPayload; + +// @public +export interface OperationDisplay { + description?: string; + operation?: string; + provider?: string; + resource?: string; +} + +// @public +export interface OperationListResult { + nextLink?: string; + value?: OperationResult[]; +} + +// @public +export interface OperationResult { + display?: OperationDisplay; + isDataAction?: boolean; + name?: string; + origin?: string; +} + +// @public +export interface Operations { + list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface OperationsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListNextResponse = OperationListResult; + +// @public +export interface OperationsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListResponse = OperationListResult; + +// @public (undocumented) +export interface PlanData { + billingCycle?: string; + effectiveDate?: Date; + planDetails?: string; + usageType?: string; +} + +// @public +export type ProvisioningState = string; + +// @public +export interface SingleSignOn { + beginCreateOrUpdate(resourceGroupName: string, monitorName: string, configurationName: string, options?: SingleSignOnCreateOrUpdateOptionalParams): Promise, SingleSignOnCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, monitorName: string, configurationName: string, options?: SingleSignOnCreateOrUpdateOptionalParams): Promise; + get(resourceGroupName: string, monitorName: string, configurationName: string, options?: SingleSignOnGetOptionalParams): Promise; + list(resourceGroupName: string, monitorName: string, options?: SingleSignOnListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface SingleSignOnCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + // (undocumented) + body?: LogzSingleSignOnResource; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type SingleSignOnCreateOrUpdateResponse = LogzSingleSignOnResource; + +// @public +export interface SingleSignOnGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SingleSignOnGetResponse = LogzSingleSignOnResource; + +// @public +export interface SingleSignOnListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SingleSignOnListNextResponse = LogzSingleSignOnResourceListResponse; + +// @public +export interface SingleSignOnListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SingleSignOnListResponse = LogzSingleSignOnResourceListResponse; + +// @public +export type SingleSignOnStates = string; + +// @public +export interface SubAccount { + beginCreate(resourceGroupName: string, monitorName: string, subAccountName: string, options?: SubAccountCreateOptionalParams): Promise, SubAccountCreateResponse>>; + beginCreateAndWait(resourceGroupName: string, monitorName: string, subAccountName: string, options?: SubAccountCreateOptionalParams): Promise; + beginDelete(resourceGroupName: string, monitorName: string, subAccountName: string, options?: SubAccountDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, monitorName: string, subAccountName: string, options?: SubAccountDeleteOptionalParams): Promise; + get(resourceGroupName: string, monitorName: string, subAccountName: string, options?: SubAccountGetOptionalParams): Promise; + list(resourceGroupName: string, monitorName: string, options?: SubAccountListOptionalParams): PagedAsyncIterableIterator; + listMonitoredResources(resourceGroupName: string, monitorName: string, subAccountName: string, options?: SubAccountListMonitoredResourcesOptionalParams): PagedAsyncIterableIterator; + listVMHosts(resourceGroupName: string, monitorName: string, subAccountName: string, options?: SubAccountListVMHostsOptionalParams): PagedAsyncIterableIterator; + listVmHostUpdate(resourceGroupName: string, monitorName: string, subAccountName: string, options?: SubAccountListVmHostUpdateOptionalParams): PagedAsyncIterableIterator; + update(resourceGroupName: string, monitorName: string, subAccountName: string, options?: SubAccountUpdateOptionalParams): Promise; + vMHostPayload(resourceGroupName: string, monitorName: string, subAccountName: string, options?: SubAccountVMHostPayloadOptionalParams): Promise; +} + +// @public +export interface SubAccountCreateOptionalParams extends coreClient.OperationOptions { + // (undocumented) + body?: LogzMonitorResource; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type SubAccountCreateResponse = LogzMonitorResource; + +// @public +export interface SubAccountDeleteHeaders { + location?: string; +} + +// @public +export interface SubAccountDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface SubAccountGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SubAccountGetResponse = LogzMonitorResource; + +// @public +export interface SubAccountListMonitoredResourcesNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SubAccountListMonitoredResourcesNextResponse = MonitoredResourceListResponse; + +// @public +export interface SubAccountListMonitoredResourcesOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SubAccountListMonitoredResourcesResponse = MonitoredResourceListResponse; + +// @public +export interface SubAccountListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SubAccountListNextResponse = LogzMonitorResourceListResponse; + +// @public +export interface SubAccountListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SubAccountListResponse = LogzMonitorResourceListResponse; + +// @public +export interface SubAccountListVMHostsNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SubAccountListVMHostsNextResponse = VMResourcesListResponse; + +// @public +export interface SubAccountListVMHostsOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SubAccountListVMHostsResponse = VMResourcesListResponse; + +// @public +export interface SubAccountListVmHostUpdateNextOptionalParams extends coreClient.OperationOptions { + body?: VMHostUpdateRequest; +} + +// @public +export type SubAccountListVmHostUpdateNextResponse = VMResourcesListResponse; + +// @public +export interface SubAccountListVmHostUpdateOptionalParams extends coreClient.OperationOptions { + body?: VMHostUpdateRequest; +} + +// @public +export type SubAccountListVmHostUpdateResponse = VMResourcesListResponse; + +// @public +export interface SubAccountTagRules { + createOrUpdate(resourceGroupName: string, monitorName: string, subAccountName: string, ruleSetName: string, options?: SubAccountTagRulesCreateOrUpdateOptionalParams): Promise; + delete(resourceGroupName: string, monitorName: string, subAccountName: string, ruleSetName: string, options?: SubAccountTagRulesDeleteOptionalParams): Promise; + get(resourceGroupName: string, monitorName: string, subAccountName: string, ruleSetName: string, options?: SubAccountTagRulesGetOptionalParams): Promise; + list(resourceGroupName: string, monitorName: string, subAccountName: string, options?: SubAccountTagRulesListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface SubAccountTagRulesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + body?: MonitoringTagRules; +} + +// @public +export type SubAccountTagRulesCreateOrUpdateResponse = MonitoringTagRules; + +// @public +export interface SubAccountTagRulesDeleteHeaders { + location?: string; +} + +// @public +export interface SubAccountTagRulesDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SubAccountTagRulesDeleteResponse = SubAccountTagRulesDeleteHeaders; + +// @public +export interface SubAccountTagRulesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SubAccountTagRulesGetResponse = MonitoringTagRules; + +// @public +export interface SubAccountTagRulesListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SubAccountTagRulesListNextResponse = MonitoringTagRulesListResponse; + +// @public +export interface SubAccountTagRulesListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SubAccountTagRulesListResponse = MonitoringTagRulesListResponse; + +// @public +export interface SubAccountUpdateOptionalParams extends coreClient.OperationOptions { + body?: LogzMonitorResourceUpdateParameters; +} + +// @public +export type SubAccountUpdateResponse = LogzMonitorResource; + +// @public +export interface SubAccountVMHostPayloadOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SubAccountVMHostPayloadResponse = VMExtensionPayload; + +// @public +export interface SystemData { + createdAt?: Date; + createdBy?: string; + createdByType?: CreatedByType; + lastModifiedAt?: Date; + lastModifiedBy?: string; + lastModifiedByType?: CreatedByType; +} + +// @public +export type TagAction = string; + +// @public +export interface TagRules { + createOrUpdate(resourceGroupName: string, monitorName: string, ruleSetName: string, options?: TagRulesCreateOrUpdateOptionalParams): Promise; + delete(resourceGroupName: string, monitorName: string, ruleSetName: string, options?: TagRulesDeleteOptionalParams): Promise; + get(resourceGroupName: string, monitorName: string, ruleSetName: string, options?: TagRulesGetOptionalParams): Promise; + list(resourceGroupName: string, monitorName: string, options?: TagRulesListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface TagRulesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + body?: MonitoringTagRules; +} + +// @public +export type TagRulesCreateOrUpdateResponse = MonitoringTagRules; + +// @public +export interface TagRulesDeleteHeaders { + location?: string; +} + +// @public +export interface TagRulesDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TagRulesDeleteResponse = TagRulesDeleteHeaders; + +// @public +export interface TagRulesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TagRulesGetResponse = MonitoringTagRules; + +// @public +export interface TagRulesListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TagRulesListNextResponse = MonitoringTagRulesListResponse; + +// @public +export interface TagRulesListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TagRulesListResponse = MonitoringTagRulesListResponse; + +// @public (undocumented) +export interface UserInfo { + emailAddress?: string; + firstName?: string; + lastName?: string; + phoneNumber?: string; +} + +// @public +export type UserRole = string; + +// @public +export interface UserRoleListResponse { + nextLink?: string; + value?: UserRoleResponse[]; +} + +// @public +export interface UserRoleRequest { + emailAddress?: string; +} + +// @public +export interface UserRoleResponse { + role?: UserRole; +} + +// @public +export interface VMExtensionPayload { + apiKey?: string; + region?: string; +} + +// @public +export interface VMHostUpdateRequest { + state?: VMHostUpdateStates; + vmResourceIds?: VMResources[]; +} + +// @public +export type VMHostUpdateStates = string; + +// @public +export interface VMResources { + agentVersion?: string; + id?: string; +} + +// @public +export interface VMResourcesListResponse { + nextLink?: string; + value?: VMResources[]; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/logz/arm-logz/rollup.config.js b/sdk/logz/arm-logz/rollup.config.js new file mode 100644 index 000000000000..9be1955eb7f1 --- /dev/null +++ b/sdk/logz/arm-logz/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/logz/arm-logz/src/index.ts b/sdk/logz/arm-logz/src/index.ts new file mode 100644 index 000000000000..2b870d9ea062 --- /dev/null +++ b/sdk/logz/arm-logz/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 { MicrosoftLogz } from "./microsoftLogz"; +export * from "./operationsInterfaces"; diff --git a/sdk/logz/arm-logz/src/lroImpl.ts b/sdk/logz/arm-logz/src/lroImpl.ts new file mode 100644 index 000000000000..518d5f053b4e --- /dev/null +++ b/sdk/logz/arm-logz/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/logz/arm-logz/src/microsoftLogz.ts b/sdk/logz/arm-logz/src/microsoftLogz.ts new file mode 100644 index 000000000000..d941f2b5207c --- /dev/null +++ b/sdk/logz/arm-logz/src/microsoftLogz.ts @@ -0,0 +1,103 @@ +/* + * 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 { + MonitorsImpl, + OperationsImpl, + TagRulesImpl, + SingleSignOnImpl, + SubAccountImpl, + SubAccountTagRulesImpl, + MonitorImpl +} from "./operations"; +import { + Monitors, + Operations, + TagRules, + SingleSignOn, + SubAccount, + SubAccountTagRules, + Monitor +} from "./operationsInterfaces"; +import { MicrosoftLogzOptionalParams } from "./models"; + +export class MicrosoftLogz extends coreClient.ServiceClient { + $host: string; + subscriptionId: string; + apiVersion: string; + + /** + * Initializes a new instance of the MicrosoftLogz class. + * @param credentials Subscription credentials which uniquely identify client subscription. + * @param subscriptionId The ID of the target subscription. + * @param options The parameter options + */ + constructor( + credentials: coreAuth.TokenCredential, + subscriptionId: string, + options?: MicrosoftLogzOptionalParams + ) { + 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: MicrosoftLogzOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; + + const packageDetails = `azsdk-js-arm-logz/1.0.0`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + if (!options.credentialScopes) { + options.credentialScopes = ["https://management.azure.com/.default"]; + } + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "https://management.azure.com" + }; + super(optionsWithDefaults); + // Parameter assignments + this.subscriptionId = subscriptionId; + + // Assigning values to Constant parameters + this.$host = options.$host || "https://management.azure.com"; + this.apiVersion = options.apiVersion || "2020-10-01"; + this.monitors = new MonitorsImpl(this); + this.operations = new OperationsImpl(this); + this.tagRules = new TagRulesImpl(this); + this.singleSignOn = new SingleSignOnImpl(this); + this.subAccount = new SubAccountImpl(this); + this.subAccountTagRules = new SubAccountTagRulesImpl(this); + this.monitor = new MonitorImpl(this); + } + + monitors: Monitors; + operations: Operations; + tagRules: TagRules; + singleSignOn: SingleSignOn; + subAccount: SubAccount; + subAccountTagRules: SubAccountTagRules; + monitor: Monitor; +} diff --git a/sdk/logz/arm-logz/src/models/index.ts b/sdk/logz/arm-logz/src/models/index.ts new file mode 100644 index 000000000000..9deb27d3cea4 --- /dev/null +++ b/sdk/logz/arm-logz/src/models/index.ts @@ -0,0 +1,1020 @@ +/* + * 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"; + +/** Response of a list operation. */ +export interface MonitoredResourceListResponse { + /** Results of a list operation. */ + value?: MonitoredResource[]; + /** Link to the next set of results, if any. */ + nextLink?: string; +} + +/** The properties of a resource currently being monitored by the Logz monitor resource. */ +export interface MonitoredResource { + /** The ARM id of the resource. */ + id?: string; + /** Flag indicating if resource is sending metrics to Logz. */ + sendingMetrics?: boolean; + /** Reason for why the resource is sending metrics (or why it is not sending). */ + reasonForMetricsStatus?: string; + /** Flag indicating if resource is sending logs to Logz. */ + sendingLogs?: boolean; + /** + * Metadata pertaining to creation and last modification of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** Reason for why the resource is sending logs (or why it is not sending). */ + reasonForLogsStatus?: 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 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; +} + +/** Result of GET request to list the Microsoft.Logz operations. */ +export interface OperationListResult { + /** List of operations supported by the Microsoft.Logz provider. */ + value?: OperationResult[]; + /** URL to get the next set of operation list results if there are any. */ + nextLink?: string; +} + +/** A Microsoft.Logz REST API operation. */ +export interface OperationResult { + /** Operation name, i.e., {provider}/{resource}/{operation}. */ + name?: string; + /** Indicates whether the operation is a data action */ + isDataAction?: boolean; + /** The object that represents the operation. */ + display?: OperationDisplay; + /** Origin of the operation */ + origin?: string; +} + +/** The object that represents the operation. */ +export interface OperationDisplay { + /** Service provider, i.e., Microsoft.Logz. */ + provider?: string; + /** Type on which the operation is performed, e.g., 'monitors'. */ + resource?: string; + /** Operation type, e.g., read, write, delete, etc. */ + operation?: string; + /** Description of the operation, e.g., 'Write monitors'. */ + description?: string; +} + +/** Response of a list operation. */ +export interface LogzMonitorResourceListResponse { + /** Results of a list operation. */ + value?: LogzMonitorResource[]; + /** Link to the next set of results, if any. */ + nextLink?: string; +} + +export interface LogzMonitorResource { + /** + * ARM id of the monitor resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * The system metadata relating to this resource + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** + * Name of the monitor resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * The type of the monitor resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** Properties specific to the monitor resource. */ + properties?: MonitorProperties; + identity?: IdentityProperties; + /** Dictionary of */ + tags?: { [propertyName: string]: string }; + location: string; +} + +/** Properties specific to the monitor resource. */ +export interface MonitorProperties { + /** + * Flag specifying if the resource provisioning state as tracked by ARM. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; + /** Flag specifying if the resource monitoring is enabled or disabled. */ + monitoringStatus?: MonitoringStatus; + /** Flag specifying the Marketplace Subscription Status of the resource. If payment is not made in time, the resource will go in Suspended state. */ + marketplaceSubscriptionStatus?: MarketplaceSubscriptionStatus; + logzOrganizationProperties?: LogzOrganizationProperties; + userInfo?: UserInfo; + planData?: PlanData; + /** NOTE: This property will not be serialized. It can only be populated by the server. */ + readonly liftrResourceCategory?: LiftrResourceCategories; + /** + * The priority of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly liftrResourcePreference?: number; +} + +export interface LogzOrganizationProperties { + /** Name of the Logz organization. */ + companyName?: string; + /** + * Id of the Logz organization. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** The Id of the Enterprise App used for Single sign on. */ + enterpriseAppId?: string; + /** The login URL specific to this Logz Organization. */ + singleSignOnUrl?: string; +} + +export interface UserInfo { + /** First Name of the user */ + firstName?: string; + /** Last Name of the user */ + lastName?: string; + /** Email of the user used by Logz for contacting them if needed */ + emailAddress?: string; + /** Phone number of the user used by Logz for contacting them if needed */ + phoneNumber?: string; +} + +export interface PlanData { + /** different usage type like PAYG/COMMITTED. this could be enum */ + usageType?: string; + /** different billing cycles like MONTHLY/WEEKLY. this could be enum */ + billingCycle?: string; + /** plan id as published by Logz */ + planDetails?: string; + /** date when plan was applied */ + effectiveDate?: Date; +} + +export interface IdentityProperties { + /** + * The identity ID. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly principalId?: string; + /** + * The tenant ID of resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly tenantId?: string; + type?: ManagedIdentityTypes; +} + +/** The parameters for a PATCH request to a monitor resource. */ +export interface LogzMonitorResourceUpdateParameters { + /** The set of properties that can be update in a PATCH request to a monitor resource. */ + properties?: MonitorUpdateProperties; + /** The new tags of the monitor resource. */ + tags?: { [propertyName: string]: string }; +} + +/** The set of properties that can be update in a PATCH request to a monitor resource. */ +export interface MonitorUpdateProperties { + /** Flag specifying if the resource monitoring is enabled or disabled. */ + monitoringStatus?: MonitoringStatus; +} + +/** Response of a list operation. */ +export interface MonitoringTagRulesListResponse { + /** Results of a list operation. */ + value?: MonitoringTagRules[]; + /** Link to the next set of results, if any. */ + nextLink?: string; +} + +/** Capture logs and metrics of Azure resources based on ARM tags. */ +export interface MonitoringTagRules { + /** + * Name of the rule set. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * The id of the rule set. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * The type of the rule set. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * The system metadata relating to this resource + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** Definition of the properties for a TagRules resource. */ + properties?: MonitoringTagRulesProperties; +} + +/** Definition of the properties for a TagRules resource. */ +export interface MonitoringTagRulesProperties { + /** + * Flag specifying if the resource provisioning state as tracked by ARM. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; + /** Set of rules for sending logs for the Monitor resource. */ + logRules?: LogRules; + /** + * Metadata pertaining to creation and last modification of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; +} + +/** Set of rules for sending logs for the Monitor resource. */ +export interface LogRules { + /** Flag specifying if AAD logs should be sent for the Monitor resource. */ + sendAadLogs?: boolean; + /** Flag specifying if subscription logs should be sent for the Monitor resource. */ + sendSubscriptionLogs?: boolean; + /** Flag specifying if activity logs from Azure resources should be sent for the Monitor resource. */ + sendActivityLogs?: boolean; + /** List of filtering tags to be used for capturing logs. This only takes effect if SendActivityLogs flag is enabled. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags. */ + filteringTags?: FilteringTag[]; +} + +/** The definition of a filtering tag. Filtering tags are used for capturing resources and include/exclude them from being monitored. */ +export interface FilteringTag { + /** The name (also known as the key) of the tag. */ + name?: string; + /** The value of the tag. */ + value?: string; + /** Valid actions for a filtering tag. Exclusion takes priority over inclusion. */ + action?: TagAction; +} + +/** Response of a list operation. */ +export interface LogzSingleSignOnResourceListResponse { + /** Results of a list operation. */ + value?: LogzSingleSignOnResource[]; + /** Link to the next set of results, if any. */ + nextLink?: string; +} + +export interface LogzSingleSignOnResource { + /** + * ARM id of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * Name of the configuration. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * The type of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * Metadata pertaining to creation and last modification of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + properties?: LogzSingleSignOnProperties; +} + +export interface LogzSingleSignOnProperties { + /** Various states of the SSO resource */ + singleSignOnState?: SingleSignOnStates; + /** The Id of the Enterprise App used for Single sign-on. */ + enterpriseAppId?: string; + /** The login URL specific to this Logz Organization. */ + singleSignOnUrl?: string; + /** + * Flag specifying if the resource provisioning state as tracked by ARM. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; +} + +/** Response of payload to be passed while installing VM agent. */ +export interface VMExtensionPayload { + /** API Key corresponding to the resource. */ + apiKey?: string; + /** Logz.io region where the resource has been created. */ + region?: string; +} + +/** Request of a list VM Host Update Operation. */ +export interface VMHostUpdateRequest { + /** Request of a list vm host update operation. */ + vmResourceIds?: VMResources[]; + /** Specifies the state of the operation - install/ delete. */ + state?: VMHostUpdateStates; +} + +/** VM Resource Ids */ +export interface VMResources { + /** Request of a list vm host update operation. */ + id?: string; + /** Version of the Logz agent installed on the VM. */ + agentVersion?: string; +} + +/** Response of a list VM Host Update Operation. */ +export interface VMResourcesListResponse { + /** Response of a list vm host update operation. */ + value?: VMResources[]; + /** Link to the next set of results, if any. */ + nextLink?: string; +} + +/** Request for checking user's role for Logz.io account. */ +export interface UserRoleRequest { + /** Email of the user used by Logz for contacting them if needed */ + emailAddress?: string; +} + +/** Response for list of user's role for Logz.io account. */ +export interface UserRoleListResponse { + /** List of user roles for Logz.io account. */ + value?: UserRoleResponse[]; + /** Link to the next set of results, if any. */ + nextLink?: string; +} + +/** Response for checking user's role for Logz.io account. */ +export interface UserRoleResponse { + /** User roles on configured in Logz.io account. */ + role?: UserRole; +} + +/** Defines headers for Monitors_delete operation. */ +export interface MonitorsDeleteHeaders { + /** URL to query for status of the operation. */ + location?: string; +} + +/** Defines headers for TagRules_delete operation. */ +export interface TagRulesDeleteHeaders { + /** URL to query for status of the operation. */ + location?: string; +} + +/** Defines headers for SubAccount_delete operation. */ +export interface SubAccountDeleteHeaders { + /** URL to query for status of the operation. */ + location?: string; +} + +/** Defines headers for SubAccountTagRules_delete operation. */ +export interface SubAccountTagRulesDeleteHeaders { + /** URL to query for status of the operation. */ + location?: string; +} + +/** Known values of {@link CreatedByType} that the service accepts. */ +export enum KnownCreatedByType { + User = "User", + Application = "Application", + ManagedIdentity = "ManagedIdentity", + Key = "Key" +} + +/** + * Defines values for CreatedByType. \ + * {@link KnownCreatedByType} can be used interchangeably with CreatedByType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **User** \ + * **Application** \ + * **ManagedIdentity** \ + * **Key** + */ +export type CreatedByType = string; + +/** Known values of {@link ProvisioningState} that the service accepts. */ +export enum KnownProvisioningState { + Accepted = "Accepted", + Creating = "Creating", + Updating = "Updating", + Deleting = "Deleting", + Succeeded = "Succeeded", + Failed = "Failed", + Canceled = "Canceled", + Deleted = "Deleted", + NotSpecified = "NotSpecified" +} + +/** + * Defines values for ProvisioningState. \ + * {@link KnownProvisioningState} can be used interchangeably with ProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Accepted** \ + * **Creating** \ + * **Updating** \ + * **Deleting** \ + * **Succeeded** \ + * **Failed** \ + * **Canceled** \ + * **Deleted** \ + * **NotSpecified** + */ +export type ProvisioningState = string; + +/** Known values of {@link MonitoringStatus} that the service accepts. */ +export enum KnownMonitoringStatus { + Enabled = "Enabled", + Disabled = "Disabled" +} + +/** + * Defines values for MonitoringStatus. \ + * {@link KnownMonitoringStatus} can be used interchangeably with MonitoringStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Enabled** \ + * **Disabled** + */ +export type MonitoringStatus = string; + +/** Known values of {@link MarketplaceSubscriptionStatus} that the service accepts. */ +export enum KnownMarketplaceSubscriptionStatus { + Active = "Active", + Suspended = "Suspended" +} + +/** + * Defines values for MarketplaceSubscriptionStatus. \ + * {@link KnownMarketplaceSubscriptionStatus} can be used interchangeably with MarketplaceSubscriptionStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Active** \ + * **Suspended** + */ +export type MarketplaceSubscriptionStatus = string; + +/** Known values of {@link LiftrResourceCategories} that the service accepts. */ +export enum KnownLiftrResourceCategories { + Unknown = "Unknown", + MonitorLogs = "MonitorLogs" +} + +/** + * Defines values for LiftrResourceCategories. \ + * {@link KnownLiftrResourceCategories} can be used interchangeably with LiftrResourceCategories, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unknown** \ + * **MonitorLogs** + */ +export type LiftrResourceCategories = string; + +/** Known values of {@link ManagedIdentityTypes} that the service accepts. */ +export enum KnownManagedIdentityTypes { + SystemAssigned = "SystemAssigned", + UserAssigned = "UserAssigned" +} + +/** + * Defines values for ManagedIdentityTypes. \ + * {@link KnownManagedIdentityTypes} can be used interchangeably with ManagedIdentityTypes, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **SystemAssigned** \ + * **UserAssigned** + */ +export type ManagedIdentityTypes = string; + +/** Known values of {@link TagAction} that the service accepts. */ +export enum KnownTagAction { + Include = "Include", + Exclude = "Exclude" +} + +/** + * Defines values for TagAction. \ + * {@link KnownTagAction} can be used interchangeably with TagAction, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Include** \ + * **Exclude** + */ +export type TagAction = string; + +/** Known values of {@link SingleSignOnStates} that the service accepts. */ +export enum KnownSingleSignOnStates { + Initial = "Initial", + Enable = "Enable", + Disable = "Disable", + Existing = "Existing" +} + +/** + * Defines values for SingleSignOnStates. \ + * {@link KnownSingleSignOnStates} can be used interchangeably with SingleSignOnStates, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Initial** \ + * **Enable** \ + * **Disable** \ + * **Existing** + */ +export type SingleSignOnStates = string; + +/** Known values of {@link VMHostUpdateStates} that the service accepts. */ +export enum KnownVMHostUpdateStates { + Install = "Install", + Delete = "Delete" +} + +/** + * Defines values for VMHostUpdateStates. \ + * {@link KnownVMHostUpdateStates} can be used interchangeably with VMHostUpdateStates, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Install** \ + * **Delete** + */ +export type VMHostUpdateStates = string; + +/** Known values of {@link UserRole} that the service accepts. */ +export enum KnownUserRole { + None = "None", + User = "User", + Admin = "Admin" +} + +/** + * Defines values for UserRole. \ + * {@link KnownUserRole} can be used interchangeably with UserRole, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **User** \ + * **Admin** + */ +export type UserRole = string; + +/** Optional parameters. */ +export interface MonitorsListMonitoredResourcesOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listMonitoredResources operation. */ +export type MonitorsListMonitoredResourcesResponse = MonitoredResourceListResponse; + +/** Optional parameters. */ +export interface MonitorsListBySubscriptionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscription operation. */ +export type MonitorsListBySubscriptionResponse = LogzMonitorResourceListResponse; + +/** Optional parameters. */ +export interface MonitorsListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type MonitorsListByResourceGroupResponse = LogzMonitorResourceListResponse; + +/** Optional parameters. */ +export interface MonitorsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type MonitorsGetResponse = LogzMonitorResource; + +/** Optional parameters. */ +export interface MonitorsCreateOptionalParams + extends coreClient.OperationOptions { + body?: LogzMonitorResource; + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the create operation. */ +export type MonitorsCreateResponse = LogzMonitorResource; + +/** Optional parameters. */ +export interface MonitorsUpdateOptionalParams + extends coreClient.OperationOptions { + /** The parameters for a PATCH request to a monitor resource. */ + body?: LogzMonitorResourceUpdateParameters; +} + +/** Contains response data for the update operation. */ +export type MonitorsUpdateResponse = LogzMonitorResource; + +/** Optional parameters. */ +export interface MonitorsDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Optional parameters. */ +export interface MonitorsListUserRolesOptionalParams + extends coreClient.OperationOptions { + /** Request for checking user's role for Logz.io account. */ + body?: UserRoleRequest; +} + +/** Contains response data for the listUserRoles operation. */ +export type MonitorsListUserRolesResponse = UserRoleListResponse; + +/** Optional parameters. */ +export interface MonitorsListMonitoredResourcesNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listMonitoredResourcesNext operation. */ +export type MonitorsListMonitoredResourcesNextResponse = MonitoredResourceListResponse; + +/** Optional parameters. */ +export interface MonitorsListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscriptionNext operation. */ +export type MonitorsListBySubscriptionNextResponse = LogzMonitorResourceListResponse; + +/** Optional parameters. */ +export interface MonitorsListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type MonitorsListByResourceGroupNextResponse = LogzMonitorResourceListResponse; + +/** Optional parameters. */ +export interface MonitorsListUserRolesNextOptionalParams + extends coreClient.OperationOptions { + /** Request for checking user's role for Logz.io account. */ + body?: UserRoleRequest; +} + +/** Contains response data for the listUserRolesNext operation. */ +export type MonitorsListUserRolesNextResponse = UserRoleListResponse; + +/** Optional parameters. */ +export interface OperationsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type OperationsListResponse = OperationListResult; + +/** Optional parameters. */ +export interface OperationsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type OperationsListNextResponse = OperationListResult; + +/** Optional parameters. */ +export interface TagRulesListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type TagRulesListResponse = MonitoringTagRulesListResponse; + +/** Optional parameters. */ +export interface TagRulesCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Capture logs and metrics of Azure resources based on ARM tags. */ + body?: MonitoringTagRules; +} + +/** Contains response data for the createOrUpdate operation. */ +export type TagRulesCreateOrUpdateResponse = MonitoringTagRules; + +/** Optional parameters. */ +export interface TagRulesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type TagRulesGetResponse = MonitoringTagRules; + +/** Optional parameters. */ +export interface TagRulesDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the delete operation. */ +export type TagRulesDeleteResponse = TagRulesDeleteHeaders; + +/** Optional parameters. */ +export interface TagRulesListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type TagRulesListNextResponse = MonitoringTagRulesListResponse; + +/** Optional parameters. */ +export interface SingleSignOnListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type SingleSignOnListResponse = LogzSingleSignOnResourceListResponse; + +/** Optional parameters. */ +export interface SingleSignOnCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + body?: LogzSingleSignOnResource; + /** 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 SingleSignOnCreateOrUpdateResponse = LogzSingleSignOnResource; + +/** Optional parameters. */ +export interface SingleSignOnGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type SingleSignOnGetResponse = LogzSingleSignOnResource; + +/** Optional parameters. */ +export interface SingleSignOnListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type SingleSignOnListNextResponse = LogzSingleSignOnResourceListResponse; + +/** Optional parameters. */ +export interface SubAccountListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type SubAccountListResponse = LogzMonitorResourceListResponse; + +/** Optional parameters. */ +export interface SubAccountCreateOptionalParams + extends coreClient.OperationOptions { + body?: LogzMonitorResource; + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the create operation. */ +export type SubAccountCreateResponse = LogzMonitorResource; + +/** Optional parameters. */ +export interface SubAccountGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type SubAccountGetResponse = LogzMonitorResource; + +/** Optional parameters. */ +export interface SubAccountDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Optional parameters. */ +export interface SubAccountUpdateOptionalParams + extends coreClient.OperationOptions { + /** The parameters for a PATCH request to a monitor resource. */ + body?: LogzMonitorResourceUpdateParameters; +} + +/** Contains response data for the update operation. */ +export type SubAccountUpdateResponse = LogzMonitorResource; + +/** Optional parameters. */ +export interface SubAccountListMonitoredResourcesOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listMonitoredResources operation. */ +export type SubAccountListMonitoredResourcesResponse = MonitoredResourceListResponse; + +/** Optional parameters. */ +export interface SubAccountVMHostPayloadOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the vMHostPayload operation. */ +export type SubAccountVMHostPayloadResponse = VMExtensionPayload; + +/** Optional parameters. */ +export interface SubAccountListVmHostUpdateOptionalParams + extends coreClient.OperationOptions { + /** Request body to update the collection for agent installed in the given monitor. */ + body?: VMHostUpdateRequest; +} + +/** Contains response data for the listVmHostUpdate operation. */ +export type SubAccountListVmHostUpdateResponse = VMResourcesListResponse; + +/** Optional parameters. */ +export interface SubAccountListVMHostsOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listVMHosts operation. */ +export type SubAccountListVMHostsResponse = VMResourcesListResponse; + +/** Optional parameters. */ +export interface SubAccountListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type SubAccountListNextResponse = LogzMonitorResourceListResponse; + +/** Optional parameters. */ +export interface SubAccountListMonitoredResourcesNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listMonitoredResourcesNext operation. */ +export type SubAccountListMonitoredResourcesNextResponse = MonitoredResourceListResponse; + +/** Optional parameters. */ +export interface SubAccountListVmHostUpdateNextOptionalParams + extends coreClient.OperationOptions { + /** Request body to update the collection for agent installed in the given monitor. */ + body?: VMHostUpdateRequest; +} + +/** Contains response data for the listVmHostUpdateNext operation. */ +export type SubAccountListVmHostUpdateNextResponse = VMResourcesListResponse; + +/** Optional parameters. */ +export interface SubAccountListVMHostsNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listVMHostsNext operation. */ +export type SubAccountListVMHostsNextResponse = VMResourcesListResponse; + +/** Optional parameters. */ +export interface SubAccountTagRulesListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type SubAccountTagRulesListResponse = MonitoringTagRulesListResponse; + +/** Optional parameters. */ +export interface SubAccountTagRulesCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Capture logs and metrics of Azure resources based on ARM tags. */ + body?: MonitoringTagRules; +} + +/** Contains response data for the createOrUpdate operation. */ +export type SubAccountTagRulesCreateOrUpdateResponse = MonitoringTagRules; + +/** Optional parameters. */ +export interface SubAccountTagRulesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type SubAccountTagRulesGetResponse = MonitoringTagRules; + +/** Optional parameters. */ +export interface SubAccountTagRulesDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the delete operation. */ +export type SubAccountTagRulesDeleteResponse = SubAccountTagRulesDeleteHeaders; + +/** Optional parameters. */ +export interface SubAccountTagRulesListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type SubAccountTagRulesListNextResponse = MonitoringTagRulesListResponse; + +/** Optional parameters. */ +export interface MonitorVMHostPayloadOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the vMHostPayload operation. */ +export type MonitorVMHostPayloadResponse = VMExtensionPayload; + +/** Optional parameters. */ +export interface MonitorListVmHostUpdateOptionalParams + extends coreClient.OperationOptions { + /** Request body to update the collection for agent installed in the given monitor. */ + body?: VMHostUpdateRequest; +} + +/** Contains response data for the listVmHostUpdate operation. */ +export type MonitorListVmHostUpdateResponse = VMResourcesListResponse; + +/** Optional parameters. */ +export interface MonitorListVMHostsOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listVMHosts operation. */ +export type MonitorListVMHostsResponse = VMResourcesListResponse; + +/** Optional parameters. */ +export interface MonitorListVmHostUpdateNextOptionalParams + extends coreClient.OperationOptions { + /** Request body to update the collection for agent installed in the given monitor. */ + body?: VMHostUpdateRequest; +} + +/** Contains response data for the listVmHostUpdateNext operation. */ +export type MonitorListVmHostUpdateNextResponse = VMResourcesListResponse; + +/** Optional parameters. */ +export interface MonitorListVMHostsNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listVMHostsNext operation. */ +export type MonitorListVMHostsNextResponse = VMResourcesListResponse; + +/** Optional parameters. */ +export interface MicrosoftLogzOptionalParams + extends coreClient.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Api Version */ + apiVersion?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/logz/arm-logz/src/models/mappers.ts b/sdk/logz/arm-logz/src/models/mappers.ts new file mode 100644 index 000000000000..7bf1cbf7665b --- /dev/null +++ b/sdk/logz/arm-logz/src/models/mappers.ts @@ -0,0 +1,1155 @@ +/* + * 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 MonitoredResourceListResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MonitoredResourceListResponse", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MonitoredResource" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const MonitoredResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MonitoredResource", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String" + } + }, + sendingMetrics: { + serializedName: "sendingMetrics", + type: { + name: "Boolean" + } + }, + reasonForMetricsStatus: { + serializedName: "reasonForMetricsStatus", + type: { + name: "String" + } + }, + sendingLogs: { + serializedName: "sendingLogs", + type: { + name: "Boolean" + } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + reasonForLogsStatus: { + serializedName: "reasonForLogsStatus", + 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 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 OperationListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "OperationResult" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const OperationResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationResult", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + isDataAction: { + serializedName: "isDataAction", + type: { + name: "Boolean" + } + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplay" + } + }, + origin: { + serializedName: "origin", + type: { + name: "String" + } + } + } + } +}; + +export const OperationDisplay: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationDisplay", + modelProperties: { + provider: { + serializedName: "provider", + type: { + name: "String" + } + }, + resource: { + serializedName: "resource", + type: { + name: "String" + } + }, + operation: { + serializedName: "operation", + type: { + name: "String" + } + }, + description: { + serializedName: "description", + type: { + name: "String" + } + } + } + } +}; + +export const LogzMonitorResourceListResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LogzMonitorResourceListResponse", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "LogzMonitorResource" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const LogzMonitorResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LogzMonitorResource", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "MonitorProperties" + } + }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "IdentityProperties" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + location: { + serializedName: "location", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const MonitorProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MonitorProperties", + modelProperties: { + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + monitoringStatus: { + defaultValue: "Enabled", + serializedName: "monitoringStatus", + type: { + name: "String" + } + }, + marketplaceSubscriptionStatus: { + defaultValue: "Active", + serializedName: "marketplaceSubscriptionStatus", + type: { + name: "String" + } + }, + logzOrganizationProperties: { + serializedName: "logzOrganizationProperties", + type: { + name: "Composite", + className: "LogzOrganizationProperties" + } + }, + userInfo: { + serializedName: "userInfo", + type: { + name: "Composite", + className: "UserInfo" + } + }, + planData: { + serializedName: "planData", + type: { + name: "Composite", + className: "PlanData" + } + }, + liftrResourceCategory: { + serializedName: "liftrResourceCategory", + readOnly: true, + type: { + name: "String" + } + }, + liftrResourcePreference: { + serializedName: "liftrResourcePreference", + readOnly: true, + type: { + name: "Number" + } + } + } + } +}; + +export const LogzOrganizationProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LogzOrganizationProperties", + modelProperties: { + companyName: { + serializedName: "companyName", + type: { + name: "String" + } + }, + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + enterpriseAppId: { + serializedName: "enterpriseAppId", + type: { + name: "String" + } + }, + singleSignOnUrl: { + serializedName: "singleSignOnUrl", + type: { + name: "String" + } + } + } + } +}; + +export const UserInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "UserInfo", + modelProperties: { + firstName: { + constraints: { + MaxLength: 50 + }, + serializedName: "firstName", + type: { + name: "String" + } + }, + lastName: { + constraints: { + MaxLength: 50 + }, + serializedName: "lastName", + type: { + name: "String" + } + }, + emailAddress: { + constraints: { + Pattern: new RegExp( + "^[A-Za-z0-9._%+-]+@(?:[A-Za-z0-9-]+\\.)+[A-Za-z]{2,}$" + ) + }, + serializedName: "emailAddress", + type: { + name: "String" + } + }, + phoneNumber: { + constraints: { + MaxLength: 40 + }, + serializedName: "phoneNumber", + type: { + name: "String" + } + } + } + } +}; + +export const PlanData: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PlanData", + modelProperties: { + usageType: { + constraints: { + MaxLength: 50 + }, + serializedName: "usageType", + type: { + name: "String" + } + }, + billingCycle: { + constraints: { + MaxLength: 50 + }, + serializedName: "billingCycle", + type: { + name: "String" + } + }, + planDetails: { + constraints: { + MaxLength: 50 + }, + serializedName: "planDetails", + type: { + name: "String" + } + }, + effectiveDate: { + serializedName: "effectiveDate", + type: { + name: "DateTime" + } + } + } + } +}; + +export const IdentityProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "IdentityProperties", + modelProperties: { + principalId: { + serializedName: "principalId", + readOnly: true, + type: { + name: "String" + } + }, + tenantId: { + serializedName: "tenantId", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + type: { + name: "String" + } + } + } + } +}; + +export const LogzMonitorResourceUpdateParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LogzMonitorResourceUpdateParameters", + modelProperties: { + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "MonitorUpdateProperties" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + } + } + } +}; + +export const MonitorUpdateProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MonitorUpdateProperties", + modelProperties: { + monitoringStatus: { + defaultValue: "Enabled", + serializedName: "monitoringStatus", + type: { + name: "String" + } + } + } + } +}; + +export const MonitoringTagRulesListResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MonitoringTagRulesListResponse", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MonitoringTagRules" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const MonitoringTagRules: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MonitoringTagRules", + modelProperties: { + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "MonitoringTagRulesProperties" + } + } + } + } +}; + +export const MonitoringTagRulesProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MonitoringTagRulesProperties", + modelProperties: { + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + logRules: { + serializedName: "logRules", + type: { + name: "Composite", + className: "LogRules" + } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + } + } + } +}; + +export const LogRules: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LogRules", + modelProperties: { + sendAadLogs: { + serializedName: "sendAadLogs", + type: { + name: "Boolean" + } + }, + sendSubscriptionLogs: { + serializedName: "sendSubscriptionLogs", + type: { + name: "Boolean" + } + }, + sendActivityLogs: { + serializedName: "sendActivityLogs", + type: { + name: "Boolean" + } + }, + filteringTags: { + serializedName: "filteringTags", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "FilteringTag" + } + } + } + } + } + } +}; + +export const FilteringTag: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FilteringTag", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "String" + } + }, + action: { + serializedName: "action", + type: { + name: "String" + } + } + } + } +}; + +export const LogzSingleSignOnResourceListResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LogzSingleSignOnResourceListResponse", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "LogzSingleSignOnResource" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const LogzSingleSignOnResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LogzSingleSignOnResource", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "LogzSingleSignOnProperties" + } + } + } + } +}; + +export const LogzSingleSignOnProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LogzSingleSignOnProperties", + modelProperties: { + singleSignOnState: { + serializedName: "singleSignOnState", + type: { + name: "String" + } + }, + enterpriseAppId: { + serializedName: "enterpriseAppId", + type: { + name: "String" + } + }, + singleSignOnUrl: { + serializedName: "singleSignOnUrl", + type: { + name: "String" + } + }, + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const VMExtensionPayload: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VMExtensionPayload", + modelProperties: { + apiKey: { + serializedName: "apiKey", + type: { + name: "String" + } + }, + region: { + serializedName: "region", + type: { + name: "String" + } + } + } + } +}; + +export const VMHostUpdateRequest: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VMHostUpdateRequest", + modelProperties: { + vmResourceIds: { + serializedName: "vmResourceIds", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "VMResources" + } + } + } + }, + state: { + serializedName: "state", + type: { + name: "String" + } + } + } + } +}; + +export const VMResources: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VMResources", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String" + } + }, + agentVersion: { + serializedName: "agentVersion", + type: { + name: "String" + } + } + } + } +}; + +export const VMResourcesListResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VMResourcesListResponse", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "VMResources" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const UserRoleRequest: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "UserRoleRequest", + modelProperties: { + emailAddress: { + constraints: { + Pattern: new RegExp( + "^[A-Za-z0-9._%+-]+@(?:[A-Za-z0-9-]+\\.)+[A-Za-z]{2,}$" + ) + }, + serializedName: "emailAddress", + type: { + name: "String" + } + } + } + } +}; + +export const UserRoleListResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "UserRoleListResponse", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "UserRoleResponse" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const UserRoleResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "UserRoleResponse", + modelProperties: { + role: { + serializedName: "role", + type: { + name: "String" + } + } + } + } +}; + +export const MonitorsDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MonitorsDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const TagRulesDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TagRulesDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const SubAccountDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SubAccountDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const SubAccountTagRulesDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SubAccountTagRulesDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; diff --git a/sdk/logz/arm-logz/src/models/parameters.ts b/sdk/logz/arm-logz/src/models/parameters.ts new file mode 100644 index 000000000000..97f49224b151 --- /dev/null +++ b/sdk/logz/arm-logz/src/models/parameters.ts @@ -0,0 +1,184 @@ +/* + * 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 { + LogzMonitorResource as LogzMonitorResourceMapper, + LogzMonitorResourceUpdateParameters as LogzMonitorResourceUpdateParametersMapper, + UserRoleRequest as UserRoleRequestMapper, + MonitoringTagRules as MonitoringTagRulesMapper, + LogzSingleSignOnResource as LogzSingleSignOnResourceMapper, + VMHostUpdateRequest as VMHostUpdateRequestMapper +} 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 subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + constraints: { + MinLength: 1 + }, + serializedName: "subscriptionId", + required: true, + type: { + name: "String" + } + } +}; + +export const resourceGroupName: OperationURLParameter = { + parameterPath: "resourceGroupName", + mapper: { + constraints: { + MaxLength: 90, + MinLength: 1 + }, + serializedName: "resourceGroupName", + required: true, + type: { + name: "String" + } + } +}; + +export const monitorName: OperationURLParameter = { + parameterPath: "monitorName", + mapper: { + serializedName: "monitorName", + required: true, + type: { + name: "String" + } + } +}; + +export const apiVersion: OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + defaultValue: "2020-10-01", + isConstant: true, + serializedName: "api-version", + type: { + name: "String" + } + } +}; + +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", + type: { + name: "String" + } + } +}; + +export const body: OperationParameter = { + parameterPath: ["options", "body"], + mapper: LogzMonitorResourceMapper +}; + +export const body1: OperationParameter = { + parameterPath: ["options", "body"], + mapper: LogzMonitorResourceUpdateParametersMapper +}; + +export const body2: OperationParameter = { + parameterPath: ["options", "body"], + mapper: UserRoleRequestMapper +}; + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", + mapper: { + serializedName: "nextLink", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const body3: OperationParameter = { + parameterPath: ["options", "body"], + mapper: MonitoringTagRulesMapper +}; + +export const ruleSetName: OperationURLParameter = { + parameterPath: "ruleSetName", + mapper: { + serializedName: "ruleSetName", + required: true, + type: { + name: "String" + } + } +}; + +export const body4: OperationParameter = { + parameterPath: ["options", "body"], + mapper: LogzSingleSignOnResourceMapper +}; + +export const configurationName: OperationURLParameter = { + parameterPath: "configurationName", + mapper: { + serializedName: "configurationName", + required: true, + type: { + name: "String" + } + } +}; + +export const subAccountName: OperationURLParameter = { + parameterPath: "subAccountName", + mapper: { + serializedName: "subAccountName", + required: true, + type: { + name: "String" + } + } +}; + +export const body5: OperationParameter = { + parameterPath: ["options", "body"], + mapper: VMHostUpdateRequestMapper +}; diff --git a/sdk/logz/arm-logz/src/operations/index.ts b/sdk/logz/arm-logz/src/operations/index.ts new file mode 100644 index 000000000000..e5a76024d3da --- /dev/null +++ b/sdk/logz/arm-logz/src/operations/index.ts @@ -0,0 +1,15 @@ +/* + * 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 "./monitors"; +export * from "./operations"; +export * from "./tagRules"; +export * from "./singleSignOn"; +export * from "./subAccount"; +export * from "./subAccountTagRules"; +export * from "./monitor"; diff --git a/sdk/logz/arm-logz/src/operations/monitor.ts b/sdk/logz/arm-logz/src/operations/monitor.ts new file mode 100644 index 000000000000..90a31c4ff877 --- /dev/null +++ b/sdk/logz/arm-logz/src/operations/monitor.ts @@ -0,0 +1,391 @@ +/* + * 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 { Monitor } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { MicrosoftLogz } from "../microsoftLogz"; +import { + VMResources, + MonitorListVmHostUpdateNextOptionalParams, + MonitorListVmHostUpdateOptionalParams, + MonitorListVMHostsNextOptionalParams, + MonitorListVMHostsOptionalParams, + MonitorVMHostPayloadOptionalParams, + MonitorVMHostPayloadResponse, + MonitorListVmHostUpdateResponse, + MonitorListVMHostsResponse, + MonitorListVmHostUpdateNextResponse, + MonitorListVMHostsNextResponse +} from "../models"; + +/// +/** Class containing Monitor operations. */ +export class MonitorImpl implements Monitor { + private readonly client: MicrosoftLogz; + + /** + * Initialize a new instance of the class Monitor class. + * @param client Reference to the service client + */ + constructor(client: MicrosoftLogz) { + this.client = client; + } + + /** + * Sending request to update the collection when Logz.io agent has been installed on a VM for a given + * monitor. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + public listVmHostUpdate( + resourceGroupName: string, + monitorName: string, + options?: MonitorListVmHostUpdateOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listVmHostUpdatePagingAll( + resourceGroupName, + monitorName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listVmHostUpdatePagingPage( + resourceGroupName, + monitorName, + options + ); + } + }; + } + + private async *listVmHostUpdatePagingPage( + resourceGroupName: string, + monitorName: string, + options?: MonitorListVmHostUpdateOptionalParams + ): AsyncIterableIterator { + let result = await this._listVmHostUpdate( + resourceGroupName, + monitorName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listVmHostUpdateNext( + resourceGroupName, + monitorName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listVmHostUpdatePagingAll( + resourceGroupName: string, + monitorName: string, + options?: MonitorListVmHostUpdateOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listVmHostUpdatePagingPage( + resourceGroupName, + monitorName, + options + )) { + yield* page; + } + } + + /** + * List the compute resources currently being monitored by the Logz main account resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + public listVMHosts( + resourceGroupName: string, + monitorName: string, + options?: MonitorListVMHostsOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listVMHostsPagingAll( + resourceGroupName, + monitorName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listVMHostsPagingPage( + resourceGroupName, + monitorName, + options + ); + } + }; + } + + private async *listVMHostsPagingPage( + resourceGroupName: string, + monitorName: string, + options?: MonitorListVMHostsOptionalParams + ): AsyncIterableIterator { + let result = await this._listVMHosts( + resourceGroupName, + monitorName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listVMHostsNext( + resourceGroupName, + monitorName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listVMHostsPagingAll( + resourceGroupName: string, + monitorName: string, + options?: MonitorListVMHostsOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listVMHostsPagingPage( + resourceGroupName, + monitorName, + options + )) { + yield* page; + } + } + + /** + * Returns the payload that needs to be passed in the request body for installing Logz.io agent on a + * VM. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + vMHostPayload( + resourceGroupName: string, + monitorName: string, + options?: MonitorVMHostPayloadOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, options }, + vMHostPayloadOperationSpec + ); + } + + /** + * Sending request to update the collection when Logz.io agent has been installed on a VM for a given + * monitor. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + private _listVmHostUpdate( + resourceGroupName: string, + monitorName: string, + options?: MonitorListVmHostUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, options }, + listVmHostUpdateOperationSpec + ); + } + + /** + * List the compute resources currently being monitored by the Logz main account resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + private _listVMHosts( + resourceGroupName: string, + monitorName: string, + options?: MonitorListVMHostsOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, options }, + listVMHostsOperationSpec + ); + } + + /** + * ListVmHostUpdateNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param nextLink The nextLink from the previous successful call to the ListVmHostUpdate method. + * @param options The options parameters. + */ + private _listVmHostUpdateNext( + resourceGroupName: string, + monitorName: string, + nextLink: string, + options?: MonitorListVmHostUpdateNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, nextLink, options }, + listVmHostUpdateNextOperationSpec + ); + } + + /** + * ListVMHostsNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param nextLink The nextLink from the previous successful call to the ListVMHosts method. + * @param options The options parameters. + */ + private _listVMHostsNext( + resourceGroupName: string, + monitorName: string, + nextLink: string, + options?: MonitorListVMHostsNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, nextLink, options }, + listVMHostsNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const vMHostPayloadOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logz/monitors/{monitorName}/vmHostPayload", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.VMExtensionPayload + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listVmHostUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logz/monitors/{monitorName}/vmHostUpdate", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.VMResourcesListResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body5, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listVMHostsOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logz/monitors/{monitorName}/listVMHosts", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.VMResourcesListResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listVmHostUpdateNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VMResourcesListResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listVMHostsNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VMResourcesListResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/logz/arm-logz/src/operations/monitors.ts b/sdk/logz/arm-logz/src/operations/monitors.ts new file mode 100644 index 000000000000..ca4b302078f3 --- /dev/null +++ b/sdk/logz/arm-logz/src/operations/monitors.ts @@ -0,0 +1,904 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Monitors } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { MicrosoftLogz } from "../microsoftLogz"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + MonitoredResource, + MonitorsListMonitoredResourcesNextOptionalParams, + MonitorsListMonitoredResourcesOptionalParams, + LogzMonitorResource, + MonitorsListBySubscriptionNextOptionalParams, + MonitorsListBySubscriptionOptionalParams, + MonitorsListByResourceGroupNextOptionalParams, + MonitorsListByResourceGroupOptionalParams, + UserRoleResponse, + MonitorsListUserRolesNextOptionalParams, + MonitorsListUserRolesOptionalParams, + MonitorsListMonitoredResourcesResponse, + MonitorsListBySubscriptionResponse, + MonitorsListByResourceGroupResponse, + MonitorsGetOptionalParams, + MonitorsGetResponse, + MonitorsCreateOptionalParams, + MonitorsCreateResponse, + MonitorsUpdateOptionalParams, + MonitorsUpdateResponse, + MonitorsDeleteOptionalParams, + MonitorsListUserRolesResponse, + MonitorsListMonitoredResourcesNextResponse, + MonitorsListBySubscriptionNextResponse, + MonitorsListByResourceGroupNextResponse, + MonitorsListUserRolesNextResponse +} from "../models"; + +/// +/** Class containing Monitors operations. */ +export class MonitorsImpl implements Monitors { + private readonly client: MicrosoftLogz; + + /** + * Initialize a new instance of the class Monitors class. + * @param client Reference to the service client + */ + constructor(client: MicrosoftLogz) { + this.client = client; + } + + /** + * List the resources currently being monitored by the Logz monitor resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + public listMonitoredResources( + resourceGroupName: string, + monitorName: string, + options?: MonitorsListMonitoredResourcesOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listMonitoredResourcesPagingAll( + resourceGroupName, + monitorName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listMonitoredResourcesPagingPage( + resourceGroupName, + monitorName, + options + ); + } + }; + } + + private async *listMonitoredResourcesPagingPage( + resourceGroupName: string, + monitorName: string, + options?: MonitorsListMonitoredResourcesOptionalParams + ): AsyncIterableIterator { + let result = await this._listMonitoredResources( + resourceGroupName, + monitorName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listMonitoredResourcesNext( + resourceGroupName, + monitorName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listMonitoredResourcesPagingAll( + resourceGroupName: string, + monitorName: string, + options?: MonitorsListMonitoredResourcesOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listMonitoredResourcesPagingPage( + resourceGroupName, + monitorName, + options + )) { + yield* page; + } + } + + /** + * List all monitors under the specified subscription. + * @param options The options parameters. + */ + public listBySubscription( + options?: MonitorsListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listBySubscriptionPagingPage(options); + } + }; + } + + private async *listBySubscriptionPagingPage( + options?: MonitorsListBySubscriptionOptionalParams + ): AsyncIterableIterator { + let result = await this._listBySubscription(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listBySubscriptionNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listBySubscriptionPagingAll( + options?: MonitorsListBySubscriptionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage(options)) { + yield* page; + } + } + + /** + * List all monitors under the specified resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: MonitorsListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByResourceGroupPagingPage(resourceGroupName, options); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: MonitorsListByResourceGroupOptionalParams + ): AsyncIterableIterator { + let result = await this._listByResourceGroup(resourceGroupName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: MonitorsListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + + /** + * List the user's roles configured on Logz.io side for the account corresponding to the monitor + * resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + public listUserRoles( + resourceGroupName: string, + monitorName: string, + options?: MonitorsListUserRolesOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listUserRolesPagingAll( + resourceGroupName, + monitorName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listUserRolesPagingPage( + resourceGroupName, + monitorName, + options + ); + } + }; + } + + private async *listUserRolesPagingPage( + resourceGroupName: string, + monitorName: string, + options?: MonitorsListUserRolesOptionalParams + ): AsyncIterableIterator { + let result = await this._listUserRoles( + resourceGroupName, + monitorName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listUserRolesNext( + resourceGroupName, + monitorName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listUserRolesPagingAll( + resourceGroupName: string, + monitorName: string, + options?: MonitorsListUserRolesOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listUserRolesPagingPage( + resourceGroupName, + monitorName, + options + )) { + yield* page; + } + } + + /** + * List the resources currently being monitored by the Logz monitor resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + private _listMonitoredResources( + resourceGroupName: string, + monitorName: string, + options?: MonitorsListMonitoredResourcesOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, options }, + listMonitoredResourcesOperationSpec + ); + } + + /** + * List all monitors under the specified subscription. + * @param options The options parameters. + */ + private _listBySubscription( + options?: MonitorsListBySubscriptionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + listBySubscriptionOperationSpec + ); + } + + /** + * List all monitors under the specified resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: MonitorsListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + + /** + * Get the properties of a specific monitor resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + get( + resourceGroupName: string, + monitorName: string, + options?: MonitorsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, options }, + getOperationSpec + ); + } + + /** + * Create a monitor resource. This create operation can take upto 10 minutes to complete. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + async beginCreate( + resourceGroupName: string, + monitorName: string, + options?: MonitorsCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + MonitorsCreateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, monitorName, options }, + createOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + } + + /** + * Create a monitor resource. This create operation can take upto 10 minutes to complete. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + async beginCreateAndWait( + resourceGroupName: string, + monitorName: string, + options?: MonitorsCreateOptionalParams + ): Promise { + const poller = await this.beginCreate( + resourceGroupName, + monitorName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Update a monitor resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + update( + resourceGroupName: string, + monitorName: string, + options?: MonitorsUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, options }, + updateOperationSpec + ); + } + + /** + * Delete a monitor resource. This delete operation can take upto 10 minutes to complete. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + monitorName: string, + options?: MonitorsDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, monitorName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "location" + }); + } + + /** + * Delete a monitor resource. This delete operation can take upto 10 minutes to complete. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + monitorName: string, + options?: MonitorsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + monitorName, + options + ); + return poller.pollUntilDone(); + } + + /** + * List the user's roles configured on Logz.io side for the account corresponding to the monitor + * resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + private _listUserRoles( + resourceGroupName: string, + monitorName: string, + options?: MonitorsListUserRolesOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, options }, + listUserRolesOperationSpec + ); + } + + /** + * ListMonitoredResourcesNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param nextLink The nextLink from the previous successful call to the ListMonitoredResources method. + * @param options The options parameters. + */ + private _listMonitoredResourcesNext( + resourceGroupName: string, + monitorName: string, + nextLink: string, + options?: MonitorsListMonitoredResourcesNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, nextLink, options }, + listMonitoredResourcesNextOperationSpec + ); + } + + /** + * ListBySubscriptionNext + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. + * @param options The options parameters. + */ + private _listBySubscriptionNext( + nextLink: string, + options?: MonitorsListBySubscriptionNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listBySubscriptionNextOperationSpec + ); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. + */ + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: MonitorsListByResourceGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); + } + + /** + * ListUserRolesNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param nextLink The nextLink from the previous successful call to the ListUserRoles method. + * @param options The options parameters. + */ + private _listUserRolesNext( + resourceGroupName: string, + monitorName: string, + nextLink: string, + options?: MonitorsListUserRolesNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, nextLink, options }, + listUserRolesNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listMonitoredResourcesOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logz/monitors/{monitorName}/listMonitoredResources", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.MonitoredResourceListResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Logz/monitors", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.LogzMonitorResourceListResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logz/monitors", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.LogzMonitorResourceListResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logz/monitors/{monitorName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.LogzMonitorResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logz/monitors/{monitorName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.LogzMonitorResource + }, + 201: { + bodyMapper: Mappers.LogzMonitorResource + }, + 202: { + bodyMapper: Mappers.LogzMonitorResource + }, + 204: { + bodyMapper: Mappers.LogzMonitorResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logz/monitors/{monitorName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.LogzMonitorResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logz/monitors/{monitorName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listUserRolesOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logz/monitors/{monitorName}/listUserRoles", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.UserRoleListResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body2, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listMonitoredResourcesNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.MonitoredResourceListResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; +const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.LogzMonitorResourceListResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.LogzMonitorResourceListResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; +const listUserRolesNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.UserRoleListResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; diff --git a/sdk/logz/arm-logz/src/operations/operations.ts b/sdk/logz/arm-logz/src/operations/operations.ts new file mode 100644 index 000000000000..fa96da84650b --- /dev/null +++ b/sdk/logz/arm-logz/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 { MicrosoftLogz } from "../microsoftLogz"; +import { + OperationResult, + OperationsListNextOptionalParams, + OperationsListOptionalParams, + OperationsListResponse, + OperationsListNextResponse +} from "../models"; + +/// +/** Class containing Operations operations. */ +export class OperationsImpl implements Operations { + private readonly client: MicrosoftLogz; + + /** + * Initialize a new instance of the class Operations class. + * @param client Reference to the service client + */ + constructor(client: MicrosoftLogz) { + this.client = client; + } + + /** + * List all operations provided by Microsoft.Logz. + * @param options The options parameters. + */ + public list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: OperationsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + options?: OperationsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + + /** + * List all operations provided by Microsoft.Logz. + * @param options The options parameters. + */ + private _list( + options?: OperationsListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + nextLink: string, + options?: OperationsListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Logz/operations", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.OperationListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.OperationListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.nextLink], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/logz/arm-logz/src/operations/singleSignOn.ts b/sdk/logz/arm-logz/src/operations/singleSignOn.ts new file mode 100644 index 000000000000..bd78f7f81242 --- /dev/null +++ b/sdk/logz/arm-logz/src/operations/singleSignOn.ts @@ -0,0 +1,350 @@ +/* + * 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 { SingleSignOn } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { MicrosoftLogz } from "../microsoftLogz"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + LogzSingleSignOnResource, + SingleSignOnListNextOptionalParams, + SingleSignOnListOptionalParams, + SingleSignOnListResponse, + SingleSignOnCreateOrUpdateOptionalParams, + SingleSignOnCreateOrUpdateResponse, + SingleSignOnGetOptionalParams, + SingleSignOnGetResponse, + SingleSignOnListNextResponse +} from "../models"; + +/// +/** Class containing SingleSignOn operations. */ +export class SingleSignOnImpl implements SingleSignOn { + private readonly client: MicrosoftLogz; + + /** + * Initialize a new instance of the class SingleSignOn class. + * @param client Reference to the service client + */ + constructor(client: MicrosoftLogz) { + this.client = client; + } + + /** + * List the single sign-on configurations for a given monitor resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + monitorName: string, + options?: SingleSignOnListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(resourceGroupName, monitorName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(resourceGroupName, monitorName, options); + } + }; + } + + private async *listPagingPage( + resourceGroupName: string, + monitorName: string, + options?: SingleSignOnListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(resourceGroupName, monitorName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + monitorName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + resourceGroupName: string, + monitorName: string, + options?: SingleSignOnListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + monitorName, + options + )) { + yield* page; + } + } + + /** + * List the single sign-on configurations for a given monitor resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + monitorName: string, + options?: SingleSignOnListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, options }, + listOperationSpec + ); + } + + /** + * Configures single-sign-on for this resource. This operation can take upto 10 minutes to complete. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param configurationName + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + monitorName: string, + configurationName: string, + options?: SingleSignOnCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + SingleSignOnCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, monitorName, configurationName, options }, + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + } + + /** + * Configures single-sign-on for this resource. This operation can take upto 10 minutes to complete. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param configurationName + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + monitorName: string, + configurationName: string, + options?: SingleSignOnCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + monitorName, + configurationName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Gets the Logz single sign-on resource for the given Monitor. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param configurationName + * @param options The options parameters. + */ + get( + resourceGroupName: string, + monitorName: string, + configurationName: string, + options?: SingleSignOnGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, configurationName, options }, + getOperationSpec + ); + } + + /** + * ListNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + monitorName: string, + nextLink: string, + options?: SingleSignOnListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logz/monitors/{monitorName}/singleSignOnConfigurations", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.LogzSingleSignOnResourceListResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logz/monitors/{monitorName}/singleSignOnConfigurations/{configurationName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.LogzSingleSignOnResource + }, + 201: { + bodyMapper: Mappers.LogzSingleSignOnResource + }, + 202: { + bodyMapper: Mappers.LogzSingleSignOnResource + }, + 204: { + bodyMapper: Mappers.LogzSingleSignOnResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body4, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName, + Parameters.configurationName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logz/monitors/{monitorName}/singleSignOnConfigurations/{configurationName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.LogzSingleSignOnResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName, + Parameters.configurationName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.LogzSingleSignOnResourceListResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/logz/arm-logz/src/operations/subAccount.ts b/sdk/logz/arm-logz/src/operations/subAccount.ts new file mode 100644 index 000000000000..32fcdd0aaed5 --- /dev/null +++ b/sdk/logz/arm-logz/src/operations/subAccount.ts @@ -0,0 +1,1070 @@ +/* + * 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 { SubAccount } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { MicrosoftLogz } from "../microsoftLogz"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + LogzMonitorResource, + SubAccountListNextOptionalParams, + SubAccountListOptionalParams, + MonitoredResource, + SubAccountListMonitoredResourcesNextOptionalParams, + SubAccountListMonitoredResourcesOptionalParams, + VMResources, + SubAccountListVmHostUpdateNextOptionalParams, + SubAccountListVmHostUpdateOptionalParams, + SubAccountListVMHostsNextOptionalParams, + SubAccountListVMHostsOptionalParams, + SubAccountListResponse, + SubAccountCreateOptionalParams, + SubAccountCreateResponse, + SubAccountGetOptionalParams, + SubAccountGetResponse, + SubAccountDeleteOptionalParams, + SubAccountUpdateOptionalParams, + SubAccountUpdateResponse, + SubAccountListMonitoredResourcesResponse, + SubAccountVMHostPayloadOptionalParams, + SubAccountVMHostPayloadResponse, + SubAccountListVmHostUpdateResponse, + SubAccountListVMHostsResponse, + SubAccountListNextResponse, + SubAccountListMonitoredResourcesNextResponse, + SubAccountListVmHostUpdateNextResponse, + SubAccountListVMHostsNextResponse +} from "../models"; + +/// +/** Class containing SubAccount operations. */ +export class SubAccountImpl implements SubAccount { + private readonly client: MicrosoftLogz; + + /** + * Initialize a new instance of the class SubAccount class. + * @param client Reference to the service client + */ + constructor(client: MicrosoftLogz) { + this.client = client; + } + + /** + * List the sub account under a given monitor resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + monitorName: string, + options?: SubAccountListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(resourceGroupName, monitorName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(resourceGroupName, monitorName, options); + } + }; + } + + private async *listPagingPage( + resourceGroupName: string, + monitorName: string, + options?: SubAccountListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(resourceGroupName, monitorName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + monitorName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + resourceGroupName: string, + monitorName: string, + options?: SubAccountListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + monitorName, + options + )) { + yield* page; + } + } + + /** + * List the resources currently being monitored by the Logz sub account resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param subAccountName Sub Account resource name + * @param options The options parameters. + */ + public listMonitoredResources( + resourceGroupName: string, + monitorName: string, + subAccountName: string, + options?: SubAccountListMonitoredResourcesOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listMonitoredResourcesPagingAll( + resourceGroupName, + monitorName, + subAccountName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listMonitoredResourcesPagingPage( + resourceGroupName, + monitorName, + subAccountName, + options + ); + } + }; + } + + private async *listMonitoredResourcesPagingPage( + resourceGroupName: string, + monitorName: string, + subAccountName: string, + options?: SubAccountListMonitoredResourcesOptionalParams + ): AsyncIterableIterator { + let result = await this._listMonitoredResources( + resourceGroupName, + monitorName, + subAccountName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listMonitoredResourcesNext( + resourceGroupName, + monitorName, + subAccountName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listMonitoredResourcesPagingAll( + resourceGroupName: string, + monitorName: string, + subAccountName: string, + options?: SubAccountListMonitoredResourcesOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listMonitoredResourcesPagingPage( + resourceGroupName, + monitorName, + subAccountName, + options + )) { + yield* page; + } + } + + /** + * Sending request to update the collection when Logz.io agent has been installed on a VM for a given + * monitor. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param subAccountName Sub Account resource name + * @param options The options parameters. + */ + public listVmHostUpdate( + resourceGroupName: string, + monitorName: string, + subAccountName: string, + options?: SubAccountListVmHostUpdateOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listVmHostUpdatePagingAll( + resourceGroupName, + monitorName, + subAccountName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listVmHostUpdatePagingPage( + resourceGroupName, + monitorName, + subAccountName, + options + ); + } + }; + } + + private async *listVmHostUpdatePagingPage( + resourceGroupName: string, + monitorName: string, + subAccountName: string, + options?: SubAccountListVmHostUpdateOptionalParams + ): AsyncIterableIterator { + let result = await this._listVmHostUpdate( + resourceGroupName, + monitorName, + subAccountName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listVmHostUpdateNext( + resourceGroupName, + monitorName, + subAccountName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listVmHostUpdatePagingAll( + resourceGroupName: string, + monitorName: string, + subAccountName: string, + options?: SubAccountListVmHostUpdateOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listVmHostUpdatePagingPage( + resourceGroupName, + monitorName, + subAccountName, + options + )) { + yield* page; + } + } + + /** + * List the compute resources currently being monitored by the Logz sub account resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param subAccountName Sub Account resource name + * @param options The options parameters. + */ + public listVMHosts( + resourceGroupName: string, + monitorName: string, + subAccountName: string, + options?: SubAccountListVMHostsOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listVMHostsPagingAll( + resourceGroupName, + monitorName, + subAccountName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listVMHostsPagingPage( + resourceGroupName, + monitorName, + subAccountName, + options + ); + } + }; + } + + private async *listVMHostsPagingPage( + resourceGroupName: string, + monitorName: string, + subAccountName: string, + options?: SubAccountListVMHostsOptionalParams + ): AsyncIterableIterator { + let result = await this._listVMHosts( + resourceGroupName, + monitorName, + subAccountName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listVMHostsNext( + resourceGroupName, + monitorName, + subAccountName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listVMHostsPagingAll( + resourceGroupName: string, + monitorName: string, + subAccountName: string, + options?: SubAccountListVMHostsOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listVMHostsPagingPage( + resourceGroupName, + monitorName, + subAccountName, + options + )) { + yield* page; + } + } + + /** + * List the sub account under a given monitor resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + monitorName: string, + options?: SubAccountListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, options }, + listOperationSpec + ); + } + + /** + * Create sub account under a given monitor resource. This create operation can take upto 10 minutes to + * complete. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param subAccountName Sub Account resource name + * @param options The options parameters. + */ + async beginCreate( + resourceGroupName: string, + monitorName: string, + subAccountName: string, + options?: SubAccountCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + SubAccountCreateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, monitorName, subAccountName, options }, + createOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + } + + /** + * Create sub account under a given monitor resource. This create operation can take upto 10 minutes to + * complete. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param subAccountName Sub Account resource name + * @param options The options parameters. + */ + async beginCreateAndWait( + resourceGroupName: string, + monitorName: string, + subAccountName: string, + options?: SubAccountCreateOptionalParams + ): Promise { + const poller = await this.beginCreate( + resourceGroupName, + monitorName, + subAccountName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Get a sub account under a given monitor resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param subAccountName Sub Account resource name + * @param options The options parameters. + */ + get( + resourceGroupName: string, + monitorName: string, + subAccountName: string, + options?: SubAccountGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, subAccountName, options }, + getOperationSpec + ); + } + + /** + * Delete a sub account resource. This delete operation can take upto 10 minutes to complete. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param subAccountName Sub Account resource name + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + monitorName: string, + subAccountName: string, + options?: SubAccountDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, monitorName, subAccountName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "location" + }); + } + + /** + * Delete a sub account resource. This delete operation can take upto 10 minutes to complete. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param subAccountName Sub Account resource name + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + monitorName: string, + subAccountName: string, + options?: SubAccountDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + monitorName, + subAccountName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Update a monitor resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param subAccountName Sub Account resource name + * @param options The options parameters. + */ + update( + resourceGroupName: string, + monitorName: string, + subAccountName: string, + options?: SubAccountUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, subAccountName, options }, + updateOperationSpec + ); + } + + /** + * List the resources currently being monitored by the Logz sub account resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param subAccountName Sub Account resource name + * @param options The options parameters. + */ + private _listMonitoredResources( + resourceGroupName: string, + monitorName: string, + subAccountName: string, + options?: SubAccountListMonitoredResourcesOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, subAccountName, options }, + listMonitoredResourcesOperationSpec + ); + } + + /** + * Returns the payload that needs to be passed as a request for installing Logz.io agent on a VM. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param subAccountName Sub Account resource name + * @param options The options parameters. + */ + vMHostPayload( + resourceGroupName: string, + monitorName: string, + subAccountName: string, + options?: SubAccountVMHostPayloadOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, subAccountName, options }, + vMHostPayloadOperationSpec + ); + } + + /** + * Sending request to update the collection when Logz.io agent has been installed on a VM for a given + * monitor. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param subAccountName Sub Account resource name + * @param options The options parameters. + */ + private _listVmHostUpdate( + resourceGroupName: string, + monitorName: string, + subAccountName: string, + options?: SubAccountListVmHostUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, subAccountName, options }, + listVmHostUpdateOperationSpec + ); + } + + /** + * List the compute resources currently being monitored by the Logz sub account resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param subAccountName Sub Account resource name + * @param options The options parameters. + */ + private _listVMHosts( + resourceGroupName: string, + monitorName: string, + subAccountName: string, + options?: SubAccountListVMHostsOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, subAccountName, options }, + listVMHostsOperationSpec + ); + } + + /** + * ListNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + monitorName: string, + nextLink: string, + options?: SubAccountListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, nextLink, options }, + listNextOperationSpec + ); + } + + /** + * ListMonitoredResourcesNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param subAccountName Sub Account resource name + * @param nextLink The nextLink from the previous successful call to the ListMonitoredResources method. + * @param options The options parameters. + */ + private _listMonitoredResourcesNext( + resourceGroupName: string, + monitorName: string, + subAccountName: string, + nextLink: string, + options?: SubAccountListMonitoredResourcesNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, subAccountName, nextLink, options }, + listMonitoredResourcesNextOperationSpec + ); + } + + /** + * ListVmHostUpdateNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param subAccountName Sub Account resource name + * @param nextLink The nextLink from the previous successful call to the ListVmHostUpdate method. + * @param options The options parameters. + */ + private _listVmHostUpdateNext( + resourceGroupName: string, + monitorName: string, + subAccountName: string, + nextLink: string, + options?: SubAccountListVmHostUpdateNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, subAccountName, nextLink, options }, + listVmHostUpdateNextOperationSpec + ); + } + + /** + * ListVMHostsNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param subAccountName Sub Account resource name + * @param nextLink The nextLink from the previous successful call to the ListVMHosts method. + * @param options The options parameters. + */ + private _listVMHostsNext( + resourceGroupName: string, + monitorName: string, + subAccountName: string, + nextLink: string, + options?: SubAccountListVMHostsNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, subAccountName, nextLink, options }, + listVMHostsNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logz/monitors/{monitorName}/accounts", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.LogzMonitorResourceListResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logz/monitors/{monitorName}/accounts/{subAccountName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.LogzMonitorResource + }, + 201: { + bodyMapper: Mappers.LogzMonitorResource + }, + 202: { + bodyMapper: Mappers.LogzMonitorResource + }, + 204: { + bodyMapper: Mappers.LogzMonitorResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName, + Parameters.subAccountName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logz/monitors/{monitorName}/accounts/{subAccountName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.LogzMonitorResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName, + Parameters.subAccountName + ], + headerParameters: [Parameters.accept], + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logz/monitors/{monitorName}/accounts/{subAccountName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName, + Parameters.subAccountName + ], + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logz/monitors/{monitorName}/accounts/{subAccountName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.LogzMonitorResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName, + Parameters.subAccountName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listMonitoredResourcesOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logz/monitors/{monitorName}/accounts/{subAccountName}/listMonitoredResources", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.MonitoredResourceListResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName, + Parameters.subAccountName + ], + headerParameters: [Parameters.accept], + serializer +}; +const vMHostPayloadOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logz/monitors/{monitorName}/accounts/{subAccountName}/vmHostPayload", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.VMExtensionPayload + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName, + Parameters.subAccountName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listVmHostUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logz/monitors/{monitorName}/accounts/{subAccountName}/vmHostUpdate", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.VMResourcesListResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body5, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName, + Parameters.subAccountName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listVMHostsOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logz/monitors/{monitorName}/accounts/{subAccountName}/listVMHosts", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.VMResourcesListResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName, + Parameters.subAccountName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.LogzMonitorResourceListResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; +const listMonitoredResourcesNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.MonitoredResourceListResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName, + Parameters.nextLink, + Parameters.subAccountName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listVmHostUpdateNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VMResourcesListResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName, + Parameters.nextLink, + Parameters.subAccountName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listVMHostsNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VMResourcesListResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName, + Parameters.nextLink, + Parameters.subAccountName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/logz/arm-logz/src/operations/subAccountTagRules.ts b/sdk/logz/arm-logz/src/operations/subAccountTagRules.ts new file mode 100644 index 000000000000..ac54de64d8ef --- /dev/null +++ b/sdk/logz/arm-logz/src/operations/subAccountTagRules.ts @@ -0,0 +1,349 @@ +/* + * 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 { SubAccountTagRules } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { MicrosoftLogz } from "../microsoftLogz"; +import { + MonitoringTagRules, + SubAccountTagRulesListNextOptionalParams, + SubAccountTagRulesListOptionalParams, + SubAccountTagRulesListResponse, + SubAccountTagRulesCreateOrUpdateOptionalParams, + SubAccountTagRulesCreateOrUpdateResponse, + SubAccountTagRulesGetOptionalParams, + SubAccountTagRulesGetResponse, + SubAccountTagRulesDeleteOptionalParams, + SubAccountTagRulesDeleteResponse, + SubAccountTagRulesListNextResponse +} from "../models"; + +/// +/** Class containing SubAccountTagRules operations. */ +export class SubAccountTagRulesImpl implements SubAccountTagRules { + private readonly client: MicrosoftLogz; + + /** + * Initialize a new instance of the class SubAccountTagRules class. + * @param client Reference to the service client + */ + constructor(client: MicrosoftLogz) { + this.client = client; + } + + /** + * List the tag rules for a given sub account resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param subAccountName Sub Account resource name + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + monitorName: string, + subAccountName: string, + options?: SubAccountTagRulesListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll( + resourceGroupName, + monitorName, + subAccountName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage( + resourceGroupName, + monitorName, + subAccountName, + options + ); + } + }; + } + + private async *listPagingPage( + resourceGroupName: string, + monitorName: string, + subAccountName: string, + options?: SubAccountTagRulesListOptionalParams + ): AsyncIterableIterator { + let result = await this._list( + resourceGroupName, + monitorName, + subAccountName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + monitorName, + subAccountName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + resourceGroupName: string, + monitorName: string, + subAccountName: string, + options?: SubAccountTagRulesListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + monitorName, + subAccountName, + options + )) { + yield* page; + } + } + + /** + * List the tag rules for a given sub account resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param subAccountName Sub Account resource name + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + monitorName: string, + subAccountName: string, + options?: SubAccountTagRulesListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, subAccountName, options }, + listOperationSpec + ); + } + + /** + * Create or update a tag rule set for a given sub account resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param subAccountName Sub Account resource name + * @param ruleSetName + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + monitorName: string, + subAccountName: string, + ruleSetName: string, + options?: SubAccountTagRulesCreateOrUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, subAccountName, ruleSetName, options }, + createOrUpdateOperationSpec + ); + } + + /** + * Get a tag rule set for a given monitor resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param subAccountName Sub Account resource name + * @param ruleSetName + * @param options The options parameters. + */ + get( + resourceGroupName: string, + monitorName: string, + subAccountName: string, + ruleSetName: string, + options?: SubAccountTagRulesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, subAccountName, ruleSetName, options }, + getOperationSpec + ); + } + + /** + * Delete a tag rule set for a given monitor resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param subAccountName Sub Account resource name + * @param ruleSetName + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + monitorName: string, + subAccountName: string, + ruleSetName: string, + options?: SubAccountTagRulesDeleteOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, subAccountName, ruleSetName, options }, + deleteOperationSpec + ); + } + + /** + * ListNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param subAccountName Sub Account resource name + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + monitorName: string, + subAccountName: string, + nextLink: string, + options?: SubAccountTagRulesListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, subAccountName, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logz/monitors/{monitorName}/accounts/{subAccountName}/tagRules", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.MonitoringTagRulesListResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName, + Parameters.subAccountName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logz/monitors/{monitorName}/accounts/{subAccountName}/tagRules/{ruleSetName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.MonitoringTagRules + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body3, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName, + Parameters.ruleSetName, + Parameters.subAccountName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logz/monitors/{monitorName}/accounts/{subAccountName}/tagRules/{ruleSetName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.MonitoringTagRules + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName, + Parameters.ruleSetName, + Parameters.subAccountName + ], + headerParameters: [Parameters.accept], + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logz/monitors/{monitorName}/accounts/{subAccountName}/tagRules/{ruleSetName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 202: { + headersMapper: Mappers.SubAccountTagRulesDeleteHeaders + }, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName, + Parameters.ruleSetName, + Parameters.subAccountName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.MonitoringTagRulesListResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName, + Parameters.nextLink, + Parameters.subAccountName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/logz/arm-logz/src/operations/tagRules.ts b/sdk/logz/arm-logz/src/operations/tagRules.ts new file mode 100644 index 000000000000..094d91a2b05d --- /dev/null +++ b/sdk/logz/arm-logz/src/operations/tagRules.ts @@ -0,0 +1,313 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { TagRules } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { MicrosoftLogz } from "../microsoftLogz"; +import { + MonitoringTagRules, + TagRulesListNextOptionalParams, + TagRulesListOptionalParams, + TagRulesListResponse, + TagRulesCreateOrUpdateOptionalParams, + TagRulesCreateOrUpdateResponse, + TagRulesGetOptionalParams, + TagRulesGetResponse, + TagRulesDeleteOptionalParams, + TagRulesDeleteResponse, + TagRulesListNextResponse +} from "../models"; + +/// +/** Class containing TagRules operations. */ +export class TagRulesImpl implements TagRules { + private readonly client: MicrosoftLogz; + + /** + * Initialize a new instance of the class TagRules class. + * @param client Reference to the service client + */ + constructor(client: MicrosoftLogz) { + this.client = client; + } + + /** + * List the tag rules for a given monitor resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + monitorName: string, + options?: TagRulesListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(resourceGroupName, monitorName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(resourceGroupName, monitorName, options); + } + }; + } + + private async *listPagingPage( + resourceGroupName: string, + monitorName: string, + options?: TagRulesListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(resourceGroupName, monitorName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + monitorName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + resourceGroupName: string, + monitorName: string, + options?: TagRulesListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + monitorName, + options + )) { + yield* page; + } + } + + /** + * List the tag rules for a given monitor resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + monitorName: string, + options?: TagRulesListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, options }, + listOperationSpec + ); + } + + /** + * Create or update a tag rule set for a given monitor resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param ruleSetName + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + monitorName: string, + ruleSetName: string, + options?: TagRulesCreateOrUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, ruleSetName, options }, + createOrUpdateOperationSpec + ); + } + + /** + * Get a tag rule set for a given monitor resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param ruleSetName + * @param options The options parameters. + */ + get( + resourceGroupName: string, + monitorName: string, + ruleSetName: string, + options?: TagRulesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, ruleSetName, options }, + getOperationSpec + ); + } + + /** + * Delete a tag rule set for a given monitor resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param ruleSetName + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + monitorName: string, + ruleSetName: string, + options?: TagRulesDeleteOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, ruleSetName, options }, + deleteOperationSpec + ); + } + + /** + * ListNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + monitorName: string, + nextLink: string, + options?: TagRulesListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, monitorName, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logz/monitors/{monitorName}/tagRules", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.MonitoringTagRulesListResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logz/monitors/{monitorName}/tagRules/{ruleSetName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.MonitoringTagRules + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body3, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName, + Parameters.ruleSetName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logz/monitors/{monitorName}/tagRules/{ruleSetName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.MonitoringTagRules + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName, + Parameters.ruleSetName + ], + headerParameters: [Parameters.accept], + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logz/monitors/{monitorName}/tagRules/{ruleSetName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 202: { + headersMapper: Mappers.TagRulesDeleteHeaders + }, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName, + Parameters.ruleSetName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.MonitoringTagRulesListResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.monitorName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/logz/arm-logz/src/operationsInterfaces/index.ts b/sdk/logz/arm-logz/src/operationsInterfaces/index.ts new file mode 100644 index 000000000000..e5a76024d3da --- /dev/null +++ b/sdk/logz/arm-logz/src/operationsInterfaces/index.ts @@ -0,0 +1,15 @@ +/* + * 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 "./monitors"; +export * from "./operations"; +export * from "./tagRules"; +export * from "./singleSignOn"; +export * from "./subAccount"; +export * from "./subAccountTagRules"; +export * from "./monitor"; diff --git a/sdk/logz/arm-logz/src/operationsInterfaces/monitor.ts b/sdk/logz/arm-logz/src/operationsInterfaces/monitor.ts new file mode 100644 index 000000000000..e517fdf3d41a --- /dev/null +++ b/sdk/logz/arm-logz/src/operationsInterfaces/monitor.ts @@ -0,0 +1,56 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + VMResources, + MonitorListVmHostUpdateOptionalParams, + MonitorListVMHostsOptionalParams, + MonitorVMHostPayloadOptionalParams, + MonitorVMHostPayloadResponse +} from "../models"; + +/// +/** Interface representing a Monitor. */ +export interface Monitor { + /** + * Sending request to update the collection when Logz.io agent has been installed on a VM for a given + * monitor. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + listVmHostUpdate( + resourceGroupName: string, + monitorName: string, + options?: MonitorListVmHostUpdateOptionalParams + ): PagedAsyncIterableIterator; + /** + * List the compute resources currently being monitored by the Logz main account resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + listVMHosts( + resourceGroupName: string, + monitorName: string, + options?: MonitorListVMHostsOptionalParams + ): PagedAsyncIterableIterator; + /** + * Returns the payload that needs to be passed in the request body for installing Logz.io agent on a + * VM. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + vMHostPayload( + resourceGroupName: string, + monitorName: string, + options?: MonitorVMHostPayloadOptionalParams + ): Promise; +} diff --git a/sdk/logz/arm-logz/src/operationsInterfaces/monitors.ts b/sdk/logz/arm-logz/src/operationsInterfaces/monitors.ts new file mode 100644 index 000000000000..915af75df6ce --- /dev/null +++ b/sdk/logz/arm-logz/src/operationsInterfaces/monitors.ts @@ -0,0 +1,141 @@ +/* + * 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 { + MonitoredResource, + MonitorsListMonitoredResourcesOptionalParams, + LogzMonitorResource, + MonitorsListBySubscriptionOptionalParams, + MonitorsListByResourceGroupOptionalParams, + UserRoleResponse, + MonitorsListUserRolesOptionalParams, + MonitorsGetOptionalParams, + MonitorsGetResponse, + MonitorsCreateOptionalParams, + MonitorsCreateResponse, + MonitorsUpdateOptionalParams, + MonitorsUpdateResponse, + MonitorsDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a Monitors. */ +export interface Monitors { + /** + * List the resources currently being monitored by the Logz monitor resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + listMonitoredResources( + resourceGroupName: string, + monitorName: string, + options?: MonitorsListMonitoredResourcesOptionalParams + ): PagedAsyncIterableIterator; + /** + * List all monitors under the specified subscription. + * @param options The options parameters. + */ + listBySubscription( + options?: MonitorsListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator; + /** + * List all monitors under the specified resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: MonitorsListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * List the user's roles configured on Logz.io side for the account corresponding to the monitor + * resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + listUserRoles( + resourceGroupName: string, + monitorName: string, + options?: MonitorsListUserRolesOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get the properties of a specific monitor resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + get( + resourceGroupName: string, + monitorName: string, + options?: MonitorsGetOptionalParams + ): Promise; + /** + * Create a monitor resource. This create operation can take upto 10 minutes to complete. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + beginCreate( + resourceGroupName: string, + monitorName: string, + options?: MonitorsCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + MonitorsCreateResponse + > + >; + /** + * Create a monitor resource. This create operation can take upto 10 minutes to complete. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + beginCreateAndWait( + resourceGroupName: string, + monitorName: string, + options?: MonitorsCreateOptionalParams + ): Promise; + /** + * Update a monitor resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + update( + resourceGroupName: string, + monitorName: string, + options?: MonitorsUpdateOptionalParams + ): Promise; + /** + * Delete a monitor resource. This delete operation can take upto 10 minutes to complete. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + monitorName: string, + options?: MonitorsDeleteOptionalParams + ): Promise, void>>; + /** + * Delete a monitor resource. This delete operation can take upto 10 minutes to complete. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + monitorName: string, + options?: MonitorsDeleteOptionalParams + ): Promise; +} diff --git a/sdk/logz/arm-logz/src/operationsInterfaces/operations.ts b/sdk/logz/arm-logz/src/operationsInterfaces/operations.ts new file mode 100644 index 000000000000..7935fc89fe19 --- /dev/null +++ b/sdk/logz/arm-logz/src/operationsInterfaces/operations.ts @@ -0,0 +1,22 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { OperationResult, OperationsListOptionalParams } from "../models"; + +/// +/** Interface representing a Operations. */ +export interface Operations { + /** + * List all operations provided by Microsoft.Logz. + * @param options The options parameters. + */ + list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/logz/arm-logz/src/operationsInterfaces/singleSignOn.ts b/sdk/logz/arm-logz/src/operationsInterfaces/singleSignOn.ts new file mode 100644 index 000000000000..fa32637a3778 --- /dev/null +++ b/sdk/logz/arm-logz/src/operationsInterfaces/singleSignOn.ts @@ -0,0 +1,78 @@ +/* + * 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 { + LogzSingleSignOnResource, + SingleSignOnListOptionalParams, + SingleSignOnCreateOrUpdateOptionalParams, + SingleSignOnCreateOrUpdateResponse, + SingleSignOnGetOptionalParams, + SingleSignOnGetResponse +} from "../models"; + +/// +/** Interface representing a SingleSignOn. */ +export interface SingleSignOn { + /** + * List the single sign-on configurations for a given monitor resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + list( + resourceGroupName: string, + monitorName: string, + options?: SingleSignOnListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Configures single-sign-on for this resource. This operation can take upto 10 minutes to complete. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param configurationName + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + monitorName: string, + configurationName: string, + options?: SingleSignOnCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + SingleSignOnCreateOrUpdateResponse + > + >; + /** + * Configures single-sign-on for this resource. This operation can take upto 10 minutes to complete. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param configurationName + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + monitorName: string, + configurationName: string, + options?: SingleSignOnCreateOrUpdateOptionalParams + ): Promise; + /** + * Gets the Logz single sign-on resource for the given Monitor. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param configurationName + * @param options The options parameters. + */ + get( + resourceGroupName: string, + monitorName: string, + configurationName: string, + options?: SingleSignOnGetOptionalParams + ): Promise; +} diff --git a/sdk/logz/arm-logz/src/operationsInterfaces/subAccount.ts b/sdk/logz/arm-logz/src/operationsInterfaces/subAccount.ts new file mode 100644 index 000000000000..dad0d830c8c7 --- /dev/null +++ b/sdk/logz/arm-logz/src/operationsInterfaces/subAccount.ts @@ -0,0 +1,182 @@ +/* + * 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 { + LogzMonitorResource, + SubAccountListOptionalParams, + MonitoredResource, + SubAccountListMonitoredResourcesOptionalParams, + VMResources, + SubAccountListVmHostUpdateOptionalParams, + SubAccountListVMHostsOptionalParams, + SubAccountCreateOptionalParams, + SubAccountCreateResponse, + SubAccountGetOptionalParams, + SubAccountGetResponse, + SubAccountDeleteOptionalParams, + SubAccountUpdateOptionalParams, + SubAccountUpdateResponse, + SubAccountVMHostPayloadOptionalParams, + SubAccountVMHostPayloadResponse +} from "../models"; + +/// +/** Interface representing a SubAccount. */ +export interface SubAccount { + /** + * List the sub account under a given monitor resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + list( + resourceGroupName: string, + monitorName: string, + options?: SubAccountListOptionalParams + ): PagedAsyncIterableIterator; + /** + * List the resources currently being monitored by the Logz sub account resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param subAccountName Sub Account resource name + * @param options The options parameters. + */ + listMonitoredResources( + resourceGroupName: string, + monitorName: string, + subAccountName: string, + options?: SubAccountListMonitoredResourcesOptionalParams + ): PagedAsyncIterableIterator; + /** + * Sending request to update the collection when Logz.io agent has been installed on a VM for a given + * monitor. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param subAccountName Sub Account resource name + * @param options The options parameters. + */ + listVmHostUpdate( + resourceGroupName: string, + monitorName: string, + subAccountName: string, + options?: SubAccountListVmHostUpdateOptionalParams + ): PagedAsyncIterableIterator; + /** + * List the compute resources currently being monitored by the Logz sub account resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param subAccountName Sub Account resource name + * @param options The options parameters. + */ + listVMHosts( + resourceGroupName: string, + monitorName: string, + subAccountName: string, + options?: SubAccountListVMHostsOptionalParams + ): PagedAsyncIterableIterator; + /** + * Create sub account under a given monitor resource. This create operation can take upto 10 minutes to + * complete. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param subAccountName Sub Account resource name + * @param options The options parameters. + */ + beginCreate( + resourceGroupName: string, + monitorName: string, + subAccountName: string, + options?: SubAccountCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + SubAccountCreateResponse + > + >; + /** + * Create sub account under a given monitor resource. This create operation can take upto 10 minutes to + * complete. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param subAccountName Sub Account resource name + * @param options The options parameters. + */ + beginCreateAndWait( + resourceGroupName: string, + monitorName: string, + subAccountName: string, + options?: SubAccountCreateOptionalParams + ): Promise; + /** + * Get a sub account under a given monitor resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param subAccountName Sub Account resource name + * @param options The options parameters. + */ + get( + resourceGroupName: string, + monitorName: string, + subAccountName: string, + options?: SubAccountGetOptionalParams + ): Promise; + /** + * Delete a sub account resource. This delete operation can take upto 10 minutes to complete. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param subAccountName Sub Account resource name + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + monitorName: string, + subAccountName: string, + options?: SubAccountDeleteOptionalParams + ): Promise, void>>; + /** + * Delete a sub account resource. This delete operation can take upto 10 minutes to complete. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param subAccountName Sub Account resource name + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + monitorName: string, + subAccountName: string, + options?: SubAccountDeleteOptionalParams + ): Promise; + /** + * Update a monitor resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param subAccountName Sub Account resource name + * @param options The options parameters. + */ + update( + resourceGroupName: string, + monitorName: string, + subAccountName: string, + options?: SubAccountUpdateOptionalParams + ): Promise; + /** + * Returns the payload that needs to be passed as a request for installing Logz.io agent on a VM. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param subAccountName Sub Account resource name + * @param options The options parameters. + */ + vMHostPayload( + resourceGroupName: string, + monitorName: string, + subAccountName: string, + options?: SubAccountVMHostPayloadOptionalParams + ): Promise; +} diff --git a/sdk/logz/arm-logz/src/operationsInterfaces/subAccountTagRules.ts b/sdk/logz/arm-logz/src/operationsInterfaces/subAccountTagRules.ts new file mode 100644 index 000000000000..53a9358ce0c0 --- /dev/null +++ b/sdk/logz/arm-logz/src/operationsInterfaces/subAccountTagRules.ts @@ -0,0 +1,82 @@ +/* + * 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 { + MonitoringTagRules, + SubAccountTagRulesListOptionalParams, + SubAccountTagRulesCreateOrUpdateOptionalParams, + SubAccountTagRulesCreateOrUpdateResponse, + SubAccountTagRulesGetOptionalParams, + SubAccountTagRulesGetResponse, + SubAccountTagRulesDeleteOptionalParams, + SubAccountTagRulesDeleteResponse +} from "../models"; + +/// +/** Interface representing a SubAccountTagRules. */ +export interface SubAccountTagRules { + /** + * List the tag rules for a given sub account resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param subAccountName Sub Account resource name + * @param options The options parameters. + */ + list( + resourceGroupName: string, + monitorName: string, + subAccountName: string, + options?: SubAccountTagRulesListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Create or update a tag rule set for a given sub account resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param subAccountName Sub Account resource name + * @param ruleSetName + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + monitorName: string, + subAccountName: string, + ruleSetName: string, + options?: SubAccountTagRulesCreateOrUpdateOptionalParams + ): Promise; + /** + * Get a tag rule set for a given monitor resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param subAccountName Sub Account resource name + * @param ruleSetName + * @param options The options parameters. + */ + get( + resourceGroupName: string, + monitorName: string, + subAccountName: string, + ruleSetName: string, + options?: SubAccountTagRulesGetOptionalParams + ): Promise; + /** + * Delete a tag rule set for a given monitor resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param subAccountName Sub Account resource name + * @param ruleSetName + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + monitorName: string, + subAccountName: string, + ruleSetName: string, + options?: SubAccountTagRulesDeleteOptionalParams + ): Promise; +} diff --git a/sdk/logz/arm-logz/src/operationsInterfaces/tagRules.ts b/sdk/logz/arm-logz/src/operationsInterfaces/tagRules.ts new file mode 100644 index 000000000000..9e2943bfbf3c --- /dev/null +++ b/sdk/logz/arm-logz/src/operationsInterfaces/tagRules.ts @@ -0,0 +1,74 @@ +/* + * 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 { + MonitoringTagRules, + TagRulesListOptionalParams, + TagRulesCreateOrUpdateOptionalParams, + TagRulesCreateOrUpdateResponse, + TagRulesGetOptionalParams, + TagRulesGetResponse, + TagRulesDeleteOptionalParams, + TagRulesDeleteResponse +} from "../models"; + +/// +/** Interface representing a TagRules. */ +export interface TagRules { + /** + * List the tag rules for a given monitor resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param options The options parameters. + */ + list( + resourceGroupName: string, + monitorName: string, + options?: TagRulesListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Create or update a tag rule set for a given monitor resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param ruleSetName + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + monitorName: string, + ruleSetName: string, + options?: TagRulesCreateOrUpdateOptionalParams + ): Promise; + /** + * Get a tag rule set for a given monitor resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param ruleSetName + * @param options The options parameters. + */ + get( + resourceGroupName: string, + monitorName: string, + ruleSetName: string, + options?: TagRulesGetOptionalParams + ): Promise; + /** + * Delete a tag rule set for a given monitor resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name + * @param ruleSetName + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + monitorName: string, + ruleSetName: string, + options?: TagRulesDeleteOptionalParams + ): Promise; +} diff --git a/sdk/logz/arm-logz/test/sampleTest.ts b/sdk/logz/arm-logz/test/sampleTest.ts new file mode 100644 index 000000000000..7ed89b043e1b --- /dev/null +++ b/sdk/logz/arm-logz/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/logz/arm-logz/tsconfig.json b/sdk/logz/arm-logz/tsconfig.json new file mode 100644 index 000000000000..3e6ae96443f3 --- /dev/null +++ b/sdk/logz/arm-logz/tsconfig.json @@ -0,0 +1,27 @@ +{ + "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" + ] +} \ No newline at end of file diff --git a/sdk/logz/ci.yml b/sdk/logz/ci.yml new file mode 100644 index 000000000000..ce5f1dbf5297 --- /dev/null +++ b/sdk/logz/ci.yml @@ -0,0 +1,30 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - release/* + - hotfix/* + paths: + include: + - sdk/logz/ + +pr: + branches: + include: + - main + - release/* + - hotfix/* + paths: + include: + - sdk/logz/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: logz + Artifacts: + - name: azure-arm-logz + safeName: azurearmlogz + \ No newline at end of file