From 503acfc2f7d099a5b9c04257ff9171dfb3aa389a Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 20 Jan 2025 05:53:05 +0000 Subject: [PATCH] CodeGen from PR 32092 in Azure/azure-rest-api-specs Merge 36c79d6cfbcadcef92748fd5c7d66f72e4c45bad into a2f4089b0e0c33d038579a80c23b470d94aeb99a --- common/config/rush/pnpm-lock.yaml | 30 +- .../arm-computeschedule/CHANGELOG.md | 20 +- .../arm-computeschedule/LICENSE | 2 +- .../arm-computeschedule/README.md | 50 +- .../arm-computeschedule/assets.json | 6 - .../arm-computeschedule/eslint.config.mjs | 17 + .../arm-computeschedule/package.json | 49 +- .../review/arm-computeschedule-models.api.md | 306 ------------ .../review/arm-computeschedule.api.md | 40 +- .../arm-computeschedule/sample.env | 2 +- .../samples-dev/operationsListSample.ts | 27 +- ...nsVirtualMachinesCancelOperationsSample.ts | 34 +- ...sVirtualMachinesExecuteDeallocateSample.ts | 47 +- ...nsVirtualMachinesExecuteHibernateSample.ts | 47 +- ...ctionsVirtualMachinesExecuteStartSample.ts | 47 +- ...VirtualMachinesGetOperationErrorsSample.ts | 33 +- ...VirtualMachinesGetOperationStatusSample.ts | 39 +- ...nsVirtualMachinesSubmitDeallocateSample.ts | 75 +-- ...onsVirtualMachinesSubmitHibernateSample.ts | 56 +-- ...ActionsVirtualMachinesSubmitStartSample.ts | 62 +-- .../samples/v1-beta/javascript/README.md | 68 --- .../javascript/operationsListSample.js | 48 -- .../samples/v1-beta/javascript/package.json | 33 -- .../samples/v1-beta/javascript/sample.env | 1 - ...nsVirtualMachinesCancelOperationsSample.js | 46 -- ...sVirtualMachinesExecuteDeallocateSample.js | 62 --- ...nsVirtualMachinesExecuteHibernateSample.js | 62 --- ...ctionsVirtualMachinesExecuteStartSample.js | 62 --- ...VirtualMachinesGetOperationErrorsSample.js | 44 -- ...VirtualMachinesGetOperationStatusSample.js | 49 -- ...nsVirtualMachinesSubmitDeallocateSample.js | 75 --- ...onsVirtualMachinesSubmitHibernateSample.js | 72 --- ...ActionsVirtualMachinesSubmitStartSample.js | 72 --- .../samples/v1-beta/typescript/README.md | 81 ---- .../samples/v1-beta/typescript/package.json | 42 -- .../samples/v1-beta/typescript/sample.env | 1 - .../typescript/src/operationsListSample.ts | 48 -- ...nsVirtualMachinesCancelOperationsSample.ts | 46 -- ...sVirtualMachinesExecuteDeallocateSample.ts | 62 --- ...nsVirtualMachinesExecuteHibernateSample.ts | 62 --- ...ctionsVirtualMachinesExecuteStartSample.ts | 62 --- ...VirtualMachinesGetOperationErrorsSample.ts | 44 -- ...VirtualMachinesGetOperationStatusSample.ts | 49 -- ...nsVirtualMachinesSubmitDeallocateSample.ts | 75 --- ...onsVirtualMachinesSubmitHibernateSample.ts | 72 --- ...ActionsVirtualMachinesSubmitStartSample.ts | 72 --- .../samples/v1-beta/typescript/tsconfig.json | 17 - .../src/api/computeScheduleContext.ts | 12 +- .../arm-computeschedule/src/api/index.ts | 12 + .../src/api/operations/index.ts | 39 +- .../src/{models => api}/options.ts | 0 .../src/api/scheduledActions/index.ts | 453 +++--------------- .../src/classic/operations/index.ts | 4 +- .../src/classic/scheduledActions/index.ts | 62 +-- .../src/computeScheduleClient.ts | 6 +- .../arm-computeschedule/src/index.ts | 11 +- .../arm-computeschedule/src/models/index.ts | 13 +- .../arm-computeschedule/src/models/models.ts | 442 ++++++++++++----- .../computeschedule_operations_test.spec.ts | 44 -- .../test/public/sampleTest.spec.ts | 20 + .../test/public/utils/recordedClient.ts | 4 - .../arm-computeschedule/test/snippets.spec.ts | 27 -- .../arm-computeschedule/tsp-location.yaml | 6 +- sdk/computeschedule/ci.mgmt.yml | 2 - 64 files changed, 677 insertions(+), 2896 deletions(-) delete mode 100644 sdk/computeschedule/arm-computeschedule/assets.json create mode 100644 sdk/computeschedule/arm-computeschedule/eslint.config.mjs delete mode 100644 sdk/computeschedule/arm-computeschedule/review/arm-computeschedule-models.api.md delete mode 100644 sdk/computeschedule/arm-computeschedule/samples/v1-beta/javascript/README.md delete mode 100644 sdk/computeschedule/arm-computeschedule/samples/v1-beta/javascript/operationsListSample.js delete mode 100644 sdk/computeschedule/arm-computeschedule/samples/v1-beta/javascript/package.json delete mode 100644 sdk/computeschedule/arm-computeschedule/samples/v1-beta/javascript/sample.env delete mode 100644 sdk/computeschedule/arm-computeschedule/samples/v1-beta/javascript/scheduledActionsVirtualMachinesCancelOperationsSample.js delete mode 100644 sdk/computeschedule/arm-computeschedule/samples/v1-beta/javascript/scheduledActionsVirtualMachinesExecuteDeallocateSample.js delete mode 100644 sdk/computeschedule/arm-computeschedule/samples/v1-beta/javascript/scheduledActionsVirtualMachinesExecuteHibernateSample.js delete mode 100644 sdk/computeschedule/arm-computeschedule/samples/v1-beta/javascript/scheduledActionsVirtualMachinesExecuteStartSample.js delete mode 100644 sdk/computeschedule/arm-computeschedule/samples/v1-beta/javascript/scheduledActionsVirtualMachinesGetOperationErrorsSample.js delete mode 100644 sdk/computeschedule/arm-computeschedule/samples/v1-beta/javascript/scheduledActionsVirtualMachinesGetOperationStatusSample.js delete mode 100644 sdk/computeschedule/arm-computeschedule/samples/v1-beta/javascript/scheduledActionsVirtualMachinesSubmitDeallocateSample.js delete mode 100644 sdk/computeschedule/arm-computeschedule/samples/v1-beta/javascript/scheduledActionsVirtualMachinesSubmitHibernateSample.js delete mode 100644 sdk/computeschedule/arm-computeschedule/samples/v1-beta/javascript/scheduledActionsVirtualMachinesSubmitStartSample.js delete mode 100644 sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/README.md delete mode 100644 sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/package.json delete mode 100644 sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/sample.env delete mode 100644 sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/src/operationsListSample.ts delete mode 100644 sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/src/scheduledActionsVirtualMachinesCancelOperationsSample.ts delete mode 100644 sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/src/scheduledActionsVirtualMachinesExecuteDeallocateSample.ts delete mode 100644 sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/src/scheduledActionsVirtualMachinesExecuteHibernateSample.ts delete mode 100644 sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/src/scheduledActionsVirtualMachinesExecuteStartSample.ts delete mode 100644 sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/src/scheduledActionsVirtualMachinesGetOperationErrorsSample.ts delete mode 100644 sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/src/scheduledActionsVirtualMachinesGetOperationStatusSample.ts delete mode 100644 sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/src/scheduledActionsVirtualMachinesSubmitDeallocateSample.ts delete mode 100644 sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/src/scheduledActionsVirtualMachinesSubmitHibernateSample.ts delete mode 100644 sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/src/scheduledActionsVirtualMachinesSubmitStartSample.ts delete mode 100644 sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/tsconfig.json rename sdk/computeschedule/arm-computeschedule/src/{models => api}/options.ts (100%) delete mode 100644 sdk/computeschedule/arm-computeschedule/test/public/computeschedule_operations_test.spec.ts create mode 100644 sdk/computeschedule/arm-computeschedule/test/public/sampleTest.spec.ts delete mode 100644 sdk/computeschedule/arm-computeschedule/test/snippets.spec.ts diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 3790a7bdc5e7..8aa365fbf9e3 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -2697,11 +2697,11 @@ packages: version: 0.0.0 '@rush-temp/arm-commerce-profile-2020-09-01-hybrid@file:projects/arm-commerce-profile-2020-09-01-hybrid.tgz': - resolution: {integrity: sha512-BRIK5ZH2ELXs6VzT9EiCUzSwvfVl95kQ5q6LP7ifFXFKj+h6jsP7US+0tTomlxVW6f1hWprP+21VdXTdzC13KQ==, tarball: file:projects/arm-commerce-profile-2020-09-01-hybrid.tgz} + resolution: {integrity: sha512-qbHpCPlW9aqZSg/D4IXUr+J/YAzvAgD8ujq5FQ80VPHUnw9ywUqNwf/Zh4AGuGA/AIMqeTJU6uP062YAGekT8w==, tarball: file:projects/arm-commerce-profile-2020-09-01-hybrid.tgz} version: 0.0.0 '@rush-temp/arm-commerce@file:projects/arm-commerce.tgz': - resolution: {integrity: sha512-StrevIYD6b6YFSAEKAkBfEtLexT8qfn3UIO1c8sfaIkZY73ol85Y7ZlqGJaJqwJABD8J/O4Vm3+PCtxDLCMlSg==, tarball: file:projects/arm-commerce.tgz} + resolution: {integrity: sha512-G/zUXO95sa7K8wDXohSMN63cj70gNPlC6bcDXLN2m3wQzpcZZuuAR0gc/SidkjtekjjsNAWLIxeMHxvoALVzwQ==, tarball: file:projects/arm-commerce.tgz} version: 0.0.0 '@rush-temp/arm-commitmentplans@file:projects/arm-commitmentplans.tgz': @@ -2713,15 +2713,15 @@ packages: version: 0.0.0 '@rush-temp/arm-compute-1@file:projects/arm-compute-1.tgz': - resolution: {integrity: sha512-Wn/WpXvVjLxRfBlWz9NC6Ag8H/95JqQys002LxgiVYZLEVkOr3HJUANqJzxCtCwzCcpofyA7SSUi4qtuBeuhXA==, tarball: file:projects/arm-compute-1.tgz} + resolution: {integrity: sha512-KCS+2o5NlcZoySjnrvsqFeXBXVm6MuIs0Vnx/NL+/nQCnaJGPku6mDBt/PddG17CwWSKdzrTXZFL40G3wDQxcg==, tarball: file:projects/arm-compute-1.tgz} version: 0.0.0 '@rush-temp/arm-compute-profile-2020-09-01-hybrid@file:projects/arm-compute-profile-2020-09-01-hybrid.tgz': - resolution: {integrity: sha512-5WpRUjlqP4XgyoZ24kqOm7a0VrmcB8tZ8Rh4evEDJ8ZIwVPS3mox9CJ+k9jgSCiPo4H0u2+mfpHLkD/Ws+I5Fg==, tarball: file:projects/arm-compute-profile-2020-09-01-hybrid.tgz} + resolution: {integrity: sha512-wRV/k7u9s/kzyieYNmYuR2X12M8hAWAodvJKU9GMPWdqIDJ1yGlC553Zsd8FGDthMZiayOSRQk7wHp6mV3SKUQ==, tarball: file:projects/arm-compute-profile-2020-09-01-hybrid.tgz} version: 0.0.0 '@rush-temp/arm-compute@file:projects/arm-compute.tgz': - resolution: {integrity: sha512-OO/RoX5bHgrnl+q/r6ExY9iFdoBm2y98S4uEoHw9I0rMm4S1NvtAkO/6O/mnf/55OIaBrl9XTD1PPxhCX8se1g==, tarball: file:projects/arm-compute.tgz} + resolution: {integrity: sha512-8uP5wM8iPPLrEHbLFqeJrbVXgyPTKrGEWoNKy7SZhBZ/bQSZfJ804hgllcvqSOjX4ElmcN/Oj6eaNC8lCyMzsA==, tarball: file:projects/arm-compute.tgz} version: 0.0.0 '@rush-temp/arm-computefleet@file:projects/arm-computefleet.tgz': @@ -2729,7 +2729,7 @@ packages: version: 0.0.0 '@rush-temp/arm-computeschedule@file:projects/arm-computeschedule.tgz': - resolution: {integrity: sha512-ib3pXHOqIcDQ6gtwwYl5zxa/HVC4zt6G0McgfgKemX+qsXm6XDFNsah1iDrmQh4G3Gmb2/4WDtxhsff9DCqzww==, tarball: file:projects/arm-computeschedule.tgz} + resolution: {integrity: sha512-huVcaqqgeWnHZNsCJW6edUCHy4mMjrLxo+/517o2xo5m0A5yaWk/U+CE6IFTFGy4Cg1BvRBoa5a0BpoNglQfbg==, tarball: file:projects/arm-computeschedule.tgz} version: 0.0.0 '@rush-temp/arm-confidentialledger@file:projects/arm-confidentialledger.tgz': @@ -3529,7 +3529,7 @@ packages: version: 0.0.0 '@rush-temp/arm-visualstudio@file:projects/arm-visualstudio.tgz': - resolution: {integrity: sha512-bu9H5YDy7yLXx4+KkVwbCPKeCo6jZzKOpwSOmCSuNBJz6w6pSOqX/qhOGKA129u2KDZcwsjurDeu6Xy4LyKLLg==, tarball: file:projects/arm-visualstudio.tgz} + resolution: {integrity: sha512-jSMd70E8RMku4WFq8JC/IhnOE9B55X0vRL59jp8HVOHCZ6lVcynacrVpI8IuUa16gtDhvGJT7gQqp+bGlZB2FQ==, tarball: file:projects/arm-visualstudio.tgz} version: 0.0.0 '@rush-temp/arm-vmwarecloudsimple@file:projects/arm-vmwarecloudsimple.tgz': @@ -3789,11 +3789,11 @@ packages: version: 0.0.0 '@rush-temp/keyvault-admin@file:projects/keyvault-admin.tgz': - resolution: {integrity: sha512-NizLT7d7g7FIam+lwQJpaMWvoM1SIdA0x1rpi4AN/U99Qw4L3PAAEwZjSa+LQmIco2o8/vBNXgmqTt1OFnGcUQ==, tarball: file:projects/keyvault-admin.tgz} + resolution: {integrity: sha512-TJLp2c5+8jmmOQU4o3J1WgjUBym+ALNt47qwn5G4Almpzn6d4fc4fvaNzIGAAEnTkmhuFGjsId4S2frOmIQyXw==, tarball: file:projects/keyvault-admin.tgz} version: 0.0.0 '@rush-temp/keyvault-certificates@file:projects/keyvault-certificates.tgz': - resolution: {integrity: sha512-1jHJ2NsW3OKtSzvwyCPj5WW1JizSDlqn258gIYCUoNpsftDKWYnYew7L1+7AMGtAjJ9DKIlj3FEkGzBBAs05yw==, tarball: file:projects/keyvault-certificates.tgz} + resolution: {integrity: sha512-3NVltxrn+VzpiQ58GHXy0wRiXTva+Xoys2j6Dfx7wrmGNiGbZXrJf5nLW/H/Bzj9ZeHbzFgDY7QUIdXqqJU7lA==, tarball: file:projects/keyvault-certificates.tgz} version: 0.0.0 '@rush-temp/keyvault-common@file:projects/keyvault-common.tgz': @@ -11581,7 +11581,6 @@ snapshots: dotenv: 16.4.7 playwright: 1.49.1 tslib: 2.8.1 - tsx: 4.19.2 typescript: 5.7.3 vitest: 2.1.8(@types/node@18.19.70)(@vitest/browser@2.1.8)(msw@2.7.0(@types/node@22.7.9)(typescript@5.7.3)) transitivePeerDependencies: @@ -11606,7 +11605,6 @@ snapshots: '@rush-temp/arm-compute-profile-2020-09-01-hybrid@file:projects/arm-compute-profile-2020-09-01-hybrid.tgz(msw@2.7.0(@types/node@22.7.9)(typescript@5.7.3))(vite@5.4.11(@types/node@22.7.9))': dependencies: - '@azure/abort-controller': 1.1.0 '@azure/core-lro': 2.7.2 '@types/node': 18.19.70 '@vitest/browser': 2.1.8(@types/node@18.19.70)(playwright@1.49.1)(typescript@5.7.3)(vite@5.4.11(@types/node@22.7.9))(vitest@2.1.8) @@ -11638,7 +11636,6 @@ snapshots: '@rush-temp/arm-compute@file:projects/arm-compute.tgz(msw@2.7.0(@types/node@22.7.9)(typescript@5.7.3))(vite@5.4.11(@types/node@22.7.9))': dependencies: - '@azure-rest/core-client': 1.4.0 '@azure/arm-network': 32.2.0 '@types/node': 18.19.70 '@vitest/browser': 2.1.8(@types/node@18.19.70)(playwright@1.49.1)(typescript@5.7.3)(vite@5.4.11(@types/node@22.7.9))(vitest@2.1.8) @@ -11705,14 +11702,15 @@ snapshots: '@rush-temp/arm-computeschedule@file:projects/arm-computeschedule.tgz(msw@2.7.0(@types/node@22.7.9)(typescript@5.7.3))(vite@5.4.11(@types/node@22.7.9))': dependencies: + '@microsoft/api-extractor': 7.49.1(@types/node@18.19.70) '@types/node': 18.19.70 - '@vitest/browser': 2.1.8(@types/node@18.19.70)(playwright@1.49.1)(typescript@5.7.3)(vite@5.4.11(@types/node@22.7.9))(vitest@2.1.8) + '@vitest/browser': 2.1.8(@types/node@18.19.70)(playwright@1.49.1)(typescript@5.6.3)(vite@5.4.11(@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 playwright: 1.49.1 tslib: 2.8.1 - typescript: 5.7.3 + typescript: 5.6.3 vitest: 2.1.8(@types/node@18.19.70)(@vitest/browser@2.1.8)(msw@2.7.0(@types/node@22.7.9)(typescript@5.7.3)) transitivePeerDependencies: - '@edge-runtime/vm' @@ -21478,7 +21476,7 @@ snapshots: ajv-formats@3.0.1: dependencies: - ajv: 8.13.0 + ajv: 8.17.1 ajv@6.12.6: dependencies: @@ -25116,7 +25114,7 @@ snapshots: resolve-import: 1.4.6 rimraf: 5.0.10 sync-content: 1.0.2 - typescript: 5.5.4 + typescript: 5.7.3 walk-up-path: 3.0.1 tshy@2.0.1: diff --git a/sdk/computeschedule/arm-computeschedule/CHANGELOG.md b/sdk/computeschedule/arm-computeschedule/CHANGELOG.md index 71617cbf5370..83ec420267f7 100644 --- a/sdk/computeschedule/arm-computeschedule/CHANGELOG.md +++ b/sdk/computeschedule/arm-computeschedule/CHANGELOG.md @@ -1,23 +1,7 @@ # Release History - -## 1.0.0-beta.3 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - -## 1.0.0-beta.2 (2024-11-04) - -### Bugs Fixed - -- Fix missing package information issue in user agent -## 1.0.0-beta.1 (2024-09-20) +## 1.0.0 (2025-01-20) ### Features Added -Initial release of the Azure ComputeSchedule package +The package of @azure/arm-computeschedule 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/computeschedule/arm-computeschedule/LICENSE b/sdk/computeschedule/arm-computeschedule/LICENSE index 7d5934740965..2ad4de7b17f0 100644 --- a/sdk/computeschedule/arm-computeschedule/LICENSE +++ b/sdk/computeschedule/arm-computeschedule/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2024 Microsoft +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 diff --git a/sdk/computeschedule/arm-computeschedule/README.md b/sdk/computeschedule/arm-computeschedule/README.md index ee35f1d1666c..907785a5c987 100644 --- a/sdk/computeschedule/arm-computeschedule/README.md +++ b/sdk/computeschedule/arm-computeschedule/README.md @@ -4,8 +4,12 @@ This package contains an isomorphic SDK (runs both in Node.js and in browsers) f Microsoft.ComputeSchedule Resource Provider management API. -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-computeschedule) | -[API reference documentation](https://learn.microsoft.com/javascript/api/@azure/arm-computeschedule?view=azure-node-preview) | +Key links: + +- [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/computeschedule/arm-computeschedule) +- [Package (NPM)](https://www.npmjs.com/package/@azure/arm-computeschedule) +- [API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-computeschedule?view=azure-node-preview) +- [Samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/computeschedule/arm-computeschedule/samples) ## Getting started @@ -42,36 +46,27 @@ npm install @azure/identity ``` You will also need to **register a new AAD application and grant access to Azure ComputeSchedule** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`. - -For more information about how to create an Azure AD Application check out [this guide](https://learn.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). -Using Node.js and Node-like environments, you can use the `DefaultAzureCredential` class to authenticate the client. +For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). -```ts snippet:ReadmeSampleCreateClient_Node -import { ComputeScheduleClient } from "@azure/arm-computeschedule"; -import { DefaultAzureCredential } from "@azure/identity"; +```javascript +const { ComputeScheduleClient } = require("@azure/arm-computeschedule"); +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 ComputeScheduleClient(new DefaultAzureCredential(), subscriptionId); -``` -or browser environments, use the `InteractiveBrowserCredential` from the `@azure/identity` package to authenticate. - -```ts snippet:ReadmeSampleCreateClient_Browser -import { InteractiveBrowserCredential } from "@azure/identity"; -import { ComputeScheduleClient } from "@azure/arm-computeschedule"; - -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const credential = new InteractiveBrowserCredential({ - tenantId: "", - clientId: "", -}); -const client = new ComputeScheduleClient(credential, subscriptionId); +// For client-side applications running in the browser, use this code instead: +// const credential = new InteractiveBrowserCredential({ +// tenantId: "", +// clientId: "" +// }); +// const client = new ComputeScheduleClient(credential, subscriptionId); ``` -### JavaScript Bundle +### 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 @@ -86,14 +81,17 @@ To use this client library in the browser, first you need to use a bundler. For 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`: -```ts snippet:SetLogLevel -import { setLogLevel } from "@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/azure-sdk-for-js/tree/main/sdk/computeschedule/arm-computeschedule/samples) 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. diff --git a/sdk/computeschedule/arm-computeschedule/assets.json b/sdk/computeschedule/arm-computeschedule/assets.json deleted file mode 100644 index 56097bdd918b..000000000000 --- a/sdk/computeschedule/arm-computeschedule/assets.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "AssetsRepo": "Azure/azure-sdk-assets", - "AssetsRepoPrefixPath": "js", - "TagPrefix": "js/computeschedule/arm-computeschedule", - "Tag": "js/computeschedule/arm-computeschedule_f8673fcc1f" -} diff --git a/sdk/computeschedule/arm-computeschedule/eslint.config.mjs b/sdk/computeschedule/arm-computeschedule/eslint.config.mjs new file mode 100644 index 000000000000..03244d34a19f --- /dev/null +++ b/sdk/computeschedule/arm-computeschedule/eslint.config.mjs @@ -0,0 +1,17 @@ +import azsdkEslint from "@azure/eslint-plugin-azure-sdk"; + +export default [ + ...azsdkEslint.configs.recommended, + { + rules: { + "@azure/azure-sdk/ts-modules-only-named": "warn", + "@azure/azure-sdk/ts-apiextractor-json-types": "warn", + "@azure/azure-sdk/ts-package-json-types": "warn", + "@azure/azure-sdk/ts-package-json-engine-is-present": "warn", + "@azure/azure-sdk/ts-package-json-module": "off", + "@azure/azure-sdk/ts-package-json-files-required": "off", + "@azure/azure-sdk/ts-package-json-main-is-cjs": "off", + "tsdoc/syntax": "warn", + }, + }, +]; diff --git a/sdk/computeschedule/arm-computeschedule/package.json b/sdk/computeschedule/arm-computeschedule/package.json index 598b8f86f07b..1c48947bef9f 100644 --- a/sdk/computeschedule/arm-computeschedule/package.json +++ b/sdk/computeschedule/arm-computeschedule/package.json @@ -1,6 +1,6 @@ { "name": "@azure/arm-computeschedule", - "version": "1.0.0-beta.3", + "version": "1.0.0", "description": "A generated SDK for ComputeScheduleClient.", "engines": { "node": ">=18.0.0" @@ -11,8 +11,7 @@ "project": "./tsconfig.src.json", "exports": { "./package.json": "./package.json", - ".": "./src/index.ts", - "./models": "./src/models/index.ts" + ".": "./src/index.ts" }, "dialects": [ "esm", @@ -47,6 +46,7 @@ "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/computeschedule/arm-computeschedule/README.md", "prettier": "@azure/eslint-plugin-azure-sdk/prettier.json", "//metadata": { "constantPaths": [ @@ -57,12 +57,12 @@ ] }, "dependencies": { - "@azure-rest/core-client": "^2.3.2", + "@azure-rest/core-client": "^2.3.1", "@azure/core-auth": "^1.9.0", "@azure/core-rest-pipeline": "^1.18.2", "@azure/core-util": "^1.11.0", "@azure/logger": "^1.1.4", - "tslib": "^2.6.2" + "tslib": "^2.8.1" }, "devDependencies": { "@azure-tools/test-credential": "^2.0.0", @@ -70,19 +70,20 @@ "@azure-tools/test-utils-vitest": "^1.0.0", "@azure/dev-tool": "^1.0.0", "@azure/eslint-plugin-azure-sdk": "^3.0.0", - "@azure/identity": "^4.5.0", + "@azure/identity": "^4.6.0", + "@microsoft/api-extractor": "^7.40.3", "@types/node": "^18.0.0", "@vitest/browser": "^2.1.8", "@vitest/coverage-istanbul": "^2.1.8", "dotenv": "^16.0.0", "eslint": "^9.9.0", "playwright": "^1.49.1", - "typescript": "~5.7.2", + "typescript": "~5.6.2", "vitest": "^2.1.8" }, "scripts": { "build": "npm run clean && dev-tool run build-package && dev-tool run vendored mkdirp ./review && dev-tool run extract-api", - "build:samples": "tsc -p tsconfig.samples.json && dev-tool samples publish -f", + "build:samples": "dev-tool run typecheck --paths samples-dev/*.ts && dev-tool samples publish -f", "build:test": "npm run clean && dev-tool run build-package && dev-tool run build-test", "check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" \"samples-dev/*.ts\"", "clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", @@ -93,8 +94,8 @@ "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", - "lint:fix": "echo skipped", + "lint": "eslint package.json api-extractor.json src test", + "lint:fix": "eslint package.json api-extractor.json src test --fix --fix-type [problem,suggestion]", "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", "test": "npm run clean && dev-tool run build-package && npm run unit-test:node && dev-tool run bundle && npm run unit-test:browser && npm run integration-test", @@ -103,7 +104,7 @@ "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": "dev-tool run update-snippets" + "update-snippets": "echo skipped" }, "//sampleConfiguration": { "productName": "@azure/arm-computeschedule", @@ -111,8 +112,10 @@ "azure" ], "disableDocsMs": true, - "apiRefLink": "https://learn.microsoft.com/javascript/api/@azure/arm-computeschedule?view=azure-node-preview" + "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-computeschedule?view=azure-node-preview" }, + "browser": "./dist/browser/index.js", + "react-native": "./dist/react-native/index.js", "exports": { "./package.json": "./package.json", ".": { @@ -132,29 +135,9 @@ "types": "./dist/commonjs/index.d.ts", "default": "./dist/commonjs/index.js" } - }, - "./models": { - "browser": { - "types": "./dist/browser/models/index.d.ts", - "default": "./dist/browser/models/index.js" - }, - "react-native": { - "types": "./dist/react-native/models/index.d.ts", - "default": "./dist/react-native/models/index.js" - }, - "import": { - "types": "./dist/esm/models/index.d.ts", - "default": "./dist/esm/models/index.js" - }, - "require": { - "types": "./dist/commonjs/models/index.d.ts", - "default": "./dist/commonjs/models/index.js" - } } }, "main": "./dist/commonjs/index.js", "types": "./dist/commonjs/index.d.ts", - "module": "./dist/esm/index.js", - "browser": "./dist/browser/index.js", - "react-native": "./dist/react-native/index.js" + "module": "./dist/esm/index.js" } diff --git a/sdk/computeschedule/arm-computeschedule/review/arm-computeschedule-models.api.md b/sdk/computeschedule/arm-computeschedule/review/arm-computeschedule-models.api.md deleted file mode 100644 index 4e87bf5a2556..000000000000 --- a/sdk/computeschedule/arm-computeschedule/review/arm-computeschedule-models.api.md +++ /dev/null @@ -1,306 +0,0 @@ -## API Report File for "@azure/arm-computeschedule" - -> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). - -```ts - -import { OperationOptions } from '@azure-rest/core-client'; - -// @public -export type ActionType = string; - -// @public -export interface CancelOperationsRequest { - correlationid: string; - operationIds: string[]; -} - -// @public -export interface CancelOperationsResponse { - results: ResourceOperation[]; -} - -// @public -export type DeadlineType = string; - -// @public -export interface DeallocateResourceOperationResponse { - description: string; - location: string; - results?: ResourceOperation[]; - type: string; -} - -// @public -export interface ExecuteDeallocateRequest { - correlationid: string; - executionParameters: ExecutionParameters; - resources: Resources; -} - -// @public -export interface ExecuteHibernateRequest { - correlationid: string; - executionParameters: ExecutionParameters; - resources: Resources; -} - -// @public -export interface ExecuteStartRequest { - correlationid: string; - executionParameters: ExecutionParameters; - resources: Resources; -} - -// @public -export interface ExecutionParameters { - optimizationPreference?: OptimizationPreference; - retryPolicy?: RetryPolicy; -} - -// @public -export interface GetOperationErrorsRequest { - operationIds: string[]; -} - -// @public -export interface GetOperationErrorsResponse { - results: OperationErrorsResult[]; -} - -// @public -export interface GetOperationStatusRequest { - correlationid: string; - operationIds: string[]; -} - -// @public -export interface GetOperationStatusResponse { - results: ResourceOperation[]; -} - -// @public -export interface HibernateResourceOperationResponse { - description: string; - location: string; - results?: ResourceOperation[]; - type: string; -} - -// @public -export enum KnownActionType { - Internal = "Internal" -} - -// @public -export enum KnownDeadlineType { - CompleteBy = "CompleteBy", - InitiateAt = "InitiateAt", - Unknown = "Unknown" -} - -// @public -export enum KnownOperationState { - Blocked = "Blocked", - Cancelled = "Cancelled", - Executing = "Executing", - Failed = "Failed", - PendingExecution = "PendingExecution", - PendingScheduling = "PendingScheduling", - Scheduled = "Scheduled", - Succeeded = "Succeeded", - Unknown = "Unknown" -} - -// @public -export enum KnownOptimizationPreference { - Availability = "Availability", - Cost = "Cost", - CostAvailabilityBalanced = "CostAvailabilityBalanced" -} - -// @public -export enum KnownOrigin { - System = "system", - User = "user", - UserSystem = "user,system" -} - -// @public -export enum KnownResourceOperationType { - Deallocate = "Deallocate", - Hibernate = "Hibernate", - Start = "Start", - Unknown = "Unknown" -} - -// @public -export interface Operation { - actionType?: ActionType; - readonly display?: OperationDisplay; - readonly isDataAction?: boolean; - readonly name?: string; - readonly origin?: Origin; -} - -// @public -export interface OperationDisplay { - readonly description?: string; - readonly operation?: string; - readonly provider?: string; - readonly resource?: string; -} - -// @public -export interface OperationErrorDetails { - crpOperationId: string; - errorCode: string; - errorDetails: string; - timeStamp: string; -} - -// @public -export interface OperationErrorsResult { - activationTime?: string; - completedAt?: string; - creationTime?: string; - operationErrors?: OperationErrorDetails[]; - operationId?: string; - requestErrorCode?: string; - requestErrorDetails?: string; -} - -// @public -export interface OperationsListOptionalParams extends OperationOptions { -} - -// @public -export type OperationState = string; - -// @public -export type OptimizationPreference = string; - -// @public -export type Origin = string; - -// @public -export interface ResourceOperation { - errorCode?: string; - errorDetails?: string; - operation?: ResourceOperationDetails; - resourceId?: string; -} - -// @public -export interface ResourceOperationDetails { - completedAt?: string; - deadline: string; - deadlineType: DeadlineType; - operationId: string; - opType: ResourceOperationType; - resourceId: string; - resourceOperationError?: ResourceOperationError; - retryPolicy?: RetryPolicy; - state: OperationState; - subscriptionId: string; - timeZone?: string; -} - -// @public -export interface ResourceOperationError { - errorCode: string; - errorDetails: string; -} - -// @public -export type ResourceOperationType = string; - -// @public -export interface Resources { - ids: string[]; -} - -// @public -export interface RetryPolicy { - retryCount?: number; - retryWindowInMinutes?: number; -} - -// @public -export interface Schedule { - deadLine: string; - deadlineType: DeadlineType; - timeZone: string; -} - -// @public -export interface ScheduledActionsVirtualMachinesCancelOperationsOptionalParams extends OperationOptions { -} - -// @public -export interface ScheduledActionsVirtualMachinesExecuteDeallocateOptionalParams extends OperationOptions { -} - -// @public -export interface ScheduledActionsVirtualMachinesExecuteHibernateOptionalParams extends OperationOptions { -} - -// @public -export interface ScheduledActionsVirtualMachinesExecuteStartOptionalParams extends OperationOptions { -} - -// @public -export interface ScheduledActionsVirtualMachinesGetOperationErrorsOptionalParams extends OperationOptions { -} - -// @public -export interface ScheduledActionsVirtualMachinesGetOperationStatusOptionalParams extends OperationOptions { -} - -// @public -export interface ScheduledActionsVirtualMachinesSubmitDeallocateOptionalParams extends OperationOptions { -} - -// @public -export interface ScheduledActionsVirtualMachinesSubmitHibernateOptionalParams extends OperationOptions { -} - -// @public -export interface ScheduledActionsVirtualMachinesSubmitStartOptionalParams extends OperationOptions { -} - -// @public -export interface StartResourceOperationResponse { - description: string; - location: string; - results?: ResourceOperation[]; - type: string; -} - -// @public -export interface SubmitDeallocateRequest { - correlationid: string; - executionParameters: ExecutionParameters; - resources: Resources; - schedule: Schedule; -} - -// @public -export interface SubmitHibernateRequest { - correlationid: string; - executionParameters: ExecutionParameters; - resources: Resources; - schedule: Schedule; -} - -// @public -export interface SubmitStartRequest { - correlationid: string; - executionParameters: ExecutionParameters; - resources: Resources; - schedule: Schedule; -} - -// (No @packageDocumentation comment for this package) - -``` diff --git a/sdk/computeschedule/arm-computeschedule/review/arm-computeschedule.api.md b/sdk/computeschedule/arm-computeschedule/review/arm-computeschedule.api.md index 5a3488d73d48..b129895105f0 100644 --- a/sdk/computeschedule/arm-computeschedule/review/arm-computeschedule.api.md +++ b/sdk/computeschedule/arm-computeschedule/review/arm-computeschedule.api.md @@ -142,9 +142,9 @@ export enum KnownOptimizationPreference { // @public export enum KnownOrigin { - System = "system", - User = "user", - UserSystem = "user,system" + "user,system" = "user,system", + system = "system", + user = "user" } // @public @@ -155,10 +155,15 @@ export enum KnownResourceOperationType { Unknown = "Unknown" } +// @public +export enum KnownVersions { + "2024-10-01" = "2024-10-01" +} + // @public export interface Operation { - actionType?: ActionType; - readonly display?: OperationDisplay; + readonly actionType?: ActionType; + display?: OperationDisplay; readonly isDataAction?: boolean; readonly name?: string; readonly origin?: Origin; @@ -174,10 +179,12 @@ export interface OperationDisplay { // @public export interface OperationErrorDetails { - crpOperationId: string; + azureOperationName?: string; + crpOperationId?: string; errorCode: string; errorDetails: string; - timeStamp: string; + timeStamp?: string; + timestamp?: string; } // @public @@ -232,16 +239,17 @@ export interface ResourceOperation { // @public export interface ResourceOperationDetails { completedAt?: string; - deadline: string; - deadlineType: DeadlineType; + deadline?: string; + deadlineType?: DeadlineType; operationId: string; - opType: ResourceOperationType; - resourceId: string; + opType?: ResourceOperationType; + resourceId?: string; resourceOperationError?: ResourceOperationError; retryPolicy?: RetryPolicy; - state: OperationState; - subscriptionId: string; + state?: OperationState; + subscriptionId?: string; timeZone?: string; + timezone?: string; } // @public @@ -266,9 +274,11 @@ export interface RetryPolicy { // @public export interface Schedule { - deadLine: string; + deadLine?: string; + deadline?: string; deadlineType: DeadlineType; - timeZone: string; + timeZone?: string; + timezone?: string; } // @public diff --git a/sdk/computeschedule/arm-computeschedule/sample.env b/sdk/computeschedule/arm-computeschedule/sample.env index efbc7787bd3b..508439fc7d62 100644 --- a/sdk/computeschedule/arm-computeschedule/sample.env +++ b/sdk/computeschedule/arm-computeschedule/sample.env @@ -1 +1 @@ -# Feel free to add your own environment variables. +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/sdk/computeschedule/arm-computeschedule/samples-dev/operationsListSample.ts b/sdk/computeschedule/arm-computeschedule/samples-dev/operationsListSample.ts index ad149e68a186..8fd4be397471 100644 --- a/sdk/computeschedule/arm-computeschedule/samples-dev/operationsListSample.ts +++ b/sdk/computeschedule/arm-computeschedule/samples-dev/operationsListSample.ts @@ -8,32 +8,14 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to list the operations for the provider * * @summary list the operations for the provider - * x-ms-original-file: 2024-08-15-preview/Operations_List_MaximumSet_Gen.json + * x-ms-original-file: 2024-10-01/Operations_List.json */ -async function operationsListMaxGeneratedByMaximumSetRuleGeneratedByMaximumSetRule(): Promise { +async function operationsList(): Promise { const credential = new DefaultAzureCredential(); const subscriptionId = "00000000-0000-0000-0000-00000000000"; const client = new ComputeScheduleClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.operations.list()) { - resArray.push(item); - } - - console.log(resArray); -} - -/** - * This sample demonstrates how to list the operations for the provider - * - * @summary list the operations for the provider - * x-ms-original-file: 2024-08-15-preview/Operations_List_MinimumSet_Gen.json - */ -async function operationsListMaxGeneratedByMaximumSetRuleGeneratedByMinimumSetRule(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-00000000000"; - const client = new ComputeScheduleClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.operations.list()) { + for await (let item of client.operations.list()) { resArray.push(item); } @@ -41,8 +23,7 @@ async function operationsListMaxGeneratedByMaximumSetRuleGeneratedByMinimumSetRu } async function main(): Promise { - await operationsListMaxGeneratedByMaximumSetRuleGeneratedByMaximumSetRule(); - await operationsListMaxGeneratedByMaximumSetRuleGeneratedByMinimumSetRule(); + operationsList(); } main().catch(console.error); diff --git a/sdk/computeschedule/arm-computeschedule/samples-dev/scheduledActionsVirtualMachinesCancelOperationsSample.ts b/sdk/computeschedule/arm-computeschedule/samples-dev/scheduledActionsVirtualMachinesCancelOperationsSample.ts index 3867cf0443d7..f7e94119a1d0 100644 --- a/sdk/computeschedule/arm-computeschedule/samples-dev/scheduledActionsVirtualMachinesCancelOperationsSample.ts +++ b/sdk/computeschedule/arm-computeschedule/samples-dev/scheduledActionsVirtualMachinesCancelOperationsSample.ts @@ -5,42 +5,24 @@ import { ComputeScheduleClient } from "@azure/arm-computeschedule"; import { DefaultAzureCredential } from "@azure/identity"; /** - * This sample demonstrates how to virtualMachinesCancelOperations: cancelOperations for a virtual machine + * This sample demonstrates how to virtualMachinesCancelOperations: Cancel a previously submitted (start/deallocate/hibernate) request * - * @summary virtualMachinesCancelOperations: cancelOperations for a virtual machine - * x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesCancelOperations_MaximumSet_Gen.json + * @summary virtualMachinesCancelOperations: Cancel a previously submitted (start/deallocate/hibernate) request + * x-ms-original-file: 2024-10-01/ScheduledActions_VirtualMachinesCancelOperations.json */ -async function scheduledActionsVirtualMachinesCancelOperationsGeneratedByMaximumSetRuleGeneratedByMaximumSetRule(): Promise { +async function scheduledActionsVirtualMachinesCancelOperations(): Promise { const credential = new DefaultAzureCredential(); - const subscriptionId = "DE84A209-5715-43E7-BC76-3E208A9A82C5"; + const subscriptionId = "D8E30CC0-2763-4FCC-84A8-3C5659281032"; const client = new ComputeScheduleClient(credential, subscriptionId); - const result = await client.scheduledActions.virtualMachinesCancelOperations("tdxypnse", { + const result = await client.scheduledActions.virtualMachinesCancelOperations("eastus2euap", { operationIds: ["23480d2f-1dca-4610-afb4-dd25eec1f34r"], - correlationid: "01080d2f-1dca-4610-afb4-dd25eec1f3c1", - }); - console.log(result); -} - -/** - * This sample demonstrates how to virtualMachinesCancelOperations: cancelOperations for a virtual machine - * - * @summary virtualMachinesCancelOperations: cancelOperations for a virtual machine - * x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesCancelOperations_MinimumSet_Gen.json - */ -async function scheduledActionsVirtualMachinesCancelOperationsGeneratedByMaximumSetRuleGeneratedByMinimumSetRule(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "DE84A209-5715-43E7-BC76-3E208A9A82C5"; - const client = new ComputeScheduleClient(credential, subscriptionId); - const result = await client.scheduledActions.virtualMachinesCancelOperations("lwapkjsbltcqp", { - operationIds: ["23480d2f-1dca-4610-afb4-dd25eec1f34r"], - correlationid: "01080d2f-1dca-4610-afb4-dd25eec1f3c1", + correlationid: "23480d2f-1dca-4610-afb4-gg25eec1f34r", }); console.log(result); } async function main(): Promise { - await scheduledActionsVirtualMachinesCancelOperationsGeneratedByMaximumSetRuleGeneratedByMaximumSetRule(); - await scheduledActionsVirtualMachinesCancelOperationsGeneratedByMaximumSetRuleGeneratedByMinimumSetRule(); + scheduledActionsVirtualMachinesCancelOperations(); } main().catch(console.error); diff --git a/sdk/computeschedule/arm-computeschedule/samples-dev/scheduledActionsVirtualMachinesExecuteDeallocateSample.ts b/sdk/computeschedule/arm-computeschedule/samples-dev/scheduledActionsVirtualMachinesExecuteDeallocateSample.ts index 64fae58efee6..c70764f3dc8b 100644 --- a/sdk/computeschedule/arm-computeschedule/samples-dev/scheduledActionsVirtualMachinesExecuteDeallocateSample.ts +++ b/sdk/computeschedule/arm-computeschedule/samples-dev/scheduledActionsVirtualMachinesExecuteDeallocateSample.ts @@ -5,58 +5,31 @@ import { ComputeScheduleClient } from "@azure/arm-computeschedule"; import { DefaultAzureCredential } from "@azure/identity"; /** - * This sample demonstrates how to virtualMachinesExecuteDeallocate: executeDeallocate for a virtual machine + * This sample demonstrates how to virtualMachinesExecuteDeallocate: Execute deallocate operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. * - * @summary virtualMachinesExecuteDeallocate: executeDeallocate for a virtual machine - * x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesExecuteDeallocate_MaximumSet_Gen.json + * @summary virtualMachinesExecuteDeallocate: Execute deallocate operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. + * x-ms-original-file: 2024-10-01/ScheduledActions_VirtualMachinesExecuteDeallocate.json */ -async function scheduledActionsVirtualMachinesExecuteDeallocateGeneratedByMaximumSetRuleGeneratedByMaximumSetRule(): Promise { +async function scheduledActionsVirtualMachinesExecuteDeallocate(): Promise { const credential = new DefaultAzureCredential(); - const subscriptionId = "DE84A209-5715-43E7-BC76-3E208A9A82C5"; + const subscriptionId = "D8E30CC0-2763-4FCC-84A8-3C5659281032"; const client = new ComputeScheduleClient(credential, subscriptionId); - const result = await client.scheduledActions.virtualMachinesExecuteDeallocate("mklyzgztbivwzo", { + const result = await client.scheduledActions.virtualMachinesExecuteDeallocate("eastus2euap", { executionParameters: { - optimizationPreference: "Cost", - retryPolicy: { retryCount: 30, retryWindowInMinutes: 27 }, + retryPolicy: { retryCount: 4, retryWindowInMinutes: 27 }, }, resources: { ids: [ - "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource2", + "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3", ], }, - correlationid: "01080d2f-1dca-4610-afb4-dd25eddf1f3c1", + correlationid: "23480d2f-1dca-4610-afb4-dd25eec1f34r", }); console.log(result); } -/** - * This sample demonstrates how to virtualMachinesExecuteDeallocate: executeDeallocate for a virtual machine - * - * @summary virtualMachinesExecuteDeallocate: executeDeallocate for a virtual machine - * x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesExecuteDeallocate_MinimumSet_Gen.json - */ -async function scheduledActionsVirtualMachinesExecuteDeallocateGeneratedByMaximumSetRuleGeneratedByMinimumSetRule(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "DE84A209-5715-43E7-BC76-3E208A9A82C5"; - const client = new ComputeScheduleClient(credential, subscriptionId); - const result = await client.scheduledActions.virtualMachinesExecuteDeallocate( - "irbtacrhjgfpyvhvjo", - { - executionParameters: {}, - resources: { - ids: [ - "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource2", - ], - }, - correlationid: "01080d2f-1dca-4610-afb4-dd25eddf1f3c1", - }, - ); - console.log(result); -} - async function main(): Promise { - await scheduledActionsVirtualMachinesExecuteDeallocateGeneratedByMaximumSetRuleGeneratedByMaximumSetRule(); - await scheduledActionsVirtualMachinesExecuteDeallocateGeneratedByMaximumSetRuleGeneratedByMinimumSetRule(); + scheduledActionsVirtualMachinesExecuteDeallocate(); } main().catch(console.error); diff --git a/sdk/computeschedule/arm-computeschedule/samples-dev/scheduledActionsVirtualMachinesExecuteHibernateSample.ts b/sdk/computeschedule/arm-computeschedule/samples-dev/scheduledActionsVirtualMachinesExecuteHibernateSample.ts index 7e025e0a540a..03c594695eb3 100644 --- a/sdk/computeschedule/arm-computeschedule/samples-dev/scheduledActionsVirtualMachinesExecuteHibernateSample.ts +++ b/sdk/computeschedule/arm-computeschedule/samples-dev/scheduledActionsVirtualMachinesExecuteHibernateSample.ts @@ -5,58 +5,31 @@ import { ComputeScheduleClient } from "@azure/arm-computeschedule"; import { DefaultAzureCredential } from "@azure/identity"; /** - * This sample demonstrates how to virtualMachinesExecuteHibernate: executeHibernate for a virtual machine + * This sample demonstrates how to virtualMachinesExecuteHibernate: Execute hibernate operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. * - * @summary virtualMachinesExecuteHibernate: executeHibernate for a virtual machine - * x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesExecuteHibernate_MaximumSet_Gen.json + * @summary virtualMachinesExecuteHibernate: Execute hibernate operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. + * x-ms-original-file: 2024-10-01/ScheduledActions_VirtualMachinesExecuteHibernate.json */ -async function scheduledActionsVirtualMachinesExecuteHibernateGeneratedByMaximumSetRuleGeneratedByMaximumSetRule(): Promise { +async function scheduledActionsVirtualMachinesExecuteHibernate(): Promise { const credential = new DefaultAzureCredential(); - const subscriptionId = "DE84A209-5715-43E7-BC76-3E208A9A82C5"; + const subscriptionId = "D8E30CC0-2763-4FCC-84A8-3C5659281032"; const client = new ComputeScheduleClient(credential, subscriptionId); - const result = await client.scheduledActions.virtualMachinesExecuteHibernate( - "sejdmamuhhvfpljomwumsplc", - { - executionParameters: { - optimizationPreference: "Cost", - retryPolicy: { retryCount: 30, retryWindowInMinutes: 27 }, - }, - resources: { - ids: [ - "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3", - ], - }, - correlationid: "01080d2f-1dca-4610-afb4-dd25eec1f3c1", + const result = await client.scheduledActions.virtualMachinesExecuteHibernate("eastus2euap", { + executionParameters: { + retryPolicy: { retryCount: 5, retryWindowInMinutes: 27 }, }, - ); - console.log(result); -} - -/** - * This sample demonstrates how to virtualMachinesExecuteHibernate: executeHibernate for a virtual machine - * - * @summary virtualMachinesExecuteHibernate: executeHibernate for a virtual machine - * x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesExecuteHibernate_MinimumSet_Gen.json - */ -async function scheduledActionsVirtualMachinesExecuteHibernateGeneratedByMaximumSetRuleGeneratedByMinimumSetRule(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "DE84A209-5715-43E7-BC76-3E208A9A82C5"; - const client = new ComputeScheduleClient(credential, subscriptionId); - const result = await client.scheduledActions.virtualMachinesExecuteHibernate("kga", { - executionParameters: {}, resources: { ids: [ "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3", ], }, - correlationid: "01080d2f-1dca-4610-afb4-dd25eec1f3c1", + correlationid: "23480d2f-1dca-4610-afb4-dd25eec1f34r", }); console.log(result); } async function main(): Promise { - await scheduledActionsVirtualMachinesExecuteHibernateGeneratedByMaximumSetRuleGeneratedByMaximumSetRule(); - await scheduledActionsVirtualMachinesExecuteHibernateGeneratedByMaximumSetRuleGeneratedByMinimumSetRule(); + scheduledActionsVirtualMachinesExecuteHibernate(); } main().catch(console.error); diff --git a/sdk/computeschedule/arm-computeschedule/samples-dev/scheduledActionsVirtualMachinesExecuteStartSample.ts b/sdk/computeschedule/arm-computeschedule/samples-dev/scheduledActionsVirtualMachinesExecuteStartSample.ts index dfe9e35d3c23..e37fa4998a48 100644 --- a/sdk/computeschedule/arm-computeschedule/samples-dev/scheduledActionsVirtualMachinesExecuteStartSample.ts +++ b/sdk/computeschedule/arm-computeschedule/samples-dev/scheduledActionsVirtualMachinesExecuteStartSample.ts @@ -5,58 +5,31 @@ import { ComputeScheduleClient } from "@azure/arm-computeschedule"; import { DefaultAzureCredential } from "@azure/identity"; /** - * This sample demonstrates how to virtualMachinesExecuteStart: executeStart for a virtual machine + * This sample demonstrates how to virtualMachinesExecuteStart: Execute start operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. * - * @summary virtualMachinesExecuteStart: executeStart for a virtual machine - * x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesExecuteStart_MaximumSet_Gen.json + * @summary virtualMachinesExecuteStart: Execute start operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. + * x-ms-original-file: 2024-10-01/ScheduledActions_VirtualMachinesExecuteStart.json */ -async function scheduledActionsVirtualMachinesExecuteStartGeneratedByMaximumSetRuleGeneratedByMaximumSetRule(): Promise { +async function scheduledActionsVirtualMachinesExecuteStart(): Promise { const credential = new DefaultAzureCredential(); - const subscriptionId = "DE84A209-5715-43E7-BC76-3E208A9A82C5"; + const subscriptionId = "D8E30CC0-2763-4FCC-84A8-3C5659281032"; const client = new ComputeScheduleClient(credential, subscriptionId); - const result = await client.scheduledActions.virtualMachinesExecuteStart("ysfrwcfmfsh", { + const result = await client.scheduledActions.virtualMachinesExecuteStart("eastus2euap", { executionParameters: { - optimizationPreference: "Cost", - retryPolicy: { retryCount: 30, retryWindowInMinutes: 27 }, + retryPolicy: { retryCount: 2, retryWindowInMinutes: 27 }, }, resources: { ids: [ - "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource4", + "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3", ], }, - correlationid: "23230d2f-1dca-4610-afb4-dd25eec1f34", + correlationid: "23480d2f-1dca-4610-afb4-dd25eec1f34r", }); console.log(result); } -/** - * This sample demonstrates how to virtualMachinesExecuteStart: executeStart for a virtual machine - * - * @summary virtualMachinesExecuteStart: executeStart for a virtual machine - * x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesExecuteStart_MinimumSet_Gen.json - */ -async function scheduledActionsVirtualMachinesExecuteStartGeneratedByMaximumSetRuleGeneratedByMinimumSetRule(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "DE84A209-5715-43E7-BC76-3E208A9A82C5"; - const client = new ComputeScheduleClient(credential, subscriptionId); - const result = await client.scheduledActions.virtualMachinesExecuteStart( - "qegbgjculewswqvnmaclcgpqqidl", - { - executionParameters: {}, - resources: { - ids: [ - "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource4", - ], - }, - correlationid: "23230d2f-1dca-4610-afb4-dd25eec1f34", - }, - ); - console.log(result); -} - async function main(): Promise { - await scheduledActionsVirtualMachinesExecuteStartGeneratedByMaximumSetRuleGeneratedByMaximumSetRule(); - await scheduledActionsVirtualMachinesExecuteStartGeneratedByMaximumSetRuleGeneratedByMinimumSetRule(); + scheduledActionsVirtualMachinesExecuteStart(); } main().catch(console.error); diff --git a/sdk/computeschedule/arm-computeschedule/samples-dev/scheduledActionsVirtualMachinesGetOperationErrorsSample.ts b/sdk/computeschedule/arm-computeschedule/samples-dev/scheduledActionsVirtualMachinesGetOperationErrorsSample.ts index d48605745122..c5f733431e6f 100644 --- a/sdk/computeschedule/arm-computeschedule/samples-dev/scheduledActionsVirtualMachinesGetOperationErrorsSample.ts +++ b/sdk/computeschedule/arm-computeschedule/samples-dev/scheduledActionsVirtualMachinesGetOperationErrorsSample.ts @@ -5,40 +5,23 @@ import { ComputeScheduleClient } from "@azure/arm-computeschedule"; import { DefaultAzureCredential } from "@azure/identity"; /** - * This sample demonstrates how to virtualMachinesGetOperationErrors: getOperationErrors associated with an operation on a virtual machine + * This sample demonstrates how to virtualMachinesGetOperationErrors: Get error details on operation errors (like transient errors encountered, additional logs) if they exist. * - * @summary virtualMachinesGetOperationErrors: getOperationErrors associated with an operation on a virtual machine - * x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesGetOperationErrors_MaximumSet_Gen.json + * @summary virtualMachinesGetOperationErrors: Get error details on operation errors (like transient errors encountered, additional logs) if they exist. + * x-ms-original-file: 2024-10-01/ScheduledActions_VirtualMachinesGetOperationErrors.json */ -async function csScheduledActionsVirtualMachinesGetOperationErrorsMax(): Promise { +async function scheduledActionsVirtualMachinesGetOperationErrors(): Promise { const credential = new DefaultAzureCredential(); - const subscriptionId = "DE84A209-5715-43E7-BC76-3E208A9A82C5"; + const subscriptionId = "D8E30CC0-2763-4FCC-84A8-3C5659281032"; const client = new ComputeScheduleClient(credential, subscriptionId); - const result = await client.scheduledActions.virtualMachinesGetOperationErrors("hfsa", { - operationIds: ["DE84A209-5715-43E7-BC76-3E208A9A323"], - }); - console.log(result); -} - -/** - * This sample demonstrates how to virtualMachinesGetOperationErrors: getOperationErrors associated with an operation on a virtual machine - * - * @summary virtualMachinesGetOperationErrors: getOperationErrors associated with an operation on a virtual machine - * x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesGetOperationErrors_MinimumSet_Gen.json - */ -async function csScheduledActionsVirtualMachinesGetOperationErrorsMin(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "DE84A209-5715-43E7-BC76-3E208A9A82C5"; - const client = new ComputeScheduleClient(credential, subscriptionId); - const result = await client.scheduledActions.virtualMachinesGetOperationErrors("ggxoaxzxtdbi", { - operationIds: ["qeicik"], + const result = await client.scheduledActions.virtualMachinesGetOperationErrors("eastus2euap", { + operationIds: ["23480d2f-1dca-4610-afb4-dd25eec1f34r"], }); console.log(result); } async function main(): Promise { - await csScheduledActionsVirtualMachinesGetOperationErrorsMax(); - await csScheduledActionsVirtualMachinesGetOperationErrorsMin(); + scheduledActionsVirtualMachinesGetOperationErrors(); } main().catch(console.error); diff --git a/sdk/computeschedule/arm-computeschedule/samples-dev/scheduledActionsVirtualMachinesGetOperationStatusSample.ts b/sdk/computeschedule/arm-computeschedule/samples-dev/scheduledActionsVirtualMachinesGetOperationStatusSample.ts index 5693bf75e1fc..60cbfaa9cc90 100644 --- a/sdk/computeschedule/arm-computeschedule/samples-dev/scheduledActionsVirtualMachinesGetOperationStatusSample.ts +++ b/sdk/computeschedule/arm-computeschedule/samples-dev/scheduledActionsVirtualMachinesGetOperationStatusSample.ts @@ -5,45 +5,24 @@ import { ComputeScheduleClient } from "@azure/arm-computeschedule"; import { DefaultAzureCredential } from "@azure/identity"; /** - * This sample demonstrates how to virtualMachinesGetOperationStatus: getOperationStatus for a virtual machine + * This sample demonstrates how to virtualMachinesGetOperationStatus: Polling endpoint to read status of operations performed on virtual machines * - * @summary virtualMachinesGetOperationStatus: getOperationStatus for a virtual machine - * x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesGetOperationStatus_MaximumSet_Gen.json + * @summary virtualMachinesGetOperationStatus: Polling endpoint to read status of operations performed on virtual machines + * x-ms-original-file: 2024-10-01/ScheduledActions_VirtualMachinesGetOperationStatus.json */ -async function scheduledActionsVirtualMachinesGetOperationStatusGeneratedByMinimumSetRuleGeneratedByMaximumSetRule(): Promise { +async function scheduledActionsVirtualMachinesGetOperationStatus(): Promise { const credential = new DefaultAzureCredential(); - const subscriptionId = "DE84A209-5715-43E7-BC76-3E208A9A82C5"; + const subscriptionId = "D8E30CC0-2763-4FCC-84A8-3C5659281032"; const client = new ComputeScheduleClient(credential, subscriptionId); - const result = await client.scheduledActions.virtualMachinesGetOperationStatus( - "htxxasfxaesuecem", - { - operationIds: ["01080d2f-1dca-4610-afb4-dd25eec1f3df"], - correlationid: "01080d2f-1dca-4610-afb4-dd25eec1f3c1", - }, - ); - console.log(result); -} - -/** - * This sample demonstrates how to virtualMachinesGetOperationStatus: getOperationStatus for a virtual machine - * - * @summary virtualMachinesGetOperationStatus: getOperationStatus for a virtual machine - * x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesGetOperationStatus_MinimumSet_Gen.json - */ -async function scheduledActionsVirtualMachinesGetOperationStatusGeneratedByMinimumSetRule(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "DE84A209-5715-43E7-BC76-3E208A9A82C5"; - const client = new ComputeScheduleClient(credential, subscriptionId); - const result = await client.scheduledActions.virtualMachinesGetOperationStatus("csay", { - operationIds: ["01080d2f-1dca-4610-afb4-dd25eec1f3df"], - correlationid: "01080d2f-1dca-4610-afb4-dd25eec1f3c1", + const result = await client.scheduledActions.virtualMachinesGetOperationStatus("eastus2euap", { + operationIds: ["23480d2f-1dca-4610-afb4-dd25eec1f34r"], + correlationid: "35780d2f-1dca-4610-afb4-dd25eec1f34r", }); console.log(result); } async function main(): Promise { - await scheduledActionsVirtualMachinesGetOperationStatusGeneratedByMinimumSetRuleGeneratedByMaximumSetRule(); - await scheduledActionsVirtualMachinesGetOperationStatusGeneratedByMinimumSetRule(); + scheduledActionsVirtualMachinesGetOperationStatus(); } main().catch(console.error); diff --git a/sdk/computeschedule/arm-computeschedule/samples-dev/scheduledActionsVirtualMachinesSubmitDeallocateSample.ts b/sdk/computeschedule/arm-computeschedule/samples-dev/scheduledActionsVirtualMachinesSubmitDeallocateSample.ts index 50014024c441..09bae26873cd 100644 --- a/sdk/computeschedule/arm-computeschedule/samples-dev/scheduledActionsVirtualMachinesSubmitDeallocateSample.ts +++ b/sdk/computeschedule/arm-computeschedule/samples-dev/scheduledActionsVirtualMachinesSubmitDeallocateSample.ts @@ -5,71 +5,36 @@ import { ComputeScheduleClient } from "@azure/arm-computeschedule"; import { DefaultAzureCredential } from "@azure/identity"; /** - * This sample demonstrates how to virtualMachinesSubmitDeallocate: submitDeallocate for a virtual machine + * This sample demonstrates how to virtualMachinesSubmitDeallocate: Schedule deallocate operation for a batch of virtual machines at datetime in future. * - * @summary virtualMachinesSubmitDeallocate: submitDeallocate for a virtual machine - * x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesSubmitDeallocate_MaximumSet_Gen.json + * @summary virtualMachinesSubmitDeallocate: Schedule deallocate operation for a batch of virtual machines at datetime in future. + * x-ms-original-file: 2024-10-01/ScheduledActions_VirtualMachinesSubmitDeallocate.json */ -async function scheduledActionsVirtualMachinesSubmitDeallocateGeneratedByMaximumSetRuleGeneratedByMaximumSetRule(): Promise { +async function scheduledActionsVirtualMachinesSubmitDeallocate(): Promise { const credential = new DefaultAzureCredential(); - const subscriptionId = "DE84A209-5715-43E7-BC76-3E208A9A82C5"; + const subscriptionId = "D8E30CC0-2763-4FCC-84A8-3C5659281032"; const client = new ComputeScheduleClient(credential, subscriptionId); - const result = await client.scheduledActions.virtualMachinesSubmitDeallocate( - "ibfxsvilwrgqttuslbduzdtxcckdet", - { - schedule: { - deadLine: "2024-07-12T18:06:53.361Z", - timeZone: "zlcujrtgxtgyik", - deadlineType: "Unknown", - }, - executionParameters: { - optimizationPreference: "Cost", - retryPolicy: { retryCount: 30, retryWindowInMinutes: 27 }, - }, - resources: { - ids: [ - "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource2", - ], - }, - correlationid: "23519o2f-1dca-4610-afb4-dd25eec1f34", + const result = await client.scheduledActions.virtualMachinesSubmitDeallocate("eastus2euap", { + schedule: { + deadline: "2024-11-01T17:52:54.215Z", + timezone: "UTC", + deadlineType: "InitiateAt", }, - ); - console.log(result); -} - -/** - * This sample demonstrates how to virtualMachinesSubmitDeallocate: submitDeallocate for a virtual machine - * - * @summary virtualMachinesSubmitDeallocate: submitDeallocate for a virtual machine - * x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesSubmitDeallocate_MinimumSet_Gen.json - */ -async function scheduledActionsVirtualMachinesSubmitDeallocateGeneratedByMaximumSetRuleGeneratedByMinimumSetRule(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "DE84A209-5715-43E7-BC76-3E208A9A82C5"; - const client = new ComputeScheduleClient(credential, subscriptionId); - const result = await client.scheduledActions.virtualMachinesSubmitDeallocate( - "qwfcdtmshnlownbkyh", - { - schedule: { - deadLine: "2024-07-12T18:06:53.361Z", - timeZone: "zlcujrtgxtgyik", - deadlineType: "Unknown", - }, - executionParameters: {}, - resources: { - ids: [ - "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource2", - ], - }, - correlationid: "23519o2f-1dca-4610-afb4-dd25eec1f34", + executionParameters: { + retryPolicy: { retryCount: 4, retryWindowInMinutes: 27 }, + }, + resources: { + ids: [ + "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3", + ], }, - ); + correlationid: "23480d2f-1dca-4610-afb4-dd25eec1f34r", + }); console.log(result); } async function main(): Promise { - await scheduledActionsVirtualMachinesSubmitDeallocateGeneratedByMaximumSetRuleGeneratedByMaximumSetRule(); - await scheduledActionsVirtualMachinesSubmitDeallocateGeneratedByMaximumSetRuleGeneratedByMinimumSetRule(); + scheduledActionsVirtualMachinesSubmitDeallocate(); } main().catch(console.error); diff --git a/sdk/computeschedule/arm-computeschedule/samples-dev/scheduledActionsVirtualMachinesSubmitHibernateSample.ts b/sdk/computeschedule/arm-computeschedule/samples-dev/scheduledActionsVirtualMachinesSubmitHibernateSample.ts index f38a4ed061d4..8c146dace664 100644 --- a/sdk/computeschedule/arm-computeschedule/samples-dev/scheduledActionsVirtualMachinesSubmitHibernateSample.ts +++ b/sdk/computeschedule/arm-computeschedule/samples-dev/scheduledActionsVirtualMachinesSubmitHibernateSample.ts @@ -5,68 +5,36 @@ import { ComputeScheduleClient } from "@azure/arm-computeschedule"; import { DefaultAzureCredential } from "@azure/identity"; /** - * This sample demonstrates how to virtualMachinesSubmitHibernate: submitHibernate for a virtual machine + * This sample demonstrates how to virtualMachinesSubmitHibernate: Schedule hibernate operation for a batch of virtual machines at datetime in future. * - * @summary virtualMachinesSubmitHibernate: submitHibernate for a virtual machine - * x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesSubmitHibernate_MaximumSet_Gen.json + * @summary virtualMachinesSubmitHibernate: Schedule hibernate operation for a batch of virtual machines at datetime in future. + * x-ms-original-file: 2024-10-01/ScheduledActions_VirtualMachinesSubmitHibernate.json */ -async function scheduledActionsVirtualMachinesSubmitHibernateGeneratedByMaximumSetRuleGeneratedByMaximumSetRule(): Promise { +async function scheduledActionsVirtualMachinesSubmitHibernate(): Promise { const credential = new DefaultAzureCredential(); - const subscriptionId = "DE84A209-5715-43E7-BC76-3E208A9A82C5"; + const subscriptionId = "D8E30CC0-2763-4FCC-84A8-3C5659281032"; const client = new ComputeScheduleClient(credential, subscriptionId); - const result = await client.scheduledActions.virtualMachinesSubmitHibernate("bgxeayimbxqzev", { + const result = await client.scheduledActions.virtualMachinesSubmitHibernate("eastus2euap", { schedule: { - deadLine: "2024-07-12T18:06:53.361Z", - timeZone: "zlcujrtgxtgyik", - deadlineType: "Unknown", + deadline: "2024-11-01T17:52:54.215Z", + timezone: "UTC", + deadlineType: "InitiateAt", }, executionParameters: { - optimizationPreference: "Cost", - retryPolicy: { retryCount: 30, retryWindowInMinutes: 27 }, + retryPolicy: { retryCount: 2, retryWindowInMinutes: 27 }, }, resources: { ids: [ "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3", ], }, - correlationid: "23519o2f-1dca-4610-afb4-dd25eec1f34", + correlationid: "23480d2f-1dca-4610-afb4-dd25eec1f34r", }); console.log(result); } -/** - * This sample demonstrates how to virtualMachinesSubmitHibernate: submitHibernate for a virtual machine - * - * @summary virtualMachinesSubmitHibernate: submitHibernate for a virtual machine - * x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesSubmitHibernate_MinimumSet_Gen.json - */ -async function scheduledActionsVirtualMachinesSubmitHibernateGeneratedByMaximumSetRuleGeneratedByMinimumSetRule(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "DE84A209-5715-43E7-BC76-3E208A9A82C5"; - const client = new ComputeScheduleClient(credential, subscriptionId); - const result = await client.scheduledActions.virtualMachinesSubmitHibernate( - "fvjciwudfbndlqumcgqs", - { - schedule: { - deadLine: "2024-07-12T18:06:53.361Z", - timeZone: "zlcujrtgxtgyik", - deadlineType: "Unknown", - }, - executionParameters: {}, - resources: { - ids: [ - "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3", - ], - }, - correlationid: "23519o2f-1dca-4610-afb4-dd25eec1f34", - }, - ); - console.log(result); -} - async function main(): Promise { - await scheduledActionsVirtualMachinesSubmitHibernateGeneratedByMaximumSetRuleGeneratedByMaximumSetRule(); - await scheduledActionsVirtualMachinesSubmitHibernateGeneratedByMaximumSetRuleGeneratedByMinimumSetRule(); + scheduledActionsVirtualMachinesSubmitHibernate(); } main().catch(console.error); diff --git a/sdk/computeschedule/arm-computeschedule/samples-dev/scheduledActionsVirtualMachinesSubmitStartSample.ts b/sdk/computeschedule/arm-computeschedule/samples-dev/scheduledActionsVirtualMachinesSubmitStartSample.ts index 7c0b3905b2a4..47b2e6704a09 100644 --- a/sdk/computeschedule/arm-computeschedule/samples-dev/scheduledActionsVirtualMachinesSubmitStartSample.ts +++ b/sdk/computeschedule/arm-computeschedule/samples-dev/scheduledActionsVirtualMachinesSubmitStartSample.ts @@ -5,68 +5,36 @@ import { ComputeScheduleClient } from "@azure/arm-computeschedule"; import { DefaultAzureCredential } from "@azure/identity"; /** - * This sample demonstrates how to virtualMachinesSubmitStart: submitStart for a virtual machine + * This sample demonstrates how to virtualMachinesSubmitStart: Schedule start operation for a batch of virtual machines at datetime in future. * - * @summary virtualMachinesSubmitStart: submitStart for a virtual machine - * x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesSubmitStart_MaximumSet_Gen.json + * @summary virtualMachinesSubmitStart: Schedule start operation for a batch of virtual machines at datetime in future. + * x-ms-original-file: 2024-10-01/ScheduledActions_VirtualMachinesSubmitStart.json */ -async function scheduledActionsVirtualMachinesSubmitStartGeneratedByMaximumSetRuleGeneratedByMaximumSetRule(): Promise { +async function scheduledActionsVirtualMachinesSubmitStart(): Promise { const credential = new DefaultAzureCredential(); - const subscriptionId = "DE84A209-5715-43E7-BC76-3E208A9A82C5"; + const subscriptionId = "D8E30CC0-2763-4FCC-84A8-3C5659281032"; const client = new ComputeScheduleClient(credential, subscriptionId); - const result = await client.scheduledActions.virtualMachinesSubmitStart( - "fxiidszhrokwjmewlahfqjiocnes", - { - schedule: { - deadLine: "2024-07-12T18:06:53.361Z", - timeZone: "zlcujrtgxtgyik", - deadlineType: "Unknown", - }, - executionParameters: { - optimizationPreference: "Cost", - retryPolicy: { retryCount: 30, retryWindowInMinutes: 27 }, - }, - resources: { - ids: [ - "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource4", - ], - }, - correlationid: "23480d2f-1dca-4610-afb4-dd25eec1f34", - }, - ); - console.log(result); -} - -/** - * This sample demonstrates how to virtualMachinesSubmitStart: submitStart for a virtual machine - * - * @summary virtualMachinesSubmitStart: submitStart for a virtual machine - * x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesSubmitStart_MinimumSet_Gen.json - */ -async function scheduledActionsVirtualMachinesSubmitStartGeneratedByMaximumSetRuleGeneratedByMinimumSetRule(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "DE84A209-5715-43E7-BC76-3E208A9A82C5"; - const client = new ComputeScheduleClient(credential, subscriptionId); - const result = await client.scheduledActions.virtualMachinesSubmitStart("httzei", { + const result = await client.scheduledActions.virtualMachinesSubmitStart("eastus2euap", { schedule: { - deadLine: "2024-07-12T18:06:53.361Z", - timeZone: "zlcujrtgxtgyik", - deadlineType: "Unknown", + deadline: "2024-11-01T17:52:54.215Z", + timezone: "UTC", + deadlineType: "InitiateAt", + }, + executionParameters: { + retryPolicy: { retryCount: 5, retryWindowInMinutes: 27 }, }, - executionParameters: {}, resources: { ids: [ - "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource4", + "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3", ], }, - correlationid: "23480d2f-1dca-4610-afb4-dd25eec1f34", + correlationid: "23480d2f-1dca-4610-afb4-dd25eec1f34r", }); console.log(result); } async function main(): Promise { - await scheduledActionsVirtualMachinesSubmitStartGeneratedByMaximumSetRuleGeneratedByMaximumSetRule(); - await scheduledActionsVirtualMachinesSubmitStartGeneratedByMaximumSetRuleGeneratedByMinimumSetRule(); + scheduledActionsVirtualMachinesSubmitStart(); } main().catch(console.error); diff --git a/sdk/computeschedule/arm-computeschedule/samples/v1-beta/javascript/README.md b/sdk/computeschedule/arm-computeschedule/samples/v1-beta/javascript/README.md deleted file mode 100644 index bd6c0bf4bdc0..000000000000 --- a/sdk/computeschedule/arm-computeschedule/samples/v1-beta/javascript/README.md +++ /dev/null @@ -1,68 +0,0 @@ -# @azure/arm-computeschedule client library samples for JavaScript (Beta) - -These sample programs show how to use the JavaScript client libraries for @azure/arm-computeschedule in some common scenarios. - -| **File Name** | **Description** | -| --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [operationsListSample.js][operationslistsample] | list the operations for the provider x-ms-original-file: 2024-08-15-preview/Operations_List_MaximumSet_Gen.json | -| [scheduledActionsVirtualMachinesCancelOperationsSample.js][scheduledactionsvirtualmachinescanceloperationssample] | virtualMachinesCancelOperations: cancelOperations for a virtual machine x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesCancelOperations_MaximumSet_Gen.json | -| [scheduledActionsVirtualMachinesExecuteDeallocateSample.js][scheduledactionsvirtualmachinesexecutedeallocatesample] | virtualMachinesExecuteDeallocate: executeDeallocate for a virtual machine x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesExecuteDeallocate_MaximumSet_Gen.json | -| [scheduledActionsVirtualMachinesExecuteHibernateSample.js][scheduledactionsvirtualmachinesexecutehibernatesample] | virtualMachinesExecuteHibernate: executeHibernate for a virtual machine x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesExecuteHibernate_MaximumSet_Gen.json | -| [scheduledActionsVirtualMachinesExecuteStartSample.js][scheduledactionsvirtualmachinesexecutestartsample] | virtualMachinesExecuteStart: executeStart for a virtual machine x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesExecuteStart_MaximumSet_Gen.json | -| [scheduledActionsVirtualMachinesGetOperationErrorsSample.js][scheduledactionsvirtualmachinesgetoperationerrorssample] | virtualMachinesGetOperationErrors: getOperationErrors associated with an operation on a virtual machine x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesGetOperationErrors_MaximumSet_Gen.json | -| [scheduledActionsVirtualMachinesGetOperationStatusSample.js][scheduledactionsvirtualmachinesgetoperationstatussample] | virtualMachinesGetOperationStatus: getOperationStatus for a virtual machine x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesGetOperationStatus_MaximumSet_Gen.json | -| [scheduledActionsVirtualMachinesSubmitDeallocateSample.js][scheduledactionsvirtualmachinessubmitdeallocatesample] | virtualMachinesSubmitDeallocate: submitDeallocate for a virtual machine x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesSubmitDeallocate_MaximumSet_Gen.json | -| [scheduledActionsVirtualMachinesSubmitHibernateSample.js][scheduledactionsvirtualmachinessubmithibernatesample] | virtualMachinesSubmitHibernate: submitHibernate for a virtual machine x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesSubmitHibernate_MaximumSet_Gen.json | -| [scheduledActionsVirtualMachinesSubmitStartSample.js][scheduledactionsvirtualmachinessubmitstartsample] | virtualMachinesSubmitStart: submitStart for a virtual machine x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesSubmitStart_MaximumSet_Gen.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). - -You need [an Azure subscription][freesub] to run these sample programs. - -Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. - -Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. - -## Setup - -To run the samples using the published version of the package: - -1. Install the dependencies using `npm`: - -```bash -npm install -``` - -2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. - -3. Run whichever samples you like (note that some samples may require additional setup, see the table above): - -```bash -node operationsListSample.js -``` - -Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): - -```bash -npx dev-tool run vendored cross-env node operationsListSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/computeschedule/arm-computeschedule/samples/v1-beta/javascript/operationsListSample.js -[scheduledactionsvirtualmachinescanceloperationssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/computeschedule/arm-computeschedule/samples/v1-beta/javascript/scheduledActionsVirtualMachinesCancelOperationsSample.js -[scheduledactionsvirtualmachinesexecutedeallocatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/computeschedule/arm-computeschedule/samples/v1-beta/javascript/scheduledActionsVirtualMachinesExecuteDeallocateSample.js -[scheduledactionsvirtualmachinesexecutehibernatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/computeschedule/arm-computeschedule/samples/v1-beta/javascript/scheduledActionsVirtualMachinesExecuteHibernateSample.js -[scheduledactionsvirtualmachinesexecutestartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/computeschedule/arm-computeschedule/samples/v1-beta/javascript/scheduledActionsVirtualMachinesExecuteStartSample.js -[scheduledactionsvirtualmachinesgetoperationerrorssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/computeschedule/arm-computeschedule/samples/v1-beta/javascript/scheduledActionsVirtualMachinesGetOperationErrorsSample.js -[scheduledactionsvirtualmachinesgetoperationstatussample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/computeschedule/arm-computeschedule/samples/v1-beta/javascript/scheduledActionsVirtualMachinesGetOperationStatusSample.js -[scheduledactionsvirtualmachinessubmitdeallocatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/computeschedule/arm-computeschedule/samples/v1-beta/javascript/scheduledActionsVirtualMachinesSubmitDeallocateSample.js -[scheduledactionsvirtualmachinessubmithibernatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/computeschedule/arm-computeschedule/samples/v1-beta/javascript/scheduledActionsVirtualMachinesSubmitHibernateSample.js -[scheduledactionsvirtualmachinessubmitstartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/computeschedule/arm-computeschedule/samples/v1-beta/javascript/scheduledActionsVirtualMachinesSubmitStartSample.js -[apiref]: https://learn.microsoft.com/javascript/api/@azure/arm-computeschedule?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/computeschedule/arm-computeschedule/README.md diff --git a/sdk/computeschedule/arm-computeschedule/samples/v1-beta/javascript/operationsListSample.js b/sdk/computeschedule/arm-computeschedule/samples/v1-beta/javascript/operationsListSample.js deleted file mode 100644 index 5cc8827deedf..000000000000 --- a/sdk/computeschedule/arm-computeschedule/samples/v1-beta/javascript/operationsListSample.js +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeScheduleClient } = require("@azure/arm-computeschedule"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to list the operations for the provider - * - * @summary list the operations for the provider - * x-ms-original-file: 2024-08-15-preview/Operations_List_MaximumSet_Gen.json - */ -async function operationsListMaxGeneratedByMaximumSetRuleGeneratedByMaximumSetRule() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-00000000000"; - const client = new ComputeScheduleClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - - console.log(resArray); -} - -/** - * This sample demonstrates how to list the operations for the provider - * - * @summary list the operations for the provider - * x-ms-original-file: 2024-08-15-preview/Operations_List_MinimumSet_Gen.json - */ -async function operationsListMaxGeneratedByMaximumSetRuleGeneratedByMinimumSetRule() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-00000000000"; - const client = new ComputeScheduleClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main() { - operationsListMaxGeneratedByMaximumSetRuleGeneratedByMaximumSetRule(); - operationsListMaxGeneratedByMaximumSetRuleGeneratedByMinimumSetRule(); -} - -main().catch(console.error); diff --git a/sdk/computeschedule/arm-computeschedule/samples/v1-beta/javascript/package.json b/sdk/computeschedule/arm-computeschedule/samples/v1-beta/javascript/package.json deleted file mode 100644 index 2e0a3f4d1fc2..000000000000 --- a/sdk/computeschedule/arm-computeschedule/samples/v1-beta/javascript/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "@azure-samples/arm-computeschedule-js-beta", - "private": true, - "version": "1.0.0", - "description": "@azure/arm-computeschedule client library samples for JavaScript (Beta)", - "engines": { - "node": ">=18.0.0" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Azure/azure-sdk-for-js.git", - "directory": "sdk/computeschedule/arm-computeschedule" - }, - "keywords": [ - "node", - "azure", - "cloud", - "typescript", - "browser", - "isomorphic" - ], - "author": "Microsoft Corporation", - "license": "MIT", - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/computeschedule/arm-computeschedule", - "dependencies": { - "@azure/arm-computeschedule": "next", - "dotenv": "latest", - "@azure/identity": "^4.2.1" - } -} diff --git a/sdk/computeschedule/arm-computeschedule/samples/v1-beta/javascript/sample.env b/sdk/computeschedule/arm-computeschedule/samples/v1-beta/javascript/sample.env deleted file mode 100644 index efbc7787bd3b..000000000000 --- a/sdk/computeschedule/arm-computeschedule/samples/v1-beta/javascript/sample.env +++ /dev/null @@ -1 +0,0 @@ -# Feel free to add your own environment variables. diff --git a/sdk/computeschedule/arm-computeschedule/samples/v1-beta/javascript/scheduledActionsVirtualMachinesCancelOperationsSample.js b/sdk/computeschedule/arm-computeschedule/samples/v1-beta/javascript/scheduledActionsVirtualMachinesCancelOperationsSample.js deleted file mode 100644 index c438a7d6f7e0..000000000000 --- a/sdk/computeschedule/arm-computeschedule/samples/v1-beta/javascript/scheduledActionsVirtualMachinesCancelOperationsSample.js +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeScheduleClient } = require("@azure/arm-computeschedule"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to virtualMachinesCancelOperations: cancelOperations for a virtual machine - * - * @summary virtualMachinesCancelOperations: cancelOperations for a virtual machine - * x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesCancelOperations_MaximumSet_Gen.json - */ -async function scheduledActionsVirtualMachinesCancelOperationsGeneratedByMaximumSetRuleGeneratedByMaximumSetRule() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "DE84A209-5715-43E7-BC76-3E208A9A82C5"; - const client = new ComputeScheduleClient(credential, subscriptionId); - const result = await client.scheduledActions.virtualMachinesCancelOperations("tdxypnse", { - operationIds: ["23480d2f-1dca-4610-afb4-dd25eec1f34r"], - correlationid: "01080d2f-1dca-4610-afb4-dd25eec1f3c1", - }); - console.log(result); -} - -/** - * This sample demonstrates how to virtualMachinesCancelOperations: cancelOperations for a virtual machine - * - * @summary virtualMachinesCancelOperations: cancelOperations for a virtual machine - * x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesCancelOperations_MinimumSet_Gen.json - */ -async function scheduledActionsVirtualMachinesCancelOperationsGeneratedByMaximumSetRuleGeneratedByMinimumSetRule() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "DE84A209-5715-43E7-BC76-3E208A9A82C5"; - const client = new ComputeScheduleClient(credential, subscriptionId); - const result = await client.scheduledActions.virtualMachinesCancelOperations("lwapkjsbltcqp", { - operationIds: ["23480d2f-1dca-4610-afb4-dd25eec1f34r"], - correlationid: "01080d2f-1dca-4610-afb4-dd25eec1f3c1", - }); - console.log(result); -} - -async function main() { - scheduledActionsVirtualMachinesCancelOperationsGeneratedByMaximumSetRuleGeneratedByMaximumSetRule(); - scheduledActionsVirtualMachinesCancelOperationsGeneratedByMaximumSetRuleGeneratedByMinimumSetRule(); -} - -main().catch(console.error); diff --git a/sdk/computeschedule/arm-computeschedule/samples/v1-beta/javascript/scheduledActionsVirtualMachinesExecuteDeallocateSample.js b/sdk/computeschedule/arm-computeschedule/samples/v1-beta/javascript/scheduledActionsVirtualMachinesExecuteDeallocateSample.js deleted file mode 100644 index 7a2aec652bc5..000000000000 --- a/sdk/computeschedule/arm-computeschedule/samples/v1-beta/javascript/scheduledActionsVirtualMachinesExecuteDeallocateSample.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeScheduleClient } = require("@azure/arm-computeschedule"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to virtualMachinesExecuteDeallocate: executeDeallocate for a virtual machine - * - * @summary virtualMachinesExecuteDeallocate: executeDeallocate for a virtual machine - * x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesExecuteDeallocate_MaximumSet_Gen.json - */ -async function scheduledActionsVirtualMachinesExecuteDeallocateGeneratedByMaximumSetRuleGeneratedByMaximumSetRule() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "DE84A209-5715-43E7-BC76-3E208A9A82C5"; - const client = new ComputeScheduleClient(credential, subscriptionId); - const result = await client.scheduledActions.virtualMachinesExecuteDeallocate("mklyzgztbivwzo", { - executionParameters: { - optimizationPreference: "Cost", - retryPolicy: { retryCount: 30, retryWindowInMinutes: 27 }, - }, - resources: { - ids: [ - "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource2", - ], - }, - correlationid: "01080d2f-1dca-4610-afb4-dd25eddf1f3c1", - }); - console.log(result); -} - -/** - * This sample demonstrates how to virtualMachinesExecuteDeallocate: executeDeallocate for a virtual machine - * - * @summary virtualMachinesExecuteDeallocate: executeDeallocate for a virtual machine - * x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesExecuteDeallocate_MinimumSet_Gen.json - */ -async function scheduledActionsVirtualMachinesExecuteDeallocateGeneratedByMaximumSetRuleGeneratedByMinimumSetRule() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "DE84A209-5715-43E7-BC76-3E208A9A82C5"; - const client = new ComputeScheduleClient(credential, subscriptionId); - const result = await client.scheduledActions.virtualMachinesExecuteDeallocate( - "irbtacrhjgfpyvhvjo", - { - executionParameters: {}, - resources: { - ids: [ - "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource2", - ], - }, - correlationid: "01080d2f-1dca-4610-afb4-dd25eddf1f3c1", - }, - ); - console.log(result); -} - -async function main() { - scheduledActionsVirtualMachinesExecuteDeallocateGeneratedByMaximumSetRuleGeneratedByMaximumSetRule(); - scheduledActionsVirtualMachinesExecuteDeallocateGeneratedByMaximumSetRuleGeneratedByMinimumSetRule(); -} - -main().catch(console.error); diff --git a/sdk/computeschedule/arm-computeschedule/samples/v1-beta/javascript/scheduledActionsVirtualMachinesExecuteHibernateSample.js b/sdk/computeschedule/arm-computeschedule/samples/v1-beta/javascript/scheduledActionsVirtualMachinesExecuteHibernateSample.js deleted file mode 100644 index a3f64e8b0f83..000000000000 --- a/sdk/computeschedule/arm-computeschedule/samples/v1-beta/javascript/scheduledActionsVirtualMachinesExecuteHibernateSample.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeScheduleClient } = require("@azure/arm-computeschedule"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to virtualMachinesExecuteHibernate: executeHibernate for a virtual machine - * - * @summary virtualMachinesExecuteHibernate: executeHibernate for a virtual machine - * x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesExecuteHibernate_MaximumSet_Gen.json - */ -async function scheduledActionsVirtualMachinesExecuteHibernateGeneratedByMaximumSetRuleGeneratedByMaximumSetRule() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "DE84A209-5715-43E7-BC76-3E208A9A82C5"; - const client = new ComputeScheduleClient(credential, subscriptionId); - const result = await client.scheduledActions.virtualMachinesExecuteHibernate( - "sejdmamuhhvfpljomwumsplc", - { - executionParameters: { - optimizationPreference: "Cost", - retryPolicy: { retryCount: 30, retryWindowInMinutes: 27 }, - }, - resources: { - ids: [ - "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3", - ], - }, - correlationid: "01080d2f-1dca-4610-afb4-dd25eec1f3c1", - }, - ); - console.log(result); -} - -/** - * This sample demonstrates how to virtualMachinesExecuteHibernate: executeHibernate for a virtual machine - * - * @summary virtualMachinesExecuteHibernate: executeHibernate for a virtual machine - * x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesExecuteHibernate_MinimumSet_Gen.json - */ -async function scheduledActionsVirtualMachinesExecuteHibernateGeneratedByMaximumSetRuleGeneratedByMinimumSetRule() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "DE84A209-5715-43E7-BC76-3E208A9A82C5"; - const client = new ComputeScheduleClient(credential, subscriptionId); - const result = await client.scheduledActions.virtualMachinesExecuteHibernate("kga", { - executionParameters: {}, - resources: { - ids: [ - "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3", - ], - }, - correlationid: "01080d2f-1dca-4610-afb4-dd25eec1f3c1", - }); - console.log(result); -} - -async function main() { - scheduledActionsVirtualMachinesExecuteHibernateGeneratedByMaximumSetRuleGeneratedByMaximumSetRule(); - scheduledActionsVirtualMachinesExecuteHibernateGeneratedByMaximumSetRuleGeneratedByMinimumSetRule(); -} - -main().catch(console.error); diff --git a/sdk/computeschedule/arm-computeschedule/samples/v1-beta/javascript/scheduledActionsVirtualMachinesExecuteStartSample.js b/sdk/computeschedule/arm-computeschedule/samples/v1-beta/javascript/scheduledActionsVirtualMachinesExecuteStartSample.js deleted file mode 100644 index 32d3c45c908f..000000000000 --- a/sdk/computeschedule/arm-computeschedule/samples/v1-beta/javascript/scheduledActionsVirtualMachinesExecuteStartSample.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeScheduleClient } = require("@azure/arm-computeschedule"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to virtualMachinesExecuteStart: executeStart for a virtual machine - * - * @summary virtualMachinesExecuteStart: executeStart for a virtual machine - * x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesExecuteStart_MaximumSet_Gen.json - */ -async function scheduledActionsVirtualMachinesExecuteStartGeneratedByMaximumSetRuleGeneratedByMaximumSetRule() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "DE84A209-5715-43E7-BC76-3E208A9A82C5"; - const client = new ComputeScheduleClient(credential, subscriptionId); - const result = await client.scheduledActions.virtualMachinesExecuteStart("ysfrwcfmfsh", { - executionParameters: { - optimizationPreference: "Cost", - retryPolicy: { retryCount: 30, retryWindowInMinutes: 27 }, - }, - resources: { - ids: [ - "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource4", - ], - }, - correlationid: "23230d2f-1dca-4610-afb4-dd25eec1f34", - }); - console.log(result); -} - -/** - * This sample demonstrates how to virtualMachinesExecuteStart: executeStart for a virtual machine - * - * @summary virtualMachinesExecuteStart: executeStart for a virtual machine - * x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesExecuteStart_MinimumSet_Gen.json - */ -async function scheduledActionsVirtualMachinesExecuteStartGeneratedByMaximumSetRuleGeneratedByMinimumSetRule() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "DE84A209-5715-43E7-BC76-3E208A9A82C5"; - const client = new ComputeScheduleClient(credential, subscriptionId); - const result = await client.scheduledActions.virtualMachinesExecuteStart( - "qegbgjculewswqvnmaclcgpqqidl", - { - executionParameters: {}, - resources: { - ids: [ - "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource4", - ], - }, - correlationid: "23230d2f-1dca-4610-afb4-dd25eec1f34", - }, - ); - console.log(result); -} - -async function main() { - scheduledActionsVirtualMachinesExecuteStartGeneratedByMaximumSetRuleGeneratedByMaximumSetRule(); - scheduledActionsVirtualMachinesExecuteStartGeneratedByMaximumSetRuleGeneratedByMinimumSetRule(); -} - -main().catch(console.error); diff --git a/sdk/computeschedule/arm-computeschedule/samples/v1-beta/javascript/scheduledActionsVirtualMachinesGetOperationErrorsSample.js b/sdk/computeschedule/arm-computeschedule/samples/v1-beta/javascript/scheduledActionsVirtualMachinesGetOperationErrorsSample.js deleted file mode 100644 index e8198bb0d736..000000000000 --- a/sdk/computeschedule/arm-computeschedule/samples/v1-beta/javascript/scheduledActionsVirtualMachinesGetOperationErrorsSample.js +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeScheduleClient } = require("@azure/arm-computeschedule"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to virtualMachinesGetOperationErrors: getOperationErrors associated with an operation on a virtual machine - * - * @summary virtualMachinesGetOperationErrors: getOperationErrors associated with an operation on a virtual machine - * x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesGetOperationErrors_MaximumSet_Gen.json - */ -async function csScheduledActionsVirtualMachinesGetOperationErrorsMax() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "DE84A209-5715-43E7-BC76-3E208A9A82C5"; - const client = new ComputeScheduleClient(credential, subscriptionId); - const result = await client.scheduledActions.virtualMachinesGetOperationErrors("hfsa", { - operationIds: ["DE84A209-5715-43E7-BC76-3E208A9A323"], - }); - console.log(result); -} - -/** - * This sample demonstrates how to virtualMachinesGetOperationErrors: getOperationErrors associated with an operation on a virtual machine - * - * @summary virtualMachinesGetOperationErrors: getOperationErrors associated with an operation on a virtual machine - * x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesGetOperationErrors_MinimumSet_Gen.json - */ -async function csScheduledActionsVirtualMachinesGetOperationErrorsMin() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "DE84A209-5715-43E7-BC76-3E208A9A82C5"; - const client = new ComputeScheduleClient(credential, subscriptionId); - const result = await client.scheduledActions.virtualMachinesGetOperationErrors("ggxoaxzxtdbi", { - operationIds: ["qeicik"], - }); - console.log(result); -} - -async function main() { - csScheduledActionsVirtualMachinesGetOperationErrorsMax(); - csScheduledActionsVirtualMachinesGetOperationErrorsMin(); -} - -main().catch(console.error); diff --git a/sdk/computeschedule/arm-computeschedule/samples/v1-beta/javascript/scheduledActionsVirtualMachinesGetOperationStatusSample.js b/sdk/computeschedule/arm-computeschedule/samples/v1-beta/javascript/scheduledActionsVirtualMachinesGetOperationStatusSample.js deleted file mode 100644 index e2e008230c0f..000000000000 --- a/sdk/computeschedule/arm-computeschedule/samples/v1-beta/javascript/scheduledActionsVirtualMachinesGetOperationStatusSample.js +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeScheduleClient } = require("@azure/arm-computeschedule"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to virtualMachinesGetOperationStatus: getOperationStatus for a virtual machine - * - * @summary virtualMachinesGetOperationStatus: getOperationStatus for a virtual machine - * x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesGetOperationStatus_MaximumSet_Gen.json - */ -async function scheduledActionsVirtualMachinesGetOperationStatusGeneratedByMinimumSetRuleGeneratedByMaximumSetRule() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "DE84A209-5715-43E7-BC76-3E208A9A82C5"; - const client = new ComputeScheduleClient(credential, subscriptionId); - const result = await client.scheduledActions.virtualMachinesGetOperationStatus( - "htxxasfxaesuecem", - { - operationIds: ["01080d2f-1dca-4610-afb4-dd25eec1f3df"], - correlationid: "01080d2f-1dca-4610-afb4-dd25eec1f3c1", - }, - ); - console.log(result); -} - -/** - * This sample demonstrates how to virtualMachinesGetOperationStatus: getOperationStatus for a virtual machine - * - * @summary virtualMachinesGetOperationStatus: getOperationStatus for a virtual machine - * x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesGetOperationStatus_MinimumSet_Gen.json - */ -async function scheduledActionsVirtualMachinesGetOperationStatusGeneratedByMinimumSetRule() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "DE84A209-5715-43E7-BC76-3E208A9A82C5"; - const client = new ComputeScheduleClient(credential, subscriptionId); - const result = await client.scheduledActions.virtualMachinesGetOperationStatus("csay", { - operationIds: ["01080d2f-1dca-4610-afb4-dd25eec1f3df"], - correlationid: "01080d2f-1dca-4610-afb4-dd25eec1f3c1", - }); - console.log(result); -} - -async function main() { - scheduledActionsVirtualMachinesGetOperationStatusGeneratedByMinimumSetRuleGeneratedByMaximumSetRule(); - scheduledActionsVirtualMachinesGetOperationStatusGeneratedByMinimumSetRule(); -} - -main().catch(console.error); diff --git a/sdk/computeschedule/arm-computeschedule/samples/v1-beta/javascript/scheduledActionsVirtualMachinesSubmitDeallocateSample.js b/sdk/computeschedule/arm-computeschedule/samples/v1-beta/javascript/scheduledActionsVirtualMachinesSubmitDeallocateSample.js deleted file mode 100644 index aa4ba727f671..000000000000 --- a/sdk/computeschedule/arm-computeschedule/samples/v1-beta/javascript/scheduledActionsVirtualMachinesSubmitDeallocateSample.js +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeScheduleClient } = require("@azure/arm-computeschedule"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to virtualMachinesSubmitDeallocate: submitDeallocate for a virtual machine - * - * @summary virtualMachinesSubmitDeallocate: submitDeallocate for a virtual machine - * x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesSubmitDeallocate_MaximumSet_Gen.json - */ -async function scheduledActionsVirtualMachinesSubmitDeallocateGeneratedByMaximumSetRuleGeneratedByMaximumSetRule() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "DE84A209-5715-43E7-BC76-3E208A9A82C5"; - const client = new ComputeScheduleClient(credential, subscriptionId); - const result = await client.scheduledActions.virtualMachinesSubmitDeallocate( - "ibfxsvilwrgqttuslbduzdtxcckdet", - { - schedule: { - deadLine: "2024-07-12T18:06:53.361Z", - timeZone: "zlcujrtgxtgyik", - deadlineType: "Unknown", - }, - executionParameters: { - optimizationPreference: "Cost", - retryPolicy: { retryCount: 30, retryWindowInMinutes: 27 }, - }, - resources: { - ids: [ - "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource2", - ], - }, - correlationid: "23519o2f-1dca-4610-afb4-dd25eec1f34", - }, - ); - console.log(result); -} - -/** - * This sample demonstrates how to virtualMachinesSubmitDeallocate: submitDeallocate for a virtual machine - * - * @summary virtualMachinesSubmitDeallocate: submitDeallocate for a virtual machine - * x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesSubmitDeallocate_MinimumSet_Gen.json - */ -async function scheduledActionsVirtualMachinesSubmitDeallocateGeneratedByMaximumSetRuleGeneratedByMinimumSetRule() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "DE84A209-5715-43E7-BC76-3E208A9A82C5"; - const client = new ComputeScheduleClient(credential, subscriptionId); - const result = await client.scheduledActions.virtualMachinesSubmitDeallocate( - "qwfcdtmshnlownbkyh", - { - schedule: { - deadLine: "2024-07-12T18:06:53.361Z", - timeZone: "zlcujrtgxtgyik", - deadlineType: "Unknown", - }, - executionParameters: {}, - resources: { - ids: [ - "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource2", - ], - }, - correlationid: "23519o2f-1dca-4610-afb4-dd25eec1f34", - }, - ); - console.log(result); -} - -async function main() { - scheduledActionsVirtualMachinesSubmitDeallocateGeneratedByMaximumSetRuleGeneratedByMaximumSetRule(); - scheduledActionsVirtualMachinesSubmitDeallocateGeneratedByMaximumSetRuleGeneratedByMinimumSetRule(); -} - -main().catch(console.error); diff --git a/sdk/computeschedule/arm-computeschedule/samples/v1-beta/javascript/scheduledActionsVirtualMachinesSubmitHibernateSample.js b/sdk/computeschedule/arm-computeschedule/samples/v1-beta/javascript/scheduledActionsVirtualMachinesSubmitHibernateSample.js deleted file mode 100644 index 2e04dbc47c5d..000000000000 --- a/sdk/computeschedule/arm-computeschedule/samples/v1-beta/javascript/scheduledActionsVirtualMachinesSubmitHibernateSample.js +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeScheduleClient } = require("@azure/arm-computeschedule"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to virtualMachinesSubmitHibernate: submitHibernate for a virtual machine - * - * @summary virtualMachinesSubmitHibernate: submitHibernate for a virtual machine - * x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesSubmitHibernate_MaximumSet_Gen.json - */ -async function scheduledActionsVirtualMachinesSubmitHibernateGeneratedByMaximumSetRuleGeneratedByMaximumSetRule() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "DE84A209-5715-43E7-BC76-3E208A9A82C5"; - const client = new ComputeScheduleClient(credential, subscriptionId); - const result = await client.scheduledActions.virtualMachinesSubmitHibernate("bgxeayimbxqzev", { - schedule: { - deadLine: "2024-07-12T18:06:53.361Z", - timeZone: "zlcujrtgxtgyik", - deadlineType: "Unknown", - }, - executionParameters: { - optimizationPreference: "Cost", - retryPolicy: { retryCount: 30, retryWindowInMinutes: 27 }, - }, - resources: { - ids: [ - "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3", - ], - }, - correlationid: "23519o2f-1dca-4610-afb4-dd25eec1f34", - }); - console.log(result); -} - -/** - * This sample demonstrates how to virtualMachinesSubmitHibernate: submitHibernate for a virtual machine - * - * @summary virtualMachinesSubmitHibernate: submitHibernate for a virtual machine - * x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesSubmitHibernate_MinimumSet_Gen.json - */ -async function scheduledActionsVirtualMachinesSubmitHibernateGeneratedByMaximumSetRuleGeneratedByMinimumSetRule() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "DE84A209-5715-43E7-BC76-3E208A9A82C5"; - const client = new ComputeScheduleClient(credential, subscriptionId); - const result = await client.scheduledActions.virtualMachinesSubmitHibernate( - "fvjciwudfbndlqumcgqs", - { - schedule: { - deadLine: "2024-07-12T18:06:53.361Z", - timeZone: "zlcujrtgxtgyik", - deadlineType: "Unknown", - }, - executionParameters: {}, - resources: { - ids: [ - "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3", - ], - }, - correlationid: "23519o2f-1dca-4610-afb4-dd25eec1f34", - }, - ); - console.log(result); -} - -async function main() { - scheduledActionsVirtualMachinesSubmitHibernateGeneratedByMaximumSetRuleGeneratedByMaximumSetRule(); - scheduledActionsVirtualMachinesSubmitHibernateGeneratedByMaximumSetRuleGeneratedByMinimumSetRule(); -} - -main().catch(console.error); diff --git a/sdk/computeschedule/arm-computeschedule/samples/v1-beta/javascript/scheduledActionsVirtualMachinesSubmitStartSample.js b/sdk/computeschedule/arm-computeschedule/samples/v1-beta/javascript/scheduledActionsVirtualMachinesSubmitStartSample.js deleted file mode 100644 index dd84c7673cd9..000000000000 --- a/sdk/computeschedule/arm-computeschedule/samples/v1-beta/javascript/scheduledActionsVirtualMachinesSubmitStartSample.js +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeScheduleClient } = require("@azure/arm-computeschedule"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to virtualMachinesSubmitStart: submitStart for a virtual machine - * - * @summary virtualMachinesSubmitStart: submitStart for a virtual machine - * x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesSubmitStart_MaximumSet_Gen.json - */ -async function scheduledActionsVirtualMachinesSubmitStartGeneratedByMaximumSetRuleGeneratedByMaximumSetRule() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "DE84A209-5715-43E7-BC76-3E208A9A82C5"; - const client = new ComputeScheduleClient(credential, subscriptionId); - const result = await client.scheduledActions.virtualMachinesSubmitStart( - "fxiidszhrokwjmewlahfqjiocnes", - { - schedule: { - deadLine: "2024-07-12T18:06:53.361Z", - timeZone: "zlcujrtgxtgyik", - deadlineType: "Unknown", - }, - executionParameters: { - optimizationPreference: "Cost", - retryPolicy: { retryCount: 30, retryWindowInMinutes: 27 }, - }, - resources: { - ids: [ - "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource4", - ], - }, - correlationid: "23480d2f-1dca-4610-afb4-dd25eec1f34", - }, - ); - console.log(result); -} - -/** - * This sample demonstrates how to virtualMachinesSubmitStart: submitStart for a virtual machine - * - * @summary virtualMachinesSubmitStart: submitStart for a virtual machine - * x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesSubmitStart_MinimumSet_Gen.json - */ -async function scheduledActionsVirtualMachinesSubmitStartGeneratedByMaximumSetRuleGeneratedByMinimumSetRule() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "DE84A209-5715-43E7-BC76-3E208A9A82C5"; - const client = new ComputeScheduleClient(credential, subscriptionId); - const result = await client.scheduledActions.virtualMachinesSubmitStart("httzei", { - schedule: { - deadLine: "2024-07-12T18:06:53.361Z", - timeZone: "zlcujrtgxtgyik", - deadlineType: "Unknown", - }, - executionParameters: {}, - resources: { - ids: [ - "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource4", - ], - }, - correlationid: "23480d2f-1dca-4610-afb4-dd25eec1f34", - }); - console.log(result); -} - -async function main() { - scheduledActionsVirtualMachinesSubmitStartGeneratedByMaximumSetRuleGeneratedByMaximumSetRule(); - scheduledActionsVirtualMachinesSubmitStartGeneratedByMaximumSetRuleGeneratedByMinimumSetRule(); -} - -main().catch(console.error); diff --git a/sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/README.md b/sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/README.md deleted file mode 100644 index 077cae18e71a..000000000000 --- a/sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/README.md +++ /dev/null @@ -1,81 +0,0 @@ -# @azure/arm-computeschedule client library samples for TypeScript (Beta) - -These sample programs show how to use the TypeScript client libraries for @azure/arm-computeschedule in some common scenarios. - -| **File Name** | **Description** | -| --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [operationsListSample.ts][operationslistsample] | list the operations for the provider x-ms-original-file: 2024-08-15-preview/Operations_List_MaximumSet_Gen.json | -| [scheduledActionsVirtualMachinesCancelOperationsSample.ts][scheduledactionsvirtualmachinescanceloperationssample] | virtualMachinesCancelOperations: cancelOperations for a virtual machine x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesCancelOperations_MaximumSet_Gen.json | -| [scheduledActionsVirtualMachinesExecuteDeallocateSample.ts][scheduledactionsvirtualmachinesexecutedeallocatesample] | virtualMachinesExecuteDeallocate: executeDeallocate for a virtual machine x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesExecuteDeallocate_MaximumSet_Gen.json | -| [scheduledActionsVirtualMachinesExecuteHibernateSample.ts][scheduledactionsvirtualmachinesexecutehibernatesample] | virtualMachinesExecuteHibernate: executeHibernate for a virtual machine x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesExecuteHibernate_MaximumSet_Gen.json | -| [scheduledActionsVirtualMachinesExecuteStartSample.ts][scheduledactionsvirtualmachinesexecutestartsample] | virtualMachinesExecuteStart: executeStart for a virtual machine x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesExecuteStart_MaximumSet_Gen.json | -| [scheduledActionsVirtualMachinesGetOperationErrorsSample.ts][scheduledactionsvirtualmachinesgetoperationerrorssample] | virtualMachinesGetOperationErrors: getOperationErrors associated with an operation on a virtual machine x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesGetOperationErrors_MaximumSet_Gen.json | -| [scheduledActionsVirtualMachinesGetOperationStatusSample.ts][scheduledactionsvirtualmachinesgetoperationstatussample] | virtualMachinesGetOperationStatus: getOperationStatus for a virtual machine x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesGetOperationStatus_MaximumSet_Gen.json | -| [scheduledActionsVirtualMachinesSubmitDeallocateSample.ts][scheduledactionsvirtualmachinessubmitdeallocatesample] | virtualMachinesSubmitDeallocate: submitDeallocate for a virtual machine x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesSubmitDeallocate_MaximumSet_Gen.json | -| [scheduledActionsVirtualMachinesSubmitHibernateSample.ts][scheduledactionsvirtualmachinessubmithibernatesample] | virtualMachinesSubmitHibernate: submitHibernate for a virtual machine x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesSubmitHibernate_MaximumSet_Gen.json | -| [scheduledActionsVirtualMachinesSubmitStartSample.ts][scheduledactionsvirtualmachinessubmitstartsample] | virtualMachinesSubmitStart: submitStart for a virtual machine x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesSubmitStart_MaximumSet_Gen.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). - -Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using: - -```bash -npm install -g typescript -``` - -You need [an Azure subscription][freesub] to run these sample programs. - -Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. - -Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. - -## Setup - -To run the samples using the published version of the package: - -1. Install the dependencies using `npm`: - -```bash -npm install -``` - -2. Compile the samples: - -```bash -npm run build -``` - -3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. - -4. Run whichever samples you like (note that some samples may require additional setup, see the table above): - -```bash -node dist/operationsListSample.js -``` - -Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): - -```bash -npx dev-tool run vendored cross-env node dist/operationsListSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/src/operationsListSample.ts -[scheduledactionsvirtualmachinescanceloperationssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/src/scheduledActionsVirtualMachinesCancelOperationsSample.ts -[scheduledactionsvirtualmachinesexecutedeallocatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/src/scheduledActionsVirtualMachinesExecuteDeallocateSample.ts -[scheduledactionsvirtualmachinesexecutehibernatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/src/scheduledActionsVirtualMachinesExecuteHibernateSample.ts -[scheduledactionsvirtualmachinesexecutestartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/src/scheduledActionsVirtualMachinesExecuteStartSample.ts -[scheduledactionsvirtualmachinesgetoperationerrorssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/src/scheduledActionsVirtualMachinesGetOperationErrorsSample.ts -[scheduledactionsvirtualmachinesgetoperationstatussample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/src/scheduledActionsVirtualMachinesGetOperationStatusSample.ts -[scheduledactionsvirtualmachinessubmitdeallocatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/src/scheduledActionsVirtualMachinesSubmitDeallocateSample.ts -[scheduledactionsvirtualmachinessubmithibernatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/src/scheduledActionsVirtualMachinesSubmitHibernateSample.ts -[scheduledactionsvirtualmachinessubmitstartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/src/scheduledActionsVirtualMachinesSubmitStartSample.ts -[apiref]: https://learn.microsoft.com/javascript/api/@azure/arm-computeschedule?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/computeschedule/arm-computeschedule/README.md -[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/package.json b/sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/package.json deleted file mode 100644 index 4af8bbe8d883..000000000000 --- a/sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/package.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "@azure-samples/arm-computeschedule-ts-beta", - "private": true, - "version": "1.0.0", - "description": "@azure/arm-computeschedule client library samples for TypeScript (Beta)", - "engines": { - "node": ">=18.0.0" - }, - "scripts": { - "build": "tsc", - "prebuild": "rimraf dist/" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Azure/azure-sdk-for-js.git", - "directory": "sdk/computeschedule/arm-computeschedule" - }, - "keywords": [ - "node", - "azure", - "cloud", - "typescript", - "browser", - "isomorphic" - ], - "author": "Microsoft Corporation", - "license": "MIT", - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/computeschedule/arm-computeschedule", - "dependencies": { - "@azure/arm-computeschedule": "next", - "dotenv": "latest", - "@azure/identity": "^4.2.1" - }, - "devDependencies": { - "@types/node": "^18.0.0", - "typescript": "~5.7.2", - "rimraf": "latest" - } -} diff --git a/sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/sample.env b/sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/sample.env deleted file mode 100644 index efbc7787bd3b..000000000000 --- a/sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/sample.env +++ /dev/null @@ -1 +0,0 @@ -# Feel free to add your own environment variables. diff --git a/sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/src/operationsListSample.ts b/sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/src/operationsListSample.ts deleted file mode 100644 index 7faae2cf03f9..000000000000 --- a/sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/src/operationsListSample.ts +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeScheduleClient } from "@azure/arm-computeschedule"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to list the operations for the provider - * - * @summary list the operations for the provider - * x-ms-original-file: 2024-08-15-preview/Operations_List_MaximumSet_Gen.json - */ -async function operationsListMaxGeneratedByMaximumSetRuleGeneratedByMaximumSetRule(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-00000000000"; - const client = new ComputeScheduleClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - - console.log(resArray); -} - -/** - * This sample demonstrates how to list the operations for the provider - * - * @summary list the operations for the provider - * x-ms-original-file: 2024-08-15-preview/Operations_List_MinimumSet_Gen.json - */ -async function operationsListMaxGeneratedByMaximumSetRuleGeneratedByMinimumSetRule(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-00000000000"; - const client = new ComputeScheduleClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main(): Promise { - operationsListMaxGeneratedByMaximumSetRuleGeneratedByMaximumSetRule(); - operationsListMaxGeneratedByMaximumSetRuleGeneratedByMinimumSetRule(); -} - -main().catch(console.error); diff --git a/sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/src/scheduledActionsVirtualMachinesCancelOperationsSample.ts b/sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/src/scheduledActionsVirtualMachinesCancelOperationsSample.ts deleted file mode 100644 index b07576d04062..000000000000 --- a/sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/src/scheduledActionsVirtualMachinesCancelOperationsSample.ts +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeScheduleClient } from "@azure/arm-computeschedule"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to virtualMachinesCancelOperations: cancelOperations for a virtual machine - * - * @summary virtualMachinesCancelOperations: cancelOperations for a virtual machine - * x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesCancelOperations_MaximumSet_Gen.json - */ -async function scheduledActionsVirtualMachinesCancelOperationsGeneratedByMaximumSetRuleGeneratedByMaximumSetRule(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "DE84A209-5715-43E7-BC76-3E208A9A82C5"; - const client = new ComputeScheduleClient(credential, subscriptionId); - const result = await client.scheduledActions.virtualMachinesCancelOperations("tdxypnse", { - operationIds: ["23480d2f-1dca-4610-afb4-dd25eec1f34r"], - correlationid: "01080d2f-1dca-4610-afb4-dd25eec1f3c1", - }); - console.log(result); -} - -/** - * This sample demonstrates how to virtualMachinesCancelOperations: cancelOperations for a virtual machine - * - * @summary virtualMachinesCancelOperations: cancelOperations for a virtual machine - * x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesCancelOperations_MinimumSet_Gen.json - */ -async function scheduledActionsVirtualMachinesCancelOperationsGeneratedByMaximumSetRuleGeneratedByMinimumSetRule(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "DE84A209-5715-43E7-BC76-3E208A9A82C5"; - const client = new ComputeScheduleClient(credential, subscriptionId); - const result = await client.scheduledActions.virtualMachinesCancelOperations("lwapkjsbltcqp", { - operationIds: ["23480d2f-1dca-4610-afb4-dd25eec1f34r"], - correlationid: "01080d2f-1dca-4610-afb4-dd25eec1f3c1", - }); - console.log(result); -} - -async function main(): Promise { - scheduledActionsVirtualMachinesCancelOperationsGeneratedByMaximumSetRuleGeneratedByMaximumSetRule(); - scheduledActionsVirtualMachinesCancelOperationsGeneratedByMaximumSetRuleGeneratedByMinimumSetRule(); -} - -main().catch(console.error); diff --git a/sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/src/scheduledActionsVirtualMachinesExecuteDeallocateSample.ts b/sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/src/scheduledActionsVirtualMachinesExecuteDeallocateSample.ts deleted file mode 100644 index acd3f7c8d23b..000000000000 --- a/sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/src/scheduledActionsVirtualMachinesExecuteDeallocateSample.ts +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeScheduleClient } from "@azure/arm-computeschedule"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to virtualMachinesExecuteDeallocate: executeDeallocate for a virtual machine - * - * @summary virtualMachinesExecuteDeallocate: executeDeallocate for a virtual machine - * x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesExecuteDeallocate_MaximumSet_Gen.json - */ -async function scheduledActionsVirtualMachinesExecuteDeallocateGeneratedByMaximumSetRuleGeneratedByMaximumSetRule(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "DE84A209-5715-43E7-BC76-3E208A9A82C5"; - const client = new ComputeScheduleClient(credential, subscriptionId); - const result = await client.scheduledActions.virtualMachinesExecuteDeallocate("mklyzgztbivwzo", { - executionParameters: { - optimizationPreference: "Cost", - retryPolicy: { retryCount: 30, retryWindowInMinutes: 27 }, - }, - resources: { - ids: [ - "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource2", - ], - }, - correlationid: "01080d2f-1dca-4610-afb4-dd25eddf1f3c1", - }); - console.log(result); -} - -/** - * This sample demonstrates how to virtualMachinesExecuteDeallocate: executeDeallocate for a virtual machine - * - * @summary virtualMachinesExecuteDeallocate: executeDeallocate for a virtual machine - * x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesExecuteDeallocate_MinimumSet_Gen.json - */ -async function scheduledActionsVirtualMachinesExecuteDeallocateGeneratedByMaximumSetRuleGeneratedByMinimumSetRule(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "DE84A209-5715-43E7-BC76-3E208A9A82C5"; - const client = new ComputeScheduleClient(credential, subscriptionId); - const result = await client.scheduledActions.virtualMachinesExecuteDeallocate( - "irbtacrhjgfpyvhvjo", - { - executionParameters: {}, - resources: { - ids: [ - "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource2", - ], - }, - correlationid: "01080d2f-1dca-4610-afb4-dd25eddf1f3c1", - }, - ); - console.log(result); -} - -async function main(): Promise { - scheduledActionsVirtualMachinesExecuteDeallocateGeneratedByMaximumSetRuleGeneratedByMaximumSetRule(); - scheduledActionsVirtualMachinesExecuteDeallocateGeneratedByMaximumSetRuleGeneratedByMinimumSetRule(); -} - -main().catch(console.error); diff --git a/sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/src/scheduledActionsVirtualMachinesExecuteHibernateSample.ts b/sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/src/scheduledActionsVirtualMachinesExecuteHibernateSample.ts deleted file mode 100644 index 957792ae306c..000000000000 --- a/sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/src/scheduledActionsVirtualMachinesExecuteHibernateSample.ts +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeScheduleClient } from "@azure/arm-computeschedule"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to virtualMachinesExecuteHibernate: executeHibernate for a virtual machine - * - * @summary virtualMachinesExecuteHibernate: executeHibernate for a virtual machine - * x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesExecuteHibernate_MaximumSet_Gen.json - */ -async function scheduledActionsVirtualMachinesExecuteHibernateGeneratedByMaximumSetRuleGeneratedByMaximumSetRule(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "DE84A209-5715-43E7-BC76-3E208A9A82C5"; - const client = new ComputeScheduleClient(credential, subscriptionId); - const result = await client.scheduledActions.virtualMachinesExecuteHibernate( - "sejdmamuhhvfpljomwumsplc", - { - executionParameters: { - optimizationPreference: "Cost", - retryPolicy: { retryCount: 30, retryWindowInMinutes: 27 }, - }, - resources: { - ids: [ - "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3", - ], - }, - correlationid: "01080d2f-1dca-4610-afb4-dd25eec1f3c1", - }, - ); - console.log(result); -} - -/** - * This sample demonstrates how to virtualMachinesExecuteHibernate: executeHibernate for a virtual machine - * - * @summary virtualMachinesExecuteHibernate: executeHibernate for a virtual machine - * x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesExecuteHibernate_MinimumSet_Gen.json - */ -async function scheduledActionsVirtualMachinesExecuteHibernateGeneratedByMaximumSetRuleGeneratedByMinimumSetRule(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "DE84A209-5715-43E7-BC76-3E208A9A82C5"; - const client = new ComputeScheduleClient(credential, subscriptionId); - const result = await client.scheduledActions.virtualMachinesExecuteHibernate("kga", { - executionParameters: {}, - resources: { - ids: [ - "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3", - ], - }, - correlationid: "01080d2f-1dca-4610-afb4-dd25eec1f3c1", - }); - console.log(result); -} - -async function main(): Promise { - scheduledActionsVirtualMachinesExecuteHibernateGeneratedByMaximumSetRuleGeneratedByMaximumSetRule(); - scheduledActionsVirtualMachinesExecuteHibernateGeneratedByMaximumSetRuleGeneratedByMinimumSetRule(); -} - -main().catch(console.error); diff --git a/sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/src/scheduledActionsVirtualMachinesExecuteStartSample.ts b/sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/src/scheduledActionsVirtualMachinesExecuteStartSample.ts deleted file mode 100644 index d79157e871e5..000000000000 --- a/sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/src/scheduledActionsVirtualMachinesExecuteStartSample.ts +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeScheduleClient } from "@azure/arm-computeschedule"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to virtualMachinesExecuteStart: executeStart for a virtual machine - * - * @summary virtualMachinesExecuteStart: executeStart for a virtual machine - * x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesExecuteStart_MaximumSet_Gen.json - */ -async function scheduledActionsVirtualMachinesExecuteStartGeneratedByMaximumSetRuleGeneratedByMaximumSetRule(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "DE84A209-5715-43E7-BC76-3E208A9A82C5"; - const client = new ComputeScheduleClient(credential, subscriptionId); - const result = await client.scheduledActions.virtualMachinesExecuteStart("ysfrwcfmfsh", { - executionParameters: { - optimizationPreference: "Cost", - retryPolicy: { retryCount: 30, retryWindowInMinutes: 27 }, - }, - resources: { - ids: [ - "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource4", - ], - }, - correlationid: "23230d2f-1dca-4610-afb4-dd25eec1f34", - }); - console.log(result); -} - -/** - * This sample demonstrates how to virtualMachinesExecuteStart: executeStart for a virtual machine - * - * @summary virtualMachinesExecuteStart: executeStart for a virtual machine - * x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesExecuteStart_MinimumSet_Gen.json - */ -async function scheduledActionsVirtualMachinesExecuteStartGeneratedByMaximumSetRuleGeneratedByMinimumSetRule(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "DE84A209-5715-43E7-BC76-3E208A9A82C5"; - const client = new ComputeScheduleClient(credential, subscriptionId); - const result = await client.scheduledActions.virtualMachinesExecuteStart( - "qegbgjculewswqvnmaclcgpqqidl", - { - executionParameters: {}, - resources: { - ids: [ - "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource4", - ], - }, - correlationid: "23230d2f-1dca-4610-afb4-dd25eec1f34", - }, - ); - console.log(result); -} - -async function main(): Promise { - scheduledActionsVirtualMachinesExecuteStartGeneratedByMaximumSetRuleGeneratedByMaximumSetRule(); - scheduledActionsVirtualMachinesExecuteStartGeneratedByMaximumSetRuleGeneratedByMinimumSetRule(); -} - -main().catch(console.error); diff --git a/sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/src/scheduledActionsVirtualMachinesGetOperationErrorsSample.ts b/sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/src/scheduledActionsVirtualMachinesGetOperationErrorsSample.ts deleted file mode 100644 index 6f3822589eda..000000000000 --- a/sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/src/scheduledActionsVirtualMachinesGetOperationErrorsSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeScheduleClient } from "@azure/arm-computeschedule"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to virtualMachinesGetOperationErrors: getOperationErrors associated with an operation on a virtual machine - * - * @summary virtualMachinesGetOperationErrors: getOperationErrors associated with an operation on a virtual machine - * x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesGetOperationErrors_MaximumSet_Gen.json - */ -async function csScheduledActionsVirtualMachinesGetOperationErrorsMax(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "DE84A209-5715-43E7-BC76-3E208A9A82C5"; - const client = new ComputeScheduleClient(credential, subscriptionId); - const result = await client.scheduledActions.virtualMachinesGetOperationErrors("hfsa", { - operationIds: ["DE84A209-5715-43E7-BC76-3E208A9A323"], - }); - console.log(result); -} - -/** - * This sample demonstrates how to virtualMachinesGetOperationErrors: getOperationErrors associated with an operation on a virtual machine - * - * @summary virtualMachinesGetOperationErrors: getOperationErrors associated with an operation on a virtual machine - * x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesGetOperationErrors_MinimumSet_Gen.json - */ -async function csScheduledActionsVirtualMachinesGetOperationErrorsMin(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "DE84A209-5715-43E7-BC76-3E208A9A82C5"; - const client = new ComputeScheduleClient(credential, subscriptionId); - const result = await client.scheduledActions.virtualMachinesGetOperationErrors("ggxoaxzxtdbi", { - operationIds: ["qeicik"], - }); - console.log(result); -} - -async function main(): Promise { - csScheduledActionsVirtualMachinesGetOperationErrorsMax(); - csScheduledActionsVirtualMachinesGetOperationErrorsMin(); -} - -main().catch(console.error); diff --git a/sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/src/scheduledActionsVirtualMachinesGetOperationStatusSample.ts b/sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/src/scheduledActionsVirtualMachinesGetOperationStatusSample.ts deleted file mode 100644 index 8fca1b41b38a..000000000000 --- a/sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/src/scheduledActionsVirtualMachinesGetOperationStatusSample.ts +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeScheduleClient } from "@azure/arm-computeschedule"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to virtualMachinesGetOperationStatus: getOperationStatus for a virtual machine - * - * @summary virtualMachinesGetOperationStatus: getOperationStatus for a virtual machine - * x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesGetOperationStatus_MaximumSet_Gen.json - */ -async function scheduledActionsVirtualMachinesGetOperationStatusGeneratedByMinimumSetRuleGeneratedByMaximumSetRule(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "DE84A209-5715-43E7-BC76-3E208A9A82C5"; - const client = new ComputeScheduleClient(credential, subscriptionId); - const result = await client.scheduledActions.virtualMachinesGetOperationStatus( - "htxxasfxaesuecem", - { - operationIds: ["01080d2f-1dca-4610-afb4-dd25eec1f3df"], - correlationid: "01080d2f-1dca-4610-afb4-dd25eec1f3c1", - }, - ); - console.log(result); -} - -/** - * This sample demonstrates how to virtualMachinesGetOperationStatus: getOperationStatus for a virtual machine - * - * @summary virtualMachinesGetOperationStatus: getOperationStatus for a virtual machine - * x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesGetOperationStatus_MinimumSet_Gen.json - */ -async function scheduledActionsVirtualMachinesGetOperationStatusGeneratedByMinimumSetRule(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "DE84A209-5715-43E7-BC76-3E208A9A82C5"; - const client = new ComputeScheduleClient(credential, subscriptionId); - const result = await client.scheduledActions.virtualMachinesGetOperationStatus("csay", { - operationIds: ["01080d2f-1dca-4610-afb4-dd25eec1f3df"], - correlationid: "01080d2f-1dca-4610-afb4-dd25eec1f3c1", - }); - console.log(result); -} - -async function main(): Promise { - scheduledActionsVirtualMachinesGetOperationStatusGeneratedByMinimumSetRuleGeneratedByMaximumSetRule(); - scheduledActionsVirtualMachinesGetOperationStatusGeneratedByMinimumSetRule(); -} - -main().catch(console.error); diff --git a/sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/src/scheduledActionsVirtualMachinesSubmitDeallocateSample.ts b/sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/src/scheduledActionsVirtualMachinesSubmitDeallocateSample.ts deleted file mode 100644 index 792ade26a724..000000000000 --- a/sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/src/scheduledActionsVirtualMachinesSubmitDeallocateSample.ts +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeScheduleClient } from "@azure/arm-computeschedule"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to virtualMachinesSubmitDeallocate: submitDeallocate for a virtual machine - * - * @summary virtualMachinesSubmitDeallocate: submitDeallocate for a virtual machine - * x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesSubmitDeallocate_MaximumSet_Gen.json - */ -async function scheduledActionsVirtualMachinesSubmitDeallocateGeneratedByMaximumSetRuleGeneratedByMaximumSetRule(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "DE84A209-5715-43E7-BC76-3E208A9A82C5"; - const client = new ComputeScheduleClient(credential, subscriptionId); - const result = await client.scheduledActions.virtualMachinesSubmitDeallocate( - "ibfxsvilwrgqttuslbduzdtxcckdet", - { - schedule: { - deadLine: "2024-07-12T18:06:53.361Z", - timeZone: "zlcujrtgxtgyik", - deadlineType: "Unknown", - }, - executionParameters: { - optimizationPreference: "Cost", - retryPolicy: { retryCount: 30, retryWindowInMinutes: 27 }, - }, - resources: { - ids: [ - "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource2", - ], - }, - correlationid: "23519o2f-1dca-4610-afb4-dd25eec1f34", - }, - ); - console.log(result); -} - -/** - * This sample demonstrates how to virtualMachinesSubmitDeallocate: submitDeallocate for a virtual machine - * - * @summary virtualMachinesSubmitDeallocate: submitDeallocate for a virtual machine - * x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesSubmitDeallocate_MinimumSet_Gen.json - */ -async function scheduledActionsVirtualMachinesSubmitDeallocateGeneratedByMaximumSetRuleGeneratedByMinimumSetRule(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "DE84A209-5715-43E7-BC76-3E208A9A82C5"; - const client = new ComputeScheduleClient(credential, subscriptionId); - const result = await client.scheduledActions.virtualMachinesSubmitDeallocate( - "qwfcdtmshnlownbkyh", - { - schedule: { - deadLine: "2024-07-12T18:06:53.361Z", - timeZone: "zlcujrtgxtgyik", - deadlineType: "Unknown", - }, - executionParameters: {}, - resources: { - ids: [ - "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource2", - ], - }, - correlationid: "23519o2f-1dca-4610-afb4-dd25eec1f34", - }, - ); - console.log(result); -} - -async function main(): Promise { - scheduledActionsVirtualMachinesSubmitDeallocateGeneratedByMaximumSetRuleGeneratedByMaximumSetRule(); - scheduledActionsVirtualMachinesSubmitDeallocateGeneratedByMaximumSetRuleGeneratedByMinimumSetRule(); -} - -main().catch(console.error); diff --git a/sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/src/scheduledActionsVirtualMachinesSubmitHibernateSample.ts b/sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/src/scheduledActionsVirtualMachinesSubmitHibernateSample.ts deleted file mode 100644 index 47f3f8b6641a..000000000000 --- a/sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/src/scheduledActionsVirtualMachinesSubmitHibernateSample.ts +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeScheduleClient } from "@azure/arm-computeschedule"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to virtualMachinesSubmitHibernate: submitHibernate for a virtual machine - * - * @summary virtualMachinesSubmitHibernate: submitHibernate for a virtual machine - * x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesSubmitHibernate_MaximumSet_Gen.json - */ -async function scheduledActionsVirtualMachinesSubmitHibernateGeneratedByMaximumSetRuleGeneratedByMaximumSetRule(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "DE84A209-5715-43E7-BC76-3E208A9A82C5"; - const client = new ComputeScheduleClient(credential, subscriptionId); - const result = await client.scheduledActions.virtualMachinesSubmitHibernate("bgxeayimbxqzev", { - schedule: { - deadLine: "2024-07-12T18:06:53.361Z", - timeZone: "zlcujrtgxtgyik", - deadlineType: "Unknown", - }, - executionParameters: { - optimizationPreference: "Cost", - retryPolicy: { retryCount: 30, retryWindowInMinutes: 27 }, - }, - resources: { - ids: [ - "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3", - ], - }, - correlationid: "23519o2f-1dca-4610-afb4-dd25eec1f34", - }); - console.log(result); -} - -/** - * This sample demonstrates how to virtualMachinesSubmitHibernate: submitHibernate for a virtual machine - * - * @summary virtualMachinesSubmitHibernate: submitHibernate for a virtual machine - * x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesSubmitHibernate_MinimumSet_Gen.json - */ -async function scheduledActionsVirtualMachinesSubmitHibernateGeneratedByMaximumSetRuleGeneratedByMinimumSetRule(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "DE84A209-5715-43E7-BC76-3E208A9A82C5"; - const client = new ComputeScheduleClient(credential, subscriptionId); - const result = await client.scheduledActions.virtualMachinesSubmitHibernate( - "fvjciwudfbndlqumcgqs", - { - schedule: { - deadLine: "2024-07-12T18:06:53.361Z", - timeZone: "zlcujrtgxtgyik", - deadlineType: "Unknown", - }, - executionParameters: {}, - resources: { - ids: [ - "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3", - ], - }, - correlationid: "23519o2f-1dca-4610-afb4-dd25eec1f34", - }, - ); - console.log(result); -} - -async function main(): Promise { - scheduledActionsVirtualMachinesSubmitHibernateGeneratedByMaximumSetRuleGeneratedByMaximumSetRule(); - scheduledActionsVirtualMachinesSubmitHibernateGeneratedByMaximumSetRuleGeneratedByMinimumSetRule(); -} - -main().catch(console.error); diff --git a/sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/src/scheduledActionsVirtualMachinesSubmitStartSample.ts b/sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/src/scheduledActionsVirtualMachinesSubmitStartSample.ts deleted file mode 100644 index a5de791c9bc2..000000000000 --- a/sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/src/scheduledActionsVirtualMachinesSubmitStartSample.ts +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeScheduleClient } from "@azure/arm-computeschedule"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to virtualMachinesSubmitStart: submitStart for a virtual machine - * - * @summary virtualMachinesSubmitStart: submitStart for a virtual machine - * x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesSubmitStart_MaximumSet_Gen.json - */ -async function scheduledActionsVirtualMachinesSubmitStartGeneratedByMaximumSetRuleGeneratedByMaximumSetRule(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "DE84A209-5715-43E7-BC76-3E208A9A82C5"; - const client = new ComputeScheduleClient(credential, subscriptionId); - const result = await client.scheduledActions.virtualMachinesSubmitStart( - "fxiidszhrokwjmewlahfqjiocnes", - { - schedule: { - deadLine: "2024-07-12T18:06:53.361Z", - timeZone: "zlcujrtgxtgyik", - deadlineType: "Unknown", - }, - executionParameters: { - optimizationPreference: "Cost", - retryPolicy: { retryCount: 30, retryWindowInMinutes: 27 }, - }, - resources: { - ids: [ - "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource4", - ], - }, - correlationid: "23480d2f-1dca-4610-afb4-dd25eec1f34", - }, - ); - console.log(result); -} - -/** - * This sample demonstrates how to virtualMachinesSubmitStart: submitStart for a virtual machine - * - * @summary virtualMachinesSubmitStart: submitStart for a virtual machine - * x-ms-original-file: 2024-08-15-preview/ScheduledActions_VirtualMachinesSubmitStart_MinimumSet_Gen.json - */ -async function scheduledActionsVirtualMachinesSubmitStartGeneratedByMaximumSetRuleGeneratedByMinimumSetRule(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "DE84A209-5715-43E7-BC76-3E208A9A82C5"; - const client = new ComputeScheduleClient(credential, subscriptionId); - const result = await client.scheduledActions.virtualMachinesSubmitStart("httzei", { - schedule: { - deadLine: "2024-07-12T18:06:53.361Z", - timeZone: "zlcujrtgxtgyik", - deadlineType: "Unknown", - }, - executionParameters: {}, - resources: { - ids: [ - "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource4", - ], - }, - correlationid: "23480d2f-1dca-4610-afb4-dd25eec1f34", - }); - console.log(result); -} - -async function main(): Promise { - scheduledActionsVirtualMachinesSubmitStartGeneratedByMaximumSetRuleGeneratedByMaximumSetRule(); - scheduledActionsVirtualMachinesSubmitStartGeneratedByMaximumSetRuleGeneratedByMinimumSetRule(); -} - -main().catch(console.error); diff --git a/sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/tsconfig.json b/sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/tsconfig.json deleted file mode 100644 index 984eed535aa8..000000000000 --- a/sdk/computeschedule/arm-computeschedule/samples/v1-beta/typescript/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2020", - "module": "commonjs", - "moduleResolution": "node", - "resolveJsonModule": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "strict": true, - "alwaysStrict": true, - "outDir": "dist", - "rootDir": "src" - }, - "include": [ - "src/**/*.ts" - ] -} diff --git a/sdk/computeschedule/arm-computeschedule/src/api/computeScheduleContext.ts b/sdk/computeschedule/arm-computeschedule/src/api/computeScheduleContext.ts index 3c2d05558c87..0e78386cd022 100644 --- a/sdk/computeschedule/arm-computeschedule/src/api/computeScheduleContext.ts +++ b/sdk/computeschedule/arm-computeschedule/src/api/computeScheduleContext.ts @@ -1,15 +1,18 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import { TokenCredential } from "@azure/core-auth"; -import { ClientOptions, Client, getClient } from "@azure-rest/core-client"; import { logger } from "../logger.js"; +import { KnownVersions } from "../models/models.js"; +import { Client, ClientOptions, getClient } from "@azure-rest/core-client"; +import { TokenCredential } from "@azure/core-auth"; +/** Microsoft.ComputeSchedule Resource Provider management API. */ export interface ComputeScheduleContext extends Client {} /** Optional parameters for the client. */ export interface ComputeScheduleClientOptionalParams extends ClientOptions { /** The API version to use for this operation. */ + /** Known values of {@link KnownVersions} that the service accepts. */ apiVersion?: string; } @@ -19,9 +22,8 @@ export function createComputeSchedule( options: ComputeScheduleClientOptionalParams = {}, ): ComputeScheduleContext { const endpointUrl = options.endpoint ?? options.baseUrl ?? `https://management.azure.com`; - const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix; - const userAgentInfo = `azsdk-js-arm-computeschedule/1.0.0-beta.3`; + const userAgentInfo = `azsdk-js-arm-computeschedule/1.0.0-beta.1`; const userAgentPrefix = prefixFromOptions ? `${prefixFromOptions} azsdk-js-api ${userAgentInfo}` : `azsdk-js-api ${userAgentInfo}`; @@ -35,7 +37,7 @@ export function createComputeSchedule( }; const clientContext = getClient(endpointUrl, credential, updatedOptions); clientContext.pipeline.removePolicy({ name: "ApiVersionPolicy" }); - const apiVersion = options.apiVersion ?? "2024-08-15-preview"; + const apiVersion = options.apiVersion ?? "2024-10-01"; clientContext.pipeline.addPolicy({ name: "ClientApiVersionPolicy", sendRequest: (req, next) => { diff --git a/sdk/computeschedule/arm-computeschedule/src/api/index.ts b/sdk/computeschedule/arm-computeschedule/src/api/index.ts index 267a18e2c99e..34a47e744e59 100644 --- a/sdk/computeschedule/arm-computeschedule/src/api/index.ts +++ b/sdk/computeschedule/arm-computeschedule/src/api/index.ts @@ -6,6 +6,18 @@ export { ComputeScheduleContext, ComputeScheduleClientOptionalParams, } from "./computeScheduleContext.js"; +export { + OperationsListOptionalParams, + ScheduledActionsVirtualMachinesSubmitDeallocateOptionalParams, + ScheduledActionsVirtualMachinesSubmitHibernateOptionalParams, + ScheduledActionsVirtualMachinesSubmitStartOptionalParams, + ScheduledActionsVirtualMachinesExecuteDeallocateOptionalParams, + ScheduledActionsVirtualMachinesExecuteHibernateOptionalParams, + ScheduledActionsVirtualMachinesExecuteStartOptionalParams, + ScheduledActionsVirtualMachinesGetOperationStatusOptionalParams, + ScheduledActionsVirtualMachinesCancelOperationsOptionalParams, + ScheduledActionsVirtualMachinesGetOperationErrorsOptionalParams, +} from "./options.js"; export { operationsList } from "./operations/index.js"; export { scheduledActionsVirtualMachinesSubmitDeallocate, diff --git a/sdk/computeschedule/arm-computeschedule/src/api/operations/index.ts b/sdk/computeschedule/arm-computeschedule/src/api/operations/index.ts index 9b6d22bf26ba..5404588c6017 100644 --- a/sdk/computeschedule/arm-computeschedule/src/api/operations/index.ts +++ b/sdk/computeschedule/arm-computeschedule/src/api/operations/index.ts @@ -1,19 +1,22 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import { Operation, _OperationListResult } from "../../models/models.js"; -import { ComputeScheduleContext as Client } from "../index.js"; +import { ComputeScheduleContext as Client, OperationsListOptionalParams } from "../index.js"; import { - StreamableMethod, - operationOptionsToRequestParameters, - PathUncheckedResponse, - createRestError, -} from "@azure-rest/core-client"; + _OperationListResult, + _operationListResultDeserializer, + Operation, +} from "../../models/models.js"; import { PagedAsyncIterableIterator, buildPagedAsyncIterator, } from "../../static-helpers/pagingHelpers.js"; -import { OperationsListOptionalParams } from "../../models/options.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; export function _operationsListSend( context: Client, @@ -32,25 +35,7 @@ export async function _operationsListDeserialize( throw createRestError(result); } - return { - value: result.body["value"].map((p: any) => { - return { - name: p["name"], - isDataAction: p["isDataAction"], - display: !p.display - ? undefined - : { - provider: p.display?.["provider"], - resource: p.display?.["resource"], - operation: p.display?.["operation"], - description: p.display?.["description"], - }, - origin: p["origin"], - actionType: p["actionType"], - }; - }), - nextLink: result.body["nextLink"], - }; + return _operationListResultDeserializer(result.body); } /** List the operations for the provider */ diff --git a/sdk/computeschedule/arm-computeschedule/src/models/options.ts b/sdk/computeschedule/arm-computeschedule/src/api/options.ts similarity index 100% rename from sdk/computeschedule/arm-computeschedule/src/models/options.ts rename to sdk/computeschedule/arm-computeschedule/src/api/options.ts diff --git a/sdk/computeschedule/arm-computeschedule/src/api/scheduledActions/index.ts b/sdk/computeschedule/arm-computeschedule/src/api/scheduledActions/index.ts index 993bbd7c07a1..721d3c3e7bcf 100644 --- a/sdk/computeschedule/arm-computeschedule/src/api/scheduledActions/index.ts +++ b/sdk/computeschedule/arm-computeschedule/src/api/scheduledActions/index.ts @@ -2,43 +2,55 @@ // Licensed under the MIT License. import { - scheduleSerializer, - executionParametersSerializer, - resourcesSerializer, + ComputeScheduleContext as Client, + ScheduledActionsVirtualMachinesCancelOperationsOptionalParams, + ScheduledActionsVirtualMachinesExecuteDeallocateOptionalParams, + ScheduledActionsVirtualMachinesExecuteHibernateOptionalParams, + ScheduledActionsVirtualMachinesExecuteStartOptionalParams, + ScheduledActionsVirtualMachinesGetOperationErrorsOptionalParams, + ScheduledActionsVirtualMachinesGetOperationStatusOptionalParams, + ScheduledActionsVirtualMachinesSubmitDeallocateOptionalParams, + ScheduledActionsVirtualMachinesSubmitHibernateOptionalParams, + ScheduledActionsVirtualMachinesSubmitStartOptionalParams, +} from "../index.js"; +import { SubmitDeallocateRequest, + submitDeallocateRequestSerializer, DeallocateResourceOperationResponse, + deallocateResourceOperationResponseDeserializer, SubmitHibernateRequest, + submitHibernateRequestSerializer, HibernateResourceOperationResponse, + hibernateResourceOperationResponseDeserializer, SubmitStartRequest, + submitStartRequestSerializer, StartResourceOperationResponse, + startResourceOperationResponseDeserializer, ExecuteDeallocateRequest, + executeDeallocateRequestSerializer, ExecuteHibernateRequest, + executeHibernateRequestSerializer, ExecuteStartRequest, + executeStartRequestSerializer, GetOperationStatusRequest, + getOperationStatusRequestSerializer, GetOperationStatusResponse, + getOperationStatusResponseDeserializer, CancelOperationsRequest, + cancelOperationsRequestSerializer, CancelOperationsResponse, + cancelOperationsResponseDeserializer, GetOperationErrorsRequest, + getOperationErrorsRequestSerializer, GetOperationErrorsResponse, + getOperationErrorsResponseDeserializer, } from "../../models/models.js"; -import { ComputeScheduleContext as Client } from "../index.js"; import { StreamableMethod, - operationOptionsToRequestParameters, PathUncheckedResponse, createRestError, + operationOptionsToRequestParameters, } from "@azure-rest/core-client"; -import { - ScheduledActionsVirtualMachinesSubmitDeallocateOptionalParams, - ScheduledActionsVirtualMachinesSubmitHibernateOptionalParams, - ScheduledActionsVirtualMachinesSubmitStartOptionalParams, - ScheduledActionsVirtualMachinesExecuteDeallocateOptionalParams, - ScheduledActionsVirtualMachinesExecuteHibernateOptionalParams, - ScheduledActionsVirtualMachinesExecuteStartOptionalParams, - ScheduledActionsVirtualMachinesGetOperationStatusOptionalParams, - ScheduledActionsVirtualMachinesCancelOperationsOptionalParams, - ScheduledActionsVirtualMachinesGetOperationErrorsOptionalParams, -} from "../../models/options.js"; export function _scheduledActionsVirtualMachinesSubmitDeallocateSend( context: Client, @@ -57,12 +69,7 @@ export function _scheduledActionsVirtualMachinesSubmitDeallocateSend( ) .post({ ...operationOptionsToRequestParameters(options), - body: { - schedule: scheduleSerializer(requestBody.schedule), - executionParameters: executionParametersSerializer(requestBody.executionParameters), - resources: resourcesSerializer(requestBody.resources), - correlationid: requestBody["correlationid"], - }, + body: submitDeallocateRequestSerializer(requestBody), }); } @@ -74,49 +81,10 @@ export async function _scheduledActionsVirtualMachinesSubmitDeallocateDeserializ throw createRestError(result); } - return { - description: result.body["description"], - type: result.body["type"], - location: result.body["location"], - results: - result.body["results"] === undefined - ? result.body["results"] - : result.body["results"].map((p: any) => { - return { - resourceId: p["resourceId"], - errorCode: p["errorCode"], - errorDetails: p["errorDetails"], - operation: !p.operation - ? undefined - : { - operationId: p.operation?.["operationId"], - resourceId: p.operation?.["resourceId"], - opType: p.operation?.["opType"], - subscriptionId: p.operation?.["subscriptionId"], - deadline: p.operation?.["deadline"], - deadlineType: p.operation?.["deadlineType"], - state: p.operation?.["state"], - timeZone: p.operation?.["timeZone"], - resourceOperationError: !p.operation?.resourceOperationError - ? undefined - : { - errorCode: p.operation?.resourceOperationError?.["errorCode"], - errorDetails: p.operation?.resourceOperationError?.["errorDetails"], - }, - completedAt: p.operation?.["completedAt"], - retryPolicy: !p.operation?.retryPolicy - ? undefined - : { - retryCount: p.operation?.retryPolicy?.["retryCount"], - retryWindowInMinutes: p.operation?.retryPolicy?.["retryWindowInMinutes"], - }, - }, - }; - }), - }; + return deallocateResourceOperationResponseDeserializer(result.body); } -/** virtualMachinesSubmitDeallocate: submitDeallocate for a virtual machine */ +/** VirtualMachinesSubmitDeallocate: Schedule deallocate operation for a batch of virtual machines at datetime in future. */ export async function scheduledActionsVirtualMachinesSubmitDeallocate( context: Client, subscriptionId: string, @@ -153,12 +121,7 @@ export function _scheduledActionsVirtualMachinesSubmitHibernateSend( ) .post({ ...operationOptionsToRequestParameters(options), - body: { - schedule: scheduleSerializer(requestBody.schedule), - executionParameters: executionParametersSerializer(requestBody.executionParameters), - resources: resourcesSerializer(requestBody.resources), - correlationid: requestBody["correlationid"], - }, + body: submitHibernateRequestSerializer(requestBody), }); } @@ -170,49 +133,10 @@ export async function _scheduledActionsVirtualMachinesSubmitHibernateDeserialize throw createRestError(result); } - return { - description: result.body["description"], - type: result.body["type"], - location: result.body["location"], - results: - result.body["results"] === undefined - ? result.body["results"] - : result.body["results"].map((p: any) => { - return { - resourceId: p["resourceId"], - errorCode: p["errorCode"], - errorDetails: p["errorDetails"], - operation: !p.operation - ? undefined - : { - operationId: p.operation?.["operationId"], - resourceId: p.operation?.["resourceId"], - opType: p.operation?.["opType"], - subscriptionId: p.operation?.["subscriptionId"], - deadline: p.operation?.["deadline"], - deadlineType: p.operation?.["deadlineType"], - state: p.operation?.["state"], - timeZone: p.operation?.["timeZone"], - resourceOperationError: !p.operation?.resourceOperationError - ? undefined - : { - errorCode: p.operation?.resourceOperationError?.["errorCode"], - errorDetails: p.operation?.resourceOperationError?.["errorDetails"], - }, - completedAt: p.operation?.["completedAt"], - retryPolicy: !p.operation?.retryPolicy - ? undefined - : { - retryCount: p.operation?.retryPolicy?.["retryCount"], - retryWindowInMinutes: p.operation?.retryPolicy?.["retryWindowInMinutes"], - }, - }, - }; - }), - }; + return hibernateResourceOperationResponseDeserializer(result.body); } -/** virtualMachinesSubmitHibernate: submitHibernate for a virtual machine */ +/** VirtualMachinesSubmitHibernate: Schedule hibernate operation for a batch of virtual machines at datetime in future. */ export async function scheduledActionsVirtualMachinesSubmitHibernate( context: Client, subscriptionId: string, @@ -249,12 +173,7 @@ export function _scheduledActionsVirtualMachinesSubmitStartSend( ) .post({ ...operationOptionsToRequestParameters(options), - body: { - schedule: scheduleSerializer(requestBody.schedule), - executionParameters: executionParametersSerializer(requestBody.executionParameters), - resources: resourcesSerializer(requestBody.resources), - correlationid: requestBody["correlationid"], - }, + body: submitStartRequestSerializer(requestBody), }); } @@ -266,49 +185,10 @@ export async function _scheduledActionsVirtualMachinesSubmitStartDeserialize( throw createRestError(result); } - return { - description: result.body["description"], - type: result.body["type"], - location: result.body["location"], - results: - result.body["results"] === undefined - ? result.body["results"] - : result.body["results"].map((p: any) => { - return { - resourceId: p["resourceId"], - errorCode: p["errorCode"], - errorDetails: p["errorDetails"], - operation: !p.operation - ? undefined - : { - operationId: p.operation?.["operationId"], - resourceId: p.operation?.["resourceId"], - opType: p.operation?.["opType"], - subscriptionId: p.operation?.["subscriptionId"], - deadline: p.operation?.["deadline"], - deadlineType: p.operation?.["deadlineType"], - state: p.operation?.["state"], - timeZone: p.operation?.["timeZone"], - resourceOperationError: !p.operation?.resourceOperationError - ? undefined - : { - errorCode: p.operation?.resourceOperationError?.["errorCode"], - errorDetails: p.operation?.resourceOperationError?.["errorDetails"], - }, - completedAt: p.operation?.["completedAt"], - retryPolicy: !p.operation?.retryPolicy - ? undefined - : { - retryCount: p.operation?.retryPolicy?.["retryCount"], - retryWindowInMinutes: p.operation?.retryPolicy?.["retryWindowInMinutes"], - }, - }, - }; - }), - }; + return startResourceOperationResponseDeserializer(result.body); } -/** virtualMachinesSubmitStart: submitStart for a virtual machine */ +/** VirtualMachinesSubmitStart: Schedule start operation for a batch of virtual machines at datetime in future. */ export async function scheduledActionsVirtualMachinesSubmitStart( context: Client, subscriptionId: string, @@ -345,11 +225,7 @@ export function _scheduledActionsVirtualMachinesExecuteDeallocateSend( ) .post({ ...operationOptionsToRequestParameters(options), - body: { - executionParameters: executionParametersSerializer(requestBody.executionParameters), - resources: resourcesSerializer(requestBody.resources), - correlationid: requestBody["correlationid"], - }, + body: executeDeallocateRequestSerializer(requestBody), }); } @@ -361,49 +237,10 @@ export async function _scheduledActionsVirtualMachinesExecuteDeallocateDeseriali throw createRestError(result); } - return { - description: result.body["description"], - type: result.body["type"], - location: result.body["location"], - results: - result.body["results"] === undefined - ? result.body["results"] - : result.body["results"].map((p: any) => { - return { - resourceId: p["resourceId"], - errorCode: p["errorCode"], - errorDetails: p["errorDetails"], - operation: !p.operation - ? undefined - : { - operationId: p.operation?.["operationId"], - resourceId: p.operation?.["resourceId"], - opType: p.operation?.["opType"], - subscriptionId: p.operation?.["subscriptionId"], - deadline: p.operation?.["deadline"], - deadlineType: p.operation?.["deadlineType"], - state: p.operation?.["state"], - timeZone: p.operation?.["timeZone"], - resourceOperationError: !p.operation?.resourceOperationError - ? undefined - : { - errorCode: p.operation?.resourceOperationError?.["errorCode"], - errorDetails: p.operation?.resourceOperationError?.["errorDetails"], - }, - completedAt: p.operation?.["completedAt"], - retryPolicy: !p.operation?.retryPolicy - ? undefined - : { - retryCount: p.operation?.retryPolicy?.["retryCount"], - retryWindowInMinutes: p.operation?.retryPolicy?.["retryWindowInMinutes"], - }, - }, - }; - }), - }; + return deallocateResourceOperationResponseDeserializer(result.body); } -/** virtualMachinesExecuteDeallocate: executeDeallocate for a virtual machine */ +/** VirtualMachinesExecuteDeallocate: Execute deallocate operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. */ export async function scheduledActionsVirtualMachinesExecuteDeallocate( context: Client, subscriptionId: string, @@ -440,11 +277,7 @@ export function _scheduledActionsVirtualMachinesExecuteHibernateSend( ) .post({ ...operationOptionsToRequestParameters(options), - body: { - executionParameters: executionParametersSerializer(requestBody.executionParameters), - resources: resourcesSerializer(requestBody.resources), - correlationid: requestBody["correlationid"], - }, + body: executeHibernateRequestSerializer(requestBody), }); } @@ -456,49 +289,10 @@ export async function _scheduledActionsVirtualMachinesExecuteHibernateDeserializ throw createRestError(result); } - return { - description: result.body["description"], - type: result.body["type"], - location: result.body["location"], - results: - result.body["results"] === undefined - ? result.body["results"] - : result.body["results"].map((p: any) => { - return { - resourceId: p["resourceId"], - errorCode: p["errorCode"], - errorDetails: p["errorDetails"], - operation: !p.operation - ? undefined - : { - operationId: p.operation?.["operationId"], - resourceId: p.operation?.["resourceId"], - opType: p.operation?.["opType"], - subscriptionId: p.operation?.["subscriptionId"], - deadline: p.operation?.["deadline"], - deadlineType: p.operation?.["deadlineType"], - state: p.operation?.["state"], - timeZone: p.operation?.["timeZone"], - resourceOperationError: !p.operation?.resourceOperationError - ? undefined - : { - errorCode: p.operation?.resourceOperationError?.["errorCode"], - errorDetails: p.operation?.resourceOperationError?.["errorDetails"], - }, - completedAt: p.operation?.["completedAt"], - retryPolicy: !p.operation?.retryPolicy - ? undefined - : { - retryCount: p.operation?.retryPolicy?.["retryCount"], - retryWindowInMinutes: p.operation?.retryPolicy?.["retryWindowInMinutes"], - }, - }, - }; - }), - }; + return hibernateResourceOperationResponseDeserializer(result.body); } -/** virtualMachinesExecuteHibernate: executeHibernate for a virtual machine */ +/** VirtualMachinesExecuteHibernate: Execute hibernate operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. */ export async function scheduledActionsVirtualMachinesExecuteHibernate( context: Client, subscriptionId: string, @@ -535,11 +329,7 @@ export function _scheduledActionsVirtualMachinesExecuteStartSend( ) .post({ ...operationOptionsToRequestParameters(options), - body: { - executionParameters: executionParametersSerializer(requestBody.executionParameters), - resources: resourcesSerializer(requestBody.resources), - correlationid: requestBody["correlationid"], - }, + body: executeStartRequestSerializer(requestBody), }); } @@ -551,49 +341,10 @@ export async function _scheduledActionsVirtualMachinesExecuteStartDeserialize( throw createRestError(result); } - return { - description: result.body["description"], - type: result.body["type"], - location: result.body["location"], - results: - result.body["results"] === undefined - ? result.body["results"] - : result.body["results"].map((p: any) => { - return { - resourceId: p["resourceId"], - errorCode: p["errorCode"], - errorDetails: p["errorDetails"], - operation: !p.operation - ? undefined - : { - operationId: p.operation?.["operationId"], - resourceId: p.operation?.["resourceId"], - opType: p.operation?.["opType"], - subscriptionId: p.operation?.["subscriptionId"], - deadline: p.operation?.["deadline"], - deadlineType: p.operation?.["deadlineType"], - state: p.operation?.["state"], - timeZone: p.operation?.["timeZone"], - resourceOperationError: !p.operation?.resourceOperationError - ? undefined - : { - errorCode: p.operation?.resourceOperationError?.["errorCode"], - errorDetails: p.operation?.resourceOperationError?.["errorDetails"], - }, - completedAt: p.operation?.["completedAt"], - retryPolicy: !p.operation?.retryPolicy - ? undefined - : { - retryCount: p.operation?.retryPolicy?.["retryCount"], - retryWindowInMinutes: p.operation?.retryPolicy?.["retryWindowInMinutes"], - }, - }, - }; - }), - }; + return startResourceOperationResponseDeserializer(result.body); } -/** virtualMachinesExecuteStart: executeStart for a virtual machine */ +/** VirtualMachinesExecuteStart: Execute start operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. */ export async function scheduledActionsVirtualMachinesExecuteStart( context: Client, subscriptionId: string, @@ -630,10 +381,7 @@ export function _scheduledActionsVirtualMachinesGetOperationStatusSend( ) .post({ ...operationOptionsToRequestParameters(options), - body: { - operationIds: requestBody["operationIds"], - correlationid: requestBody["correlationid"], - }, + body: getOperationStatusRequestSerializer(requestBody), }); } @@ -645,43 +393,10 @@ export async function _scheduledActionsVirtualMachinesGetOperationStatusDeserial throw createRestError(result); } - return { - results: result.body["results"].map((p: any) => { - return { - resourceId: p["resourceId"], - errorCode: p["errorCode"], - errorDetails: p["errorDetails"], - operation: !p.operation - ? undefined - : { - operationId: p.operation?.["operationId"], - resourceId: p.operation?.["resourceId"], - opType: p.operation?.["opType"], - subscriptionId: p.operation?.["subscriptionId"], - deadline: p.operation?.["deadline"], - deadlineType: p.operation?.["deadlineType"], - state: p.operation?.["state"], - timeZone: p.operation?.["timeZone"], - resourceOperationError: !p.operation?.resourceOperationError - ? undefined - : { - errorCode: p.operation?.resourceOperationError?.["errorCode"], - errorDetails: p.operation?.resourceOperationError?.["errorDetails"], - }, - completedAt: p.operation?.["completedAt"], - retryPolicy: !p.operation?.retryPolicy - ? undefined - : { - retryCount: p.operation?.retryPolicy?.["retryCount"], - retryWindowInMinutes: p.operation?.retryPolicy?.["retryWindowInMinutes"], - }, - }, - }; - }), - }; + return getOperationStatusResponseDeserializer(result.body); } -/** virtualMachinesGetOperationStatus: getOperationStatus for a virtual machine */ +/** VirtualMachinesGetOperationStatus: Polling endpoint to read status of operations performed on virtual machines */ export async function scheduledActionsVirtualMachinesGetOperationStatus( context: Client, subscriptionId: string, @@ -718,10 +433,7 @@ export function _scheduledActionsVirtualMachinesCancelOperationsSend( ) .post({ ...operationOptionsToRequestParameters(options), - body: { - operationIds: requestBody["operationIds"], - correlationid: requestBody["correlationid"], - }, + body: cancelOperationsRequestSerializer(requestBody), }); } @@ -733,43 +445,10 @@ export async function _scheduledActionsVirtualMachinesCancelOperationsDeserializ throw createRestError(result); } - return { - results: result.body["results"].map((p: any) => { - return { - resourceId: p["resourceId"], - errorCode: p["errorCode"], - errorDetails: p["errorDetails"], - operation: !p.operation - ? undefined - : { - operationId: p.operation?.["operationId"], - resourceId: p.operation?.["resourceId"], - opType: p.operation?.["opType"], - subscriptionId: p.operation?.["subscriptionId"], - deadline: p.operation?.["deadline"], - deadlineType: p.operation?.["deadlineType"], - state: p.operation?.["state"], - timeZone: p.operation?.["timeZone"], - resourceOperationError: !p.operation?.resourceOperationError - ? undefined - : { - errorCode: p.operation?.resourceOperationError?.["errorCode"], - errorDetails: p.operation?.resourceOperationError?.["errorDetails"], - }, - completedAt: p.operation?.["completedAt"], - retryPolicy: !p.operation?.retryPolicy - ? undefined - : { - retryCount: p.operation?.retryPolicy?.["retryCount"], - retryWindowInMinutes: p.operation?.retryPolicy?.["retryWindowInMinutes"], - }, - }, - }; - }), - }; + return cancelOperationsResponseDeserializer(result.body); } -/** virtualMachinesCancelOperations: cancelOperations for a virtual machine */ +/** VirtualMachinesCancelOperations: Cancel a previously submitted (start/deallocate/hibernate) request */ export async function scheduledActionsVirtualMachinesCancelOperations( context: Client, subscriptionId: string, @@ -806,7 +485,7 @@ export function _scheduledActionsVirtualMachinesGetOperationErrorsSend( ) .post({ ...operationOptionsToRequestParameters(options), - body: { operationIds: requestBody["operationIds"] }, + body: getOperationErrorsRequestSerializer(requestBody), }); } @@ -818,32 +497,10 @@ export async function _scheduledActionsVirtualMachinesGetOperationErrorsDeserial throw createRestError(result); } - return { - results: result.body["results"].map((p: any) => { - return { - operationId: p["operationId"], - creationTime: p["creationTime"], - activationTime: p["activationTime"], - completedAt: p["completedAt"], - operationErrors: - p["operationErrors"] === undefined - ? p["operationErrors"] - : p["operationErrors"].map((p: any) => { - return { - errorCode: p["errorCode"], - errorDetails: p["errorDetails"], - timeStamp: p["timeStamp"], - crpOperationId: p["crpOperationId"], - }; - }), - requestErrorCode: p["requestErrorCode"], - requestErrorDetails: p["requestErrorDetails"], - }; - }), - }; + return getOperationErrorsResponseDeserializer(result.body); } -/** virtualMachinesGetOperationErrors: getOperationErrors associated with an operation on a virtual machine */ +/** VirtualMachinesGetOperationErrors: Get error details on operation errors (like transient errors encountered, additional logs) if they exist. */ export async function scheduledActionsVirtualMachinesGetOperationErrors( context: Client, subscriptionId: string, diff --git a/sdk/computeschedule/arm-computeschedule/src/classic/operations/index.ts b/sdk/computeschedule/arm-computeschedule/src/classic/operations/index.ts index 0e0f61938a3a..511542215e9f 100644 --- a/sdk/computeschedule/arm-computeschedule/src/classic/operations/index.ts +++ b/sdk/computeschedule/arm-computeschedule/src/classic/operations/index.ts @@ -2,10 +2,10 @@ // Licensed under the MIT License. import { ComputeScheduleContext } from "../../api/computeScheduleContext.js"; -import { Operation } from "../../models/models.js"; import { operationsList } from "../../api/operations/index.js"; +import { OperationsListOptionalParams } from "../../api/options.js"; +import { Operation } from "../../models/models.js"; import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; -import { OperationsListOptionalParams } from "../../models/options.js"; /** Interface representing a Operations operations. */ export interface OperationsOperations { diff --git a/sdk/computeschedule/arm-computeschedule/src/classic/scheduledActions/index.ts b/sdk/computeschedule/arm-computeschedule/src/classic/scheduledActions/index.ts index 7d732554aa17..2af4bda16785 100644 --- a/sdk/computeschedule/arm-computeschedule/src/classic/scheduledActions/index.ts +++ b/sdk/computeschedule/arm-computeschedule/src/classic/scheduledActions/index.ts @@ -2,6 +2,28 @@ // Licensed under the MIT License. import { ComputeScheduleContext } from "../../api/computeScheduleContext.js"; +import { + ScheduledActionsVirtualMachinesSubmitDeallocateOptionalParams, + ScheduledActionsVirtualMachinesSubmitHibernateOptionalParams, + ScheduledActionsVirtualMachinesSubmitStartOptionalParams, + ScheduledActionsVirtualMachinesExecuteDeallocateOptionalParams, + ScheduledActionsVirtualMachinesExecuteHibernateOptionalParams, + ScheduledActionsVirtualMachinesExecuteStartOptionalParams, + ScheduledActionsVirtualMachinesGetOperationStatusOptionalParams, + ScheduledActionsVirtualMachinesCancelOperationsOptionalParams, + ScheduledActionsVirtualMachinesGetOperationErrorsOptionalParams, +} from "../../api/options.js"; +import { + scheduledActionsVirtualMachinesSubmitDeallocate, + scheduledActionsVirtualMachinesSubmitHibernate, + scheduledActionsVirtualMachinesSubmitStart, + scheduledActionsVirtualMachinesExecuteDeallocate, + scheduledActionsVirtualMachinesExecuteHibernate, + scheduledActionsVirtualMachinesExecuteStart, + scheduledActionsVirtualMachinesGetOperationStatus, + scheduledActionsVirtualMachinesCancelOperations, + scheduledActionsVirtualMachinesGetOperationErrors, +} from "../../api/scheduledActions/index.js"; import { SubmitDeallocateRequest, DeallocateResourceOperationResponse, @@ -19,80 +41,58 @@ import { GetOperationErrorsRequest, GetOperationErrorsResponse, } from "../../models/models.js"; -import { - scheduledActionsVirtualMachinesSubmitDeallocate, - scheduledActionsVirtualMachinesSubmitHibernate, - scheduledActionsVirtualMachinesSubmitStart, - scheduledActionsVirtualMachinesExecuteDeallocate, - scheduledActionsVirtualMachinesExecuteHibernate, - scheduledActionsVirtualMachinesExecuteStart, - scheduledActionsVirtualMachinesGetOperationStatus, - scheduledActionsVirtualMachinesCancelOperations, - scheduledActionsVirtualMachinesGetOperationErrors, -} from "../../api/scheduledActions/index.js"; -import { - ScheduledActionsVirtualMachinesSubmitDeallocateOptionalParams, - ScheduledActionsVirtualMachinesSubmitHibernateOptionalParams, - ScheduledActionsVirtualMachinesSubmitStartOptionalParams, - ScheduledActionsVirtualMachinesExecuteDeallocateOptionalParams, - ScheduledActionsVirtualMachinesExecuteHibernateOptionalParams, - ScheduledActionsVirtualMachinesExecuteStartOptionalParams, - ScheduledActionsVirtualMachinesGetOperationStatusOptionalParams, - ScheduledActionsVirtualMachinesCancelOperationsOptionalParams, - ScheduledActionsVirtualMachinesGetOperationErrorsOptionalParams, -} from "../../models/options.js"; /** Interface representing a ScheduledActions operations. */ export interface ScheduledActionsOperations { - /** virtualMachinesSubmitDeallocate: submitDeallocate for a virtual machine */ + /** VirtualMachinesSubmitDeallocate: Schedule deallocate operation for a batch of virtual machines at datetime in future. */ virtualMachinesSubmitDeallocate: ( locationparameter: string, requestBody: SubmitDeallocateRequest, options?: ScheduledActionsVirtualMachinesSubmitDeallocateOptionalParams, ) => Promise; - /** virtualMachinesSubmitHibernate: submitHibernate for a virtual machine */ + /** VirtualMachinesSubmitHibernate: Schedule hibernate operation for a batch of virtual machines at datetime in future. */ virtualMachinesSubmitHibernate: ( locationparameter: string, requestBody: SubmitHibernateRequest, options?: ScheduledActionsVirtualMachinesSubmitHibernateOptionalParams, ) => Promise; - /** virtualMachinesSubmitStart: submitStart for a virtual machine */ + /** VirtualMachinesSubmitStart: Schedule start operation for a batch of virtual machines at datetime in future. */ virtualMachinesSubmitStart: ( locationparameter: string, requestBody: SubmitStartRequest, options?: ScheduledActionsVirtualMachinesSubmitStartOptionalParams, ) => Promise; - /** virtualMachinesExecuteDeallocate: executeDeallocate for a virtual machine */ + /** VirtualMachinesExecuteDeallocate: Execute deallocate operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. */ virtualMachinesExecuteDeallocate: ( locationparameter: string, requestBody: ExecuteDeallocateRequest, options?: ScheduledActionsVirtualMachinesExecuteDeallocateOptionalParams, ) => Promise; - /** virtualMachinesExecuteHibernate: executeHibernate for a virtual machine */ + /** VirtualMachinesExecuteHibernate: Execute hibernate operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. */ virtualMachinesExecuteHibernate: ( locationparameter: string, requestBody: ExecuteHibernateRequest, options?: ScheduledActionsVirtualMachinesExecuteHibernateOptionalParams, ) => Promise; - /** virtualMachinesExecuteStart: executeStart for a virtual machine */ + /** VirtualMachinesExecuteStart: Execute start operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. */ virtualMachinesExecuteStart: ( locationparameter: string, requestBody: ExecuteStartRequest, options?: ScheduledActionsVirtualMachinesExecuteStartOptionalParams, ) => Promise; - /** virtualMachinesGetOperationStatus: getOperationStatus for a virtual machine */ + /** VirtualMachinesGetOperationStatus: Polling endpoint to read status of operations performed on virtual machines */ virtualMachinesGetOperationStatus: ( locationparameter: string, requestBody: GetOperationStatusRequest, options?: ScheduledActionsVirtualMachinesGetOperationStatusOptionalParams, ) => Promise; - /** virtualMachinesCancelOperations: cancelOperations for a virtual machine */ + /** VirtualMachinesCancelOperations: Cancel a previously submitted (start/deallocate/hibernate) request */ virtualMachinesCancelOperations: ( locationparameter: string, requestBody: CancelOperationsRequest, options?: ScheduledActionsVirtualMachinesCancelOperationsOptionalParams, ) => Promise; - /** virtualMachinesGetOperationErrors: getOperationErrors associated with an operation on a virtual machine */ + /** VirtualMachinesGetOperationErrors: Get error details on operation errors (like transient errors encountered, additional logs) if they exist. */ virtualMachinesGetOperationErrors: ( locationparameter: string, requestBody: GetOperationErrorsRequest, diff --git a/sdk/computeschedule/arm-computeschedule/src/computeScheduleClient.ts b/sdk/computeschedule/arm-computeschedule/src/computeScheduleClient.ts index fda418542483..ad450edd6166 100644 --- a/sdk/computeschedule/arm-computeschedule/src/computeScheduleClient.ts +++ b/sdk/computeschedule/arm-computeschedule/src/computeScheduleClient.ts @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import { TokenCredential } from "@azure/core-auth"; -import { Pipeline } from "@azure/core-rest-pipeline"; import { getOperationsOperations, OperationsOperations } from "./classic/operations/index.js"; import { getScheduledActionsOperations, @@ -13,6 +11,8 @@ import { ComputeScheduleContext, ComputeScheduleClientOptionalParams, } from "./api/index.js"; +import { Pipeline } from "@azure/core-rest-pipeline"; +import { TokenCredential } from "@azure/core-auth"; export { ComputeScheduleClientOptionalParams } from "./api/computeScheduleContext.js"; @@ -30,7 +30,7 @@ export class ComputeScheduleClient { const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix; const userAgentPrefix = prefixFromOptions ? `${prefixFromOptions} azsdk-js-client` - : "azsdk-js-client"; + : `azsdk-js-client`; this._client = createComputeSchedule(credential, { ...options, userAgentOptions: { userAgentPrefix }, diff --git a/sdk/computeschedule/arm-computeschedule/src/index.ts b/sdk/computeschedule/arm-computeschedule/src/index.ts index e7393ad3b1d5..34b72d5f7da9 100644 --- a/sdk/computeschedule/arm-computeschedule/src/index.ts +++ b/sdk/computeschedule/arm-computeschedule/src/index.ts @@ -7,10 +7,7 @@ import { PagedAsyncIterableIterator, } from "./static-helpers/pagingHelpers.js"; -export { - ComputeScheduleClient, - ComputeScheduleClientOptionalParams, -} from "./computeScheduleClient.js"; +export { ComputeScheduleClient } from "./computeScheduleClient.js"; export { SubmitDeallocateRequest, Schedule, @@ -50,6 +47,10 @@ export { Origin, KnownActionType, ActionType, + KnownVersions, +} from "./models/index.js"; +export { + ComputeScheduleClientOptionalParams, OperationsListOptionalParams, ScheduledActionsVirtualMachinesSubmitDeallocateOptionalParams, ScheduledActionsVirtualMachinesSubmitHibernateOptionalParams, @@ -60,6 +61,6 @@ export { ScheduledActionsVirtualMachinesGetOperationStatusOptionalParams, ScheduledActionsVirtualMachinesCancelOperationsOptionalParams, ScheduledActionsVirtualMachinesGetOperationErrorsOptionalParams, -} from "./models/index.js"; +} from "./api/index.js"; export { OperationsOperations, ScheduledActionsOperations } from "./classic/index.js"; export { PageSettings, ContinuablePage, PagedAsyncIterableIterator }; diff --git a/sdk/computeschedule/arm-computeschedule/src/models/index.ts b/sdk/computeschedule/arm-computeschedule/src/models/index.ts index 48b41afdc4fa..035113e3e44b 100644 --- a/sdk/computeschedule/arm-computeschedule/src/models/index.ts +++ b/sdk/computeschedule/arm-computeschedule/src/models/index.ts @@ -40,16 +40,5 @@ export { Origin, KnownActionType, ActionType, + KnownVersions, } from "./models.js"; -export { - OperationsListOptionalParams, - ScheduledActionsVirtualMachinesSubmitDeallocateOptionalParams, - ScheduledActionsVirtualMachinesSubmitHibernateOptionalParams, - ScheduledActionsVirtualMachinesSubmitStartOptionalParams, - ScheduledActionsVirtualMachinesExecuteDeallocateOptionalParams, - ScheduledActionsVirtualMachinesExecuteHibernateOptionalParams, - ScheduledActionsVirtualMachinesExecuteStartOptionalParams, - ScheduledActionsVirtualMachinesGetOperationStatusOptionalParams, - ScheduledActionsVirtualMachinesCancelOperationsOptionalParams, - ScheduledActionsVirtualMachinesGetOperationErrorsOptionalParams, -} from "./options.js"; diff --git a/sdk/computeschedule/arm-computeschedule/src/models/models.ts b/sdk/computeschedule/arm-computeschedule/src/models/models.ts index 85720a909441..4fddbf66fe72 100644 --- a/sdk/computeschedule/arm-computeschedule/src/models/models.ts +++ b/sdk/computeschedule/arm-computeschedule/src/models/models.ts @@ -9,17 +9,15 @@ export interface SubmitDeallocateRequest { executionParameters: ExecutionParameters; /** The resources for the request */ resources: Resources; - /** Correlationid item */ + /** CorrelationId item */ correlationid: string; } -export function submitDeallocateRequestSerializer( - item: SubmitDeallocateRequest, -): Record { +export function submitDeallocateRequestSerializer(item: SubmitDeallocateRequest): any { return { - schedule: scheduleSerializer(item.schedule), - executionParameters: executionParametersSerializer(item.executionParameters), - resources: resourcesSerializer(item.resources), + schedule: scheduleSerializer(item["schedule"]), + executionParameters: executionParametersSerializer(item["executionParameters"]), + resources: resourcesSerializer(item["resources"]), correlationid: item["correlationid"], }; } @@ -27,28 +25,34 @@ export function submitDeallocateRequestSerializer( /** The schedule details for the user request */ export interface Schedule { /** The deadline for the operation */ - deadLine: string; + deadline?: string; + /** The deadline for the operation */ + deadLine?: string; + /** The timezone for the operation */ + timezone?: string; /** The timezone for the operation */ - timeZone: string; + timeZone?: string; /** The deadlinetype of the operation, this can either be InitiateAt or CompleteBy */ deadlineType: DeadlineType; } -export function scheduleSerializer(item: Schedule): Record { +export function scheduleSerializer(item: Schedule): any { return { + deadline: item["deadline"], deadLine: item["deadLine"], + timezone: item["timezone"], timeZone: item["timeZone"], deadlineType: item["deadlineType"], }; } -/** Known values of {@link DeadlineType} that the service accepts. */ +/** The types of deadlines supported by ScheduledActions */ export enum KnownDeadlineType { - /** Unknown */ + /** Default value of Unknown. */ Unknown = "Unknown", - /** InitiateAt */ + /** Initiate the operation at the given deadline. */ InitiateAt = "InitiateAt", - /** CompleteBy */ + /** Complete the operation by the given deadline. */ CompleteBy = "CompleteBy", } @@ -57,9 +61,9 @@ export enum KnownDeadlineType { * {@link KnownDeadlineType} can be used interchangeably with DeadlineType, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **Unknown** \ - * **InitiateAt** \ - * **CompleteBy** + * **Unknown**: Default value of Unknown. \ + * **InitiateAt**: Initiate the operation at the given deadline. \ + * **CompleteBy**: Complete the operation by the given deadline. */ export type DeadlineType = string; @@ -71,20 +75,22 @@ export interface ExecutionParameters { retryPolicy?: RetryPolicy; } -export function executionParametersSerializer(item: ExecutionParameters): Record { +export function executionParametersSerializer(item: ExecutionParameters): any { return { optimizationPreference: item["optimizationPreference"], - retryPolicy: !item.retryPolicy ? item.retryPolicy : retryPolicySerializer(item.retryPolicy), + retryPolicy: !item["retryPolicy"] + ? item["retryPolicy"] + : retryPolicySerializer(item["retryPolicy"]), }; } -/** Known values of {@link OptimizationPreference} that the service accepts. */ +/** The preferences customers can select to optimize their requests to ScheduledActions */ export enum KnownOptimizationPreference { - /** Cost */ + /** Optimize while considering cost savings */ Cost = "Cost", - /** Availability */ + /** Optimize while considering availability of resources */ Availability = "Availability", - /** CostAvailabilityBalanced */ + /** Optimize while considering a balance of cost and availability */ CostAvailabilityBalanced = "CostAvailabilityBalanced", } @@ -93,9 +99,9 @@ export enum KnownOptimizationPreference { * {@link KnownOptimizationPreference} can be used interchangeably with OptimizationPreference, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **Cost** \ - * **Availability** \ - * **CostAvailabilityBalanced** + * **Cost**: Optimize while considering cost savings \ + * **Availability**: Optimize while considering availability of resources \ + * **CostAvailabilityBalanced**: Optimize while considering a balance of cost and availability */ export type OptimizationPreference = string; @@ -107,7 +113,14 @@ export interface RetryPolicy { retryWindowInMinutes?: number; } -export function retryPolicySerializer(item: RetryPolicy): Record { +export function retryPolicySerializer(item: RetryPolicy): any { + return { + retryCount: item["retryCount"], + retryWindowInMinutes: item["retryWindowInMinutes"], + }; +} + +export function retryPolicyDeserializer(item: any): RetryPolicy { return { retryCount: item["retryCount"], retryWindowInMinutes: item["retryWindowInMinutes"], @@ -120,9 +133,11 @@ export interface Resources { ids: string[]; } -export function resourcesSerializer(item: Resources): Record { +export function resourcesSerializer(item: Resources): any { return { - ids: item["ids"], + ids: item["ids"].map((p: any) => { + return p; + }), }; } @@ -138,6 +153,25 @@ export interface DeallocateResourceOperationResponse { results?: ResourceOperation[]; } +export function deallocateResourceOperationResponseDeserializer( + item: any, +): DeallocateResourceOperationResponse { + return { + description: item["description"], + type: item["type"], + location: item["location"], + results: !item["results"] + ? item["results"] + : resourceOperationArrayDeserializer(item["results"]), + }; +} + +export function resourceOperationArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return resourceOperationDeserializer(item); + }); +} + /** High level response from an operation on a resource */ export interface ResourceOperation { /** Unique identifier for the resource involved in the operation, eg ArmId */ @@ -150,22 +184,35 @@ export interface ResourceOperation { operation?: ResourceOperationDetails; } +export function resourceOperationDeserializer(item: any): ResourceOperation { + return { + resourceId: item["resourceId"], + errorCode: item["errorCode"], + errorDetails: item["errorDetails"], + operation: !item["operation"] + ? item["operation"] + : resourceOperationDetailsDeserializer(item["operation"]), + }; +} + /** The details of a response from an operation on a resource */ export interface ResourceOperationDetails { /** Operation identifier for the unique operation */ operationId: string; /** Unique identifier for the resource involved in the operation, eg ArmId */ - resourceId: string; + resourceId?: string; /** Type of operation performed on the resources */ - opType: ResourceOperationType; + opType?: ResourceOperationType; /** Subscription id attached to the request */ - subscriptionId: string; + subscriptionId?: string; /** Deadline for the operation */ - deadline: string; + deadline?: string; /** Type of deadline of the operation */ - deadlineType: DeadlineType; + deadlineType?: DeadlineType; /** Current state of the operation */ - state: OperationState; + state?: OperationState; + /** Timezone for the operation */ + timezone?: string; /** Timezone for the operation */ timeZone?: string; /** Operation level errors if they exist */ @@ -176,15 +223,36 @@ export interface ResourceOperationDetails { retryPolicy?: RetryPolicy; } -/** Known values of {@link ResourceOperationType} that the service accepts. */ +export function resourceOperationDetailsDeserializer(item: any): ResourceOperationDetails { + return { + operationId: item["operationId"], + resourceId: item["resourceId"], + opType: item["opType"], + subscriptionId: item["subscriptionId"], + deadline: item["deadline"], + deadlineType: item["deadlineType"], + state: item["state"], + timezone: item["timezone"], + timeZone: item["timeZone"], + resourceOperationError: !item["resourceOperationError"] + ? item["resourceOperationError"] + : resourceOperationErrorDeserializer(item["resourceOperationError"]), + completedAt: item["completedAt"], + retryPolicy: !item["retryPolicy"] + ? item["retryPolicy"] + : retryPolicyDeserializer(item["retryPolicy"]), + }; +} + +/** The kind of operation types that can be performed on resources using ScheduledActions */ export enum KnownResourceOperationType { - /** Unknown */ + /** The default value for this enum type */ Unknown = "Unknown", - /** Start */ + /** Start operations on the resources */ Start = "Start", - /** Deallocate */ + /** Deallocate operations on the resources */ Deallocate = "Deallocate", - /** Hibernate */ + /** Hibernate operations on the resources */ Hibernate = "Hibernate", } @@ -193,32 +261,32 @@ export enum KnownResourceOperationType { * {@link KnownResourceOperationType} can be used interchangeably with ResourceOperationType, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **Unknown** \ - * **Start** \ - * **Deallocate** \ - * **Hibernate** + * **Unknown**: The default value for this enum type \ + * **Start**: Start operations on the resources \ + * **Deallocate**: Deallocate operations on the resources \ + * **Hibernate**: Hibernate operations on the resources */ export type ResourceOperationType = string; -/** Known values of {@link OperationState} that the service accepts. */ +/** Values that define the states of operations in Scheduled Actions */ export enum KnownOperationState { - /** Unknown */ + /** The default value for the operation state enum */ Unknown = "Unknown", - /** PendingScheduling */ + /** Operations that are pending scheduling */ PendingScheduling = "PendingScheduling", - /** Scheduled */ + /** Operations that have been scheduled */ Scheduled = "Scheduled", - /** PendingExecution */ + /** Operations that are waiting to be executed */ PendingExecution = "PendingExecution", - /** Executing */ + /** Operations that are in the process of being executed */ Executing = "Executing", - /** Succeeded */ + /** Operations that suceeded */ Succeeded = "Succeeded", - /** Failed */ + /** Operations that have failed */ Failed = "Failed", - /** Cancelled */ + /** Operations that have been Cancelled by the user */ Cancelled = "Cancelled", - /** Blocked */ + /** Operations that are blocked */ Blocked = "Blocked", } @@ -227,15 +295,15 @@ export enum KnownOperationState { * {@link KnownOperationState} can be used interchangeably with OperationState, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **Unknown** \ - * **PendingScheduling** \ - * **Scheduled** \ - * **PendingExecution** \ - * **Executing** \ - * **Succeeded** \ - * **Failed** \ - * **Cancelled** \ - * **Blocked** + * **Unknown**: The default value for the operation state enum \ + * **PendingScheduling**: Operations that are pending scheduling \ + * **Scheduled**: Operations that have been scheduled \ + * **PendingExecution**: Operations that are waiting to be executed \ + * **Executing**: Operations that are in the process of being executed \ + * **Succeeded**: Operations that suceeded \ + * **Failed**: Operations that have failed \ + * **Cancelled**: Operations that have been Cancelled by the user \ + * **Blocked**: Operations that are blocked */ export type OperationState = string; @@ -247,6 +315,13 @@ export interface ResourceOperationError { errorDetails: string; } +export function resourceOperationErrorDeserializer(item: any): ResourceOperationError { + return { + errorCode: item["errorCode"], + errorDetails: item["errorDetails"], + }; +} + /** This is the request for hibernate */ export interface SubmitHibernateRequest { /** The schedule for the request */ @@ -255,17 +330,15 @@ export interface SubmitHibernateRequest { executionParameters: ExecutionParameters; /** The resources for the request */ resources: Resources; - /** Correlationid item */ + /** CorrelationId item */ correlationid: string; } -export function submitHibernateRequestSerializer( - item: SubmitHibernateRequest, -): Record { +export function submitHibernateRequestSerializer(item: SubmitHibernateRequest): any { return { - schedule: scheduleSerializer(item.schedule), - executionParameters: executionParametersSerializer(item.executionParameters), - resources: resourcesSerializer(item.resources), + schedule: scheduleSerializer(item["schedule"]), + executionParameters: executionParametersSerializer(item["executionParameters"]), + resources: resourcesSerializer(item["resources"]), correlationid: item["correlationid"], }; } @@ -282,6 +355,19 @@ export interface HibernateResourceOperationResponse { results?: ResourceOperation[]; } +export function hibernateResourceOperationResponseDeserializer( + item: any, +): HibernateResourceOperationResponse { + return { + description: item["description"], + type: item["type"], + location: item["location"], + results: !item["results"] + ? item["results"] + : resourceOperationArrayDeserializer(item["results"]), + }; +} + /** This is the request for start */ export interface SubmitStartRequest { /** The schedule for the request */ @@ -290,15 +376,15 @@ export interface SubmitStartRequest { executionParameters: ExecutionParameters; /** The resources for the request */ resources: Resources; - /** Correlationid item */ + /** CorrelationId item */ correlationid: string; } -export function submitStartRequestSerializer(item: SubmitStartRequest): Record { +export function submitStartRequestSerializer(item: SubmitStartRequest): any { return { - schedule: scheduleSerializer(item.schedule), - executionParameters: executionParametersSerializer(item.executionParameters), - resources: resourcesSerializer(item.resources), + schedule: scheduleSerializer(item["schedule"]), + executionParameters: executionParametersSerializer(item["executionParameters"]), + resources: resourcesSerializer(item["resources"]), correlationid: item["correlationid"], }; } @@ -315,22 +401,33 @@ export interface StartResourceOperationResponse { results?: ResourceOperation[]; } +export function startResourceOperationResponseDeserializer( + item: any, +): StartResourceOperationResponse { + return { + description: item["description"], + type: item["type"], + location: item["location"], + results: !item["results"] + ? item["results"] + : resourceOperationArrayDeserializer(item["results"]), + }; +} + /** The ExecuteDeallocateRequest request for executeDeallocate operations */ export interface ExecuteDeallocateRequest { /** The execution parameters for the request */ executionParameters: ExecutionParameters; /** The resources for the request */ resources: Resources; - /** Correlationid item */ + /** CorrelationId item */ correlationid: string; } -export function executeDeallocateRequestSerializer( - item: ExecuteDeallocateRequest, -): Record { +export function executeDeallocateRequestSerializer(item: ExecuteDeallocateRequest): any { return { - executionParameters: executionParametersSerializer(item.executionParameters), - resources: resourcesSerializer(item.resources), + executionParameters: executionParametersSerializer(item["executionParameters"]), + resources: resourcesSerializer(item["resources"]), correlationid: item["correlationid"], }; } @@ -341,16 +438,14 @@ export interface ExecuteHibernateRequest { executionParameters: ExecutionParameters; /** The resources for the request */ resources: Resources; - /** Correlationid item */ + /** CorrelationId item */ correlationid: string; } -export function executeHibernateRequestSerializer( - item: ExecuteHibernateRequest, -): Record { +export function executeHibernateRequestSerializer(item: ExecuteHibernateRequest): any { return { - executionParameters: executionParametersSerializer(item.executionParameters), - resources: resourcesSerializer(item.resources), + executionParameters: executionParametersSerializer(item["executionParameters"]), + resources: resourcesSerializer(item["resources"]), correlationid: item["correlationid"], }; } @@ -361,14 +456,14 @@ export interface ExecuteStartRequest { executionParameters: ExecutionParameters; /** The resources for the request */ resources: Resources; - /** Correlationid item */ + /** CorrelationId item */ correlationid: string; } -export function executeStartRequestSerializer(item: ExecuteStartRequest): Record { +export function executeStartRequestSerializer(item: ExecuteStartRequest): any { return { - executionParameters: executionParametersSerializer(item.executionParameters), - resources: resourcesSerializer(item.resources), + executionParameters: executionParametersSerializer(item["executionParameters"]), + resources: resourcesSerializer(item["resources"]), correlationid: item["correlationid"], }; } @@ -377,15 +472,15 @@ export function executeStartRequestSerializer(item: ExecuteStartRequest): Record export interface GetOperationStatusRequest { /** The list of operation ids to get the status of */ operationIds: string[]; - /** Correlationid item */ + /** CorrelationId item */ correlationid: string; } -export function getOperationStatusRequestSerializer( - item: GetOperationStatusRequest, -): Record { +export function getOperationStatusRequestSerializer(item: GetOperationStatusRequest): any { return { - operationIds: item["operationIds"], + operationIds: item["operationIds"].map((p: any) => { + return p; + }), correlationid: item["correlationid"], }; } @@ -396,19 +491,25 @@ export interface GetOperationStatusResponse { results: ResourceOperation[]; } +export function getOperationStatusResponseDeserializer(item: any): GetOperationStatusResponse { + return { + results: resourceOperationArrayDeserializer(item["results"]), + }; +} + /** This is the request to cancel running operations in scheduled actions using the operation ids */ export interface CancelOperationsRequest { /** The list of operation ids to cancel operations on */ operationIds: string[]; - /** Correlationid item */ + /** CorrelationId item */ correlationid: string; } -export function cancelOperationsRequestSerializer( - item: CancelOperationsRequest, -): Record { +export function cancelOperationsRequestSerializer(item: CancelOperationsRequest): any { return { - operationIds: item["operationIds"], + operationIds: item["operationIds"].map((p: any) => { + return p; + }), correlationid: item["correlationid"], }; } @@ -419,17 +520,23 @@ export interface CancelOperationsResponse { results: ResourceOperation[]; } +export function cancelOperationsResponseDeserializer(item: any): CancelOperationsResponse { + return { + results: resourceOperationArrayDeserializer(item["results"]), + }; +} + /** This is the request to get errors per vm operations */ export interface GetOperationErrorsRequest { /** The list of operation ids to query errors of */ operationIds: string[]; } -export function getOperationErrorsRequestSerializer( - item: GetOperationErrorsRequest, -): Record { +export function getOperationErrorsRequestSerializer(item: GetOperationErrorsRequest): any { return { - operationIds: item["operationIds"], + operationIds: item["operationIds"].map((p: any) => { + return p; + }), }; } @@ -439,6 +546,20 @@ export interface GetOperationErrorsResponse { results: OperationErrorsResult[]; } +export function getOperationErrorsResponseDeserializer(item: any): GetOperationErrorsResponse { + return { + results: operationErrorsResultArrayDeserializer(item["results"]), + }; +} + +export function operationErrorsResultArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return operationErrorsResultDeserializer(item); + }); +} + /** This is the first level of operation errors from the request when clients get errors per vm operation */ export interface OperationErrorsResult { /** The operationId identifying a vm operation */ @@ -457,6 +578,28 @@ export interface OperationErrorsResult { requestErrorDetails?: string; } +export function operationErrorsResultDeserializer(item: any): OperationErrorsResult { + return { + operationId: item["operationId"], + creationTime: item["creationTime"], + activationTime: item["activationTime"], + completedAt: item["completedAt"], + operationErrors: !item["operationErrors"] + ? item["operationErrors"] + : operationErrorDetailsArrayDeserializer(item["operationErrors"]), + requestErrorCode: item["requestErrorCode"], + requestErrorDetails: item["requestErrorDetails"], + }; +} + +export function operationErrorDetailsArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return operationErrorDetailsDeserializer(item); + }); +} + /** This defines a list of operation errors associated with a unique operationId */ export interface OperationErrorDetails { /** The error code of the operation */ @@ -464,9 +607,24 @@ export interface OperationErrorDetails { /** The error details of the operation */ errorDetails: string; /** The timestamp of the error occurence */ - timeStamp: string; - /** CRP operationid of the operation for deeper analysis */ - crpOperationId: string; + timestamp?: string; + /** The timestamp of the error occurence */ + timeStamp?: string; + /** The compute operationid of the Start/Deallocate/Hibernate request */ + azureOperationName?: string; + /** The compute operationid of the Start/Deallocate/Hibernate request */ + crpOperationId?: string; +} + +export function operationErrorDetailsDeserializer(item: any): OperationErrorDetails { + return { + errorCode: item["errorCode"], + errorDetails: item["errorDetails"], + timestamp: item["timestamp"], + timeStamp: item["timeStamp"], + azureOperationName: item["azureOperationName"], + crpOperationId: item["crpOperationId"], + }; } /** A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. */ @@ -477,6 +635,19 @@ export interface _OperationListResult { nextLink?: string; } +export function _operationListResultDeserializer(item: any): _OperationListResult { + return { + value: operationArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function operationArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return operationDeserializer(item); + }); +} + /** Details of a REST API operation, returned from the Resource Provider Operations API */ export interface Operation { /** The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" */ @@ -484,11 +655,21 @@ export interface Operation { /** Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure Resource Manager/control-plane operations. */ readonly isDataAction?: boolean; /** Localized display information for this particular operation. */ - readonly display?: OperationDisplay; + display?: OperationDisplay; /** The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" */ readonly origin?: Origin; /** Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ - actionType?: ActionType; + readonly actionType?: ActionType; +} + +export function operationDeserializer(item: any): Operation { + return { + name: item["name"], + isDataAction: item["isDataAction"], + display: !item["display"] ? item["display"] : operationDisplayDeserializer(item["display"]), + origin: item["origin"], + actionType: item["actionType"], + }; } /** Localized display information for and operation. */ @@ -503,14 +684,23 @@ export interface OperationDisplay { readonly description?: string; } -/** Known values of {@link Origin} that the service accepts. */ +export function operationDisplayDeserializer(item: any): OperationDisplay { + return { + provider: item["provider"], + resource: item["resource"], + operation: item["operation"], + description: item["description"], + }; +} + +/** The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" */ export enum KnownOrigin { - /** user */ - User = "user", - /** system */ - System = "system", - /** user,system */ - UserSystem = "user,system", + /** Indicates the operation is initiated by a user. */ + user = "user", + /** Indicates the operation is initiated by a system. */ + system = "system", + /** Indicates the operation is initiated by a user or system. */ + "user,system" = "user,system", } /** @@ -518,15 +708,15 @@ export enum KnownOrigin { * {@link KnownOrigin} can be used interchangeably with Origin, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **user** \ - * **system** \ - * **user,system** + * **user**: Indicates the operation is initiated by a user. \ + * **system**: Indicates the operation is initiated by a system. \ + * **user,system**: Indicates the operation is initiated by a user or system. */ export type Origin = string; -/** Known values of {@link ActionType} that the service accepts. */ +/** Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ export enum KnownActionType { - /** Internal */ + /** Actions are for internal-only APIs. */ Internal = "Internal", } @@ -535,6 +725,12 @@ export enum KnownActionType { * {@link KnownActionType} can be used interchangeably with ActionType, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **Internal** + * **Internal**: Actions are for internal-only APIs. */ export type ActionType = string; + +/** ComputeSchedule API versions */ +export enum KnownVersions { + /** 2024-10-01 version */ + "2024-10-01" = "2024-10-01", +} diff --git a/sdk/computeschedule/arm-computeschedule/test/public/computeschedule_operations_test.spec.ts b/sdk/computeschedule/arm-computeschedule/test/public/computeschedule_operations_test.spec.ts deleted file mode 100644 index 3a70c6adb8b9..000000000000 --- a/sdk/computeschedule/arm-computeschedule/test/public/computeschedule_operations_test.spec.ts +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { Recorder } from "@azure-tools/test-recorder"; -import { env, isPlaybackMode } from "@azure-tools/test-recorder"; -import { createTestCredential } from "@azure-tools/test-credential"; -import { assert, beforeEach, afterEach, it, describe } from "vitest"; -import { createRecorder } from "./utils/recordedClient.js"; -import { ComputeScheduleClient } from "../../src/computeScheduleClient.js"; - -export const testPollingOptions = { - updateIntervalInMs: isPlaybackMode() ? 0 : undefined, -}; - -describe("ComputeSchedule test", () => { - let recorder: Recorder; - let subscriptionId: string; - let client: ComputeScheduleClient; - - beforeEach(async (context) => { - process.env.SystemRoot = process.env.SystemRoot || "C:\\Windows"; - recorder = await createRecorder(context); - subscriptionId = env.SUBSCRIPTION_ID || ""; - // This is an example of how the environment variables are used - const credential = createTestCredential(); - client = new ComputeScheduleClient( - credential, - subscriptionId, - recorder.configureClientOptions({}), - ); - }); - - afterEach(async () => { - await recorder.stop(); - }); - - it("operations list test", async () => { - const resArray = new Array(); - for await (const item of client.operations.list()) { - resArray.push(item); - } - assert.notEqual(resArray.length, 0); - }); -}); diff --git a/sdk/computeschedule/arm-computeschedule/test/public/sampleTest.spec.ts b/sdk/computeschedule/arm-computeschedule/test/public/sampleTest.spec.ts new file mode 100644 index 000000000000..e4591bbad342 --- /dev/null +++ b/sdk/computeschedule/arm-computeschedule/test/public/sampleTest.spec.ts @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { assert, beforeEach, afterEach, it, describe } from "vitest"; + +describe("My test", () => { + // let recorder: Recorder; + + beforeEach(async () => { + // recorder = await createRecorder(this); + }); + + afterEach(async () => { + // await recorder.stop(); + }); + + it("sample test", async function () { + assert.equal(1, 1); + }); +}); diff --git a/sdk/computeschedule/arm-computeschedule/test/public/utils/recordedClient.ts b/sdk/computeschedule/arm-computeschedule/test/public/utils/recordedClient.ts index 527ccc9dee86..14dcd9fa397c 100644 --- a/sdk/computeschedule/arm-computeschedule/test/public/utils/recordedClient.ts +++ b/sdk/computeschedule/arm-computeschedule/test/public/utils/recordedClient.ts @@ -9,10 +9,6 @@ const replaceableVariables: Record = { const recorderEnvSetup: RecorderStartOptions = { envSetupForPlayback: replaceableVariables, - removeCentralSanitizers: [ - "AZSDK3493", // .name in the body is not a secret and is listed below in the beforeEach section - "AZSDK3430", // .id in the body is not a secret and is listed below in the beforeEach section - ], }; /** diff --git a/sdk/computeschedule/arm-computeschedule/test/snippets.spec.ts b/sdk/computeschedule/arm-computeschedule/test/snippets.spec.ts deleted file mode 100644 index e8f6cae21c45..000000000000 --- a/sdk/computeschedule/arm-computeschedule/test/snippets.spec.ts +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeScheduleClient } from "../src/index.js"; -import { DefaultAzureCredential, InteractiveBrowserCredential } from "@azure/identity"; -import { setLogLevel } from "@azure/logger"; -import { describe, it } from "vitest"; - -describe("snippets", () => { - it("ReadmeSampleCreateClient_Node", async () => { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new ComputeScheduleClient(new DefaultAzureCredential(), subscriptionId); - }); - - it("ReadmeSampleCreateClient_Browser", async () => { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const credential = new InteractiveBrowserCredential({ - tenantId: "", - clientId: "", - }); - const client = new ComputeScheduleClient(credential, subscriptionId); - }); - - it("SetLogLevel", async () => { - setLogLevel("info"); - }); -}); diff --git a/sdk/computeschedule/arm-computeschedule/tsp-location.yaml b/sdk/computeschedule/arm-computeschedule/tsp-location.yaml index 26e8e3dc906c..686dca4a83d3 100644 --- a/sdk/computeschedule/arm-computeschedule/tsp-location.yaml +++ b/sdk/computeschedule/arm-computeschedule/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/computeschedule/ComputeSchedule.Management -commit: 9ce76c4f113368361dac4de5d0a71eb058602756 -repo: Azure/azure-rest-api-specs -additionalDirectories: +commit: 4b0caba797fff8f3d58c145e1f958141b2e67935 +repo: ../azure-rest-api-specs +additionalDirectories: diff --git a/sdk/computeschedule/ci.mgmt.yml b/sdk/computeschedule/ci.mgmt.yml index 46b96020d6fe..c437a7d2e225 100644 --- a/sdk/computeschedule/ci.mgmt.yml +++ b/sdk/computeschedule/ci.mgmt.yml @@ -13,7 +13,6 @@ trigger: include: - sdk/computeschedule/arm-computeschedule - sdk/computeschedule/ci.mgmt.yml - pr: branches: include: @@ -27,7 +26,6 @@ pr: include: - sdk/computeschedule/arm-computeschedule - sdk/computeschedule/ci.mgmt.yml - extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: