From dc29436bed4d055951561f69348e6eb9b2cfdb54 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 22 Jan 2025 20:09:35 +0000 Subject: [PATCH] CodeGen from PR 31523 in Azure/azure-rest-api-specs Merge 5aa6cb0964bea3dbeabeb3bd950372f17b8bf40f into d8322344919f53f162e90fab01eb324b0c2eab30 --- common/config/rush/pnpm-lock.yaml | 97 ++- rush.json | 17 +- .../CHANGELOG.md | 7 + .../LICENSE | 21 + .../README.md | 108 +++ .../_meta.json | 8 + .../api-extractor.json | 31 + .../package.json | 135 +++ ...-kubernetesconfiguration-extensions.api.md | 294 +++++++ .../sample.env | 1 + .../src/extensionsClient.ts | 143 ++++ .../src/index.ts | 13 + .../src/lroImpl.ts | 42 + .../src/models/index.ts | 433 ++++++++++ .../src/models/mappers.ts | 653 +++++++++++++++ .../src/models/parameters.ts | 187 +++++ .../src/operations/extensions.ts | 769 ++++++++++++++++++ .../src/operations/index.ts | 10 + .../src/operations/operationStatus.ts | 93 +++ .../src/operationsInterfaces/extensions.ts | 197 +++++ .../src/operationsInterfaces/index.ts | 10 + .../operationsInterfaces/operationStatus.ts | 37 + .../src/pagingHelper.ts | 39 + .../test/sampleTest.ts | 40 + .../tsconfig.browser.config.json | 6 + .../tsconfig.json | 27 + .../tsconfig.samples.json | 10 + .../tsconfig.src.json | 3 + .../tsconfig.test.json | 6 + .../vitest.browser.config.ts | 17 + .../vitest.config.ts | 16 + .../vitest.esm.config.ts | 12 + sdk/kubernetesconfiguration/ci.mgmt.yml | 4 + 33 files changed, 3447 insertions(+), 39 deletions(-) create mode 100644 sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/CHANGELOG.md create mode 100644 sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/LICENSE create mode 100644 sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/README.md create mode 100644 sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/_meta.json create mode 100644 sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/api-extractor.json create mode 100644 sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/package.json create mode 100644 sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/review/arm-kubernetesconfiguration-extensions.api.md create mode 100644 sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/sample.env create mode 100644 sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/src/extensionsClient.ts create mode 100644 sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/src/index.ts create mode 100644 sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/src/lroImpl.ts create mode 100644 sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/src/models/index.ts create mode 100644 sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/src/models/mappers.ts create mode 100644 sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/src/models/parameters.ts create mode 100644 sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/src/operations/extensions.ts create mode 100644 sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/src/operations/index.ts create mode 100644 sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/src/operations/operationStatus.ts create mode 100644 sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/src/operationsInterfaces/extensions.ts create mode 100644 sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/src/operationsInterfaces/index.ts create mode 100644 sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/src/operationsInterfaces/operationStatus.ts create mode 100644 sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/src/pagingHelper.ts create mode 100644 sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/test/sampleTest.ts create mode 100644 sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/tsconfig.browser.config.json create mode 100644 sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/tsconfig.json create mode 100644 sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/tsconfig.samples.json create mode 100644 sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/tsconfig.src.json create mode 100644 sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/tsconfig.test.json create mode 100644 sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/vitest.browser.config.ts create mode 100644 sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/vitest.config.ts create mode 100644 sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/vitest.esm.config.ts diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 229587c6c8fc..64707425a2a5 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -439,6 +439,9 @@ importers: '@rush-temp/arm-kubernetesconfiguration': specifier: file:./projects/arm-kubernetesconfiguration.tgz version: file:projects/arm-kubernetesconfiguration.tgz + '@rush-temp/arm-kubernetesconfiguration-extensions': + specifier: file:./projects/arm-kubernetesconfiguration-extensions.tgz + version: file:projects/arm-kubernetesconfiguration-extensions.tgz(msw@2.7.0(@types/node@22.7.9)(typescript@5.7.3))(vite@5.4.12(@types/node@22.7.9)) '@rush-temp/arm-kusto': specifier: file:./projects/arm-kusto.tgz version: file:projects/arm-kusto.tgz @@ -2705,7 +2708,7 @@ packages: version: 0.0.0 '@rush-temp/arm-communication@file:projects/arm-communication.tgz': - resolution: {integrity: sha512-5jnCqpuY6z3rgWgy6kM49tMQ8GmBuuhmHfmTPkELkUj/SY69lfQO199xWweZNLBANjPQ1oV7RBow/mDroYiOIA==, tarball: file:projects/arm-communication.tgz} + resolution: {integrity: sha512-PbHAL7W3wC27H1Ywror0uQBeNriBegGylAM7/Im5b8aR/BpoCRr3kJTMypx1F3+T/xRJONxrHKJfyDefYHIz2Q==, tarball: file:projects/arm-communication.tgz} version: 0.0.0 '@rush-temp/arm-compute-1@file:projects/arm-compute-1.tgz': @@ -3044,6 +3047,10 @@ packages: resolution: {integrity: sha512-2Q/FImXfCKzvA6UphwQ5xnbvEN7Sqcjw6iYHyQ8WE4Yc1BcJA0IIsMuffcX0lbL90fmf01Z89LBAiTEmrcepRA==, tarball: file:projects/arm-keyvault.tgz} version: 0.0.0 + '@rush-temp/arm-kubernetesconfiguration-extensions@file:projects/arm-kubernetesconfiguration-extensions.tgz': + resolution: {integrity: sha512-ubjEuPSwt6WIJj7fdI90HJ+YxdJcmqktx4xZ0WEyLcWOCOiV8HgzMQFoDDHr8QwTv0KefazTr74mPWuikC/AlQ==, tarball: file:projects/arm-kubernetesconfiguration-extensions.tgz} + version: 0.0.0 + '@rush-temp/arm-kubernetesconfiguration@file:projects/arm-kubernetesconfiguration.tgz': resolution: {integrity: sha512-uMCytuhkoGwgvYyXkOb+HinlrPi+uMIMmBna4rrjSzrGK2cYd8HoGip5xnmqOF0xQ6NnOFXqSCkv9p8FsxM16A==, tarball: file:projects/arm-kubernetesconfiguration.tgz} version: 0.0.0 @@ -3577,55 +3584,55 @@ packages: version: 0.0.0 '@rush-temp/communication-common@file:projects/communication-common.tgz': - resolution: {integrity: sha512-B096hJCl8KGVcAI4GLoLl0Imon8q/uo6UPQvBFGlRd+10RJqgwVuv6bwQcsIdLZGc9EtFR4dh1WpmJIk/oHkfQ==, tarball: file:projects/communication-common.tgz} + resolution: {integrity: sha512-gLMyuDcbOXQpKwVuepjiX3Q+xFfwDgLkg+CB5zcFRUDT/DkU7DLr3t1aIB4ic0ZnOrlPhe92EDZqYSORilDBQg==, tarball: file:projects/communication-common.tgz} version: 0.0.0 '@rush-temp/communication-email@file:projects/communication-email.tgz': - resolution: {integrity: sha512-kCtc9UyXFNIZpnxLwcKwNh4UXaKq/VL0NbDsNrAcAcMvnb/jGF00cla5XIWx/aDDP4+kKLGGAOLIP03sGlglFg==, tarball: file:projects/communication-email.tgz} + resolution: {integrity: sha512-d7Q8AQwbAi5l1DpOl8n9DUET+PKi1f52IYh6ImSd8jHO72EbZRg9TvoeMf2r1OxpDvYwJObi2FWVajNMyO9Jgw==, tarball: file:projects/communication-email.tgz} version: 0.0.0 '@rush-temp/communication-identity@file:projects/communication-identity.tgz': - resolution: {integrity: sha512-GXi3SsU9e78RWIBopm7ZbFghRH0O58RuR3WbCCb1a58tkDNEwtdlb+BCUEKqmgAg1UyzsNK0DLA9ks0TTQR7tQ==, tarball: file:projects/communication-identity.tgz} + resolution: {integrity: sha512-qUEmURaERnZ8EHvXZB+NpsOtmiIP4QM3DiZ2kUTcGcdqtHexcSARyt8K8g24TxSqZoE7ItPmVcLAqB6A+E+O1A==, tarball: file:projects/communication-identity.tgz} version: 0.0.0 '@rush-temp/communication-job-router-1@file:projects/communication-job-router-1.tgz': - resolution: {integrity: sha512-n2z2bSadooX3ECLjkCFKuepcUpBcSxc2IFMRRn1DeGJhGE6ZcUtyU4+RqeSc6wqNgYR5FDyeoDUK2g4daEacmg==, tarball: file:projects/communication-job-router-1.tgz} + resolution: {integrity: sha512-whYMbdpPBP/4b9qQwjrPHtXGOGpMU7WfcdsqkQjqWUvoeOg6pMrnBi4gcW6dSViwNql0pecfGdqfnfXfvFLkcA==, tarball: file:projects/communication-job-router-1.tgz} version: 0.0.0 '@rush-temp/communication-job-router@file:projects/communication-job-router.tgz': - resolution: {integrity: sha512-8Uocnv0mBRgp67j96CXyVlpyuk+eCN38VoH2z+7n5lPcIkyTlXALBdWXSKmfqvSyHHTR1cPpLs0HvlXEokjdjA==, tarball: file:projects/communication-job-router.tgz} + resolution: {integrity: sha512-gCxmyVPCkjkmeJ0y8m4mK2SO1tJT/SeJC7Ql/X/Rz+u3Ip+ZNd84ZRwWHruLmf0SE2KwjQNnzpNpboVld1pC9g==, tarball: file:projects/communication-job-router.tgz} version: 0.0.0 '@rush-temp/communication-messages@file:projects/communication-messages.tgz': - resolution: {integrity: sha512-ReB7ZS3ys+VFPUzPcmiUQlhyqhaiR08drMVGcMcPYJMCfNmenW6+cZ1AzriNVY0CSio71MQyyh3WDJk/0Z3aPA==, tarball: file:projects/communication-messages.tgz} + resolution: {integrity: sha512-j9FTBSXJdhPlc5W87raemEinMxQKAgBN+W/9M3RsARtNcjP+cQr7bVskAUwQhKlJOB/lqRpgrWie0DUv1bjMVA==, tarball: file:projects/communication-messages.tgz} version: 0.0.0 '@rush-temp/communication-phone-numbers@file:projects/communication-phone-numbers.tgz': - resolution: {integrity: sha512-m2kcdE07LLUjLO+pVUNAW+heNAqNJLo+FfAjbZ3Z4ZjsOH4gWkC3sDhPb2lNZBzRPH8SuBQchhseyggJPED4+A==, tarball: file:projects/communication-phone-numbers.tgz} + resolution: {integrity: sha512-OZGLH3VupuasP1UqK80Eb2MAAqr2epoPVDiXUHD/C7WV4vYvY7VjJzPnd7bLwzmI086M3hycsX9CMWL5fOF+kw==, tarball: file:projects/communication-phone-numbers.tgz} version: 0.0.0 '@rush-temp/communication-recipient-verification@file:projects/communication-recipient-verification.tgz': - resolution: {integrity: sha512-e2/J7CYk4aVzkAz8QrHSxZs5HwS1CaecXw08mFGI/uhDuNxmcWL1oHqRNJCDk8AMGsAzRd6u3neZkJuabfDB6w==, tarball: file:projects/communication-recipient-verification.tgz} + resolution: {integrity: sha512-NcVmJbIgfEwtJQf/ga2Ph+6RiBWi/+97QyWkN2UPNb/bfZQgkv6wxvVyKs89hQqSgdz4tTUUMLSnE7KLMIqxFw==, tarball: file:projects/communication-recipient-verification.tgz} version: 0.0.0 '@rush-temp/communication-rooms@file:projects/communication-rooms.tgz': - resolution: {integrity: sha512-PLrdNfiv+awM5bJVE7hO1uD9TQPJXkC1ScwrwthgA1i8OoQaEWn+vpskW5Mkm50At/a4tl2aAMob2Pz72dSqTw==, tarball: file:projects/communication-rooms.tgz} + resolution: {integrity: sha512-hGNydIoXXsiBVTArnY3NJVZBr/86bfSrYkfoiKl6HP+I3Vl+qACaP1QT/6zhFpNpzFgIiFI9zXse8h8X3Rgj8A==, tarball: file:projects/communication-rooms.tgz} version: 0.0.0 '@rush-temp/communication-short-codes@file:projects/communication-short-codes.tgz': - resolution: {integrity: sha512-Ds1Js7sk+85Ato6lhobS3rv4SyE9QLtWuGcjh1okN0L61Z+oayXi6LjM5XVMD3gzlgV4S6tKgJX4G+yvqv2Mww==, tarball: file:projects/communication-short-codes.tgz} + resolution: {integrity: sha512-iZWG3Ads9TnIUpZspZpxf6ipL0t5oH4kLw4LXyqETGT/432NUJySQY+SlRd0+O3an6El9HAhaX5oHKQgXBirHA==, tarball: file:projects/communication-short-codes.tgz} version: 0.0.0 '@rush-temp/communication-sms@file:projects/communication-sms.tgz': - resolution: {integrity: sha512-HCXJQnm4PLnKjfZutc1vHXh9ed2iq1e5CI6rvjzRw0SzCgfs1GmtwMtt05bJyanzeunaiWLXWMfKHVoQa9MlsA==, tarball: file:projects/communication-sms.tgz} + resolution: {integrity: sha512-RKZPGO0+HQDeiVfDJYvp8vZM2P2hUcQZW4FysWutCiz3irFnTweyc7IBXg5jtK93CxSIu3h64jy9sqlHJkrqgA==, tarball: file:projects/communication-sms.tgz} version: 0.0.0 '@rush-temp/communication-tiering@file:projects/communication-tiering.tgz': - resolution: {integrity: sha512-UqpcP6tGe7h8mJpfdq3qLXa7F6ctb6QHGbJr1cHw7GrUeICfRd8IGX4o2YOtwi7WoRIxcakFLtR3DmJT/aS3sg==, tarball: file:projects/communication-tiering.tgz} + resolution: {integrity: sha512-4uTh9alsftAjGCDlJw6nQZAUTj6EdjVxotuQnswqv/CnPnT+fzofyAlNl3o0dJB2QPnm1RgUXeBZjIBPAnV8Rw==, tarball: file:projects/communication-tiering.tgz} version: 0.0.0 '@rush-temp/communication-toll-free-verification@file:projects/communication-toll-free-verification.tgz': - resolution: {integrity: sha512-Remwrhf8Wr+z3waxN07OrU/VPbgH5ODU42JKx/a0z34FdIcJqtJky/Fdnn/UGY/dE6ID1Ft0tWSSpqjIZXOfMA==, tarball: file:projects/communication-toll-free-verification.tgz} + resolution: {integrity: sha512-8RZPaGQN3pO+8tp/eiOV5vgn9i84iJf4wqqKkFO8nJnK7AzvKc0SGTjrV3JgzdCtNRYpaULZe+lknpryMXJTqA==, tarball: file:projects/communication-toll-free-verification.tgz} version: 0.0.0 '@rush-temp/confidential-ledger@file:projects/confidential-ledger.tgz': @@ -11531,7 +11538,6 @@ snapshots: '@rush-temp/arm-communication@file:projects/arm-communication.tgz(msw@2.7.0(@types/node@22.7.9)(typescript@5.7.3))(vite@5.4.12(@types/node@22.7.9))': dependencies: - '@azure/abort-controller': 1.1.0 '@azure/core-lro': 2.7.2 '@types/node': 18.19.71 '@vitest/browser': 2.1.8(@types/node@18.19.71)(playwright@1.49.1)(typescript@5.7.3)(vite@5.4.12(@types/node@22.7.9))(vitest@2.1.8) @@ -13804,6 +13810,37 @@ snapshots: - '@swc/wasm' - supports-color + '@rush-temp/arm-kubernetesconfiguration-extensions@file:projects/arm-kubernetesconfiguration-extensions.tgz(msw@2.7.0(@types/node@22.7.9)(typescript@5.7.3))(vite@5.4.12(@types/node@22.7.9))': + dependencies: + '@azure/core-lro': 2.7.2 + '@types/node': 18.19.71 + '@vitest/browser': 2.1.8(@types/node@18.19.71)(playwright@1.49.1)(typescript@5.6.3)(vite@5.4.12(@types/node@22.7.9))(vitest@2.1.8) + '@vitest/coverage-istanbul': 2.1.8(vitest@2.1.8) + dotenv: 16.4.7 + playwright: 1.49.1 + tslib: 2.8.1 + typescript: 5.6.3 + vitest: 2.1.8(@types/node@18.19.71)(@vitest/browser@2.1.8)(msw@2.7.0(@types/node@22.7.9)(typescript@5.7.3)) + transitivePeerDependencies: + - '@edge-runtime/vm' + - '@vitest/ui' + - bufferutil + - happy-dom + - jsdom + - less + - lightningcss + - msw + - safaridriver + - sass + - sass-embedded + - stylus + - sugarss + - supports-color + - terser + - utf-8-validate + - vite + - webdriverio + '@rush-temp/arm-kubernetesconfiguration@file:projects/arm-kubernetesconfiguration.tgz': dependencies: '@azure-tools/test-credential': 1.3.1 @@ -16675,13 +16712,11 @@ snapshots: '@vitest/coverage-istanbul': 2.1.8(vitest@2.1.8) eslint: 9.18.0 events: 3.3.0 - inherits: 2.0.4 jwt-decode: 4.0.0 mockdate: 3.0.5 playwright: 1.49.1 tslib: 2.8.1 typescript: 5.7.3 - util: 0.12.5 vitest: 2.1.8(@types/node@18.19.71)(@vitest/browser@2.1.8)(msw@2.7.0(@types/node@22.7.9)(typescript@5.7.3)) transitivePeerDependencies: - '@edge-runtime/vm' @@ -16775,18 +16810,14 @@ snapshots: '@rush-temp/communication-job-router-1@file:projects/communication-job-router-1.tgz(msw@2.7.0(@types/node@22.7.9)(typescript@5.7.3))(vite@5.4.12(@types/node@22.7.9))': dependencies: '@types/node': 18.19.71 - '@types/uuid': 8.3.4 '@vitest/browser': 2.1.8(@types/node@18.19.71)(playwright@1.49.1)(typescript@5.7.3)(vite@5.4.12(@types/node@22.7.9))(vitest@2.1.8) '@vitest/coverage-istanbul': 2.1.8(vitest@2.1.8) dotenv: 16.4.7 eslint: 9.18.0 events: 3.3.0 - inherits: 2.0.4 playwright: 1.49.1 tslib: 2.8.1 typescript: 5.7.3 - util: 0.12.5 - uuid: 8.3.2 vitest: 2.1.8(@types/node@18.19.71)(@vitest/browser@2.1.8)(msw@2.7.0(@types/node@22.7.9)(typescript@5.7.3)) transitivePeerDependencies: - '@edge-runtime/vm' @@ -17047,17 +17078,14 @@ snapshots: dependencies: '@azure/core-lro': 2.7.2 '@types/node': 18.19.71 - '@types/uuid': 8.3.4 '@vitest/browser': 2.1.8(@types/node@18.19.71)(playwright@1.49.1)(typescript@5.7.3)(vite@5.4.12(@types/node@22.7.9))(vitest@2.1.8) '@vitest/coverage-istanbul': 2.1.8(vitest@2.1.8) dotenv: 16.4.7 eslint: 9.18.0 events: 3.3.0 - inherits: 2.0.4 playwright: 1.49.1 tslib: 2.8.1 typescript: 5.7.3 - uuid: 8.3.2 vitest: 2.1.8(@types/node@18.19.71)(@vitest/browser@2.1.8)(msw@2.7.0(@types/node@22.7.9)(typescript@5.7.3)) transitivePeerDependencies: - '@edge-runtime/vm' @@ -17088,7 +17116,6 @@ snapshots: '@vitest/coverage-istanbul': 2.1.8(vitest@2.1.8) dotenv: 16.4.7 eslint: 9.18.0 - inherits: 2.0.4 playwright: 1.49.1 tslib: 2.8.1 typescript: 5.7.3 @@ -20956,7 +20983,7 @@ snapshots: '@types/connect@3.4.38': dependencies: - '@types/node': 18.19.71 + '@types/node': 22.7.9 '@types/cookie@0.4.1': {} @@ -20964,7 +20991,7 @@ snapshots: '@types/cors@2.8.17': dependencies: - '@types/node': 18.19.71 + '@types/node': 22.7.9 '@types/debug@4.1.12': dependencies: @@ -20987,7 +21014,7 @@ snapshots: '@types/express-serve-static-core@4.19.6': dependencies: - '@types/node': 18.19.71 + '@types/node': 22.7.9 '@types/qs': 6.9.18 '@types/range-parser': 1.2.7 '@types/send': 0.17.4 @@ -21002,7 +21029,7 @@ snapshots: '@types/fs-extra@11.0.4': dependencies: '@types/jsonfile': 6.1.4 - '@types/node': 18.19.71 + '@types/node': 22.7.9 '@types/fs-extra@8.1.5': dependencies: @@ -21011,7 +21038,7 @@ snapshots: '@types/glob@7.2.0': dependencies: '@types/minimatch': 5.1.2 - '@types/node': 18.19.71 + '@types/node': 22.7.9 '@types/http-errors@2.0.4': {} @@ -21028,7 +21055,7 @@ snapshots: '@types/jsonfile@6.1.4': dependencies: - '@types/node': 18.19.71 + '@types/node': 22.7.9 '@types/jsonwebtoken@9.0.7': dependencies: @@ -21111,7 +21138,7 @@ snapshots: '@types/readdir-glob@1.1.5': dependencies: - '@types/node': 18.19.71 + '@types/node': 22.7.9 '@types/resolve@1.20.2': {} @@ -21122,7 +21149,7 @@ snapshots: '@types/send@0.17.4': dependencies: '@types/mime': 1.3.5 - '@types/node': 18.19.71 + '@types/node': 22.7.9 '@types/serve-static@1.15.7': dependencies: @@ -21180,7 +21207,7 @@ snapshots: '@types/yauzl@2.10.3': dependencies: - '@types/node': 18.19.71 + '@types/node': 22.7.9 optional: true '@typescript-eslint/eslint-plugin@8.16.0(@typescript-eslint/parser@8.16.0(eslint@9.18.0)(typescript@5.7.3))(eslint@9.18.0)(typescript@5.7.3)': @@ -22151,7 +22178,7 @@ snapshots: dependencies: '@types/cookie': 0.4.1 '@types/cors': 2.8.17 - '@types/node': 18.19.71 + '@types/node': 22.7.9 accepts: 1.3.8 base64id: 2.0.0 cookie: 0.7.2 diff --git a/rush.json b/rush.json index 33ba5b5cdfa1..d55e067a24f3 100644 --- a/rush.json +++ b/rush.json @@ -1,7 +1,7 @@ /** * This is the main configuration file for Rush. * For full documentation, please see https://rushjs.io - */ { + */{ "$schema": "https://developer.microsoft.com/json-schemas/rush/v5/rush.schema.json", /** * (Required) This specifies the version of the Rush engine to be used in this repo. @@ -570,7 +570,9 @@ "projectFolder": "common/tools/dev-tool", "versionPolicyName": "utility", // Add Identity to decoupledLocalDependencies so that dev-tool uses the package from npm, avoiding a cyclic dependency. - "decoupledLocalDependencies": ["@azure/identity"] + "decoupledLocalDependencies": [ + "@azure/identity" + ] }, { "packageName": "@azure/eventgrid", @@ -610,7 +612,9 @@ { "packageName": "@azure/identity", "projectFolder": "sdk/identity/identity", - "decoupledLocalDependencies": ["@azure/keyvault-keys"], + "decoupledLocalDependencies": [ + "@azure/keyvault-keys" + ], "versionPolicyName": "client" }, { @@ -2327,6 +2331,11 @@ "packageName": "@azure/ai-projects", "projectFolder": "sdk/ai/ai-projects", "versionPolicyName": "client" + }, + { + "packageName": "@azure/arm-kubernetesconfiguration-extensions", + "projectFolder": "sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions", + "versionPolicyName": "management" } ] -} +} \ No newline at end of file diff --git a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/CHANGELOG.md b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/CHANGELOG.md new file mode 100644 index 000000000000..40fb68f3b385 --- /dev/null +++ b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/CHANGELOG.md @@ -0,0 +1,7 @@ +# Release History + +## 1.0.0 (2025-01-22) + +### Features Added + +The package of @azure/arm-kubernetesconfiguration-extensions is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart). diff --git a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/LICENSE b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/LICENSE new file mode 100644 index 000000000000..2ad4de7b17f0 --- /dev/null +++ b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2025 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/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/README.md b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/README.md new file mode 100644 index 000000000000..f5f72da8a774 --- /dev/null +++ b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/README.md @@ -0,0 +1,108 @@ +# Azure Extensions client library for JavaScript + +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure Extensions client. + +KubernetesConfiguration Extensions Client + +[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions) | +[Package (NPM)](https://www.npmjs.com/package/@azure/arm-kubernetesconfiguration-extensions) | +[API reference documentation](https://learn.microsoft.com/javascript/api/@azure/arm-kubernetesconfiguration-extensions) | +[Samples](https://github.com/Azure-Samples/azure-samples-js-management) + +## Getting started + +### Currently supported environments + +- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule) +- Latest versions of Safari, Chrome, Edge and Firefox. + +See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details. + +### Prerequisites + +- An [Azure subscription][azure_sub]. + +### Install the `@azure/arm-kubernetesconfiguration-extensions` package + +Install the Azure Extensions client library for JavaScript with `npm`: + +```bash +npm install @azure/arm-kubernetesconfiguration-extensions +``` + +### Create and authenticate a `ExtensionsClient` + +To create a client object to access the Azure Extensions API, you will need the `endpoint` of your Azure Extensions resource and a `credential`. The Azure Extensions client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azure Extensions 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 Extensions** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). + +For more information about how to create an Azure AD Application check out [this guide](https://learn.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). + +```javascript +const { ExtensionsClient } = require("@azure/arm-kubernetesconfiguration-extensions"); +const { DefaultAzureCredential } = require("@azure/identity"); +// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details. + +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new ExtensionsClient(new DefaultAzureCredential(), subscriptionId); + +// For client-side applications running in the browser, use this code instead: +// const credential = new InteractiveBrowserCredential({ +// tenantId: "", +// clientId: "" +// }); +// const client = new ExtensionsClient(credential, 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 + +### ExtensionsClient + +`ExtensionsClient` is the primary interface for developers using the Azure Extensions client library. Explore the methods on this client object to understand the different features of the Azure Extensions 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%2Fkubernetesconfiguration%2Farm-kubernetesconfiguration-extensions%2FREADME.png) + +[azure_cli]: https://learn.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/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/_meta.json b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/_meta.json new file mode 100644 index 000000000000..32ecf26b3e8e --- /dev/null +++ b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/_meta.json @@ -0,0 +1,8 @@ +{ + "commit": "4cf55a3be95af47358f8c4c17a48f7c8719289e7", + "readme": "specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/extensions/readme.md", + "autorest_command": "autorest --version=3.9.7 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/extensions/readme.md --use=@autorest/typescript@^6.0.12", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.18", + "use": "@autorest/typescript@^6.0.12" +} \ No newline at end of file diff --git a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/api-extractor.json b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/api-extractor.json new file mode 100644 index 000000000000..4b3d4ef4e76b --- /dev/null +++ b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/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-kubernetesconfiguration-extensions.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/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/package.json b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/package.json new file mode 100644 index 000000000000..7535cabd9e39 --- /dev/null +++ b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/package.json @@ -0,0 +1,135 @@ +{ + "name": "@azure/arm-kubernetesconfiguration-extensions", + "sdk-type": "mgmt", + "author": "Microsoft Corporation", + "description": "A generated SDK for ExtensionsClient.", + "version": "1.0.0", + "engines": { + "node": ">=18.0.0" + }, + "dependencies": { + "@azure/abort-controller": "^2.1.2", + "@azure/core-auth": "^1.9.0", + "@azure/core-client": "^1.9.2", + "@azure/core-lro": "^2.5.4", + "@azure/core-paging": "^1.6.2", + "@azure/core-rest-pipeline": "^1.18.2", + "tslib": "^2.8.1" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "license": "MIT", + "main": "./dist/commonjs/index.js", + "module": "./dist-esm/src/index.js", + "types": "./dist/commonjs/index.d.ts", + "devDependencies": { + "@azure-tools/test-credential": "^2.0.0", + "@azure-tools/test-recorder": "^4.1.0", + "@azure-tools/test-utils-vitest": "^1.0.0", + "@azure/dev-tool": "^1.0.0", + "@azure/identity": "^4.6.0", + "@types/node": "^18.0.0", + "@vitest/browser": "^2.1.8", + "@vitest/coverage-istanbul": "^2.1.8", + "dotenv": "^16.0.0", + "playwright": "^1.49.1", + "typescript": "~5.6.2", + "vitest": "^2.1.8" + }, + "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/", + "README.md", + "LICENSE", + "review/", + "CHANGELOG.md" + ], + "scripts": { + "build": "npm run clean && dev-tool run build-package && dev-tool run vendored mkdirp ./review && dev-tool run extract-api", + "build:browser": "echo skipped", + "build:node": "echo skipped", + "build:samples": "echo skipped.", + "build:test": "echo skipped", + "check-format": "echo skipped", + "clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", + "execute:samples": "echo skipped", + "extract-api": "dev-tool run extract-api", + "format": "echo skipped", + "integration-test": "npm run integration-test:node && npm run integration-test:browser", + "integration-test:browser": "echo skipped", + "integration-test:node": "dev-tool run test:vitest --esm", + "lint": "echo skipped", + "minify": "dev-tool run vendored uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", + "pack": "npm pack 2>&1", + "prepack": "npm run build", + "test": "npm run integration-test", + "test:browser": "echo skipped", + "test:node": "echo skipped", + "unit-test": "npm run unit-test:node && npm run unit-test:browser", + "unit-test:browser": "echo skipped", + "unit-test:node": "dev-tool run test:vitest", + "update-snippets": "echo skipped" + }, + "sideEffects": false, + "//metadata": { + "constantPaths": [ + { + "path": "src/extensionsClient.ts", + "prefix": "packageDetails" + } + ] + }, + "autoPublish": true, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions", + "type": "module", + "tshy": { + "project": "./tsconfig.src.json", + "exports": { + "./package.json": "./package.json", + ".": "./src/index.ts" + }, + "dialects": [ + "esm", + "commonjs" + ], + "esmDialects": [ + "browser", + "react-native" + ], + "selfLink": false + }, + "browser": "./dist/browser/index.js", + "react-native": "./dist/react-native/index.js", + "exports": { + "./package.json": "./package.json", + ".": { + "browser": { + "types": "./dist/browser/index.d.ts", + "default": "./dist/browser/index.js" + }, + "react-native": { + "types": "./dist/react-native/index.d.ts", + "default": "./dist/react-native/index.js" + }, + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.js" + } + } + } +} \ No newline at end of file diff --git a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/review/arm-kubernetesconfiguration-extensions.api.md b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/review/arm-kubernetesconfiguration-extensions.api.md new file mode 100644 index 000000000000..1a729406788d --- /dev/null +++ b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/review/arm-kubernetesconfiguration-extensions.api.md @@ -0,0 +1,294 @@ +## API Report File for "@azure/arm-kubernetesconfiguration-extensions" + +> 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 { OperationState } from '@azure/core-lro'; +import { PagedAsyncIterableIterator } from '@azure/core-paging'; +import { SimplePollerLike } from '@azure/core-lro'; + +// @public +export type AKSIdentityType = "SystemAssigned" | "UserAssigned"; + +// @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 Extension extends ProxyResource { + aksAssignedIdentity?: ExtensionPropertiesAksAssignedIdentity; + autoUpgradeMinorVersion?: boolean; + configurationProtectedSettings?: { + [propertyName: string]: string; + }; + configurationSettings?: { + [propertyName: string]: string; + }; + readonly currentVersion?: string; + readonly customLocationSettings?: { + [propertyName: string]: string; + }; + readonly errorInfo?: ErrorDetail; + extensionType?: string; + identity?: Identity; + readonly isSystemExtension?: boolean; + readonly packageUri?: string; + plan?: Plan; + readonly provisioningState?: ProvisioningState; + releaseTrain?: string; + scope?: Scope; + statuses?: ExtensionStatus[]; + readonly systemData?: SystemData; + version?: string; +} + +// @public +export interface ExtensionPropertiesAksAssignedIdentity { + readonly principalId?: string; + readonly tenantId?: string; + type?: AKSIdentityType; +} + +// @public +export interface Extensions { + beginCreate(resourceGroupName: string, clusterRp: string, clusterResourceName: string, clusterName: string, extensionName: string, extension: Extension, options?: ExtensionsCreateOptionalParams): Promise, ExtensionsCreateResponse>>; + beginCreateAndWait(resourceGroupName: string, clusterRp: string, clusterResourceName: string, clusterName: string, extensionName: string, extension: Extension, options?: ExtensionsCreateOptionalParams): Promise; + beginDelete(resourceGroupName: string, clusterRp: string, clusterResourceName: string, clusterName: string, extensionName: string, options?: ExtensionsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, clusterRp: string, clusterResourceName: string, clusterName: string, extensionName: string, options?: ExtensionsDeleteOptionalParams): Promise; + beginUpdate(resourceGroupName: string, clusterRp: string, clusterResourceName: string, clusterName: string, extensionName: string, patchExtension: PatchExtension, options?: ExtensionsUpdateOptionalParams): Promise, ExtensionsUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, clusterRp: string, clusterResourceName: string, clusterName: string, extensionName: string, patchExtension: PatchExtension, options?: ExtensionsUpdateOptionalParams): Promise; + get(resourceGroupName: string, clusterRp: string, clusterResourceName: string, clusterName: string, extensionName: string, options?: ExtensionsGetOptionalParams): Promise; + list(resourceGroupName: string, clusterRp: string, clusterResourceName: string, clusterName: string, options?: ExtensionsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public (undocumented) +export class ExtensionsClient extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: ExtensionsClientOptionalParams); + // (undocumented) + apiVersion: string; + // (undocumented) + extensions: Extensions; + // (undocumented) + operationStatus: OperationStatus; + // (undocumented) + subscriptionId: string; +} + +// @public +export interface ExtensionsClientOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + apiVersion?: string; + endpoint?: string; +} + +// @public +export interface ExtensionsCreateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ExtensionsCreateResponse = Extension; + +// @public +export interface ExtensionsDeleteOptionalParams extends coreClient.OperationOptions { + forceDelete?: boolean; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface ExtensionsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ExtensionsGetResponse = Extension; + +// @public +export interface ExtensionsList { + readonly nextLink?: string; + readonly value?: Extension[]; +} + +// @public +export interface ExtensionsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ExtensionsListNextResponse = ExtensionsList; + +// @public +export interface ExtensionsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ExtensionsListResponse = ExtensionsList; + +// @public +export interface ExtensionStatus { + code?: string; + displayStatus?: string; + level?: LevelType; + message?: string; + time?: string; +} + +// @public +export interface ExtensionsUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ExtensionsUpdateResponse = Extension; + +// @public +export function getContinuationToken(page: unknown): string | undefined; + +// @public +export interface Identity { + readonly principalId?: string; + readonly tenantId?: string; + type?: "SystemAssigned"; +} + +// @public +export enum KnownCreatedByType { + Application = "Application", + Key = "Key", + ManagedIdentity = "ManagedIdentity", + User = "User" +} + +// @public +export enum KnownLevelType { + Error = "Error", + Information = "Information", + Warning = "Warning" +} + +// @public +export enum KnownProvisioningState { + Canceled = "Canceled", + Creating = "Creating", + Deleting = "Deleting", + Failed = "Failed", + Succeeded = "Succeeded", + Updating = "Updating" +} + +// @public +export type LevelType = string; + +// @public +export interface OperationStatus { + get(resourceGroupName: string, clusterRp: string, clusterResourceName: string, clusterName: string, extensionName: string, operationId: string, options?: OperationStatusGetOptionalParams): Promise; +} + +// @public +export interface OperationStatusGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationStatusGetResponse = OperationStatusResult; + +// @public +export interface OperationStatusResult { + readonly error?: ErrorDetail; + id?: string; + name?: string; + properties?: { + [propertyName: string]: string; + }; + status: string; +} + +// @public +export interface PatchExtension { + autoUpgradeMinorVersion?: boolean; + configurationProtectedSettings?: { + [propertyName: string]: string; + }; + configurationSettings?: { + [propertyName: string]: string; + }; + releaseTrain?: string; + version?: string; +} + +// @public +export interface Plan { + name: string; + product: string; + promotionCode?: string; + publisher: string; + version?: string; +} + +// @public +export type ProvisioningState = string; + +// @public +export interface ProxyResource extends Resource { +} + +// @public +export interface Resource { + readonly id?: string; + readonly name?: string; + readonly type?: string; +} + +// @public +export interface Scope { + cluster?: ScopeCluster; + namespace?: ScopeNamespace; +} + +// @public +export interface ScopeCluster { + releaseNamespace?: string; +} + +// @public +export interface ScopeNamespace { + targetNamespace?: string; +} + +// @public +export interface SystemData { + createdAt?: Date; + createdBy?: string; + createdByType?: CreatedByType; + lastModifiedAt?: Date; + lastModifiedBy?: string; + lastModifiedByType?: CreatedByType; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/sample.env b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/sample.env new file mode 100644 index 000000000000..508439fc7d62 --- /dev/null +++ b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/sample.env @@ -0,0 +1 @@ +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/src/extensionsClient.ts b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/src/extensionsClient.ts new file mode 100644 index 000000000000..bbba53257cdc --- /dev/null +++ b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/src/extensionsClient.ts @@ -0,0 +1,143 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import * as coreRestPipeline from "@azure/core-rest-pipeline"; +import { + PipelineRequest, + PipelineResponse, + SendRequest, +} from "@azure/core-rest-pipeline"; +import * as coreAuth from "@azure/core-auth"; +import { ExtensionsImpl, OperationStatusImpl } from "./operations/index.js"; +import { Extensions, OperationStatus } from "./operationsInterfaces/index.js"; +import { ExtensionsClientOptionalParams } from "./models/index.js"; + +export class ExtensionsClient extends coreClient.ServiceClient { + $host: string; + subscriptionId: string; + apiVersion: string; + + /** + * Initializes a new instance of the ExtensionsClient 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?: ExtensionsClientOptionalParams, + ) { + 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: ExtensionsClientOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials, + }; + + const packageDetails = `azsdk-js-arm-kubernetesconfiguration-extensions/1.0.0`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix, + }, + endpoint: + options.endpoint ?? options.baseUri ?? "https://management.azure.com", + }; + super(optionsWithDefaults); + + let bearerTokenAuthenticationPolicyFound: boolean = false; + if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) { + const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = + options.pipeline.getOrderedPolicies(); + bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( + (pipelinePolicy) => + pipelinePolicy.name === + coreRestPipeline.bearerTokenAuthenticationPolicyName, + ); + } + if ( + !options || + !options.pipeline || + options.pipeline.getOrderedPolicies().length == 0 || + !bearerTokenAuthenticationPolicyFound + ) { + this.pipeline.removePolicy({ + name: coreRestPipeline.bearerTokenAuthenticationPolicyName, + }); + this.pipeline.addPolicy( + coreRestPipeline.bearerTokenAuthenticationPolicy({ + credential: credentials, + scopes: + optionsWithDefaults.credentialScopes ?? + `${optionsWithDefaults.endpoint}/.default`, + challengeCallbacks: { + authorizeRequestOnChallenge: + coreClient.authorizeRequestOnClaimChallenge, + }, + }), + ); + } + // Parameter assignments + this.subscriptionId = subscriptionId; + + // Assigning values to Constant parameters + this.$host = options.$host || "https://management.azure.com"; + this.apiVersion = options.apiVersion || "2024-11-01"; + this.extensions = new ExtensionsImpl(this); + this.operationStatus = new OperationStatusImpl(this); + this.addCustomApiVersionPolicy(options.apiVersion); + } + + /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */ + private addCustomApiVersionPolicy(apiVersion?: string) { + if (!apiVersion) { + return; + } + const apiVersionPolicy = { + name: "CustomApiVersionPolicy", + async sendRequest( + request: PipelineRequest, + next: SendRequest, + ): Promise { + const param = request.url.split("?"); + if (param.length > 1) { + const newParams = param[1].split("&").map((item) => { + if (item.indexOf("api-version") > -1) { + return "api-version=" + apiVersion; + } else { + return item; + } + }); + request.url = param[0] + "?" + newParams.join("&"); + } + return next(request); + }, + }; + this.pipeline.addPolicy(apiVersionPolicy); + } + + extensions: Extensions; + operationStatus: OperationStatus; +} diff --git a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/src/index.ts b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/src/index.ts new file mode 100644 index 000000000000..23451a92ccc3 --- /dev/null +++ b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/src/index.ts @@ -0,0 +1,13 @@ +/* + * 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 { getContinuationToken } from "./pagingHelper.js"; +export * from "./models/index.js"; +export { ExtensionsClient } from "./extensionsClient.js"; +export * from "./operationsInterfaces/index.js"; diff --git a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/src/lroImpl.ts b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/src/lroImpl.ts new file mode 100644 index 000000000000..5f88efab981b --- /dev/null +++ b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/src/lroImpl.ts @@ -0,0 +1,42 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AbortSignalLike } from "@azure/abort-controller"; +import { LongRunningOperation, LroResponse } from "@azure/core-lro"; + +export function createLroSpec(inputs: { + sendOperationFn: (args: any, spec: any) => Promise>; + args: Record; + spec: { + readonly requestBody?: unknown; + readonly path?: string; + readonly httpMethod: string; + } & Record; +}): LongRunningOperation { + const { args, spec, sendOperationFn } = inputs; + return { + requestMethod: spec.httpMethod, + requestPath: spec.path!, + sendInitialRequest: () => sendOperationFn(args, spec), + sendPollRequest: ( + path: string, + options?: { abortSignal?: AbortSignalLike }, + ) => { + const { requestBody, ...restSpec } = spec; + return sendOperationFn(args, { + ...restSpec, + httpMethod: "GET", + path, + abortSignal: options?.abortSignal, + }); + }, + }; +} diff --git a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/src/models/index.ts b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/src/models/index.ts new file mode 100644 index 000000000000..921f78e0866f --- /dev/null +++ b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/src/models/index.ts @@ -0,0 +1,433 @@ +/* + * 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"; + +/** Scope of the extension. It can be either Cluster or Namespace; but not both. */ +export interface Scope { + /** Specifies that the scope of the extension is Cluster */ + cluster?: ScopeCluster; + /** Specifies that the scope of the extension is Namespace */ + namespace?: ScopeNamespace; +} + +/** Specifies that the scope of the extension is Cluster */ +export interface ScopeCluster { + /** Namespace where the extension Release must be placed, for a Cluster scoped extension. If this namespace does not exist, it will be created */ + releaseNamespace?: string; +} + +/** Specifies that the scope of the extension is Namespace */ +export interface ScopeNamespace { + /** Namespace where the extension will be created for an Namespace scoped extension. If this namespace does not exist, it will be created */ + targetNamespace?: string; +} + +/** Status from the extension. */ +export interface ExtensionStatus { + /** Status code provided by the Extension */ + code?: string; + /** Short description of status of the extension. */ + displayStatus?: string; + /** Level of the status. */ + level?: LevelType; + /** Detailed message of the status from the Extension. */ + message?: string; + /** DateLiteral (per ISO8601) noting the time of installation status. */ + time?: string; +} + +/** 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; +} + +/** Identity of the Extension resource in an AKS cluster */ +export interface ExtensionPropertiesAksAssignedIdentity { + /** + * The principal ID of resource identity. + * 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; + /** The identity type. */ + type?: AKSIdentityType; +} + +/** Identity for the resource. */ +export interface Identity { + /** + * The principal ID of resource identity. + * 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; + /** The identity type. */ + type?: "SystemAssigned"; +} + +/** 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; +} + +/** Plan for the resource. */ +export interface Plan { + /** A user defined name of the 3rd Party Artifact that is being procured. */ + name: string; + /** The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic */ + publisher: string; + /** The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the OfferID specified for the artifact at the time of Data Market onboarding. */ + product: string; + /** A publisher provided promotion code as provisioned in Data Market for the said product/artifact. */ + promotionCode?: string; + /** The version of the desired product/artifact. */ + version?: string; +} + +/** Common fields that are returned in the response for all Azure Resource Manager resources */ +export interface Resource { + /** + * Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * The name of the resource + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; +} + +/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */ +export interface ErrorResponse { + /** The error object. */ + error?: ErrorDetail; +} + +/** The Extension Patch Request object. */ +export interface PatchExtension { + /** Flag to note if this extension participates in auto upgrade of minor version, or not. */ + autoUpgradeMinorVersion?: boolean; + /** ReleaseTrain this extension participates in for auto-upgrade (e.g. Stable, Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. */ + releaseTrain?: string; + /** Version of the extension for this extension, if it is 'pinned' to a specific version. autoUpgradeMinorVersion must be 'false'. */ + version?: string; + /** Configuration settings, as name-value pairs for configuring this extension. */ + configurationSettings?: { [propertyName: string]: string }; + /** Configuration settings that are sensitive, as name-value pairs for configuring this extension. */ + configurationProtectedSettings?: { [propertyName: string]: string }; +} + +/** Result of the request to list Extensions. It contains a list of Extension objects and a URL link to get the next set of results. */ +export interface ExtensionsList { + /** + * List of Extensions within a Kubernetes cluster. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: Extension[]; + /** + * URL to get the next set of extension objects, if any. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** The current status of an async operation. */ +export interface OperationStatusResult { + /** Fully qualified ID for the async operation. */ + id?: string; + /** Name of the async operation. */ + name?: string; + /** Operation status. */ + status: string; + /** Additional information, if available. */ + properties?: { [propertyName: string]: string }; + /** + * If present, details of the operation error. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly error?: ErrorDetail; +} + +/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ +export interface ProxyResource extends Resource {} + +/** The Extension object. */ +export interface Extension extends ProxyResource { + /** Identity of the Extension resource */ + identity?: Identity; + /** + * Top level metadata https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** The plan information. */ + plan?: Plan; + /** Type of the Extension, of which this resource is an instance of. It must be one of the Extension Types registered with Microsoft.KubernetesConfiguration by the Extension publisher. */ + extensionType?: string; + /** Flag to note if this extension participates in auto upgrade of minor version, or not. */ + autoUpgradeMinorVersion?: boolean; + /** ReleaseTrain this extension participates in for auto-upgrade (e.g. Stable, Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. */ + releaseTrain?: string; + /** User-specified version of the extension for this extension to 'pin'. To use 'version', autoUpgradeMinorVersion must be 'false'. */ + version?: string; + /** Scope at which the extension is installed. */ + scope?: Scope; + /** Configuration settings, as name-value pairs for configuring this extension. */ + configurationSettings?: { [propertyName: string]: string }; + /** Configuration settings that are sensitive, as name-value pairs for configuring this extension. */ + configurationProtectedSettings?: { [propertyName: string]: string }; + /** + * Currently installed version of the extension. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly currentVersion?: string; + /** + * Status of installation of this extension. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; + /** Status from this extension. */ + statuses?: ExtensionStatus[]; + /** + * Error information from the Agent - e.g. errors during installation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly errorInfo?: ErrorDetail; + /** + * Custom Location settings properties. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly customLocationSettings?: { [propertyName: string]: string }; + /** + * Uri of the Helm package + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly packageUri?: string; + /** Identity of the Extension resource in an AKS cluster */ + aksAssignedIdentity?: ExtensionPropertiesAksAssignedIdentity; + /** + * Flag to note if this extension is a system extension + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly isSystemExtension?: boolean; +} + +/** Known values of {@link ProvisioningState} that the service accepts. */ +export enum KnownProvisioningState { + /** Succeeded */ + Succeeded = "Succeeded", + /** Failed */ + Failed = "Failed", + /** Canceled */ + Canceled = "Canceled", + /** Creating */ + Creating = "Creating", + /** Updating */ + Updating = "Updating", + /** Deleting */ + Deleting = "Deleting", +} + +/** + * 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 + * **Succeeded** \ + * **Failed** \ + * **Canceled** \ + * **Creating** \ + * **Updating** \ + * **Deleting** + */ +export type ProvisioningState = string; + +/** Known values of {@link LevelType} that the service accepts. */ +export enum KnownLevelType { + /** Error */ + Error = "Error", + /** Warning */ + Warning = "Warning", + /** Information */ + Information = "Information", +} + +/** + * Defines values for LevelType. \ + * {@link KnownLevelType} can be used interchangeably with LevelType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Error** \ + * **Warning** \ + * **Information** + */ +export type LevelType = string; + +/** Known values of {@link CreatedByType} that the service accepts. */ +export enum KnownCreatedByType { + /** User */ + User = "User", + /** Application */ + Application = "Application", + /** ManagedIdentity */ + ManagedIdentity = "ManagedIdentity", + /** Key */ + 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; +/** Defines values for AKSIdentityType. */ +export type AKSIdentityType = "SystemAssigned" | "UserAssigned"; + +/** Optional parameters. */ +export interface ExtensionsCreateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the create operation. */ +export type ExtensionsCreateResponse = Extension; + +/** Optional parameters. */ +export interface ExtensionsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type ExtensionsGetResponse = Extension; + +/** Optional parameters. */ +export interface ExtensionsDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delete the extension resource in Azure - not the normal asynchronous delete. */ + forceDelete?: boolean; + /** 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 ExtensionsUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the update operation. */ +export type ExtensionsUpdateResponse = Extension; + +/** Optional parameters. */ +export interface ExtensionsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type ExtensionsListResponse = ExtensionsList; + +/** Optional parameters. */ +export interface ExtensionsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type ExtensionsListNextResponse = ExtensionsList; + +/** Optional parameters. */ +export interface OperationStatusGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type OperationStatusGetResponse = OperationStatusResult; + +/** Optional parameters. */ +export interface ExtensionsClientOptionalParams + extends coreClient.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Api Version */ + apiVersion?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/src/models/mappers.ts b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/src/models/mappers.ts new file mode 100644 index 000000000000..139e37130ea0 --- /dev/null +++ b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/src/models/mappers.ts @@ -0,0 +1,653 @@ +/* + * 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 Scope: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Scope", + modelProperties: { + cluster: { + serializedName: "cluster", + type: { + name: "Composite", + className: "ScopeCluster", + }, + }, + namespace: { + serializedName: "namespace", + type: { + name: "Composite", + className: "ScopeNamespace", + }, + }, + }, + }, +}; + +export const ScopeCluster: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ScopeCluster", + modelProperties: { + releaseNamespace: { + serializedName: "releaseNamespace", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const ScopeNamespace: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ScopeNamespace", + modelProperties: { + targetNamespace: { + serializedName: "targetNamespace", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const ExtensionStatus: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ExtensionStatus", + modelProperties: { + code: { + serializedName: "code", + type: { + name: "String", + }, + }, + displayStatus: { + serializedName: "displayStatus", + type: { + name: "String", + }, + }, + level: { + defaultValue: "Information", + serializedName: "level", + type: { + name: "String", + }, + }, + message: { + serializedName: "message", + type: { + name: "String", + }, + }, + time: { + serializedName: "time", + type: { + name: "String", + }, + }, + }, + }, +}; + +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 ExtensionPropertiesAksAssignedIdentity: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "ExtensionPropertiesAksAssignedIdentity", + modelProperties: { + principalId: { + serializedName: "principalId", + readOnly: true, + type: { + name: "String", + }, + }, + tenantId: { + serializedName: "tenantId", + readOnly: true, + type: { + name: "String", + }, + }, + type: { + serializedName: "type", + type: { + name: "Enum", + allowedValues: ["SystemAssigned", "UserAssigned"], + }, + }, + }, + }, + }; + +export const Identity: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Identity", + modelProperties: { + principalId: { + serializedName: "principalId", + readOnly: true, + type: { + name: "String", + }, + }, + tenantId: { + serializedName: "tenantId", + readOnly: true, + type: { + name: "String", + }, + }, + type: { + defaultValue: "SystemAssigned", + isConstant: true, + serializedName: "type", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const SystemData: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SystemData", + modelProperties: { + createdBy: { + serializedName: "createdBy", + type: { + name: "String", + }, + }, + createdByType: { + serializedName: "createdByType", + type: { + name: "String", + }, + }, + createdAt: { + serializedName: "createdAt", + type: { + name: "DateTime", + }, + }, + lastModifiedBy: { + serializedName: "lastModifiedBy", + type: { + name: "String", + }, + }, + lastModifiedByType: { + serializedName: "lastModifiedByType", + type: { + name: "String", + }, + }, + lastModifiedAt: { + serializedName: "lastModifiedAt", + type: { + name: "DateTime", + }, + }, + }, + }, +}; + +export const Plan: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Plan", + modelProperties: { + name: { + serializedName: "name", + required: true, + type: { + name: "String", + }, + }, + publisher: { + serializedName: "publisher", + required: true, + type: { + name: "String", + }, + }, + product: { + serializedName: "product", + required: true, + type: { + name: "String", + }, + }, + promotionCode: { + serializedName: "promotionCode", + type: { + name: "String", + }, + }, + version: { + serializedName: "version", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const Resource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Resource", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String", + }, + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String", + }, + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const ErrorResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorResponse", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorDetail", + }, + }, + }, + }, +}; + +export const PatchExtension: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PatchExtension", + modelProperties: { + autoUpgradeMinorVersion: { + defaultValue: true, + serializedName: "properties.autoUpgradeMinorVersion", + type: { + name: "Boolean", + }, + }, + releaseTrain: { + defaultValue: "Stable", + serializedName: "properties.releaseTrain", + type: { + name: "String", + }, + }, + version: { + serializedName: "properties.version", + nullable: true, + type: { + name: "String", + }, + }, + configurationSettings: { + serializedName: "properties.configurationSettings", + nullable: true, + type: { + name: "Dictionary", + value: { type: { name: "String" } }, + }, + }, + configurationProtectedSettings: { + serializedName: "properties.configurationProtectedSettings", + nullable: true, + type: { + name: "Dictionary", + value: { type: { name: "String" } }, + }, + }, + }, + }, +}; + +export const ExtensionsList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ExtensionsList", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Extension", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const OperationStatusResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationStatusResult", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String", + }, + }, + name: { + serializedName: "name", + type: { + name: "String", + }, + }, + status: { + serializedName: "status", + required: true, + type: { + name: "String", + }, + }, + properties: { + serializedName: "properties", + nullable: true, + type: { + name: "Dictionary", + value: { type: { name: "String" } }, + }, + }, + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorDetail", + }, + }, + }, + }, +}; + +export const ProxyResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProxyResource", + modelProperties: { + ...Resource.type.modelProperties, + }, + }, +}; + +export const Extension: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Extension", + modelProperties: { + ...ProxyResource.type.modelProperties, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "Identity", + }, + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData", + }, + }, + plan: { + serializedName: "plan", + type: { + name: "Composite", + className: "Plan", + }, + }, + extensionType: { + serializedName: "properties.extensionType", + type: { + name: "String", + }, + }, + autoUpgradeMinorVersion: { + defaultValue: true, + serializedName: "properties.autoUpgradeMinorVersion", + type: { + name: "Boolean", + }, + }, + releaseTrain: { + defaultValue: "Stable", + serializedName: "properties.releaseTrain", + type: { + name: "String", + }, + }, + version: { + serializedName: "properties.version", + nullable: true, + type: { + name: "String", + }, + }, + scope: { + serializedName: "properties.scope", + type: { + name: "Composite", + className: "Scope", + }, + }, + configurationSettings: { + serializedName: "properties.configurationSettings", + nullable: true, + type: { + name: "Dictionary", + value: { type: { name: "String" } }, + }, + }, + configurationProtectedSettings: { + serializedName: "properties.configurationProtectedSettings", + nullable: true, + type: { + name: "Dictionary", + value: { type: { name: "String" } }, + }, + }, + currentVersion: { + serializedName: "properties.currentVersion", + readOnly: true, + nullable: true, + type: { + name: "String", + }, + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String", + }, + }, + statuses: { + serializedName: "properties.statuses", + nullable: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ExtensionStatus", + }, + }, + }, + }, + errorInfo: { + serializedName: "properties.errorInfo", + type: { + name: "Composite", + className: "ErrorDetail", + }, + }, + customLocationSettings: { + serializedName: "properties.customLocationSettings", + readOnly: true, + nullable: true, + type: { + name: "Dictionary", + value: { type: { name: "String" } }, + }, + }, + packageUri: { + serializedName: "properties.packageUri", + readOnly: true, + nullable: true, + type: { + name: "String", + }, + }, + aksAssignedIdentity: { + serializedName: "properties.aksAssignedIdentity", + type: { + name: "Composite", + className: "ExtensionPropertiesAksAssignedIdentity", + }, + }, + isSystemExtension: { + defaultValue: false, + serializedName: "properties.isSystemExtension", + readOnly: true, + type: { + name: "Boolean", + }, + }, + }, + }, +}; diff --git a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/src/models/parameters.ts b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/src/models/parameters.ts new file mode 100644 index 000000000000..54b1d6273be6 --- /dev/null +++ b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/src/models/parameters.ts @@ -0,0 +1,187 @@ +/* + * 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 { + Extension as ExtensionMapper, + PatchExtension as PatchExtensionMapper, +} from "../models/mappers.js"; + +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", + type: { + name: "String", + }, + }, +}; + +export const extension: OperationParameter = { + parameterPath: "extension", + mapper: ExtensionMapper, +}; + +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 clusterRp: OperationURLParameter = { + parameterPath: "clusterRp", + mapper: { + serializedName: "clusterRp", + required: true, + type: { + name: "String", + }, + }, +}; + +export const clusterResourceName: OperationURLParameter = { + parameterPath: "clusterResourceName", + mapper: { + constraints: { + Pattern: new RegExp("^[a-zA-Z]*$"), + }, + serializedName: "clusterResourceName", + required: true, + type: { + name: "String", + }, + }, +}; + +export const clusterName: OperationURLParameter = { + parameterPath: "clusterName", + mapper: { + constraints: { + Pattern: new RegExp("^.*"), + }, + serializedName: "clusterName", + required: true, + type: { + name: "String", + }, + }, +}; + +export const extensionName: OperationURLParameter = { + parameterPath: "extensionName", + mapper: { + serializedName: "extensionName", + required: true, + type: { + name: "String", + }, + }, +}; + +export const apiVersion: OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + defaultValue: "2024-11-01", + isConstant: true, + serializedName: "api-version", + type: { + name: "String", + }, + }, +}; + +export const forceDelete: OperationQueryParameter = { + parameterPath: ["options", "forceDelete"], + mapper: { + serializedName: "forceDelete", + type: { + name: "Boolean", + }, + }, +}; + +export const patchExtension: OperationParameter = { + parameterPath: "patchExtension", + mapper: PatchExtensionMapper, +}; + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", + mapper: { + serializedName: "nextLink", + required: true, + type: { + name: "String", + }, + }, + skipEncoding: true, +}; + +export const operationId: OperationURLParameter = { + parameterPath: "operationId", + mapper: { + serializedName: "operationId", + required: true, + type: { + name: "String", + }, + }, +}; diff --git a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/src/operations/extensions.ts b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/src/operations/extensions.ts new file mode 100644 index 000000000000..44164b392758 --- /dev/null +++ b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/src/operations/extensions.ts @@ -0,0 +1,769 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper.js"; +import { Extensions } from "../operationsInterfaces/index.js"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import { ExtensionsClient } from "../extensionsClient.js"; +import { + SimplePollerLike, + OperationState, + createHttpPoller, +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl.js"; +import { + Extension, + ExtensionsListNextOptionalParams, + ExtensionsListOptionalParams, + ExtensionsListResponse, + ExtensionsCreateOptionalParams, + ExtensionsCreateResponse, + ExtensionsGetOptionalParams, + ExtensionsGetResponse, + ExtensionsDeleteOptionalParams, + PatchExtension, + ExtensionsUpdateOptionalParams, + ExtensionsUpdateResponse, + ExtensionsListNextResponse, +} from "../models/index.js"; + +/// +/** Class containing Extensions operations. */ +export class ExtensionsImpl implements Extensions { + private readonly client: ExtensionsClient; + + /** + * Initialize a new instance of the class Extensions class. + * @param client Reference to the service client + */ + constructor(client: ExtensionsClient) { + this.client = client; + } + + /** + * List all Extensions in the cluster. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, + * connectedClusters, provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + clusterRp: string, + clusterResourceName: string, + clusterName: string, + options?: ExtensionsListOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll( + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + options, + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + options, + settings, + ); + }, + }; + } + + private async *listPagingPage( + resourceGroupName: string, + clusterRp: string, + clusterResourceName: string, + clusterName: string, + options?: ExtensionsListOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: ExtensionsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list( + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + options, + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + resourceGroupName: string, + clusterRp: string, + clusterResourceName: string, + clusterName: string, + options?: ExtensionsListOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + options, + )) { + yield* page; + } + } + + /** + * Create a new Kubernetes Cluster Extension. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, + * connectedClusters, provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param extensionName Name of the Extension. + * @param extension Properties necessary to Create an Extension. + * @param options The options parameters. + */ + async beginCreate( + resourceGroupName: string, + clusterRp: string, + clusterResourceName: string, + clusterName: string, + extensionName: string, + extension: Extension, + options?: ExtensionsCreateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + ExtensionsCreateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + extensionName, + extension, + options, + }, + spec: createOperationSpec, + }); + const poller = await createHttpPoller< + ExtensionsCreateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation", + }); + await poller.poll(); + return poller; + } + + /** + * Create a new Kubernetes Cluster Extension. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, + * connectedClusters, provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param extensionName Name of the Extension. + * @param extension Properties necessary to Create an Extension. + * @param options The options parameters. + */ + async beginCreateAndWait( + resourceGroupName: string, + clusterRp: string, + clusterResourceName: string, + clusterName: string, + extensionName: string, + extension: Extension, + options?: ExtensionsCreateOptionalParams, + ): Promise { + const poller = await this.beginCreate( + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + extensionName, + extension, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Gets Kubernetes Cluster Extension. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, + * connectedClusters, provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param extensionName Name of the Extension. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + clusterRp: string, + clusterResourceName: string, + clusterName: string, + extensionName: string, + options?: ExtensionsGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + extensionName, + options, + }, + getOperationSpec, + ); + } + + /** + * Delete a Kubernetes Cluster Extension. This will cause the Agent to Uninstall the extension from the + * cluster. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, + * connectedClusters, provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param extensionName Name of the Extension. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + clusterRp: string, + clusterResourceName: string, + clusterName: string, + extensionName: string, + options?: ExtensionsDeleteOptionalParams, + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + extensionName, + options, + }, + spec: deleteOperationSpec, + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation", + }); + await poller.poll(); + return poller; + } + + /** + * Delete a Kubernetes Cluster Extension. This will cause the Agent to Uninstall the extension from the + * cluster. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, + * connectedClusters, provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param extensionName Name of the Extension. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + clusterRp: string, + clusterResourceName: string, + clusterName: string, + extensionName: string, + options?: ExtensionsDeleteOptionalParams, + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + extensionName, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Patch an existing Kubernetes Cluster Extension. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, + * connectedClusters, provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param extensionName Name of the Extension. + * @param patchExtension Properties to Patch in an existing Extension. + * @param options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + clusterRp: string, + clusterResourceName: string, + clusterName: string, + extensionName: string, + patchExtension: PatchExtension, + options?: ExtensionsUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + ExtensionsUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + extensionName, + patchExtension, + options, + }, + spec: updateOperationSpec, + }); + const poller = await createHttpPoller< + ExtensionsUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation", + }); + await poller.poll(); + return poller; + } + + /** + * Patch an existing Kubernetes Cluster Extension. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, + * connectedClusters, provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param extensionName Name of the Extension. + * @param patchExtension Properties to Patch in an existing Extension. + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + clusterRp: string, + clusterResourceName: string, + clusterName: string, + extensionName: string, + patchExtension: PatchExtension, + options?: ExtensionsUpdateOptionalParams, + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + extensionName, + patchExtension, + options, + ); + return poller.pollUntilDone(); + } + + /** + * List all Extensions in the cluster. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, + * connectedClusters, provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + clusterRp: string, + clusterResourceName: string, + clusterName: string, + options?: ExtensionsListOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + options, + }, + listOperationSpec, + ); + } + + /** + * ListNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, + * connectedClusters, provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + clusterRp: string, + clusterResourceName: string, + clusterName: string, + nextLink: string, + options?: ExtensionsListNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + nextLink, + options, + }, + listNextOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const createOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.Extension, + }, + 201: { + bodyMapper: Mappers.Extension, + }, + 202: { + bodyMapper: Mappers.Extension, + }, + 204: { + bodyMapper: Mappers.Extension, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.extension, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterRp, + Parameters.clusterResourceName, + Parameters.clusterName, + Parameters.extensionName, + ], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer, +}; +const getOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Extension, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterRp, + Parameters.clusterResourceName, + Parameters.clusterName, + Parameters.extensionName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion, Parameters.forceDelete], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterRp, + Parameters.clusterResourceName, + Parameters.clusterName, + Parameters.extensionName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.Extension, + }, + 201: { + bodyMapper: Mappers.Extension, + }, + 202: { + bodyMapper: Mappers.Extension, + }, + 204: { + bodyMapper: Mappers.Extension, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.patchExtension, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterRp, + Parameters.clusterResourceName, + Parameters.clusterName, + Parameters.extensionName, + ], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer, +}; +const listOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ExtensionsList, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterRp, + Parameters.clusterResourceName, + Parameters.clusterName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ExtensionsList, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterRp, + Parameters.clusterResourceName, + Parameters.clusterName, + Parameters.nextLink, + ], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/src/operations/index.ts b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/src/operations/index.ts new file mode 100644 index 000000000000..d09378f4f671 --- /dev/null +++ b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/src/operations/index.ts @@ -0,0 +1,10 @@ +/* + * 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 "./extensions.js"; +export * from "./operationStatus.js"; diff --git a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/src/operations/operationStatus.ts b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/src/operations/operationStatus.ts new file mode 100644 index 000000000000..abe997f9747e --- /dev/null +++ b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/src/operations/operationStatus.ts @@ -0,0 +1,93 @@ +/* + * 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 { OperationStatus } from "../operationsInterfaces/index.js"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import { ExtensionsClient } from "../extensionsClient.js"; +import { + OperationStatusGetOptionalParams, + OperationStatusGetResponse, +} from "../models/index.js"; + +/** Class containing OperationStatus operations. */ +export class OperationStatusImpl implements OperationStatus { + private readonly client: ExtensionsClient; + + /** + * Initialize a new instance of the class OperationStatus class. + * @param client Reference to the service client + */ + constructor(client: ExtensionsClient) { + this.client = client; + } + + /** + * Get Async Operation status + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, + * connectedClusters, provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param extensionName Name of the Extension. + * @param operationId operation Id + * @param options The options parameters. + */ + get( + resourceGroupName: string, + clusterRp: string, + clusterResourceName: string, + clusterName: string, + extensionName: string, + operationId: string, + options?: OperationStatusGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + extensionName, + operationId, + options, + }, + getOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}/operations/{operationId}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.OperationStatusResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterRp, + Parameters.clusterResourceName, + Parameters.clusterName, + Parameters.extensionName, + Parameters.operationId, + ], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/src/operationsInterfaces/extensions.ts b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/src/operationsInterfaces/extensions.ts new file mode 100644 index 000000000000..e88135d256b0 --- /dev/null +++ b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/src/operationsInterfaces/extensions.ts @@ -0,0 +1,197 @@ +/* + * 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 { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + Extension, + ExtensionsListOptionalParams, + ExtensionsCreateOptionalParams, + ExtensionsCreateResponse, + ExtensionsGetOptionalParams, + ExtensionsGetResponse, + ExtensionsDeleteOptionalParams, + PatchExtension, + ExtensionsUpdateOptionalParams, + ExtensionsUpdateResponse, +} from "../models/index.js"; + +/// +/** Interface representing a Extensions. */ +export interface Extensions { + /** + * List all Extensions in the cluster. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, + * connectedClusters, provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param options The options parameters. + */ + list( + resourceGroupName: string, + clusterRp: string, + clusterResourceName: string, + clusterName: string, + options?: ExtensionsListOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Create a new Kubernetes Cluster Extension. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, + * connectedClusters, provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param extensionName Name of the Extension. + * @param extension Properties necessary to Create an Extension. + * @param options The options parameters. + */ + beginCreate( + resourceGroupName: string, + clusterRp: string, + clusterResourceName: string, + clusterName: string, + extensionName: string, + extension: Extension, + options?: ExtensionsCreateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + ExtensionsCreateResponse + > + >; + /** + * Create a new Kubernetes Cluster Extension. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, + * connectedClusters, provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param extensionName Name of the Extension. + * @param extension Properties necessary to Create an Extension. + * @param options The options parameters. + */ + beginCreateAndWait( + resourceGroupName: string, + clusterRp: string, + clusterResourceName: string, + clusterName: string, + extensionName: string, + extension: Extension, + options?: ExtensionsCreateOptionalParams, + ): Promise; + /** + * Gets Kubernetes Cluster Extension. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, + * connectedClusters, provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param extensionName Name of the Extension. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + clusterRp: string, + clusterResourceName: string, + clusterName: string, + extensionName: string, + options?: ExtensionsGetOptionalParams, + ): Promise; + /** + * Delete a Kubernetes Cluster Extension. This will cause the Agent to Uninstall the extension from the + * cluster. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, + * connectedClusters, provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param extensionName Name of the Extension. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + clusterRp: string, + clusterResourceName: string, + clusterName: string, + extensionName: string, + options?: ExtensionsDeleteOptionalParams, + ): Promise, void>>; + /** + * Delete a Kubernetes Cluster Extension. This will cause the Agent to Uninstall the extension from the + * cluster. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, + * connectedClusters, provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param extensionName Name of the Extension. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + clusterRp: string, + clusterResourceName: string, + clusterName: string, + extensionName: string, + options?: ExtensionsDeleteOptionalParams, + ): Promise; + /** + * Patch an existing Kubernetes Cluster Extension. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, + * connectedClusters, provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param extensionName Name of the Extension. + * @param patchExtension Properties to Patch in an existing Extension. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + clusterRp: string, + clusterResourceName: string, + clusterName: string, + extensionName: string, + patchExtension: PatchExtension, + options?: ExtensionsUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + ExtensionsUpdateResponse + > + >; + /** + * Patch an existing Kubernetes Cluster Extension. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, + * connectedClusters, provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param extensionName Name of the Extension. + * @param patchExtension Properties to Patch in an existing Extension. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + clusterRp: string, + clusterResourceName: string, + clusterName: string, + extensionName: string, + patchExtension: PatchExtension, + options?: ExtensionsUpdateOptionalParams, + ): Promise; +} diff --git a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/src/operationsInterfaces/index.ts b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/src/operationsInterfaces/index.ts new file mode 100644 index 000000000000..d09378f4f671 --- /dev/null +++ b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/src/operationsInterfaces/index.ts @@ -0,0 +1,10 @@ +/* + * 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 "./extensions.js"; +export * from "./operationStatus.js"; diff --git a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/src/operationsInterfaces/operationStatus.ts b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/src/operationsInterfaces/operationStatus.ts new file mode 100644 index 000000000000..4ede03867484 --- /dev/null +++ b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/src/operationsInterfaces/operationStatus.ts @@ -0,0 +1,37 @@ +/* + * 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 { + OperationStatusGetOptionalParams, + OperationStatusGetResponse, +} from "../models/index.js"; + +/** Interface representing a OperationStatus. */ +export interface OperationStatus { + /** + * Get Async Operation status + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, + * connectedClusters, provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param extensionName Name of the Extension. + * @param operationId operation Id + * @param options The options parameters. + */ + get( + resourceGroupName: string, + clusterRp: string, + clusterResourceName: string, + clusterName: string, + extensionName: string, + operationId: string, + options?: OperationStatusGetOptionalParams, + ): Promise; +} diff --git a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/src/pagingHelper.ts b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/src/pagingHelper.ts new file mode 100644 index 000000000000..205cccc26592 --- /dev/null +++ b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/src/pagingHelper.ts @@ -0,0 +1,39 @@ +/* + * 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 interface PageInfo { + continuationToken?: string; +} + +const pageMap = new WeakMap(); + +/** + * Given the last `.value` produced by the `byPage` iterator, + * returns a continuation token that can be used to begin paging from + * that point later. + * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator. + * @returns The continuation token that can be passed into byPage() during future calls. + */ +export function getContinuationToken(page: unknown): string | undefined { + if (typeof page !== "object" || page === null) { + return undefined; + } + return pageMap.get(page)?.continuationToken; +} + +export function setContinuationToken( + page: unknown, + continuationToken: string | undefined, +): void { + if (typeof page !== "object" || page === null || !continuationToken) { + return; + } + const pageInfo = pageMap.get(page) ?? {}; + pageInfo.continuationToken = continuationToken; + pageMap.set(page, pageInfo); +} diff --git a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/test/sampleTest.ts b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/test/sampleTest.ts new file mode 100644 index 000000000000..a1cf7c25afd2 --- /dev/null +++ b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/test/sampleTest.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + Recorder, + RecorderStartOptions, +} from "@azure-tools/test-recorder"; + +const replaceableVariables: Record = { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id", +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables, +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async (ctx) => { + recorder = new Recorder(ctx); + await recorder.start(recorderOptions); + }); + + afterEach(async () => { + await recorder.stop(); + }); + + it("sample test", async function () { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/tsconfig.browser.config.json b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/tsconfig.browser.config.json new file mode 100644 index 000000000000..0c8bafa97126 --- /dev/null +++ b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/tsconfig.browser.config.json @@ -0,0 +1,6 @@ +{ + "extends": [ + "./tsconfig.test.json", + "../../../tsconfig.browser.base.json" + ] +} diff --git a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/tsconfig.json b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/tsconfig.json new file mode 100644 index 000000000000..b35d05ad6e9d --- /dev/null +++ b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/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/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/tsconfig.samples.json b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/tsconfig.samples.json new file mode 100644 index 000000000000..5b097f97877e --- /dev/null +++ b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/tsconfig.samples.json @@ -0,0 +1,10 @@ +{ + "extends": "../../../tsconfig.samples.base.json", + "compilerOptions": { + "paths": { + "@azure/arm-kubernetesconfiguration-extensions": [ + "./dist/esm" + ] + } + } +} diff --git a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/tsconfig.src.json b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/tsconfig.src.json new file mode 100644 index 000000000000..bae70752dd38 --- /dev/null +++ b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/tsconfig.src.json @@ -0,0 +1,3 @@ +{ + "extends": "../../../tsconfig.lib.json" +} diff --git a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/tsconfig.test.json b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/tsconfig.test.json new file mode 100644 index 000000000000..3c2b783a8c1b --- /dev/null +++ b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/tsconfig.test.json @@ -0,0 +1,6 @@ +{ + "extends": [ + "./tsconfig.src.json", + "../../../tsconfig.test.base.json" + ] +} diff --git a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/vitest.browser.config.ts b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/vitest.browser.config.ts new file mode 100644 index 000000000000..182729ab5ce9 --- /dev/null +++ b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/vitest.browser.config.ts @@ -0,0 +1,17 @@ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { defineConfig, mergeConfig } from "vitest/config"; +import viteConfig from "../../../vitest.browser.shared.config.ts"; + +export default mergeConfig( + viteConfig, + defineConfig({ + test: { + include: ["dist-test/browser/test/**/*.spec.js",], + testTimeout: 1200000, + hookTimeout: 1200000, + }, + }), +); diff --git a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/vitest.config.ts b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/vitest.config.ts new file mode 100644 index 000000000000..40e031385dd8 --- /dev/null +++ b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/vitest.config.ts @@ -0,0 +1,16 @@ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { defineConfig, mergeConfig } from "vitest/config"; +import viteConfig from "../../../vitest.shared.config.ts"; + +export default mergeConfig( + viteConfig, + defineConfig({ + test: { + testTimeout: 1200000, + hookTimeout: 1200000, + }, + }), +); diff --git a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/vitest.esm.config.ts b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/vitest.esm.config.ts new file mode 100644 index 000000000000..a70127279fc9 --- /dev/null +++ b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions/vitest.esm.config.ts @@ -0,0 +1,12 @@ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { mergeConfig } from "vitest/config"; +import vitestConfig from "./vitest.config.ts"; +import vitestEsmConfig from "../../../vitest.esm.shared.config.ts"; + +export default mergeConfig( + vitestConfig, + vitestEsmConfig +); diff --git a/sdk/kubernetesconfiguration/ci.mgmt.yml b/sdk/kubernetesconfiguration/ci.mgmt.yml index bac5cdc3afbb..f6fc7087b870 100644 --- a/sdk/kubernetesconfiguration/ci.mgmt.yml +++ b/sdk/kubernetesconfiguration/ci.mgmt.yml @@ -10,6 +10,7 @@ trigger: include: - sdk/kubernetesconfiguration/ci.mgmt.yml - sdk/kubernetesconfiguration/arm-kubernetesconfiguration + - sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions pr: branches: include: @@ -23,6 +24,7 @@ pr: include: - sdk/kubernetesconfiguration/ci.mgmt.yml - sdk/kubernetesconfiguration/arm-kubernetesconfiguration + - sdk/kubernetesconfiguration/arm-kubernetesconfiguration-extensions extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: @@ -30,3 +32,5 @@ extends: Artifacts: - name: azure-arm-kubernetesconfiguration safeName: azurearmkubernetesconfiguration + - name: azure-arm-kubernetesconfiguration-extensions + safeName: azurearmkubernetesconfigurationextensions